Scheduling method, scheduler and flash memory device

By matching different types of scheduled queues with different node types, the problem of excessive storage resource consumption in the prior art is solved, and the effect of saving storage resources is achieved.

CN119960935APending Publication Date: 2025-05-09DAPUSTOR CORP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411984337.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In the prior art, when the scheduler schedules multiple queues to be scheduled, it needs to store a large amount of state information and scheduling algorithms, resulting in excessive consumption of storage resources.

Method used

By matching scheduling nodes with different node types for different types of queues to be scheduled, only scheduling logic matching their types is needed, and there is no need to store scheduling algorithms and status information related to other types.

Benefits of technology

The structural complexity of the scheduling node and the usage of storage resources are reduced, thereby saving storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960935A_ABST
    Figure CN119960935A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and discloses a scheduling method, a scheduler and electronic equipment, the scheduler comprises a scheduling node, and the scheduling method comprises the steps of obtaining a to-be-scheduled queue; determining a node type according to the type of the to-be-scheduled queue; scheduling the to-be-scheduled queue based on a scheduling node corresponding to the node type; wherein the node type comprises a first node type and / or a second node type, and scheduling nodes of the first node type are different from scheduling nodes of the second node type. By matching the scheduling nodes with different node types for the to-be-scheduled queues of different types, the scheduling nodes of different node types in the application only need to realize the scheduling logic of the to-be-scheduled queues matched with the types of the scheduling nodes, and do not need to store scheduling algorithms and state information related to the to-be-scheduled queues of other types; therefore, the structural complexity of the scheduling node and the usage amount of storage resources are reduced, and the storage resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a scheduling method, a scheduler and an electronic device. Background Art

[0002] For electronic devices that support multi-host access and multi-queue processing features, such as network cards or flash memory devices, since they support scheduling multiple queues to be scheduled, the device hardware needs to have efficient queue scheduling capabilities to meet the Quality of Service (QoS) requirements. Currently, a scheduler is usually used to schedule multiple queues to be scheduled.

[0003] In the process of implementing the present application, the inventors found that there are at least the following problems in the prior art: for each queue to be scheduled, the scheduler uses the same scheduling node to perform command scheduling; however, the scheduling node needs to be compatible with different types of queues to be scheduled and use multiple scheduling algorithms to implement the scheduling function, which requires storing a large amount of status information and consumes a large amount of storage resources. Summary of the invention

[0004] Embodiments of the present application provide a scheduling method, a scheduler, and an electronic device to save storage resources.

[0005] The embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a scheduling method, the scheduling method is applied to a scheduler, the scheduler includes a scheduling node, and the scheduling method includes:

[0007] Get the queue to be scheduled;

[0008] Determine the node type according to the type of queue to be scheduled;

[0009] Schedule the queue to be scheduled based on the scheduling node corresponding to the node type;

[0010] The node type includes a first node type and / or a second node type, and the scheduling node of the first node type is different from the scheduling node of the second node type.

[0011] In a second aspect, an embodiment of the present application provides a scheduler, including:

[0012] at least one processor; and,

[0013] a memory communicatively connected to at least one processor; wherein,

[0014] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the scheduling method as described in the first aspect.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0016] Such as the scheduler in the second aspect.

[0017] In a fourth aspect, an embodiment of the present application further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a flash memory device to execute the scheduling method of the first aspect.

[0018] The beneficial effects of the embodiments of the present application are as follows: different from the prior art, the embodiments of the present application provide a scheduling method, the scheduling method is applied to a scheduler, the scheduler includes a scheduling node, and the scheduling method includes: obtaining a queue to be scheduled; determining a node type according to a type of the queue to be scheduled; scheduling the queue to be scheduled based on a scheduling node corresponding to the node type; wherein the node type includes a first node type and / or a second node type, and the scheduling node of the first node type is different from the scheduling node of the second node type.

[0019] By matching different types of queues to be scheduled with scheduling nodes with different node types, the scheduling nodes of different node types in the present application only need to implement the scheduling logic of the queues to be scheduled that match their types, and there is no need to store scheduling algorithms and status information related to other types of queues to be scheduled, thereby reducing the structural complexity of the scheduling nodes and the usage of storage resources, thereby saving storage resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0021] Figure 1 It is a schematic diagram of a queue scheduling provided in an embodiment of the present application;

[0022] Figure 2 is a schematic diagram of the internal structure of a parent node provided in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of the internal structure of a subnode provided in an embodiment of the present application;

[0024] Figure 4 It is a flowchart of a scheduling method provided in an embodiment of the present application;

[0025] Figure 5 It is a structural diagram of a scheduling tree provided in an embodiment of the present application;

[0026] Figure 6 is a schematic diagram of the structure of another scheduling tree provided in an embodiment of the present application;

[0027] Figure 7 is a schematic diagram of the internal structure of a second sub-node provided in an embodiment of the present application;

[0028] Figure 8 It is a structural diagram of a parameter configuration module provided in an embodiment of the present application;

[0029] Fig. 9 It is a schematic diagram of a process of updating node information of a scheduling node provided in an embodiment of the present application;

[0030] Fig.10 This is a schematic diagram of a process for controlling a gradual change in a sending rate provided in an embodiment of the present application;

[0031] Fig.11 This is a schematic diagram of the relationship between a transmission rate and a time slice provided in an embodiment of the present application;

[0032] Fig.12 It is a structural diagram of a scheduler provided in an embodiment of the present application;

[0033] Fig.13 It is a structural schematic diagram of a flash memory device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0035] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0036] The technical solution of this application is described in detail below with reference to the accompanying drawings:

[0037] For electronic devices that support multi-host access and multi-queue processing features, such as network cards or flash memory devices, since they support scheduling multiple queues to be scheduled, the device hardware needs to have efficient queue scheduling capabilities to meet the requirements of Quality of Service (QoS). Specifically, the queue scheduling function is implemented by integrating a dedicated scheduler on the chip of the electronic device. Among them, the queue scheduling function includes but is not limited to bandwidth allocation between queues to be scheduled, priority control of command processing, etc.

[0038] Currently, a scheduler is usually used to schedule multiple queues to be scheduled.

[0039] See also Figure 1 , Figure 1 It is a schematic diagram of a queue scheduling provided in an embodiment of the present application;

[0040] Figure 1 Taking the tree-structured scheduler as an example, it has only one root node, and a tree structure is formed by connecting multiple nodes to the root node. The node is used to process the connected queue according to the set scheduling algorithm.

[0041] like Figure 1 As shown, the queues to be scheduled outside the scheduler include N queues, such as queue 0, queue 1, queue 2, queue 3, ..., queue N-1, queue N. There is only one root node ( Figure 1 The parent node 0 in , forms a tree structure by connecting multiple nodes on the root node.

[0042] The node at the end of the scheduling tree is called a child node (also called a leaf node or leaf node). Each child node is used to participate in scheduling in the entire scheduling tree for a queue waiting to be scheduled. In the scheduling tree, each parent node (also called a non-leaf node) has the same structure, and each child node also has the same structure.

[0043] See also Figure 2 , Figure 2 is a schematic diagram of the internal structure of a parent node provided in an embodiment of the present application;

[0044] like Figure 2 As shown, the parent node 200 is composed of a cascaded combination of a strict priority (SP) scheduling module 201, a weighted fair queuing (WFQ) scheduling module 202, and a dual-color dual-bucket scheduling module 203.

[0045] Among them, the SP scheduling module adopts the SP scheduling algorithm to prioritize the scheduling of high-priority queues. The WFQ scheduling module adopts the WFQ scheduling algorithm to allocate bandwidth to multiple queues according to preset weights. The dual-color dual-bucket scheduling module adopts the dual-color dual-bucket algorithm, including the committed information rate (CIR) scheduling module and the excess information rate (EIR) scheduling module.

[0046] Among them, the two-color two-bucket algorithm is a traffic management mechanism based on credit buckets and token buckets, which is used for bandwidth control and traffic scheduling in the network. The two-color two-bucket algorithm manages green (high priority) and yellow (low priority) traffic through the CIR scheduling module and the EIR scheduling module respectively. The CIR bucket and the EIR bucket control the traffic rate and burstiness based on the token bucket mechanism, and at the same time combine the credit bucket for long-term rate constraints to ensure fair and compliant traffic distribution.

[0047] See also Figure 3 , Figure 3 is a schematic diagram of the internal structure of a subnode provided in an embodiment of the present application;

[0048] like Figure 3 As shown, the child node 300 is composed of a dual-color dual-bucket scheduling module 203, and the dual-color dual-bucket scheduling module 203 includes a committed information rate scheduling module 231 and an excess information rate scheduling module 232. It can be seen that the internal structure of the child node 300 is simplified from the internal structure of the parent node 200, and the parts irrelevant to the child node are removed.

[0049] It can be seen that for each queue to be scheduled, the scheduler uses the same scheduling node to schedule commands. Among them, the scheduling node includes a child node and a parent node, that is, the scheduler uses the same child node and the same parent node to schedule each queue to be scheduled. However, the scheduling node needs to be compatible with different types of queues to be scheduled, and use multiple scheduling algorithms to implement the scheduling function, which requires storing a large amount of state information and consumes a lot of storage resources.

[0050] Specifically, from Figure 2 It can be seen that the parent node needs to realize its scheduling function through a combination of multiple scheduling algorithms, needs to store a large amount of state information, consumes a large amount of storage resources, and needs to adapt complex scheduling logic to coordinate the operation of multiple algorithms, which increases the difficulty of chip backend layout and wiring. Among them, the state information includes queue priority information, task scheduling order, resource usage, etc.

[0051] from Figure 3It can be seen that although the internal structure of the child node is simpler than that of the parent node, the child node also needs to implement its scheduling function through the scheduling algorithm, and each queue to be scheduled needs to be connected to a child node, and its demand for child nodes will still consume a lot of storage resources.

[0052] Based on this, an embodiment of the present application proposes a scheduling method, by matching different types of scheduling nodes to different types of queues to be scheduled. Different types of scheduling nodes in the present application only need to implement the scheduling logic of the queues to be scheduled that match their types, and there is no need to store scheduling algorithms and status information related to other types of queues to be scheduled, thereby reducing the structural complexity of the scheduling nodes and the usage of storage resources, thereby saving storage resources.

[0053] See also Figure 4 , Figure 4 It is a flowchart of a scheduling method provided in an embodiment of the present application;

[0054] The scheduling method is applied to a scheduler, specifically, to at least one processor of the scheduler. The scheduler includes a scheduling node, and the scheduling node is used to process the connected queues to be scheduled according to a set scheduling algorithm.

[0055] like Figure 4 As shown, the scheduling method includes:

[0056] Step S401: Obtain the queue to be scheduled;

[0057] The queue to be scheduled is a queue that needs to be scheduled by the scheduler, and the queue to be scheduled is used to store data, commands or messages.

[0058] Specifically, the scheduler receives the queue to be scheduled sent by the host, network card and other devices.

[0059] Step S402: Determine the node type according to the type of the queue to be scheduled;

[0060] Among them, the types of queues to be scheduled include the first precision type and / or the second precision type. The queues to be scheduled of the first precision type (also referred to as high-precision queues) are queues that require high-precision scheduling, and the queues to be scheduled of the second precision type (also referred to as low-precision queues) are queues that do not require high-precision scheduling. The types of queues to be scheduled can be divided by those skilled in the art according to indicators such as quality of service, priority, and whether bandwidth resources can be shared, and are not limited here.

[0061] Exemplarily, the first type of precision queues to be scheduled include high scheduling precision queues, which are queues that allow independent bandwidth resources and independent scheduling priorities to be set. The second type of precision queues to be scheduled include low scheduling precision queues, which are queues that share bandwidth resources with other queues, and low scheduling precision queues cannot set independent scheduling priorities.

[0062] The node type includes a first node type and / or a second node type, and the scheduling node of the first node type is different from the scheduling node of the second node type. The scheduling node of the first node type has a more complex structure and function than the scheduling node of the second node type. The scheduling node of the first node type can also be called a full-function scheduling node, which consumes more resources but has complete scheduling functions; the scheduling node of the second node type can also be called a simple scheduling node, which consumes less resources and can realize basic scheduling functions.

[0063] Specifically, according to the type of the queue to be scheduled, the node type of the scheduling node used to schedule the queue to be scheduled is determined.

[0064] In some embodiments, the queue to be scheduled has an identifier, which is used to identify the type of the queue to be scheduled. The scheduler determines whether the type of the queue to be scheduled is the first precision type or the second precision type through the identifier.

[0065] In the embodiment of the present application, step S402 specifically includes:

[0066] Step S421: when the type of the queue to be scheduled is the first precision type, determining that the node type is the first node type;

[0067] Specifically, when the type of the queue to be scheduled is the first precision type, it is determined that the node type of the scheduling node used to schedule the queue to be scheduled is the first node type.

[0068] Step S422: When the type of the queue to be scheduled is the second precision type, determine that the node type is the second node type.

[0069] Specifically, when the type of the queue to be scheduled is the second precision type, it is determined that the node type of the scheduling node used to schedule the queue to be scheduled is the second node type.

[0070] See also Figure 5 , Figure 5 It is a structural diagram of a scheduling tree provided in an embodiment of the present application;

[0071] like Figure 5As shown, the types of queue 1 to be scheduled and queue 2 to be scheduled are both of the first precision type, the types of queue 3 to be scheduled, queue 4 to be scheduled and queue 5 to be scheduled are all of the second precision type, the node types of scheduling node 1 and scheduling node 3 are both of the first node type, and the node type of scheduling node 2 is the second node type.

[0072] See also Figure 6 , Figure 6 is a schematic diagram of the structure of another scheduling tree provided in an embodiment of the present application;

[0073] like Figure 6 As shown, the types of queues to be scheduled 1, queues to be scheduled 2 and queues to be scheduled 3 are all of the first precision type, the types of queues to be scheduled 4 and queues to be scheduled 5 are all of the second precision type, the node types of scheduling nodes 1, scheduling nodes 2, scheduling nodes 5, scheduling nodes 6 and scheduling nodes 7 are all of the first node type, and the node types of scheduling nodes 3 and scheduling nodes 4 are of the second node type.

[0074] In the embodiment of the present application, the number of queues to be scheduled and the hierarchical structure of the scheduling tree can be set by those skilled in the art according to actual conditions and are not limited here.

[0075] In an embodiment of the present application, a scheduling node of a first node type includes a first child node (also referred to as a fully functional child node) and a first parent node (also referred to as a fully functional parent node), and a scheduling node of a second node type includes a second child node (also referred to as a simple child node) and a second parent node (also referred to as a simple parent node).

[0076] The first child node is composed of a cascaded combination of an SP scheduling module, a WFQ scheduling module, and a dual-color dual-bucket scheduling module. The first parent node is composed of a dual-color dual-bucket scheduling module, which includes a CIR scheduling module and an EIR scheduling module. Figure 3 The internal structure of the child node 300 in is the same as that of the first parent node. Figure 2 The internal structure of the parent node 200 is the same as that of the parent node 200, which will not be repeated here.

[0077] There is no scheduling module inside the second sub-node.

[0078] See also Figure 7 , Figure 7 is a schematic diagram of the internal structure of a second sub-node provided in an embodiment of the present application;

[0079] like Figure 7As shown, the second parent node 700 is composed of a round-robin scheduling module 701 and a dual-color dual-bucket scheduling module 203, which includes a committed information rate scheduling module 231 and an excess information rate scheduling module 232. The round-robin scheduling module 701 is used to round-robin schedule the message units obtained by the second parent node 700.

[0080] It can be seen that compared with the first child node, the second child node reduces the dual-color dual-bucket scheduling module, so the second child node also degenerates into a simple structure, which has no scheduling module inside, and the second child node only needs to maintain its information pointing to the second parent node. Therefore, the second child node can save storage resources and logic resources compared to the first child node.

[0081] Compared with the first parent node, the internal structure of the second parent node eliminates the SP scheduling module, WFQ scheduling module and their cascade structure, and uses a relatively simple round-robin module structure implementation, which can save storage resources and logical resources. Especially in the scenario where the number of queues to be scheduled is large, using the second child node and the second parent node can save a lot of storage resources and logical resources compared to using the first child node and the first parent node.

[0082] A plurality of first child nodes and a plurality of first parent nodes are hierarchically connected to form a first scheduling tree, a plurality of second child nodes and a plurality of second parent nodes are hierarchically connected to form a second scheduling tree, the first scheduling tree and the second scheduling tree are connected through the same first parent node, the first parent node is connected to a root node through a plurality of first parent nodes, and the root node is the first parent node.

[0083] Since the functions of the internal structures of the first child node, the second child node, the first parent node, and the second parent node on the scheduling tree are different, the scheduler uses heterogeneous scheduling nodes, so the scheduler can also be called a heterogeneous scheduler. Due to the different internal structures, the functions of the scheduling nodes are also different.

[0084] For example: when the type of the queue to be scheduled is the first precision type, that is, when the queue to be scheduled is a queue that requires high-precision scheduling, the scheduling node connected to the queue to be scheduled needs to have more scheduling functions, that is, the first child node based on the credit algorithm is used to connect the queue to be scheduled, and the first parent node with complete scheduling functions is used to connect the first child node.

[0085] When the type of the queue to be scheduled is the second precision type, that is, when the queue to be scheduled is a queue that does not require high-precision scheduling, the scheduling node connected to the queue to be scheduled only needs to have basic scheduling functions, that is, using a second child node that does not use a credit algorithm to connect the queue to be scheduled, and using a second parent node based on a credit algorithm to connect the second child node, thereby reducing the credit information that needs to be stored.

[0086] By combining the first child node, the second child node, the first parent node, and the second parent node to perform queue scheduling, the present application can reduce the difficulty and cost of implementation while realizing the scheduling function.

[0087] In some embodiments, by reducing the number of queues to be scheduled of the first precision type sent to the scheduler and the proportion of queues to be scheduled of the first precision type to be scheduled to all queues to be scheduled, the present application can reduce the storage resources and logical operation units used to store credit information when scheduling queues to be scheduled of the first precision type with high precision, thereby reducing chip costs and reducing the complexity of physical implementation.

[0088] Step S403: Schedule the queue to be scheduled based on the scheduling node corresponding to the node type.

[0089] The queue to be scheduled includes a plurality of message units, and the message units include data, messages or commands. The first child node is used to schedule the queue to be scheduled based on the credit algorithm to control the transmission bandwidth of the queue to be scheduled. The first parent node is used to schedule the acquired message units based on the priority of the queue to be scheduled, the weight value of each first child node connected to the first parent node and the credit algorithm, and control the transmission bandwidth of the message units.

[0090] The second child node is used to transmit the queue to be scheduled to the second parent node connected to the second child node. The second parent node is used to perform round-robin scheduling on the acquired message units based on the credit algorithm to control several message units to share the transmission bandwidth of the second parent node.

[0091] Specifically, when the type of any queue to be scheduled is the first precision type, the queue to be scheduled is scheduled through the first child node and several first parent nodes. Or, when the type of any queue to be scheduled is the second precision type, the queue to be scheduled is scheduled through the second child node and several second parent nodes.

[0092] In some embodiments, when the type of any queue to be scheduled is the first precision type, step S403 specifically includes steps S431 to S434:

[0093] Step S431: When the type of any queue to be scheduled is the first precision type, select a first child node, and associate the queue to be scheduled with the first child node;

[0094] Specifically, when the type of any queue to be scheduled is the first precision type, a first sub-node is selected, and the queue to be scheduled is associated with the first sub-node, that is, the queue to be scheduled is attached to the first sub-node.

[0095] In some embodiments, the step of selecting a first sub-node includes: randomly selecting a first sub-node that is not attached to a queue to be scheduled from a plurality of first sub-nodes.

[0096] In some embodiments, the method of selecting the first sub-node can also be configured by a first node selection rule. The first node selection rule refers to a rule for selecting one of the first sub-nodes from a plurality of first sub-nodes according to a certain strategy for attaching to the queue to be scheduled. Those skilled in the art can flexibly set the first node selection rule according to specific needs and implementation scenarios, and no specific limitation is made here.

[0097] Step S432: Record the credit value of the queue to be scheduled based on the first child node;

[0098] Specifically, the first subnode records the credit value of the queue to be scheduled through a dual-color dual-bucket module.

[0099] Step S433: When the credit value is a preset value, a first number of message units in the queue to be scheduled is sent to a first parent node connected to the first child node, and the credit value is updated;

[0100] The preset value is the sum of the message lengths of the plurality of message units scheduled by the first child node each time. The preset value can be set by a person skilled in the art according to actual conditions and is not limited here. The sum of the message lengths of the first number of message units is the preset value. The first number is the number of message units whose sum of message lengths reaches the preset value. The first number is the ratio of the preset value to the message length of one message unit.

[0101] Specifically, the first child node sends a first number of message units to a first parent node connected to the first child node through a credit filter of the dual-color dual-bucket module, and updates the credit value when the credit value in the credit bucket reaches a preset value.

[0102] Step S434: Schedule the message units in turn through the first parent node of each level corresponding to the first child node, until the root node completes the scheduling operation on each message unit in the queue to be scheduled.

[0103] Specifically, the first parent node connected to the first child node receives a first number of message units, and schedules the acquired message units according to the priority of the queue to be scheduled, the weight value of each first child node connected to the first parent node, and the credit algorithm, and controls the transmission bandwidth of the message units. Furthermore, the first parent node sends several message units to the first parent node of the previous level connected to it, so that the first parent node of each level schedules the message units in turn until the message units are transmitted to the root node in the scheduling tree, and the root node completes the scheduling operation for each message unit in the queue to be scheduled.

[0104] In some embodiments, when the type of any queue to be scheduled is the second precision type, step S403 specifically includes steps S435 to S437:

[0105] Step S435: When the type of any queue to be scheduled is the second precision type, select a second child node, and associate the queue to be scheduled with the second child node;

[0106] Specifically, when the type of any queue to be scheduled is the second precision type, a second sub-node is selected, and the queue to be scheduled is associated with the second sub-node, that is, the queue to be scheduled is hung in the second sub-node.

[0107] In some embodiments, the step of selecting a second sub-node includes: randomly selecting a second sub-node that is not attached to a queue to be scheduled from a plurality of second sub-nodes.

[0108] In some embodiments, the method of selecting the second sub-node can also be configured by a second node selection rule. The second node selection rule refers to a rule for selecting one of the second sub-nodes from a plurality of second sub-nodes according to a certain strategy for attaching to the queue to be scheduled. Those skilled in the art can flexibly set the second node selection rule according to specific needs and implementation scenarios, and no specific limitation is made here.

[0109] Step S436: Based on the second child node, transmitting the queue to be scheduled to the second parent node connected to the second child node;

[0110] Specifically, the second child node transmits the queue to be scheduled to the second parent node connected to the second child node. Since the second child node does not have a dual-color dual-barrel module, it is impossible to accurately control the amount of data (bandwidth) sent by each second child node, and several second child nodes share the transmission bandwidth of the second parent node connected to them.

[0111] Step S437: The message units are scheduled in round-robin fashion through the second parent node of each level corresponding to the second child node and the first parent node of each level corresponding to the second parent node, until the root node completes the scheduling operation on each message unit in the queue to be scheduled.

[0112] Specifically, the second parent node connected to the second child node receives the queue to be scheduled, and performs round-robin scheduling on each queue to be scheduled obtained by it through a round-robin scheduling module, wherein the round-robin scheduling is based on a single message unit as the granularity, and then the message units are scheduled based on a credit algorithm to control several message units to share the transmission bandwidth of the second parent node.

[0113] Furthermore, the second parent node sends several message units to the second parent node of the previous level connected to it, so that the second parent node of each level schedules the message units in turn, until each second parent node in the second scheduling tree where these second parent nodes are located completes the scheduling operation, at which time, the last second parent node to complete the scheduling operation will send the message unit to the first parent node connected to it. Thus, the first parent node performs the scheduling operation on the message unit, and then sends the message unit to the first parent node of the previous level connected to it, so that the first parent node of each level schedules the message unit in turn, until the message unit is transmitted to the root node in the scheduling tree, that is, the first parent node of each level corresponding to the last second parent node to complete the scheduling operation schedules the message unit in turn, and finally the root node completes the scheduling operation on each message unit in the queue to be scheduled.

[0114] In an embodiment of the present application, by introducing a second child node and a second parent node, compared to using only the first child node and the first parent node, the present application can reduce the number of first child nodes and first parent nodes used, schedule a large number of queues to be scheduled while meeting the accuracy requirements of the scheduling scenario, and save storage resources and logical resources.

[0115] In the embodiment of the present application, each scheduling node has a programmable feature, so that different scheduling parameters can be flexibly configured according to different scheduling algorithms to meet different usage scenarios.

[0116] Specifically, the scheduler also includes a software module and a parameter configuration module. The software module is used to access the scheduling node at the software level or send programming commands to the parameter configuration module to dynamically modify the parameters in the node information of the scheduling node. The parameter configuration module is a hardware circuit, i.e., an application-specific integrated circuit (ASIC). The parameter configuration module is used to dynamically modify the specific parameters in the node information of the scheduling node according to the programming commands sent by the software module.

[0117] The node information of the scheduling node includes at least one of the node information of the first child node, the node information of the first parent node, the node information of the second child node and the node information of the second parent node.

[0118] The first child node is also used to store node information of the first child node, including: dual-color dual-bucket module parameters, the credit value of the queue to be scheduled, and the identifier of the second parent node connected to the first child node. The identifier includes but is not limited to the node number and the number of layers, and the dual-color dual-bucket module parameters include the bucket depth of the dual-color dual-bucket algorithm, the rate of adding tokens, the initial number of tokens, etc.

[0119] The first parent node is also used to store node information of the first parent node, including: dual-color dual-bucket module parameters, the credit value of the queue to be scheduled obtained by the first parent node, the weight value of the first child node connected to the first parent node (the weight of the WFQ algorithm), the service order mark of the WFQ algorithm, the weight value of the SP algorithm, the scheduling state of the first child node connected to the first parent node, etc. The scheduling state includes but is not limited to the switch state of the first child node that the WFQ algorithm needs to save.

[0120] The second child node is also used to store the node information of the second child node, including: the identifier of the second parent node connected to the second child node. The second parent node is also used to store the node information of the second parent node, including: dual-color dual-barrel module parameters, a credit value uniformly set for each second child node connected to the second parent node, and a scheduling order and switch status of each second child node connected to the second parent node.

[0121] By programming and configuring the identifier of the parent node (first parent node or second parent node) to which the child node (first child node or second child node) is connected, and connecting the second parent node to the first parent node, the first scheduling tree is combined with the second scheduling tree, and the present application can realize different scheduling tree topology structures.

[0122] By programming and configuring the parameters of the dual-color dual-bucket module, you can set both peak bandwidth and guaranteed bandwidth for the node. The guaranteed bandwidth refers to the minimum guaranteed bandwidth, ensuring that network traffic is given priority within this range, that is, regardless of network conditions, this part of the bandwidth will be reserved for users. Peak bandwidth refers to the maximum transmission bandwidth allowed.

[0123] In the embodiment of the present application, the method further includes: dynamically modifying the parameters in the node information of the scheduling node according to the software module and the parameter configuration module, specifically including steps S1-S2:

[0124] Step S1: Obtain target parameters;

[0125] The target parameter includes a parameter name and a parameter value. The parameter name includes the name of any parameter in the node information of the scheduling node, and the parameter value is the value that the parameter corresponding to the parameter name needs to be updated. The target parameter can be input into the scheduler by those skilled in the art according to actual conditions, and is not limited here.

[0126] Step S2: Based on the software module, the parameter configuration module and the target parameter, the node information of the corresponding scheduling node is updated, so that the scheduling node schedules the queue to be scheduled according to the updated node information.

[0127] Among them, the parameter configuration module includes an access controller, an information read and write controller, a software register interface and a hardware access interface.

[0128] See also Figure 8 , Figure 8 It is a structural diagram of a parameter configuration module provided in an embodiment of the present application;

[0129] like Figure 8 As shown, the parameter configuration module 800 includes an access controller 801 , an information read and write controller 802 , a software register interface 803 and a hardware access interface 804 .

[0130] The access controller 801 connects the information read / write controller 802, the software register interface 803 and the hardware access interface 804 to manage the access request of the software module. The access controller 801 is also used to store the working status bitmap of each scheduling node, which is used to indicate whether the node is being accessed.

[0131] The information read and write controller 802 is connected to the access controller 801, the software register interface 803 and the hardware access interface 804, and is used to read and update the node information of the scheduling node.

[0132] The software register interface 803 connects the access controller 801 and the information read and write controller 802 , and is used as a communication interface between the software module (not shown) and the parameter configuration module 800 .

[0133] The hardware access interface 804 connects the access controller 801 and the information read / write controller 802 and is used as an interface to access the node information of each scheduling node.

[0134] Specifically, the software module sends a programming command containing the target parameter to the parameter configuration module, and the parameter configuration module receives and parses the programming command, thereby updating the node information of the corresponding scheduling node according to the target parameter, so that the scheduling node schedules the scheduling queue according to the updated node information.

[0135] See also Fig. 9 , Fig. 9 It is a schematic diagram of a process of updating node information of a scheduling node provided in an embodiment of the present application;

[0136] like Fig. 9 As shown, the process of updating the node information of the scheduling node includes:

[0137] Step S901: Sending programming instructions to the parameter configuration module based on the software module;

[0138] The programming instructions include target parameters, and the programming instructions are used to instruct the parameter configuration module to update the node information of the corresponding scheduling node according to the target parameters.

[0139] Specifically, the software module sends programming instructions to the parameter configuration module.

[0140] In some embodiments, the scheduler further includes a register, the register is used to store programming instructions, and the software module writes the programming instructions into the register.

[0141] Step S902: Determine the target node based on the parameter configuration module;

[0142] The target node is the scheduling node corresponding to the target parameter, that is, the scheduling node whose node information needs to be updated.

[0143] Specifically, based on the software register interface and the access controller, the programming instruction is received and parsed to determine the number of the target node.

[0144] In some embodiments, the access controller accesses the register through the software register interface to obtain the programming instruction, and parses the programming instruction to determine the number of the target node.

[0145] Step S903: determining whether the software module is performing an access operation on the target node;

[0146] Specifically, the working status bitmap of the target node is queried based on the access controller to determine whether the software module is performing an access operation on the target node. The working status bitmap can be set to a first value or a second value, the first value is used to indicate that the scheduling node is being accessed, and the second value is used to indicate that the scheduling node is not being accessed. The specific values ​​of the first value and the second value can be set by those skilled in the art according to actual conditions, and are not limited here. For example, the first value is 1 and the second value is 0.

[0147] In some embodiments, the access controller queries the working status bitmap of the target node stored therein. When the working status bitmap is a first value, it determines that the software module is performing an access operation on the target node. When the working status bitmap is a second value, it determines that the software module is not performing an access operation on the target node.

[0148] If the software module is performing an access operation on the target node, the process proceeds to step S909 ; if the software module is not performing an access operation on the target node, the process proceeds to step S904 .

[0149] It is understandable that when the hardware is scheduling, it will modify the node information in the scheduling node. For example, the CIR algorithm will maintain the credit value, and the hardware will add or subtract the credit value. When the software module modifies the node information, it will configure the rate of adding tokens to the bucket, force a scheduling node to be turned on or off, etc. These node information are also maintained inside the scheduling node. Therefore, the software and hardware cannot access the node information of the same scheduling node at the same time, otherwise it is easy to cause conflicts and affect the scheduling results.

[0150] Step S904: Determine access to the target node based on the parameter configuration module;

[0151] Specifically, if the software module does not perform an access operation on the target node, the parameter configuration module accesses the target node.

[0152] Specifically, if the software module does not perform an access operation on the target node, the working state bitmap of the target node is set to a first value based on the access controller. For example, the access controller sets the working state bitmap of the target node to 1.

[0153] It is understandable that in order to prevent the scheduling process of the scheduler from being affected, when hardware and software programming access are initiated simultaneously, hardware access is responded to first. After the hardware access or software access is responded to, the access controller sets the working state bitmap of the target node to the first value.

[0154] Step S905: Read and update the node information of the target node based on the parameter configuration module;

[0155] Specifically, based on the information read and write controller and the hardware access interface, the node information of the target node is read and updated.

[0156] In some embodiments, the information read and write controller reads the node information of the target node through the hardware access interface, reads the register through the software register interface to obtain the target parameters, updates the node information of the target node according to the target parameters, and then writes the updated node information back to the target node through the hardware access interface.

[0157] Step S906: Update the working status bitmap of the target node;

[0158] Specifically, the access controller sets the target node's work status bitmap to the second value. For example, the access controller sets the target node's work status bitmap to 0, that is, clears the previous setting.

[0159] Step S907: Determine whether the node information of each target node has been updated;

[0160] Specifically, the access controller determines whether the node information of each target node is updated by judging whether all access requests are responded to. If any access request is not responded to, the node information of a target node is not updated, and the process returns to step S903 to continue executing the loop step to update the node information of the target node. That is, when the node information of any target node is not updated, the node information of the target node is updated based on the parameter configuration module until the node information of each target node is updated.

[0161] If each access request is responded to, it is determined that the node information of each target node is updated and the process proceeds to step S908.

[0162] Step S908: the control parameter configuration module enters an idle state;

[0163] Specifically, after the node information of each target node is updated, the parameter configuration module enters an idle state (IDLE state).

[0164] Step S909: After the software module completes the access operation, the working status bitmap of the target node is updated.

[0165] Specifically, if the software module is performing an access operation on the target node, after the software module completes the access operation, the working state bitmap of the target node is set to a second value based on the access controller. For example, after the same node information is written back, the access controller sets the working state bitmap of the target node to 0, i.e., clears the previous setting.

[0166] After executing step S909, the method returns to step S904 and the parameter configuration module accesses the target node, thereby continuing to execute the loop step to update the node information of the target node. After executing step S904, the method further includes: sending an information update request to the information read-write controller based on the access controller, so that the information read-write controller updates the node information of the target node. The information update request is used to instruct the information read-write controller to read and update the node information of the target node.

[0167] In the embodiment of the present application, by configuring an abstract interface (software register interface) for the software module, the software module only needs to send the target parameters to the parameter configuration module through the register and wait for the parameter configuration module to modify the parameters. This method effectively isolates the interference of the internal operation of the scheduler on the software configuration. The parameter configuration module will update the target parameters to the table items of the internal storage information of the scheduling node, and the software module does not need to pay attention to the running status of the scheduler.

[0168] In the embodiment of the present application, the scheduling node has programmability and the node information is modified based on the parameter configuration module. The present application can dynamically modify the parameters without affecting the normal operation of the scheduler.

[0169] In some embodiments, when the target parameter is a bandwidth parameter, the present application can dynamically adjust the bandwidth by updating the node information of the corresponding scheduling node according to the bandwidth parameter. Among them, the bandwidth parameter is a related parameter for adjusting the transmission bandwidth of the scheduling node or the message unit, for example: the bandwidth parameter includes the token addition rate of the scheduling node, or the number of tokens in the token bucket and the interval of the token addition time. It is understandable that for a scheduler for bandwidth allocation, the software module can set the peak bandwidth by modifying the number of tokens added to the token bucket and the time interval.

[0170] by Figure 5 For example, for scheduling node 1 (including the first child node and the first parent node), when the peak bandwidth of the first child node connected to queue 1 to be scheduled is 5Gbps, the peak bandwidth of the first child node connected to queue 2 to be scheduled is 1Gbps, and the peak bandwidth of the first parent node of these two first child nodes is 5Gbps, the total peak bandwidth of queue 1 to be scheduled and queue 2 to be scheduled is 5Gbps. When the peak bandwidth of the second parent node in scheduling node 2 is 9Gbps, queues 3 to be scheduled, queues 4 to be scheduled, and queues 5 to be scheduled share a total peak bandwidth of 9Gbps.

[0171] by Figure 6 For example, for scheduling node 1 (including the first child node and the first parent node), the peak bandwidth of the first child node connected to the queue 1 to be scheduled is 2Gbps, the peak bandwidth of the first parent node connected to the queue 1 to be scheduled is 2Gbps, and the peak bandwidth of the scheduling node 5 (first parent node) connected to the queue 1 to be scheduled is 4Gbps.

[0172] For scheduling node 2 (including the first child node and the first parent node), the peak bandwidth of the first child node connected to queue 2 to be scheduled is 5 Gbps, the peak bandwidth of the first child node connected to queue 3 to be scheduled is 2 Gbps, and the peak bandwidth of the first parent node is 7 Gbps.

[0173] The peak bandwidth of the second parent node in the scheduling node 3 connected to the to-be-scheduled queue 4 is 9 Gbps, and the peak bandwidth of the second parent node in the scheduling node 4 connected to the to-be-scheduled queue 5 is 1 Gbps. The peak bandwidth of the scheduling node 6 (the first parent node) is 17 Gbps, and the peak bandwidth of the scheduling node 7 (the first parent node) is 21 Gbps.

[0174] In some embodiments, the scheduler is configured in an electronic device, wherein the electronic device includes a communication device or a flash memory device. The communication device includes but is not limited to a network interface card (NIC), and preferably, the communication device is a network card. The flash memory device is a storage device using semiconductor flash memory (NAND Flash) as a medium. The flash memory device includes a solid state drive (SSD) or other storage devices using flash memory as a storage medium.

[0175] In some embodiments, when the scheduler is configured on a communication device, for example, when the scheduler is configured on a network card. When there is no remaining space in the receiving buffer area of ​​the other end, the other end will send a pause message to this end, and after receiving the pause message, this end needs to pause sending data to the other end. In addition, after the pause time specified by the pause message ends, if the local end immediately sends a large amount of data to the other end at full rate, it is easy to cause the other end to send a new pause message again. Based on this, the present application updates the node information of the scheduling node through bandwidth parameters to dynamically control traffic distribution, and reduces the probability of network congestion again by slowly increasing the sending bandwidth.

[0176] Specifically, the scheduler further includes a first timer and a second timer, the scheduler is communicatively connected to the first network card (ie, the local end), the first network card is communicatively connected to the second network card (ie, the opposite end), and the queue to be scheduled includes messages. The target parameter includes a first target parameter or a second target parameter.

[0177] When the scheduler is configured on the communication device, for example, when the scheduler is configured on the first network card, the method further includes: controlling the sending rate to change gradually by configuring the node information of the target node. The sending rate is the rate at which the first network card sends a message queue to the second network card through the scheduler, and the message queue is the queue sent by the first network card to the second network card through the scheduler.

[0178] See also Fig.10 , Fig.10 This is a schematic diagram of a process for controlling a gradual change in a sending rate provided in an embodiment of the present application;

[0179] like Fig.10 As shown in FIG. 1 , the process of controlling the gradual change of the sending rate includes:

[0180] Step S1001: obtaining a pause message sent by the second network card;

[0181] The pause message includes a pause frame (Pause Frame) or a priority flow control frame (Priority Flow Control Frame), and the pause message is used to instruct the first network card to stop sending the message queue to the second network card.

[0182] Specifically, a pause message sent by the second network card is received.

[0183] Step S1002: Based on the pause message, control the first timer to start timing and stop sending the message queue to the second network card;

[0184] Specifically, after receiving the pause message, the scheduler reports the firmware of the first network card through an interrupt, and controls the first timer to start timing, generates a back pressure signal to all modules, and stops sending the message queue to the second network card.

[0185] The first timer is used to record the effective time of the pause message.

[0186] In some embodiments, the step of controlling the first timer to start timing includes: setting the time of the first timer to the effective time of the pause message, and controlling the first timer to start countdown.

[0187] Step S1003: Determine whether the number of network congestion times is a preset number;

[0188] The number of network congestion times is the total number of congestion times that occur during the communication process from the time when the first network card and the second network card start communicating to the time when the first network card receives the pause message. The preset number is the maximum value of the number of network congestion times when the slow speed-up function is turned on. The preset number can be set by those skilled in the art according to actual conditions and is not limited here. The slow speed-up function controls the rate at which the first network card sends the message queue to the second network card to change continuously, gradually increasing from a low rate to a peak rate.

[0189] Specifically, the scheduler records the number of network congestion events in an internal table of the scheduling node.

[0190] If the number of network congestion times is the preset number, the process proceeds to step S1004; if the number of network congestion times is less than the preset number, the process ends.

[0191] In some embodiments, the method further includes: periodically clearing the recorded number of network congestion events.

[0192] In some embodiments, the method further includes: when the number of network congestion times is a preset number and the speed-up parameter is a first parameter value, entering step S1004; or, when the number of network congestion times is a preset number and the speed-up parameter is a second parameter value, ending the process. The speed-up parameter is used to characterize whether the slow speed-up function is turned on. When the speed-up parameter is the first parameter value, it is determined that the slow speed-up function is turned on. When the speed-up parameter is the second parameter value, it is determined that the slow speed-up function is turned off.

[0193] The speed-up parameter may be configured by the user, and the first parameter value and the second parameter value may be set by those skilled in the art according to actual conditions, and are not limited here.

[0194] For example, in scenarios where network congestion is likely to occur, turning on the slow speed increase function can reduce the re-congestion caused by immediately resuming full-rate message sending. Through the programmability of the scheduler, in scenarios where the probability of network congestion is low, turning off the slow speed increase function can maximize the network bandwidth.

[0195] Step S1004: determining whether the time recorded by the first timer is a first preset time;

[0196] The first preset time is the time when the pause message ceases to be effective.

[0197] In some embodiments, when the first timer counts down, the first preset time is 0.

[0198] If the time recorded by the first timer is the first preset time, the time for the message to take effect has ended, and the message sending can be resumed, that is, entering step S1005; if the time recorded by the first timer is less than the first preset time, repeat step S1004 until the time recorded by the first timer is equal to the first preset time, and enter step S1005.

[0199] Step S1005: setting a first target parameter and updating node information of the target node based on the first target parameter;

[0200] Specifically, when the number of network congestion times is a preset number and the time recorded by the first timer is a first preset time, a first target parameter is set and executed. Fig. 9 Steps S901 to S909 in the embodiment are performed to update the node information of the target node based on the first target parameter.

[0201] Among them, the first target parameter includes the first token addition rate of the target node corresponding to the message queue. The first token addition rate is the product of the rate parameter and the peak rate of the target node. The rate parameter is a parameter that characterizes the speed of the increase of the sending rate. The rate parameter can be obtained by technicians in this field through multiple tests in an actual network environment. The rate parameter is a percentage less than 100% and greater than 0%. The peak rate of the target node is the maximum transmission rate of the target node.

[0202] Step S1006: Control the second timer to start timing, and start sending a message queue to the second network card;

[0203] The second timer is used to record the duration of the first network card using the first token adding rate as the sending rate.

[0204] Specifically, the second timer is controlled to start timing, and the target node is controlled to send the message queue at the first token adding rate.

[0205] In some embodiments, the step of controlling the second timer to start timing includes: setting the time of the second timer to the effective time of the first token adding rate, and controlling the second timer to start countdown.

[0206] Step S1007: Determine whether the time recorded by the second timer is the second preset time;

[0207] The second preset time is the time when the first token adding rate stops taking effect as the sending rate.

[0208] In some embodiments, when the second timer counts down, the second preset time is 0.

[0209] If the time recorded by the second timer is the second preset time, proceed to step S1008; if the time recorded by the second timer is less than the second preset time, repeat step S1007 until the time recorded by the second timer is equal to the second preset time, then proceed to step S1008.

[0210] Step S1008: determining whether the current token addition rate of each target node is equal to or greater than the peak rate of the target node;

[0211] The current token adding rate is the first token adding rate or the second token adding rate.

[0212] Specifically, if the current token addition rate of each target node is equal to or greater than the peak rate of the target node, the process ends; if the current token addition rate of any target node is less than the peak rate of the target node, proceed to step S1009.

[0213] Step S1009: setting a second target parameter and updating the node information of the target node based on the second target parameter, and controlling the second timer to restart timing.

[0214] The second target parameter includes a second token addition rate of the target node, and the second token addition rate is greater than the first token addition rate. The token addition rate of the target node set each time is expressed by the following formula:

[0215] V2=(1+α)*V1

[0216] Among them, V2 represents the token addition rate of the target node set in this round, α represents the rate parameter, and V1 represents the token addition rate of the target node set in the previous round.

[0217] It can be understood that when step S1009 is executed for the first time, V1 substituted into the formula is the first token addition rate, and V2 calculated is the second token addition rate. At this time, the second token addition rate is α*(1+α) of the peak rate. Starting from the second execution of step S1009, each subsequent execution of step S1009, V1 substituted into the formula is the second token addition rate set when step S1009 was last executed, and V2 calculated is the second token addition rate set when step S1009 is executed this time.

[0218] Specifically, set the second target parameters and execute Fig. 9 Steps S901 to S909 in the process are performed to update the node information of the target node based on the second target parameter, and control the second timer to restart timing.

[0219] Then return to step S1007, and repeat steps S1007-S1009 until the current token addition rate of each target node is equal to or greater than the peak rate of the target node, and then the process ends.

[0220] That is, when the time recorded by the second timer is the second preset time and the current token addition rate of any target node is less than the peak rate of the target node, the second target parameter is set and the node information of the target node is updated based on the second target parameter, and the second timer is controlled to restart timing until the current token addition rate of each target node is equal to or greater than the peak rate of the target node.

[0221] It is understandable that in Fig.10 During the process, when the first network card needs to resume sending messages, the slow speed increase function is: Fig. 9 The specific steps of updating the node information of the target node are as follows: the rate initially sent to the second network card is set to the first token addition rate, and then after each second preset time, the rate sent to the second network card is limited to (1+α) of the last sending rate, and so on, gradually restoring the sending rate to the peak rate.

[0222] See also Fig.11 , Fig.11 This is a schematic diagram of the relationship between a transmission rate and a time slice provided in an embodiment of the present application;

[0223] Fig.11 For example, the rate parameter is 0.3 and the timer's one-time timing value is one time slice.

[0224] like Fig.11As shown, the horizontal axis represents the time slice, and the vertical axis represents the ratio of the sending rate to the peak rate. In the first and second time slices, the scheduler uses the peak rate as the sending rate, that is, sends messages at 100% of the peak rate; at the end of the second time slice, the first network card receives the pause message sent by the second network card; in the third, fourth, and fifth time slices, the scheduler pauses sending messages, and the sending rate is 0; when the time recorded by the first timer is the first preset time, the scheduler starts sending messages and turns on the slow speed increase function; in the sixth time slice, the sending rate is the first token addition rate, that is, 30% of the peak rate. Thereafter, for each time slice, the sending rate is (1+α) of the previous sending rate, that is, 130%, until the sending rate returns to the peak rate.

[0225] In some embodiments, the scheduler is communicatively connected to the flash memory device, and the queue to be scheduled includes write commands. When the scheduler is configured on the flash memory device, the method further includes: when the flash memory device determines to perform garbage collection, setting a target parameter and updating the node information of the corresponding scheduling node based on the target parameter to control the rate at which the write command is issued.

[0226] The target parameters include the token adding rate of the scheduling node, and the garbage collection (GC) is a prior art and will not be described in detail here.

[0227] Specifically, when the flash memory device determines to perform garbage collection, the target parameters are set and executed. Fig. 9 Steps S901 to S909 in the above method are performed to update the node information of the corresponding scheduling node based on the target parameters, thereby controlling the sending rate of the write command.

[0228] By updating the node information of the corresponding scheduling node based on the target parameters when the flash memory device needs to perform garbage collection, the present application can adjust the bandwidth allocation and limit the speed of the write command issued by the host, thereby achieving the purpose of limiting the speed of the write operation.

[0229] In an embodiment of the present application, a scheduling method is provided, the scheduling method is applied to a scheduler, the scheduler includes a scheduling node, and the scheduling method includes: obtaining a queue to be scheduled; determining a node type according to the type of the queue to be scheduled; scheduling the queue to be scheduled based on a scheduling node corresponding to the node type; wherein the node type includes a first node type and / or a second node type, and the scheduling node of the first node type is different from the scheduling node of the second node type.

[0230] By matching different types of queues to be scheduled with scheduling nodes with different node types, the scheduling nodes of different node types in the present application only need to implement the scheduling logic of the queues to be scheduled that match their types, and there is no need to store scheduling algorithms and status information related to other types of queues to be scheduled, thereby reducing the structural complexity of the scheduling nodes and the usage of storage resources, thereby saving storage resources.

[0231] See also Fig.12 , Fig.12 It is a structural diagram of a scheduler provided in an embodiment of the present application;

[0232] like Fig.12 As shown, the scheduler 120 includes one or more processors 121 and a memory 122. Fig.12 A processor 121 is taken as an example.

[0233] The processor 121 and the memory 122 may be connected via a bus or other means. Fig.12 The example of connecting through bus is taken in the following.

[0234] The processor 121 is used to provide computing and control capabilities to control the electronic device 130 to perform corresponding tasks, for example, to control the electronic device 130 to execute the scheduling method in any of the above method embodiments, the scheduling method is applied to the scheduler, the scheduler includes a scheduling node, and the scheduling method includes: obtaining a queue to be scheduled; determining a node type according to the type of the queue to be scheduled; scheduling the queue to be scheduled based on the scheduling node corresponding to the node type; wherein the node type includes a first node type and / or a second node type, and the scheduling node of the first node type is different from the scheduling node of the second node type.

[0235] By matching different types of queues to be scheduled with scheduling nodes with different node types, the scheduling nodes of different node types in the present application only need to implement the scheduling logic of the queues to be scheduled that match their types, and there is no need to store scheduling algorithms and status information related to other types of queues to be scheduled, thereby reducing the structural complexity of the scheduling nodes and the usage of storage resources, thereby saving storage resources.

[0236] The processor 121 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0237] The memory 122, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the scheduling method in the embodiment of the present application. The processor 121 can implement the scheduling method in any of the above method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 122. Specifically, the memory 122 may include a volatile memory (VolatileMemory, VM), such as a random access memory (Random Access Memory, RAM); the memory 122 may also include a non-volatile memory (Non-Volatile Memory, NVM), such as a read-only memory (Read-Only Memory, ROM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD) or other non-transitory solid-state storage devices; the memory 122 may also include a combination of the above types of memories.

[0238] The memory 122 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 122 may optionally include a memory remotely arranged relative to the processor 121, and these remote memories may be connected to the processor 121 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0239] One or more modules are stored in the memory 122, and when executed by one or more processors 121, the scheduling method in any of the above method embodiments is executed, for example, the scheduling method described above is executed. Figure 4 The steps shown.

[0240] See also Fig.13 , Fig.13 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0241] like Fig.13 As shown, the electronic device 130 includes a scheduler 120. The scheduler 120 includes a scheduling node. The electronic device 130 includes but is not limited to a network card or a flash memory device.

[0242] The scheduler 120 is used to execute the scheduling method in any of the above embodiments, and the scheduling method includes: obtaining a queue to be scheduled; determining a node type according to the type of the queue to be scheduled; scheduling the queue to be scheduled based on a scheduling node corresponding to the node type; wherein the node type includes a first node type and / or a second node type, and the scheduling node of the first node type is different from the scheduling node of the second node type.

[0243] By including an electronic device with a scheduler, the scheduler is used to execute the scheduling method in any of the above embodiments. The present application can match scheduling nodes with different node types for different types of queues to be scheduled, so that scheduling nodes of different node types only need to implement the scheduling logic of the queues to be scheduled that match their types, and there is no need to store scheduling algorithms and status information related to other types of queues to be scheduled, thereby reducing the structural complexity of the scheduling nodes and the usage of storage resources, thereby saving storage resources.

[0244] An embodiment of the present application also provides a non-volatile computer storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors. For example, the one or more processors can execute the scheduling method in any of the above method embodiments, for example, execute the scheduling method in any of the above method embodiments, for example, execute the various steps described above.

[0245] The above-described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0246] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute various embodiments or certain parts of the embodiments.

[0247] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A scheduling method, characterized in that: Applied to a scheduler, the scheduler includes a scheduling node, and the method includes: Get the queue to be scheduled; Determine the node type according to the type of the queue to be scheduled; Scheduling the queue to be scheduled based on the scheduling node corresponding to the node type; The node type includes a first node type and / or a second node type, and a scheduling node of the first node type is different from a scheduling node of the second node type.

2. The method according to claim 1, characterized in that: The type of the queue to be scheduled includes a first precision type and / or a second precision type; The determining the node type according to the type of the queue to be scheduled includes: When the type of the queue to be scheduled is a first precision type, determining that the node type is a first node type; When the type of the queue to be scheduled is a second precision type, determining that the node type is a second node type; The scheduling node of the first node type includes a first child node and a first parent node, and the scheduling node of the second node type includes a second child node and a second parent node.

3. The method according to claim 2, characterized in that A plurality of the first child nodes and a plurality of the first parent nodes are hierarchically connected to form a first scheduling tree; A plurality of the second child nodes and a plurality of the second parent nodes are hierarchically connected to form a second scheduling tree; The first scheduling tree and the second scheduling tree are connected through the same first parent node, the first parent node is connected to a root node through a plurality of first parent nodes, and the root node is the first parent node; The queue to be scheduled includes a plurality of message units.

4. The method according to claim 3, characterized in that The first sub-node is used to schedule the queue to be scheduled based on the credit algorithm to control the transmission bandwidth of the queue to be scheduled; The first parent node is used to schedule the acquired message unit based on the priority of the queue to be scheduled, the weight value of each first child node connected to the first parent node, and the credit algorithm, and control the transmission bandwidth of the message unit; The scheduling node corresponding to the node type scheduling the queue to be scheduled includes: When the type of any queue to be scheduled is the first precision type, selecting a first child node, and associating the queue to be scheduled with the first child node; Recording the credit value of the queue to be scheduled based on the first sub-node; When the credit value is a preset value, a first number of message units in the queue to be scheduled is sent to a first parent node connected to the first child node, and the credit value is updated, wherein the sum of the message lengths of the first number of message units is the preset value; The message units are scheduled in turn through the first parent node of each level corresponding to the first child node until the root node completes the scheduling operation on each message unit in the queue to be scheduled.

5. The method according to claim 3, characterized in that: The second child node is used to transmit the queue to be scheduled to the second parent node connected to the second child node; The second parent node is used to perform round-robin scheduling on the acquired message units based on a credit algorithm to control a plurality of message units to share a transmission bandwidth of the second parent node; The scheduling node corresponding to the node type scheduling the queue to be scheduled includes: When the type of any queue to be scheduled is the second precision type, selecting a second child node, and associating the queue to be scheduled with the second child node; Based on the second child node, transmitting the queue to be scheduled to a second parent node connected to the second child node; The message units are scheduled in round-robin fashion through the second parent node of each level corresponding to the second child node and the first parent node of each level corresponding to the second parent node, until the root node completes the scheduling operation on each message unit in the queue to be scheduled.

6. The method according to claim 2, characterized in that The scheduler also includes a software module and a parameter configuration module, and the method also includes: Get target parameters; Based on the software module, the parameter configuration module and the target parameter, updating the node information of the corresponding scheduling node, so that the scheduling node schedules the queue to be scheduled according to the updated node information; The node information includes at least one of node information of a first child node, node information of a first parent node, node information of a second child node, and node information of a second parent node.

7. The method according to claim 6, characterized in that The parameter configuration module includes an access controller, an information read and write controller, a software register interface and a hardware access interface; The updating of the node information of the corresponding scheduling node based on the software module, the parameter configuration module and the target parameter includes: Sending programming instructions to the parameter configuration module based on the software module, wherein the programming instructions include target parameters; Based on the software register interface and the access controller, receiving and parsing the programming instruction to determine the number of the target node; querying the working status bitmap of the target node based on the access controller to determine whether the software module is performing an access operation on the target node; If the software module does not perform an access operation on the target node, setting a working status bitmap of the target node to a first value based on the access controller; Based on the information read-write controller and the hardware access interface, read and update the node information of the target node; Setting the working status bitmap of the target node to a second value based on the access controller; When the node information of any target node is not updated, the node information of the target node is updated based on the parameter configuration module until the node information of each target node is updated.

8. The method according to claim 7, characterized in that The updating of the node information of the corresponding scheduling node based on the software module, the parameter configuration module and the target parameter further includes: If the software module is performing an access operation on the target node, after the software module completes the access operation, setting the working status bitmap of the target node to a second value based on the access controller; Based on the access controller, an information update request is sent to the information read and write controller, so that the information read and write controller updates the node information of the target node.

9. The method according to claim 6, characterized in that The scheduler further includes a first timer and a second timer, the scheduler is communicatively connected to the first network card, the first network card is communicatively connected to the second network card, and the queue to be scheduled includes messages; The method further comprises: Obtaining a pause message sent by the second network card; Based on the pause message, control the first timer to start timing and stop sending the message queue to the second network card; When the number of network congestion times is a preset number and the time recorded by the first timer is a first preset time, setting a first target parameter and updating the node information of the target node based on the first target parameter, wherein the first target parameter includes a first token addition rate of the target node corresponding to the message queue; Control the second timer to start timing, and start sending a message queue to the second network card; When the time recorded by the second timer is the second preset time and the current token addition rate of any target node is less than the peak rate of the target node, set the second target parameter and update the node information of the target node based on the second target parameter, and control the second timer to restart timing until the current token addition rate of each target node is equal to or greater than the peak rate of the target node; The second target parameter includes a second token adding rate of the target node, and the second token adding rate is greater than the first token adding rate.

10. The method according to claim 6, characterized in that The scheduler is communicatively connected to the flash memory device, and the queue to be scheduled includes write commands; The method further comprises: When the flash memory device determines to perform garbage collection, a target parameter is set and node information of a corresponding scheduling node is updated based on the target parameter to control the sending rate of the write command, wherein the target parameter includes a token adding rate of the scheduling node.

11. A scheduler, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the scheduling method according to any one of claims 1 to 10.

12. An electronic device, characterized in that: include: The scheduler of claim 11.

Citation Information

Cited By

  • Information processing method and device, equipment and storage medium

    CN120508396A

  • Information processing method, device, equipment and storage medium

    CN120508396B