Multi-level flow scheduling method, related device and medium

By maintaining the address link list for each flow queue in the multi-level flow scheduling system and assigning a flow scheduling engine to each flow scheduling unit, the problem of poor flexibility and universality caused by hierarchical fixation in the prior art is solved, and flexible multi-level flow scheduling is realized to adapt to different network communication scenarios.

CN117560324BActive Publication Date: 2025-08-12BEIJING YUSHU HUACHUANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311511533.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2025-08-12
Estimated Expiration
2043-11-13

AI Technical Summary

Technical Problem

The level of the prior art hierarchical quality of service (HQoS) system is pre-designed and cannot be dynamically configured, resulting in poor flexibility and scenario universality of multi-level stream scheduling, and cannot be applied to network communication scenarios at different levels.

Method used

Maintain an address link list for each flow queue in the multi-level flow scheduling system, and assign a flow scheduling engine to each flow scheduling unit. Through the flow scheduling engine, the flow data address is scheduled according to the scheduling strategy to achieve flexible multi-level flow scheduling.

Benefits of technology

It improves the flexibility and scenario universality of multi-level stream scheduling, so that the stream scheduling system can dynamically configure hierarchies and scheduling strategies according to requirements, and is suitable for a variety of network communication scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117560324B_ABST
    Figure CN117560324B_ABST
Patent Text Reader

Abstract

The present disclosure provides a multi-level flow scheduling method, related devices and media. The multi-level flow scheduling method includes: for each flow queue in the multi-level flow scheduling system, maintaining an address linked list in which the flow data in the flow queue is stored in the data cache; for each flow scheduling unit in the multi-level flow scheduling system, allocating a flow scheduling engine, wherein the flow scheduling engine has a first instruction and a second instruction, the first instruction instructs the flow scheduling unit to schedule the first flow queue and the output second flow queue, and the second instruction indicates the corresponding scheduling strategy of the flow scheduling unit; using the flow scheduling engine, according to the scheduling strategy, taking the flow data address from the address linked list corresponding to the first flow queue and placing it in the address linked list corresponding to the second flow queue; taking the flow data output from the data cache according to the address linked list corresponding to the merged scheduling flow queue. The embodiment of the present disclosure improves the flexibility and scenario universality of multi-level flow scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of stream communications, and in particular to a multi-stage stream scheduling method, related devices, and media. Background Art

[0002] Hierarchical Quality of Service (HQoS) is a method for managing network service quality. It divides network communication traffic into multiple layers, each equipped with different scheduling strategies and different service quality parameters. For example, the service layer schedules traffic for different service types (voice, data, video, etc.) (for example, voice has a higher priority, so among the voice flow queue, data flow queue, and video flow queue, flow data is preferentially taken from the voice flow queue and placed in the output flow queue). After the data of different service types for each user is scheduled and integrated using the above method, the data of different users is further scheduled and integrated at the user layer. For example, 7 flow data are first taken from the flow queue of a VIP user, and then 3 flow data are taken from the flow queue of an ordinary user. The data taken ratio between VIP users and ordinary users is 7:3.

[0003] A drawback of existing hierarchical scheduling technology is that the HQoS system's layers are pre-designed and cannot be dynamically configured. For example, a three-layer HQoS system cannot be applied to scenarios where a four-layer HQoS system is suitable. Furthermore, the scheduling policy within each layer is also pre-designed, and the number of input flow queues integrated by each scheduling unit is also pre-set. This results in multi-layer flow scheduling with limited flexibility and scenario applicability. Summary of the Invention

[0004] In view of this, embodiments of the present disclosure provide a multi-level flow scheduling method, related devices, and media, which can improve the flexibility and scenario universality of multi-level flow scheduling.

[0005] According to a first aspect of an embodiment of the present disclosure, a multi-level flow scheduling method is provided for a dedicated data processor used in conjunction with a master device, wherein multiple flow generation units in the master device generate multiple flow queues, and the dedicated data processor hierarchically schedules the multiple flow queues using a multi-level flow scheduling system to generate a merged scheduled flow queue, wherein each level of the multi-level flow scheduling system has at least one flow scheduling unit, which schedules at least one flow queue output by the previous level to generate a scheduled flow queue, which is input to at least one flow scheduling unit in the next level, and the flow scheduling unit in the last level generates the merged scheduled flow queue; the multi-level flow scheduling method includes:

[0006] For each of the flow queues in the multi-level flow scheduling system, maintaining an address linked list of flow data in the flow queue stored in a data cache;

[0007] Allocate a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system, wherein the flow scheduling engine has a first instruction and a second instruction, the first instruction indicates a first flow queue to be scheduled and a second flow queue to be output by the flow scheduling unit, and the second instruction indicates a scheduling policy corresponding to the flow scheduling unit;

[0008] Using the flow scheduling engine, according to the scheduling policy, taking the flow data address from the address linked list corresponding to the first flow queue and placing it in the address linked list corresponding to the second flow queue;

[0009] According to the address linked list corresponding to the merged scheduling flow queue, the flow data is retrieved from the data cache and outputted.

[0010] According to a second aspect of an embodiment of the present disclosure, a multi-level flow scheduling apparatus is provided, which is located in a dedicated data processor used in conjunction with a master device, wherein multiple flow generation units in the master device generate multiple flow queues, and the multi-level flow scheduling apparatus utilizes a multi-level flow scheduling system to hierarchically schedule the multiple flow queues to generate a merged scheduled flow queue, wherein each level of the multi-level flow scheduling system has at least one flow scheduling unit, which schedules at least one flow queue output by the previous level to generate a scheduled flow queue, which is input to at least one flow scheduling unit in the next level, and the flow scheduling unit in the last level generates the merged scheduled flow queue; the multi-level flow scheduling apparatus includes:

[0011] A maintenance unit, configured to maintain, for each of the flow queues in the multi-level flow scheduling system, an address linked list of flow data in the flow queue stored in a data cache;

[0012] An allocation unit is configured to allocate a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system, wherein the flow scheduling engine has a first instruction and a second instruction, the first instruction indicates a first flow queue to be scheduled and a second flow queue to be output by the flow scheduling unit, and the second instruction indicates a scheduling policy corresponding to the flow scheduling unit;

[0013] a first acquiring unit, configured to utilize the flow scheduling engine to obtain, according to the scheduling policy, a flow data address from the address linked table corresponding to the first flow queue, and place the address in the address linked table corresponding to the second flow queue;

[0014] The second acquiring unit is configured to obtain the flow data from the data cache and output it according to the address linked list corresponding to the merged scheduling flow queue.

[0015] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0016] a memory for storing computer-readable program code;

[0017] A processor is configured to execute the computer-readable program code stored in the memory to implement the multi-stage flow scheduling method as described above.

[0018] According to a fourth aspect of an embodiment of the present disclosure, a computer storage medium is provided, wherein the computer storage medium stores computer program code, and when the computer program code is executed by a processor, the processor executes the multi-stage flow scheduling method as described above.

[0019] According to an embodiment of the present disclosure, any flow scheduling unit in a multi-level flow scheduling system is implemented using a flow scheduling engine. The flow scheduling engine has a first instruction and a second instruction. The first instruction instructs the flow scheduling unit to schedule a first flow queue and an output second flow queue, and the second instruction instructs the flow scheduling unit to implement a corresponding scheduling policy. Different flow scheduling units differ in the flow queues they schedule and the specific scheduling policies they implement. In this embodiment of the present disclosure, the first instruction indicates the flow queue to be scheduled and the second instruction indicates the scheduling policy. In this way, by applying different first and second instructions to the flow scheduling engine, the flow scheduling engine can simulate any flow scheduling unit in a multi-level flow scheduling system. In this embodiment of the present disclosure, an address linked list is maintained for each flow queue, indicating the storage address of the flow data in the flow queue in the data cache. Then, when the flow scheduling engine performs scheduling, it schedules the address of the flow data rather than the specific flow data. That is, according to the scheduling policy, the flow data address is taken from the address linked list corresponding to the first flow queue and placed in the address linked list corresponding to the second flow queue. By separating flow data storage and flow queue management, zero data movement in hierarchical scheduling is achieved. In this way, the complex hierarchical flow scheduling is transferred to the scheduling of a smaller-scale flow scheduling engine. Then, by hierarchically cascading different flow scheduling engines according to different needs, a flexible configuration of a multi-level flow scheduling system is achieved. In the embodiment of the present disclosure, the multi-level flow scheduling system is flexibly configured through the on-demand cascading of flow scheduling engines. The flow queues and specific scheduling strategies scheduled in each layer can be flexibly configured in the flow scheduling engine through the first and second instructions. The scheduling is performed based on the flow data address, eliminating the dependence on specific data, thereby improving the flexibility and scenario universality of multi-level flow scheduling. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present disclosure. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0021] Figure 1 This is a system architecture diagram to which the multi-stage flow scheduling method according to an embodiment of the present disclosure is applied;

[0022] Figure 2 is a flowchart of a multi-stage flow scheduling method according to an embodiment of the present disclosure;

[0023] Figure 3 It is a schematic diagram of a multi-level flow scheduling system;

[0024] Figure 4 is a schematic diagram of maintaining an address list for a flow queue in step 210;

[0025] Figure 5 This is an implementation architecture diagram of a multi-stage flow scheduling method according to an embodiment of the present disclosure;

[0026] Figures 6A-6D This is a schematic diagram of the process of the flow scheduling engine scheduling the flow data address according to the scheduling policy in step 230;

[0027] Figures 7A-7D This is a schematic diagram of the process of continuously fetching stream data from the data cache according to the address linked list in step 240;

[0028] Figure 8 is a flowchart of a specific decomposition of step 210;

[0029] Figures 9A-9F It is a schematic diagram of the process of adding addresses to and removing addresses from an address list in combination with a queue pointer according to one embodiment of the present disclosure;

[0030] Figures 10A-10B A schematic diagram illustrating non-time-division multiplexing of a candidate flow scheduling engine according to an embodiment of the present disclosure is shown;

[0031] Figures 11A-11B A schematic diagram illustrating time-division multiplexing of a candidate flow scheduling engine according to an embodiment of the present disclosure is shown;

[0032] Figure 12 A schematic diagram showing a flow scheduling unit scheduling at least one flow queue outputted from a previous layer and a supplementary flow queue outputted from no layer of a multi-layer flow scheduling system according to an embodiment of the present disclosure is shown;

[0033] Figure 13 is a block diagram of a multi-stage flow scheduling device according to an embodiment of the present disclosure;

[0034] Figure 14 To implement Figure 2 The structural diagram of the dedicated data processor of the multi-stage flow scheduling method is shown. DETAILED DESCRIPTION

[0035] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field should fall within the scope of protection of the embodiments of the present application.

[0036] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0037] Hierarchical Quality of Service (HQoS) is a method for managing network service quality. It divides network communication traffic into multiple layers, each equipped with different scheduling strategies and different service quality parameters. For example, the service layer schedules traffic for different service types (voice, data, video, etc.) (for example, voice has a higher priority, so among the voice flow queue, data flow queue, and video flow queue, flow data is preferentially taken from the voice flow queue and placed in the output flow queue). After the data of different service types for each user is scheduled and integrated using the above method, the data of different users is further scheduled and integrated at the user layer. For example, 7 flow data are first taken from the flow queue of a VIP user, and then 3 flow data are taken from the flow queue of an ordinary user. The data taken ratio between VIP users and ordinary users is 7:3.

[0038] A drawback of related hierarchical scheduling techniques is that the HQoS system's layers are pre-designed and cannot be dynamically configured. For example, a three-layer HQoS system cannot be applied to scenarios where a four-layer HQoS system is suitable. Furthermore, the scheduling policies within each layer are also pre-designed, and the number of input flow queues integrated by each scheduling unit is also pre-set. A different HQoS system must be designed for each scenario. Once the hierarchical system is fixed, it cannot be applied to other scenarios.

[0039] Figure 1 FIG2 is a diagram of a system architecture to which the multi-stage flow scheduling method according to an embodiment of the present disclosure is applied. The system architecture includes a master device, a dedicated data processor attached to the master device, and a destination device.

[0040] The master device is the device that generates and sends stream data. It can be a client or a server. It can be a desktop computer, laptop computer, mobile phone, PDA, dedicated terminal, or a cluster of multiple terminals. Alternatively, it can be a partitioned portion of a terminal, such as a virtual machine, or a collection of virtual machines partitioned from multiple terminals. The master device generates stream queues using various stream generation units within the master device. A stream generation unit is a physical or virtual unit within the master device that generates stream data. For example, in a video conference, a microphone acts as a stream generation unit, specifically collecting the various audio signals generated during the video conference; a camera acts as another stream generation unit, specifically collecting the video signals during the video conference. If the master device is a switch or server, it may receive audio, video, and data signals from different users. Each of these signals may form a corresponding stream queue. A stream queue is a queue formed by the stream data generated by the stream generation unit.

[0041] A dedicated data processor provides network quality of service (QoS) management for the main device. It provides HQoS services, such as HQoS, by dividing network traffic into multiple tiers and applying different QoS parameters to each tier, enabling better QoS and resource management for the main device. It can be implemented as an auxiliary device (such as a card plugged into a slot) or as another independent device connected to the main device via an interface.

[0042] A dedicated data processor schedules the various flow queues generated by the master device in layers according to the scheduling policy, generating a merged flow queue. For example, VIP users and regular users are scheduled with a 7:3 data ratio, generating a merged flow queue. The merged flow queue is then sent to the destination device.

[0043] The destination device is the device that receives the stream data. It can be a client or a server. It can be a desktop computer, laptop computer, mobile phone, PDA, dedicated terminal, or a cluster of terminals. It can also be a partitioned portion of a terminal, such as a virtual machine.

[0044] According to one embodiment of the present disclosure, a multi-level flow scheduling method is provided. The multi-level flow scheduling method refers to a method for hierarchically scheduling flow queues in a multi-level flow scheduling system. For example, VIP users and ordinary users take data according to a 7:3 ratio for scheduling, generating a merged scheduling flow queue. The multi-level flow scheduling system refers to a scheduling framework for scheduling flow queues according to multiple levels, each level constructs one or more flow scheduling units, and each flow queue input by the flow scheduling unit takes data according to a certain scheduling strategy to synthesize the output scheduling flow queue. For example, VIP users and ordinary users take data according to a 7:3 ratio for scheduling, and the above-mentioned taking data according to 7:3 is the scheduling strategy.

[0045] The multi-stage flow scheduling method is used for a dedicated data processor used in conjunction with a main device.

[0046] Figure 3 An example of a multi-level flow scheduling system according to an embodiment of the present disclosure is shown. The flow generation unit in the master device generates multiple flow queues, such as Figure 3 The dedicated data processor utilizes a multi-level flow scheduling system to hierarchically schedule multiple flow queues to generate a merged scheduling flow queue (such as Figure 3 Flow queue 15). In the multi-level flow scheduling system, each level has at least one flow scheduling unit, which schedules at least one flow queue output by the previous level to generate a scheduling flow queue, which is input to at least one flow scheduling unit of the next level. Figure 3 The multi-level flow scheduling system shown includes a service level, a user level, and a port level. Each flow scheduling unit at the service level receives input flow queues representing different service types for the same user. For example, flow queue 1 is the voice flow queue for user A, and flow queue 2 is the video flow queue for user A. The flow scheduling unit combines these into a scheduling flow queue 9, which is then input to the flow scheduling unit at the next level. Each flow scheduling unit at the user level receives flow queues synthesized from different user service types. For example, flow queue 9 is the synthesized flow queue representing user A's service types, and flow queue 10 is the synthesized flow queue representing user B's service types. The flow scheduling unit synthesizes these into a scheduling flow queue 13, which is then input to the flow scheduling unit at the next level. Each flow scheduling unit at the port level receives flow queues synthesized from users output from different ports. For example, flow queue 13 is the flow queue output from port A, and flow queue 14 is the flow queue output from port B. The flow scheduling unit synthesizes these into a scheduling flow queue 15, i.e., merges the scheduling flow queues.

[0047] In related technologies, such as Figure 3 The system level is pre-designed, the scheduling strategy in each level is also pre-designed, and the number of input flow queues integrated by each flow scheduling unit is also pre-set. Figure 3Once the layered system is fixed, if you need to use it in other scenarios, you need to change it. Figure 3 The disclosed embodiment does not require a fixed hierarchical system level or a fixed scheduling strategy. The following methods can improve the flexibility and scenario universality of multi-level flow scheduling. Figure 2 As shown, the multi-level flow scheduling method includes:

[0048] Step 210: For each flow queue in the multi-level flow scheduling system, maintain an address list of the flow data in the flow queue stored in the data cache;

[0049] Step 220: Allocate a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system, wherein the flow scheduling engine has a first instruction and a second instruction, the first instruction instructing the flow scheduling unit to schedule a first flow queue and an output second flow queue, and the second instruction instructs the flow scheduling unit to schedule a corresponding scheduling policy;

[0050] Step 230: Using the flow scheduling engine, according to the scheduling policy, take the flow data address from the address linked list corresponding to the first flow queue and put it into the address linked list corresponding to the second flow queue;

[0051] Step 240: According to the address linked list corresponding to the merged scheduling flow queue, the flow data is taken from the data cache and output.

[0052] The above steps 210 - 240 are described in detail below.

[0053] In step 210, for a flow queue in a multi-level flow scheduling system, an address linked list of flow data in the flow queue stored in a data cache is maintained.

[0054] The flow queue is a queue formed by flow data, which includes the flow queue generated by the flow generation unit and the flow queue synthesized after scheduling by each flow scheduling unit, namely flow queues 1-15.

[0055] like Figure 5As shown, the dedicated data processor of the embodiment of the present disclosure includes a queue data partition and a queue management scheduling partition. The queue data partition is used to store the flow queue so that the partition to be sent can be retrieved after scheduling. The queue management scheduling partition schedules the flow data address of the flow queue, thereby obtaining the address of the flow data to be retrieved, so as to retrieve the partition to send the flow data from the queue data partition. The queue data partition includes a queue write unit, a data cache, and a queue read unit. As described above, the flow data of the embodiment of the present disclosure does not migrate, and only the flow data address is migrated and processed by the flow scheduling engine. The flow data only needs to be stored in a fixed location, and when outputting the flow data, it is only necessary to output the flow data of the corresponding address according to the scheduling result of the flow data address. The data cache is a storage space for fixed storage of flow data. The queue write unit is a unit that writes the flow data in the queue to the data cache. The queue read unit is a unit that outputs the flow data of the flow data address after scheduling from the data cache.

[0056] The address linked list is a string of addresses of stream data stored in the data cache. Figure 4 As shown, there are 4 stream data in stream queue 1. When the queue write unit writes the first stream data, the address Addr in the allocated data cache is 11 When the queue write unit writes the second stream data, due to the Addr 12 -Addr 23 All are occupied, allocate the address Addr in the data cache 24 When the queue write unit writes the third stream data, due to the Addr 31 -Addr 34 All are occupied, allocate the address Addr in the data cache 41 When the queue write unit writes the fourth stream data, due to the Addr 42 Already occupied, allocate the address Addr in the data cache 43 At this time, Addr 11 、Addr 24 、Addr 41 、Addr 43 String together an address list. Note that Figure 4 In the address list, the right side is the head of the team. The address that first enters the address list is written to the right side of the address list.

[0057] In step 220, a stream scheduling engine is assigned to each stream scheduling unit in the multi-level stream scheduling system. A stream scheduling engine is the hardware structure that implements the stream scheduling unit. At a given moment, a stream scheduling engine can only function as one stream scheduling unit, but it can function as different stream scheduling units at different times, a process known as time-division multiplexing. Time-division multiplexing will be explained in detail later.

[0058] like Figure 5 As shown, the queue management scheduling partition includes an in-queue and out-queue interface, a multi-queue management module and multiple candidate flow scheduling engines (such as Figure 5 The multiple queue management module includes the address list, queue pointers, and queue status. The queue pointers will be described in detail later. The queue status indicates whether the queue is empty, etc.

[0059] A candidate flow scheduling engine refers to a unit that can be used as a flow scheduling engine. The flow scheduling engine is selected from it. The candidate flow scheduling engine has a time-sharing scheduler, an instruction RAM and a scheduling body. The time-sharing scheduler is a device that implements the above-mentioned time-sharing multiplexing. The instruction RAM stores multiple wide instructions. Each wide instruction corresponds to a flow scheduling unit that the candidate flow scheduling engine acts as in time-sharing multiplexing. The number of times a candidate flow scheduling engine is time-sharing multiplexed is the number of flow scheduling units it acts as, and accordingly, the number of wide instructions it has. Each wide instruction includes a first instruction and a second instruction. The first instruction indicates the first flow queue to be scheduled and the second flow queue to be output by the flow scheduling unit that the candidate flow scheduling engine acts as. The second instruction indicates the scheduling strategy corresponding to the flow scheduling unit. Assume that the flow scheduling engine is to implement Figure 3 In the flow scheduling unit, flow queue Q3 and flow queue Q4 are scheduled into flow queue Q10. At this time, Figure 6A As shown, the first flow queues indicated by the first instruction are Q3 and Q4, and the second flow queue is Q10. The scheduling policy indicated by the second instruction is PQ / WFQ.

[0060] The scheduling body includes a queue establishment module, a scheduling policy module, and a scheduling execution module. The queue establishment module is configured to establish a flow queue according to the first flow queue and the second flow queue indicated by the first instruction. The scheduling policy module is configured to load the scheduling policy indicated by the second instruction. The scheduling execution module is configured to execute the scheduling policy on the first flow queue to obtain the second flow queue.

[0061] In step 230, the flow scheduling engine is used to retrieve the flow data address from the address linked list corresponding to the first flow queue according to the scheduling policy, and put it into the address linked list corresponding to the second flow queue.

[0062] like Figure 6A As shown, the first flow queues are Q3 and Q4, and the second flow queue is Q10. The scheduling execution module takes the first address Addr from the address list of the first flow queue Q3. 11 (The right side is the head of the queue, so it is the first address on the right), put it in the first position of the second stream queue.11 It has been taken out from the address linked list of the first flow queue Q3, which is indicated by a dotted box.

[0063] like Figure 6B As shown, the scheduling execution module takes out the first address Addr from the address list of the first flow queue Q4. 13 , put into the second position of the second stream queue. 13 It has been taken out from the address linked list of the first flow queue Q4, which is indicated by a dotted box.

[0064] like Figure 6C As shown, the scheduling execution module takes out the second address Addr from the address list of the first flow queue Q4. 31 , put into the third position of the second flow queue. 31 It has been taken out from the address linked list of the first flow queue Q4, which is indicated by a dotted box.

[0065] like Figure 6D As shown, the scheduling execution module takes out the second address Addr from the address list of the first flow queue Q3. 24 , put into the fourth position of the second flow queue. 24 It has been taken out from the address linked list of the first flow queue Q3, which is indicated by a dotted box.

[0066] The address list corresponding to the second stream queue becomes Addr 11 ,Addr 13 ,Addr 31 ,Addr 24 The address list is the address list of flow queue 10. Then, Figure 3 As shown, the subsequent flow scheduling engine executes the corresponding scheduling strategy based on the address list of flow queue 9 and the address list of flow queue 10, obtains the address list of flow queue 13, and finally obtains the address list of flow queue 15, that is, merges the address lists corresponding to the scheduling flow queues.

[0067] In step 240, the flow data is output from the data cache according to the address linked list corresponding to the merged scheduling flow queue.

[0068] like Figure 7A As shown, the first address of the address list corresponding to the merged scheduling flow queue is Addr 21 Therefore, from the data cache address Addr 21 The corresponding stream data is output. 21 Removed, indicated by a dotted frame.

[0069] like Figure 7B As shown, the second address of the address list corresponding to the merged scheduling flow queue is Addr24 Therefore, from the data cache address Addr 24 The corresponding stream data is output. 24 Removed, indicated by a dotted frame.

[0070] like Figure 7C As shown, the third address of the address list corresponding to the merged scheduling flow queue is Addr 33 Therefore, from the data cache address Addr 33 The corresponding stream data is output. 33 Removed, indicated by a dotted frame.

[0071] like Figure 7D As shown, the fourth address of the address list corresponding to the merged scheduling flow queue is Addr 34 Therefore, from the data cache address Addr 34 The corresponding stream data is output. 34 Removed, indicated by a dotted frame.

[0072] According to an embodiment of the present disclosure, any flow scheduling unit in a multi-level flow scheduling system is implemented using a flow scheduling engine. The flow scheduling engine has a first instruction and a second instruction. The first instruction indicates the first flow queue to be scheduled and the second flow queue to be output by the flow scheduling unit, and the second instruction indicates the corresponding scheduling strategy of the flow scheduling unit. In this way, as long as different first instructions and second instructions are applied to the flow scheduling engine, the flow scheduling engine can simulate any flow scheduling unit in the multi-level flow scheduling system. At the same time, the embodiment of the present disclosure maintains an address linked list for each flow queue, which indicates the storage address of the flow data in the flow queue in the data cache. Then, when the flow scheduling engine performs scheduling, it schedules the address of the flow data instead of the specific flow data. By separating the flow data storage and the flow queue management, zero data movement is achieved in hierarchical scheduling. In this way, the complex hierarchical flow scheduling is transferred to the scheduling of a smaller-scale flow scheduling engine. Then, by hierarchically cascading different flow scheduling engines according to different needs, a flexible configuration of a multi-level flow scheduling system is achieved. In the disclosed embodiment, the multi-level flow scheduling system is flexibly configured through on-demand cascading of flow scheduling engines. The flow queues and specific scheduling strategies scheduled in each level can be flexibly configured in the flow scheduling engine through the first instruction and the second instruction, and the scheduling is performed based on the flow data address, eliminating the dependence on specific data, thereby improving the flexibility and scenario universality of multi-level flow scheduling.

[0073] In one embodiment, Figure 8 As shown, step 210 includes:

[0074] Step 810: Receive stream data from the master device, where the stream data has a stream queue number.

[0075] Step 820: Allocate a stream data address for the stream data in the unallocated space of the data cache;

[0076] Step 830: Record the flow data address into the address linked list corresponding to the flow queue of the flow queue number, and store the flow data into the flow data address.

[0077] In step 810, the flow queue from the master device may include queues of different service types of various users, such as Figure 3 Stream queues 1-8 in the example. Stream queue 1 is the queue for user A's voice stream data. Stream queue 2 is the queue for user A's video stream data. Stream queue 3 is the queue for user B's voice stream data. Stream queue 4 is the queue for user B's video stream data. Stream queue 5 is the queue for user C's voice stream data. Stream queue 6 is the queue for user C's video stream data. Stream queue 7 is the queue for user D's voice stream data. Stream queue 8 is the queue for user D's video stream data. Because these queues come from different service types for different users, different address linked lists are required. To distinguish these queues, each stream data in these queues is assigned a stream queue number. For example, each stream data in stream queue 1 has a stream queue number of 1, and each stream data in stream queue 2 has a stream queue number of 2.

[0078] like Figure 9A As shown, in the data cache, for the flow data 1 of the flow queue 1, the flow data address Addr is allocated in step 820. 11 In step 830, the address Addr 11 Record the address in the address chain list corresponding to stream queue 1, in principle, from front to back. Since the right side of the address chain list is the head of the queue, the address Addr 11 Record to the rightmost of the address chain corresponding to stream queue 1. Store stream data 1 of stream queue 1 into the data cache address Addr 11 location.

[0079] like Figure 9B As shown, in the data cache, for the flow data 1 of the flow queue 2, the flow data address Addr is allocated in step 820. 13 In step 830, the address Addr 13 Record it in the address list corresponding to stream queue 2. Since the right side of the address list is the head of the queue, the address Addr 13 Record to the rightmost of the address chain corresponding to stream queue 2. Store stream data 1 of stream queue 2 to the data cache address Addr 13 location.

[0080] like Figure 9CAs shown, in the data cache, for the flow data 2 of the flow queue 1, the flow data address Addr is allocated in step 820. 32 In step 830, the address Addr 32 Record it in the address list corresponding to stream queue 1. Since the right side of the address list is the head of the queue, the address Addr 32 Record the second position from the right of the address list corresponding to stream queue 1. Store stream data 2 of stream queue 1 into the data cache address Addr 32 location.

[0081] like Figure 9D As shown, in the data cache, for the flow data 1 of the flow queue 3, the flow data address Addr is allocated in step 820. 44 In step 830, the address Addr 44 Record it in the address list corresponding to stream queue 3. Since the right side of the address list is the head of the queue, the address Addr 44 Record to the rightmost of the address chain corresponding to stream queue 3. Store stream data 1 of stream queue 3 into the data cache address Addr 44 location.

[0082] The above steps 810-830, by assigning flow queue numbers to flow data, each flow queue number corresponds to an address linked list, so that the assigned flow data address is recorded in the corresponding address linked list according to the flow queue number, thereby improving the efficiency of recording the flow data address in the address linked list, thereby improving the efficiency of multi-level flow scheduling.

[0083] In one embodiment, the address linked list has a queue pointer. The queue pointer is a pointer used to indicate the queue position. It includes a head pointer and a tail pointer. The head pointer indicates the first stream data address in the address linked list, and the tail pointer indicates the last stream data address in the address linked list.

[0084] In this embodiment, recording the stream data address to the address linked list corresponding to the stream queue number in step 830 specifically includes: recording the stream data address to the tail of the address linked list corresponding to the stream queue number, and updating the queue pointer of the address linked list (specifically, updating the tail pointer of the address linked list to the stream data address recorded at the tail).

[0085] like Figure 9A As shown, the address Addr 11 Record to the tail of the address chain list corresponding to flow queue 1. Since the address chain list corresponding to flow queue 1 was originally empty, after recording to the tail, Addr 11 Still in the first position of the address list, and the tail pointer becomes the stream data address Addr recorded to the end 11 .

[0086] like Figure 9B As shown, the address Addr 13 Record to the tail of the address chain list corresponding to flow queue 2. Since the address chain list corresponding to flow queue 2 was originally empty, after recording to the tail, Addr 13 Still in the first position of the address list, and the tail pointer becomes the stream data address Addr recorded to the end 13 .

[0087] like Figure 9C As shown, the address Addr 32 Record to the end of the address list corresponding to flow queue 1. Since there is an address Addr in the address list corresponding to flow queue 1 11 , recording to the end is actually recording to the second position Addr in the address list 32 The tail pointer becomes the stream data address Addr recorded to the end 32 .

[0088] like Figure 9D As shown, the address Addr 44 Record to the tail of the address chain list corresponding to flow queue 3. Since the address chain list corresponding to flow queue 3 was originally empty, after recording to the tail, Addr 44 Still in the first position of the address list, and the tail pointer becomes the stream data address Addr recorded to the end 44 .

[0089] The above describes the pointer changes when adding an address to the address list. The following describes the pointer changes when taking an address from the address list.

[0090] In step 230, a flow data address is retrieved from the address linked list corresponding to the first flow queue, including: retrieving flow data addresses from the first flow queue in a forward-to-backward order, and stopping retrieving flow data addresses based on the queue pointer. Specifically, this includes executing a first process, which includes: retrieving the flow data addresses according to the first pointer; each time a flow data address is retrieved, updating the first pointer with the next flow data address retrieved from the address linked list, and repeating the first process until the first pointer is equal to the last pointer, at which point the flow data address corresponding to the first pointer is retrieved.

[0091] like Figure 9E As shown, since the first pointer of stream queue 1 is Addr 11 , so take out Addr from the address list of flow queue 1 11 . Use the address list of stream queue 1 to take out the Addr 11 The next stream data address Addr 32 Update the first pointer, the first pointer becomes Addr32 At this time, the first pointer Addr 32 Equal to the tail pointer Addr 32 , the first process ends. Take out Addr from the address list of flow queue 1 32 The data stream address is retrieved and both the first and last pointers become null.

[0092] The beneficial effect of this embodiment is that by setting the head pointer, the stream data address to be retrieved from the address linked list can be accurately determined. Furthermore, by continuously updating the head pointer to the next stream data address in the address linked list, multiple stream data addresses can be continuously retrieved from the address linked list until the head pointer equals the tail pointer. This can reduce stream data address scheduling errors and improve stream scheduling accuracy.

[0093] In another embodiment, a similar effect can be achieved by cooperating with the head pointer and the length pointer.

[0094] In this embodiment, the queue pointer includes a head pointer and a length pointer. The head pointer indicates the first stream data address in the address chain list, and the length pointer indicates the number of stream data addresses in the address chain list. The length pointer is initially 0.

[0095] In this embodiment, recording the stream data address to the address linked list corresponding to the stream queue of the stream queue number in step 830 specifically includes: recording the stream data address to the tail of the address linked list corresponding to the stream queue of the stream queue number, and updating the queue pointer of the address linked list (specifically, adding 1 to the length pointer).

[0096] exist Figure 9A In the example, if the length pointer is used instead of the tail pointer, the address Addr 11 Record to the tail of the address chain list corresponding to flow queue 1. Since the address chain list corresponding to flow queue 1 was originally empty, after recording to the tail, Addr 11 Still at the first position of the address linked list, the length pointer of the address linked list of flow queue 1 is increased by 1 and becomes 1.

[0097] exist Figure 9B In the example, if the length pointer is used instead of the tail pointer, the address Addr 13 Record to the tail of the address chain list corresponding to flow queue 2. Since the address chain list corresponding to flow queue 2 was originally empty, after recording to the tail, Addr 13 Still at the first position of the address linked list, the length pointer of the address linked list of flow queue 2 is increased by 1 and becomes 1.

[0098] like Figure 9C As shown, if the tail pointer is replaced by the length pointer, the address Addr 32Record to the end of the address list corresponding to flow queue 1. Since there is an address Addr in the address list corresponding to flow queue 1 11 , recording to the end is actually recording to the second position Addr in the address list 32 The length pointer of the address list of flow queue 1 is increased by 1 and becomes 2.

[0099] like Figure 9D As shown, if the tail pointer is replaced by the length pointer, the address Addr 44 Record to the tail of the address chain list corresponding to flow queue 3. Since the address chain list corresponding to flow queue 3 was originally empty, after recording to the tail, Addr 44 Still at the first position of the address linked list, the length pointer of the address linked list of flow queue 3 is increased by 1 and becomes 1.

[0100] The above describes the pointer changes when adding an address to the address list. The following describes the pointer changes when taking an address from the address list.

[0101] In step 230, a flow data address is retrieved from the address linked list corresponding to the first flow queue. This includes: retrieving flow data addresses from the first flow queue in order from front to back, and stopping retrieving flow data addresses based on the queue pointer. Specifically, this includes: retrieving flow data addresses from the first flow queue, starting from the flow data address corresponding to the first pointer; and decrementing the length pointer by 1 each time a flow data address is retrieved until the length pointer reaches 0.

[0102] exist Figure 9E In the example, if the length pointer is used instead of the tail pointer, since the first pointer of stream queue 1 is Addr 11 , so from the address list of flow queue 1, 11 Start by continuously getting the stream data address. 11 After that, the length pointer is reduced by 1 and becomes 1. Then, continue as Figure 9F As shown, continue to get the next stream address Addr in the address list 32 When taking out Addr 32 After that, the length pointer decreases by 1 and becomes 0. The address of the stream data is completed. The first pointer becomes null.

[0103] The beneficial effect of this embodiment is that, by setting the length pointer, it is possible to accurately know the stream data address corresponding to the first pointer in the address list and continuously obtain the number of stream data addresses, thereby improving scheduling efficiency.

[0104] The following describes in detail the allocation of a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system in step 220.

[0105] If the first number of flow scheduling units in the multi-level flow scheduling system is not greater than the second number of candidate flow scheduling engines, then the first number of candidate flow scheduling engines are randomly selected from the second number of candidate flow scheduling engines and each is used as a flow scheduling unit. Figure 10A In the multi-level flow scheduling system, there are three flow scheduling units, and the number of candidate flow scheduling engines also happens to be three. In this case, the candidate flow scheduling engines E1-E3 are used as flow scheduling units 1-3 respectively. Figure 10B shown.

[0106] If the first number of flow scheduling units in the multi-level flow scheduling system is greater than the second number of candidate flow scheduling engines, the situation becomes complicated, involving time-division multiplexing of some of the candidate flow scheduling engines. In this embodiment, step 220 includes: obtaining multiple candidate flow scheduling engines; if the first number of flow scheduling units in the multi-level flow scheduling system is greater than the second number of candidate flow scheduling engines, time-division multiplexing some of the candidate flow scheduling engines to serve as a flow scheduling unit in each of multiplexing cycles of multiple consecutive multiplexing cycles, so that each flow scheduling unit is assigned a flow scheduling engine.

[0107] like Figure 11A As shown in Figure 1, there are 4 flow scheduling units in the multi-level flow scheduling system, but there are only 3 candidate flow scheduling engines. Therefore, it is necessary to time-multiplex one candidate flow scheduling engine. Figure 11B As shown, candidate flow scheduling engine E1 acts as flow scheduling unit 1 and 2 in two consecutive multiplexing cycles, candidate flow scheduling engine E2 acts as flow scheduling unit 3 in two consecutive multiplexing cycles, and candidate flow scheduling engine E3 acts as flow scheduling unit 4 in two consecutive multiplexing cycles. Candidate flow scheduling engine E1 acts as flow scheduling unit 1 in the first multiplexing cycle and as flow scheduling unit 2 in the second multiplexing cycle. The flow scheduling unit 4 implemented by candidate flow scheduling engine E3 must utilize the output flow queues of flow scheduling units 1-2 and must therefore operate in both multiplexing cycles to correctly schedule the output flow queues of flow scheduling units 1 and 2.

[0108] The advantage of the above embodiment is that by allowing some candidate flow scheduling engines to be time-multiplexed, a small number of candidate flow scheduling engines can be used to implement a multi-level flow scheduling system, thereby improving resource utilization.

[0109] In one embodiment, the above-mentioned time-sharing multiplexing of a part of the candidate flow scheduling engines includes: for each flow scheduling unit of the multiple flow scheduling units that the candidate flow scheduling engine acts as in multiple consecutive multiplexing cycles, based on the first flow queue to be scheduled by the flow scheduling unit and the second flow queue to be output, generating a first instruction for the flow scheduling unit, and based on the scheduling policy corresponding to the flow scheduling unit, generating a second instruction for the flow scheduling unit; writing the first instructions and the second instructions of the multiple flow scheduling units into the flow scheduling engine.

[0110] That is to say, when each flow scheduling engine corresponds to only one flow scheduling unit, the flow scheduling engine has one first instruction. The first instruction is generated based on the first flow queue to be scheduled by the flow scheduling unit and the second flow queue to be output. However, when each flow scheduling engine corresponds to multiple flow scheduling units, the flow scheduling engine has multiple first instructions and multiple second instructions, and each flow scheduling unit corresponds to one first instruction and one second instruction. The first instruction corresponding to each flow scheduling unit is generated based on the first flow queue to be scheduled by the flow scheduling unit and the second flow queue to be output. The second instruction corresponding to each flow scheduling unit is generated based on the scheduling policy of the flow scheduling unit.

[0111] like Figure 11B As shown, the flow scheduling engine E1 corresponds to two consecutive flow scheduling units 1-2. At this time, the flow scheduling engine E1 has two first instructions. The first first instruction instructs the flow scheduling unit 1 to schedule the first flow queues Q0-Q2 and output the second flow queue Q8. The second first instruction instructs the flow scheduling unit 1 to schedule the first flow queues Q3-Q5 and output the second flow queue Q9. At the same time, the flow scheduling engine E1 also has two second instructions. The first second instruction indicates the scheduling policy of the flow scheduling unit 1, and the second second instruction indicates the scheduling policy of the flow scheduling unit 2.

[0112] The above embodiment sets different first instructions and second instructions for each flow scheduling unit that the flow scheduling engine acts as in time-sharing mode, thereby improving the flexibility of time-sharing multiplexing.

[0113] In one embodiment, if the first number of flow scheduling units in the multi-level flow scheduling system is greater than the second number of candidate flow scheduling engines, time-division multiplexing of some of the candidate flow scheduling engines includes:

[0114] The quotient of the first number modulo the second number is taken as the third number, and the remainder is taken as the fourth number;

[0115] time-division multiplexing each of the fourth number of candidate flow scheduling engines in the third number plus one consecutive multiplexing period, with each candidate flow scheduling engine acting as a flow scheduling unit in each multiplexing period, wherein the flow scheduling units corresponding to the third number plus one multiplexing period are located at the same level of the multi-level flow scheduling system;

[0116] Each of the remaining candidate flow scheduling engines is time-multiplexed in a third number of consecutive multiplexing cycles, acting as a flow scheduling unit in each multiplexing cycle, wherein the flow scheduling units corresponding to the third number of multiplexing cycles are located at the same level of the multi-level flow scheduling system.

[0117] For example, the first number is 10, which means that the multi-level flow scheduling system has a total of 10 flow scheduling units. The second number is 4, which means that there are a total of 4 candidate flow scheduling engines. At this time, time-sharing multiplexing of the candidate flow scheduling engines will occur. In order to determine how many times each candidate flow scheduling engine should be time-sharing multiplexed, the first number 10 is modulo the second number 4, and the quotient is 2 and the remainder is 2. The quotient 2 is used as the third number and the remainder 2 is used as the fourth number. At this time, for 2 of the 4 candidate flow scheduling engines, time-sharing multiplexing is required 2+1=3 times, that is, each of them acts as a flow scheduling unit in 3 consecutive multiplexing cycles. For the remaining 2 candidate flow scheduling engines, time-sharing multiplexing is required 2 times, that is, each of them acts as a flow scheduling unit in 2 consecutive multiplexing cycles. In this way, the 4 candidate flow scheduling engines act as a total of 2*2+2*3=10 flow scheduling units. Note that these time-sharing multiplexed flow scheduling units should be located at the same level of the multi-level flow scheduling system as much as possible. This is because the number of input flow queues and output flow queues of the flow scheduling units at the same level of the multi-level flow scheduling system are relatively similar, so it is easier to use the same candidate flow scheduling engine to serve as the flow scheduling unit. However, the number of input flow queues and output flow queues of the flow scheduling units at different levels are quite different, so it is more difficult to use the same candidate flow scheduling engine to serve as the flow scheduling unit. Figure 11B As shown, the candidate scheduling flow engine E1 is time-multiplexed to serve as the flow scheduling units 1 and 2 at the same level, and the candidate scheduling flow engine E1 is not allowed to serve as the first-level flow scheduling unit 1 and the second-level flow scheduling unit 4 as much as possible.

[0118] The above embodiment makes the load of each candidate scheduling flow engine relatively balanced, and allows the same candidate scheduling flow engine to serve as multiple flow scheduling units at the same level, thereby improving the rationality of flow scheduling engine allocation.

[0119] In one embodiment, the input flow queues of the flow scheduling unit do not necessarily all come from the output flow queues of the previous layer. At least one flow scheduling unit schedules at least one flow queue output from the previous layer and a supplementary flow queue that is not output from any layer of the multi-level flow scheduling system. Figure 12 As shown, the flow scheduling unit 4 schedules the ordinary user flow queue Q8 output by the flow scheduling unit 1, the VIP user flow queue Q9 output by the flow scheduling unit 2, and the high-speed flow queue Q10 as a supplementary flow queue. The high-speed flow queue Q10 does not come from the flow scheduling unit of the previous level. For example, if the video data, voice data, etc. generated by a certain user needs to be sent urgently, it can be directly inserted into a certain level in the middle of the multi-level flow scheduling system as input instead of being scheduled hierarchically through the above-mentioned multi-level flow scheduling system. This embodiment improves the flexibility of the design of the multi-level flow scheduling system.

[0120] In one embodiment, step 200 includes: obtaining the maximum number of input flow queues of each of multiple candidate flow scheduling engines; obtaining the actual number of input flow queues of the flow scheduling unit; and allocating a flow scheduling engine to the flow scheduling unit among the candidate flow scheduling engines whose actual number of input flow queues is not greater than the maximum number of input flow queues.

[0121] exist Figures 10A-10B 、 Figures 11A-11B In the example, the maximum number of input flow queues for all candidate flow scheduling engines is 3, and the actual number of input flow queues for each flow scheduling unit is also 3. However, in practice, the maximum number of input flow queues for a candidate flow scheduling engine may not always be equal to the actual number of input flow queues for the flow scheduling unit. In this case, only the candidate flow scheduling engines whose actual number of input flow queues is not greater than the maximum number of input flow queues will be assigned to the flow scheduling unit, otherwise the input flow queue will overflow. For example, to assign Figure 11B The candidate flow scheduling engine is assigned to the flow scheduling unit 3. The actual number of input flow queues for the flow scheduling unit 3 is 3. Assume that the maximum number of input flow queues for the candidate flow scheduling engine E1 is 2, the maximum number of input flow queues for the candidate flow scheduling engine E2 is 3, and the maximum number of input flow queues for the candidate flow scheduling engine E3 is 4. Because the maximum number of input flow queues (2) for the candidate flow scheduling engine E1 is less than the actual number of input flow queues (3) for the flow scheduling unit 3, an input flow queue overflow occurs. Therefore, a flow scheduling engine is assigned to the flow scheduling unit 3 from the candidate scheduling flow engines E2 and E3. The last assigned flow scheduling engine is E2.

[0122] The above embodiment makes the range of flow queues that the candidate flow scheduling engines can connect to variable, improves the flexibility of allocating flow scheduling engines to the flow scheduling unit, and reduces the wiring complexity because the flow scheduling engines that can be allocated to the flow scheduling unit are limited.

[0123] In one embodiment, Figure 5 The candidate flow scheduling engine includes multiple candidate scheduling policy execution circuits (not shown). The second instruction of the candidate flow scheduling engine indicates the scheduling policy of the candidate flow scheduling engine. The scheduling policy indicates which candidate scheduling policy execution circuit is connected. In this embodiment, step 230 includes: according to the scheduling policy, selecting a target scheduling policy execution circuit from multiple candidate scheduling policy execution circuits, and using the target scheduling policy execution circuit to take the flow data address from the address linked list corresponding to the first flow queue and place it in the address linked list corresponding to the second flow queue. This embodiment implements various scheduling strategies with hardware configuration, which improves the efficiency of scheduling compared to software-implemented scheduling strategies.

[0124] In one embodiment, a part of the candidate flow scheduling engines can include only a part of the candidate scheduling policy execution circuits (not shown). In this case, when allocating candidate flow scheduling engines to the flow scheduling unit, the scheduling policy executed by the flow scheduling unit must be considered. The flow scheduling engine is allocated from those candidate flow scheduling engines that include candidate scheduling policy execution circuits that execute the scheduling policy. If the flow scheduling engine is allocated from those candidate flow scheduling engines that do not include candidate scheduling policy execution circuits that execute the scheduling policy, the flow scheduling engine cannot execute the corresponding scheduling policy because it does not have the corresponding candidate scheduling policy execution circuit. Since the flow scheduling engines that can be allocated to the flow scheduling unit are limited, the wiring complexity is reduced and the flexibility of configuring a multi-level flow scheduling system is improved.

[0125] According to another aspect of the embodiment of the present application, referring to Figure 13 , provides a multi-level flow scheduling device 1300, which is located in a dedicated data processor used in conjunction with a main device. Multiple flow generation units in the main device generate multiple flow queues. The multi-level flow scheduling device 1300 uses a multi-level flow scheduling system to hierarchically schedule multiple flow queues to generate a merged scheduling flow queue. Each level in the multi-level flow scheduling system has at least one flow scheduling unit, which schedules at least one flow queue output by the previous level to generate a scheduling flow queue, which is input to at least one flow scheduling unit in the next level. The flow scheduling unit of the last level generates a merged scheduling flow queue. The multi-level flow scheduling device 1300 includes:

[0126] A maintenance unit 1310 is configured to maintain, for each flow queue in the multi-level flow scheduling system, an address list of the flow data in the flow queue stored in the data cache;

[0127] The allocation unit 1320 is configured to allocate a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system, wherein the flow scheduling engine has a first instruction and a second instruction, the first instruction indicating a first flow queue to be scheduled and a second flow queue to be output by the flow scheduling unit, and the second instruction indicating a corresponding scheduling policy of the flow scheduling unit;

[0128] The first obtaining unit 1330 is configured to use the flow scheduling engine to obtain the flow data address from the address linked list corresponding to the first flow queue according to the scheduling policy, and put the address into the address linked list corresponding to the second flow queue;

[0129] The second acquiring unit 1340 is configured to obtain the flow data from the data cache and output it according to the address linked list corresponding to the merged scheduling flow queue.

[0130] Optionally, the maintenance unit 1310 is specifically configured to:

[0131] receiving the stream data from the master device, the stream data having a stream queue number;

[0132] Allocating the stream data address to the stream data in an unallocated space of the data cache;

[0133] The flow data address is recorded in the address linked list corresponding to the flow queue of the flow queue number, and the flow data is stored in the flow data address.

[0134] Optionally, the address linked list has a queue pointer;

[0135] The maintenance unit 1310 is specifically configured to: record the flow data address to the tail of the address linked list corresponding to the flow queue of the flow queue number, and update the queue pointer of the address linked list;

[0136] The first acquiring unit 1330 is specifically configured to: acquire the flow data addresses in the first flow queue in a forward-to-backward order, and stop acquiring the flow data addresses based on the queue pointer.

[0137] Optionally, the queue pointer includes a head pointer and a tail pointer, the head pointer indicates the frontmost stream data address in the address linked list, and the tail pointer indicates the backmost stream data address in the address linked list;

[0138] The maintenance unit 1310 is specifically configured to: update the tail pointer of the address linked list to the stream data address recorded at the tail;

[0139] The first acquisition unit 1330 is specifically used to: execute a first process, which includes: obtaining the stream data address according to the first pointer; each time a stream data address is taken out, updating the first pointer with the next stream data address of the stream data address taken out from the address linked list, and repeating the first process until the first pointer is equal to the tail pointer, and then taking out the stream data address corresponding to the first pointer.

[0140] Optionally, the allocating unit 1320 is specifically configured to:

[0141] Obtain multiple candidate flow scheduling engines;

[0142] If the first number of the flow scheduling units in the multi-level flow scheduling system is greater than the second number of the candidate flow scheduling engines, a part of the candidate flow scheduling engines are time-division multiplexed to act as a flow scheduling unit in each of multiple consecutive multiplexing cycles, so that each of the flow scheduling units is assigned a flow scheduling engine.

[0143] Optionally, the allocating unit 1320 is specifically configured to:

[0144] For each of the plurality of flow scheduling units that the candidate flow scheduling engine serves as in a plurality of consecutive multiplexing cycles, generating the first instruction of the flow scheduling unit based on a first flow queue to be scheduled by the flow scheduling unit and an output second flow queue, and generating the second instruction of the flow scheduling unit based on a scheduling policy corresponding to the flow scheduling unit;

[0145] The first instructions and the second instructions of the plurality of stream scheduling units are written into the stream scheduling engine.

[0146] Optionally, the allocating unit 1320 is specifically configured to:

[0147] The quotient of the first number modulo the second number is used as the third number, and the remainder is used as the fourth number;

[0148] Time-division multiplexing each of the fourth number of the candidate flow scheduling engines in the third number plus one consecutive multiplexing cycles, with each candidate flow scheduling engine acting as one flow scheduling unit in each multiplexing cycle, wherein the flow scheduling units corresponding to the third number plus one multiplexing cycle are located at the same level of the multi-level flow scheduling system;

[0149] Each of the remaining candidate flow scheduling engines is time-multiplexed in a third number of consecutive multiplexing cycles, acting as a flow scheduling unit in each multiplexing cycle, wherein the flow scheduling units corresponding to the third number of multiplexing cycles are located at the same level of the multi-level flow scheduling system.

[0150] Optionally, at least one of the flow scheduling units schedules at least one of the flow queues output from a previous layer and a supplementary flow queue that is not output from any layer of the multi-level flow scheduling system.

[0151] Optionally, the allocating unit 1320 is specifically configured to:

[0152] Obtain the maximum number of input flow queues for each of multiple candidate flow scheduling engines;

[0153] Obtaining the actual number of input flow queues of the flow scheduling unit;

[0154] Among the candidate flow scheduling engines whose actual number of input flow queues is not greater than the maximum number of input flow queues, the flow scheduling engine is allocated to the flow scheduling unit.

[0155] Optionally, the flow scheduling engine includes a plurality of candidate scheduling strategy execution circuits;

[0156] The first acquisition unit 1330 is specifically used to: select a target scheduling policy execution circuit from multiple candidate scheduling policy execution circuits according to the scheduling policy, and use the target scheduling policy execution circuit to obtain the flow data address from the address linked list corresponding to the first flow queue and place it in the address linked list corresponding to the second flow queue.

[0157] The multi-stage flow scheduling apparatus 1300 of this embodiment is used to implement the corresponding multi-stage flow scheduling methods of the aforementioned multiple method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each unit in the multi-stage flow scheduling apparatus 1300 of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.

[0158] Refer to the following Figure 14 1400 according to an embodiment of the present disclosure will be described. Figure 14 The dedicated data processor 1400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0159] Figure 14 The illustrated dedicated data processor 1400 may include, but is not limited to, at least one processing unit 1410, at least one storage unit 1420, and a bus 1430 connecting various system components (including the storage unit 1420 and the processing unit 1410). The storage unit 1420 stores program code, which can be executed by the processing unit 1410 to cause the processing unit 1410 to perform the steps according to various exemplary embodiments of the present invention as described in the description of the exemplary method above in this specification.

[0160] The storage unit 1420 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 14201 and / or a cache memory unit 14202 , and may further include a read-only memory unit (ROM) 14203 .

[0161] The storage unit 1420 may also include a program / utility 14204 having a set (at least one) of program modules 14205, such program modules 14205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0162] The bus 1430 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0163] The application-specific data processor 1400 can also communicate with one or more external devices 500 (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the application-specific data processor 1400, and / or any device that enables the application-specific data processor 1400 to communicate with one or more other computing devices (e.g., a router, modem, etc.). Such communication can occur via an input / output (I / O) interface 1450. Furthermore, the application-specific data processor 1400 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 1460. As shown, the network adapter 1460 communicates with other modules of the application-specific data processor 1400 via a bus 1430. It should be understood that, although not shown, the application-specific data processor 1400 can be implemented using other hardware and / or software modules, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0164] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0165] In an exemplary embodiment of the present disclosure, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method described in the above method embodiment.

[0166] According to one embodiment of the present disclosure, a program product for implementing the method in the above method embodiment is also provided. The program product may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0167] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0168] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0169] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0170] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0171] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0172] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0173] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0174] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the appended claims.

Claims

1. A multi-stage flow scheduling method, characterized in that: A dedicated data processor for use with a master device, the master device generating multiple flow queues, the dedicated data processor hierarchically scheduling the multiple flow queues using a multi-level flow scheduling system, wherein each level of the multi-level flow scheduling system has at least one flow scheduling unit, scheduling at least one flow queue output by a previous level to generate a scheduled flow queue, which is input to at least one flow scheduling unit in a subsequent level, and the flow scheduling unit in the last level generates a merged scheduled flow queue; the multi-level flow scheduling method includes: For each of the flow queues in the multi-level flow scheduling system, maintaining an address linked list of flow data in the flow queue stored in a data cache; Allocate a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system, wherein the flow scheduling engine has a first instruction and a second instruction, the first instruction indicates a first flow queue to be scheduled and a second flow queue to be output by the flow scheduling unit, and the second instruction indicates a scheduling policy corresponding to the flow scheduling unit; Using the flow scheduling engine, according to the scheduling policy, taking the flow data address from the address linked list corresponding to the first flow queue, and placing it in the address linked list corresponding to the second flow queue; According to the address linked list corresponding to the merged scheduling flow queue, the flow data is retrieved from the data cache and outputted.

2. The multi-stage flow scheduling method according to claim 1, characterized in that: The method of maintaining, for each of the flow queues in the multi-level flow scheduling system, an address linked list of flow data in the flow queue stored in a data cache, includes: receiving the stream data from the master device, the stream data having a stream queue number; Allocating the stream data address to the stream data in an unallocated space of the data cache; The flow data address is recorded in the address linked list corresponding to the flow queue of the flow queue number, and the flow data is stored in the flow data address.

3. The multi-stage flow scheduling method according to claim 2, characterized in that: The address linked list has a queue pointer; The recording of the flow data address into the address linked list corresponding to the flow queue of the flow queue number comprises: recording the flow data address into the tail of the address linked list corresponding to the flow queue of the flow queue number, and updating the queue pointer of the address linked list; The fetching of the flow data address from the address linked list corresponding to the first flow queue includes: fetching the flow data address in the first flow queue in a forward-to-backward order, and stopping fetching the flow data address based on the queue pointer.

4. The multi-stage flow scheduling method according to claim 3, characterized in that: The queue pointer includes a head pointer and a tail pointer, the head pointer indicates the frontmost stream data address in the address chain list, and the tail pointer indicates the backmost stream data address in the address chain list; The updating of the queue pointer of the address linked list includes: updating the tail pointer of the address linked list to the stream data address recorded at the tail; The method of fetching the stream data address in the first stream queue in a front-to-back order and stopping fetching the stream data address based on the queue pointer includes: executing a first process, wherein the first process includes: fetching the stream data address according to the first pointer; updating the first pointer with the next stream data address of the stream data address fetched from the address linked list each time a stream data address is fetched, and repeating the first process until the first pointer is equal to the tail pointer, and then fetching the stream data address corresponding to the first pointer.

5. The multi-stage flow scheduling method according to claim 1, characterized in that: Allocating a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system includes: Obtain multiple candidate flow scheduling engines; If the first number of the flow scheduling units in the multi-level flow scheduling system is greater than the second number of the candidate flow scheduling engines, a part of the candidate flow scheduling engines are time-division multiplexed to act as a flow scheduling unit in each of multiple consecutive multiplexing cycles, so that each of the flow scheduling units is assigned a flow scheduling engine.

6. The multi-stage flow scheduling method according to claim 5, characterized in that: The time-division multiplexing of a portion of the candidate flow scheduling engines includes: For each of the plurality of flow scheduling units that the candidate flow scheduling engine serves as in a plurality of consecutive multiplexing cycles, generating the first instruction of the flow scheduling unit based on a first flow queue to be scheduled by the flow scheduling unit and an output second flow queue, and generating the second instruction of the flow scheduling unit based on a scheduling policy corresponding to the flow scheduling unit; The first instructions and the second instructions of the plurality of stream scheduling units are written into the stream scheduling engine.

7. The multi-stage flow scheduling method according to claim 5, characterized in that: If the first number of the flow scheduling units in the multi-level flow scheduling system is greater than the second number of the candidate flow scheduling engines, time-division multiplexing a portion of the candidate flow scheduling engines includes: The quotient of the first number modulo the second number is used as the third number, and the remainder is used as the fourth number; Time-division multiplexing each of the fourth number of the candidate flow scheduling engines in the third number plus one consecutive multiplexing cycles, with each candidate flow scheduling engine acting as one flow scheduling unit in each multiplexing cycle, wherein the flow scheduling units corresponding to the third number plus one multiplexing cycle are located at the same level of the multi-level flow scheduling system; Each of the remaining candidate flow scheduling engines is time-multiplexed in a third number of consecutive multiplexing cycles, acting as a flow scheduling unit in each multiplexing cycle, wherein the flow scheduling units corresponding to the third number of multiplexing cycles are located at the same level of the multi-level flow scheduling system.

8. A multi-stage flow scheduling device, characterized in that: A dedicated data processor is located in conjunction with a master device, wherein the master device generates multiple flow queues, and the multi-level flow scheduling device hierarchically schedules the multiple flow queues using a multi-level flow scheduling system, wherein each level of the multi-level flow scheduling system has at least one flow scheduling unit, which schedules at least one flow queue output by the previous level to generate a scheduled flow queue, which is input to at least one flow scheduling unit in the next level, and the flow scheduling unit in the last level generates a merged scheduled flow queue; the multi-level flow scheduling device includes: A maintenance unit, configured to maintain, for each of the flow queues in the multi-level flow scheduling system, an address linked list of flow data in the flow queue stored in a data cache; An allocation unit is configured to allocate a flow scheduling engine to each flow scheduling unit in the multi-level flow scheduling system, wherein the flow scheduling engine has a first instruction and a second instruction, the first instruction indicates a first flow queue to be scheduled and a second flow queue to be output by the flow scheduling unit, and the second instruction indicates a scheduling policy corresponding to the flow scheduling unit; a first acquiring unit, configured to utilize the flow scheduling engine to obtain, according to the scheduling policy, a flow data address from the address linked table corresponding to the first flow queue, and place the address in the address linked table corresponding to the second flow queue; The second acquiring unit is configured to obtain the flow data from the data cache and output it according to the address linked list corresponding to the merged scheduling flow queue.

9. A special data processor, characterized in that include: a memory for storing computer-readable program code; A processor is configured to execute the computer-readable program code stored in the memory to implement the multi-stage flow scheduling method according to any one of claims 1-7.

10. A computer storage medium, characterized in that The computer storage medium stores computer program codes, which, when executed by a processor, enable the processor to execute the multi-stage flow scheduling method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for queue management

    CN102957629A

  • Multi-level scheduling device and method, network chip and computer readable storage medium

    CN112559400A