Patent Description:
At present, with the expansion of user scale and the increase of service types, a network communication device is required not only to further refine and distinguish service traffic, but also to perform unified management and hierarchical scheduling on transmission objects which have, for example, multiple users, multiple services, and multiple traffic. A multi-queue technology may be used to implement various Hierarchical Quality of Service (HQoS) functions, such as traffic flow limiting, congestion avoidance, traffic shaping, and queue scheduling. Hierarchical scheduling implemented based on the multi-queue technology not only distinguishes users, but also distinguishes services and traffic, which can provide refined service quality assurance and save network operation and maintenance costs on the whole.

However, the inventor of the present application finds that, when traffic is scheduled with a current HQoS strategy, if the HQoS strategy is configured on a sub-interface, the HQoS strategies of sub-interfaces are independent of each other so the HQoS strategies can perform scheduling and flow limiting on only service traffic of each user instead of port-level service traffic; if the HQoS policy is configured on a port, an overall scheduling and flow limiting may be performed on all service traffic on the port, but scheduling and flow limiting on the service traffic of the user cannot be taken into account at the same time.

In <CIT>, a method and device for constructing a scheduling model are disclosed. The method includes: determining, according to a service requirement of a current service scenario, a scheduling level number of an HQoS scheduling model to be constructed as N, wherein N is a positive integer greater than or equal to <NUM>; selecting, from storage resources, scheduling units for respective scheduling levels of the N scheduling levels, wherein each storage resource is provided with various types of scheduling units in advance; and configuring linking relationships between the scheduling units of the respective scheduling levels.

<CIT> describes a network device, a controller, a queue management method, and a traffic management chip. The method may be applied to a traffic management chip that uses an HQoS technology, and can include receiving a queue management instruction sent by a controller, where the queue management instruction includes an identifier of a first scheduler and an identifier of a first queue, and the first scheduler is one of multiple first-level schedulers. The method may also include controlling, according to the queue management instruction, scheduling of the first queue by the first scheduler, where a queue scheduled by the first scheduler belongs to a queue resource pool of the TM chip, and the queue resource pool includes at least one to-be-allocated queue.

According to some embodiments of the present application, a traffic scheduling method, an electronic device, and a storage medium are provided. The features of the method, the electronic device and the storage medium according to embodiments of the present disclosure are set out in the appended set of claims, which defines the invention.

One or more embodiments are illustrated by way of figures corresponding to the embodiments in the accompanying drawings. The illustrative descriptions shall not be construed to limit the embodiments.

In order to make the objectives, technical schemes, and advantages of the embodiments of the present application clearer, various embodiments of the present application will be described below in detail in conjunction with the drawings. However, those having ordinary skill in the art may understand that, in the embodiments of the present application, numerous technical details are set forth in order to enable a reader to better understand the present application. However, the technical schemes claimed in the present application can be implemented without these technical details and various changes and modifications based on the embodiments below. The embodiments below are divided for the convenience of description, and should not constitute any limitation on specific embodiments of the present application. The embodiments may be combined with each other and mutually referred to without contradiction.

An objective of the embodiments of the present application is to provide a traffic scheduling method, an electronic device, and a storage medium, so as to perform user-level and port-level scheduling and flow limiting on service traffic simultaneously under multi-service scenarios where HQoS functions are applied.

A first embodiment of the present application relates to a traffic scheduling method. This embodiment is applied to a network communication device and implemented based on HQoS functions. This embodiment involves: acquiring service traffic received at a data receiving port; performing first scheduling on the service traffic according to a preset first scheduling strategy, where the first scheduling strategy is a user-level scheduling strategy; forwarding the service traffic on which the first scheduling is performed to the data receiving port; performing second scheduling on the service traffic according to a preset second scheduling strategy, where the second scheduling strategy is a port-level scheduling strategy; and sending the service traffic on which the second scheduling is performed through a data sending port.

Implementation details of the traffic scheduling method in this embodiment are described below in conjunction with the accompanying drawings. The implementation details are provided below for ease of understanding only and are not necessary for implementation of the scheme.

The traffic scheduling method in this embodiment, as shown in <FIG>, includes the following steps.

At a step of <NUM>, a first scheduling is performed on service traffic according to a preset first scheduling strategy. The first scheduling strategy is a user-level scheduling strategy.

In some cases, in this embodiment, a data receiving port is a downlink switching-side interface of a network communication device. The network communication device receives service traffic sent from a backplane switching network through a downlink switching-side interface, parses the service traffic, and acquires a forwarding priority of the service traffic during traffic scheduling.

The first scheduling strategy is a user-level-based traffic scheduling strategy. Attributes of the service traffic include user attributes and service attributes. The first scheduling strategy may schedule service traffic according to a priority of a user to which the service traffic belongs, or schedule service traffic according to a priority of a specific service to which the service traffic belongs. In scenarios where HQoS functions are applied, different service traffic may pass through different sub-interfaces. If the first scheduling strategy is bound to a sub-interface, each sub-interface can schedule only service traffic passing through the sub-interface itself.

At a step of <NUM>, the service traffic on which the first scheduling is performed is forwarded to a data receiving port.

In some cases, after the first scheduling on the service traffic, the service traffic is forwarded to an uplink line-side interface through a loopback port inside the device and then sent to a downlink switching-side interface through the uplink line-side interface, to be received again through the downlink switching-side interface.

At a step of <NUM>, second scheduling is performed on the service traffic on which the first scheduling is performed according to a preset second scheduling strategy.

According to the claimed invention, the second scheduling strategy is a port-level-based traffic scheduling strategy, and may be bound to a parent interface. Because all service traffic have to pass through the parent interface, an overall scheduling can be performed on all service traffic having to pass through ports according to the second scheduling strategy, which ensures scheduling and flow limiting of port-level traffic after the service traffic has been distinguished based on user or service priorities in the first scheduling.

At a step of <NUM>, the service traffic on which the second scheduling is performed is forwarded to a data sending port.

According to the claimed invention, the data sending port is a downlink line-side interface. After the second scheduling on the service traffic, the service traffic that has undergone the entire scheduling process is directly forwarded to the data sending port, and then sent to a line-side device through the data sending port.

In an example, the first scheduling on the service traffic mainly realizes scheduling on traffic flow limiting and internal priorities based on users (which may be differentiated by a virtual local area network (VLAN)), and the second scheduling on the service traffic does not care about specific user VLAN information, but only performs flow limiting and priority scheduling on all service traffic on the port.

Compared with the existing technology, in the embodiment, the network communication device, after acquiring service traffic, first performs the first scheduling on the service traffic according to a user-level-based scheduling strategy, and then performs second scheduling on the service traffic on which the first scheduling is performed according to a port-level-based scheduling strategy, so as to achieve secondary enqueueing of the service traffic, so that user-level and port-level traffic scheduling and flow limiting can be implemented at the same time when the service traffic is managed using HQoS functions.

A second embodiment of the present application relates to a traffic scheduling method. In this embodiment, how to perform first scheduling on service traffic according to a first scheduling strategy and how to perform second scheduling on the traffic on which the first scheduling is performed according to a second scheduling strategy are described.

The traffic scheduling method in this embodiment, as shown in <FIG>, includes steps as follow.

At a step of <NUM>, service traffic received at a data receiving port is acquired.

At a step of <NUM>, in a preset first mapping relationship, it is identified whether there is a first scheduling queue corresponding to a sub-interface identifier of the service traffic. If the first scheduling queue corresponding to the sub-interface identifier of the service traffic presents in the preset first mapping relationship, a step of <NUM> is performed. If the first scheduling queue corresponding to the sub-interface identifier of the service traffic does not present in the preset first mapping relationship, a step of <NUM> is performed.

At the step of <NUM>, the service traffic is added to the first scheduling queue corresponding to the sub-interface identifier of the service traffic in the first mapping relationship.

At a step of <NUM>, the service traffic is sent according to a priority of the first scheduling queue to which the service traffic is added.

In some cases, there are three manners as follow to bind an HQoS scheduling strategy to an interface.

In the embodiment, the HQoS scheduling strategy is bound to the sub-interfaces in the multiple-level mode, and bound to the parent interface in the overwrite mode. A first scheduling queue corresponding to the service traffic is identified in a first mapping relationship according to a sub-interface identifier, and the first scheduling is done through the sub-interface. The first mapping relationship is a mapping relationship between users to which services belong and queue identifiers, and stored in an ACL (access control list) table; and a corresponding second scheduling queue is identified in the ACL table according to a parent interface identifier, and second scheduling is done through the parent interface.

In some cases, the first scheduling strategy is pre-configured, and the device binds the first scheduling strategy to sub-interfaces according to preset configuration, and then attaches a queue to each sub-interface according to the first scheduling strategy. Each queue has a different priority, and the priority is determined according to the pre-configured first scheduling strategy. In actual operation, when multiple traffic exists on an identical interface, the service traffic in queues with higher priorities may be preferentially forwarded. In this configuration, when the first scheduling is performed on the service traffic, the sub-interface may write a flag of secondary scheduling to the service traffic, which is added to a queue attached to an internal loopback port. After the service traffic undergoes the first scheduling, the service traffic may be forwarded to a downlink switching-side interface through the loopback port.

In some cases, the first mapping relationship in the embodiment is a mapping relationship between sub-interface identifiers and first scheduling queues. The first mapping relationship is stored in an ACL table. After the received service traffic is parsed, firstly, a sub-interface that the service traffic passes through is determined according to a scheduling tree under the pre-configured first scheduling strategy, and then a first scheduling queue corresponding to a sub-interface identifier is identified in the ACL table according to the first mapping relationship. If the first scheduling queue corresponding to the sub-interface identifier is found in the ACL table, the service traffic is added to the first scheduling queue. If the first scheduling queue corresponding to the sub-interface identifier is not found in the ACL table, the first scheduling on the service traffic is skipped and second scheduling is directly performed. The step of <NUM> is performed to identify a sub-interface identifier corresponding to the service traffic in a preset second mapping relationship.

At the step of <NUM>, in a preset second mapping relationship, it is identified whether there is a second scheduling queue corresponding to a parent interface identifier of the service traffic. If a second scheduling queue corresponding to the sub-interface identifier of the service traffic presents in the preset second mapping relationship, a step of <NUM> is performed. If the second scheduling queue corresponding to the sub-interface identifier of the service traffic does not present in the preset second mapping relationship, a step of <NUM> is performed.

At the step of <NUM>, the service traffic is added to the second scheduling queue corresponding to the parent interface identifier of the service traffic in the second mapping relationship.

In some cases, the second mapping relationship in the embodiment is a mapping relationship between parent interface identifiers and second scheduling queues. The second mapping relationship is also stored in the ACL table. After the service traffic is received for a second time, a parent interface that the service traffic passes through is determined according to a scheduling tree under the pre-configured second scheduling strategy, and then a second scheduling queue corresponding to the parent interface identifier is identified in the ACL table according to the second mapping relationship. If the second scheduling queue corresponding to the parent interface identifier is found in the ACL table, the service traffic is added to the second scheduling queue. If the second scheduling queue corresponding to the sub-interface identifier does not present in the ACL table, which means that a priority of a user attribute or a service attribute of the service traffic is not set in the pre-configured scheduling strategy, the step of <NUM> is performed to add the service traffic to a default queue and perform, according to a priority of the default queue, second scheduling on the service traffic not completing ACL rule matching.

At a step of <NUM>, the service traffic is sent according to a priority of the second scheduling queue to which the service traffic is added.

In some cases, in the embodiment, an HQoS scheduling strategy is bound to the parent interface in an overwrite mode, the corresponding second scheduling queue is identified in the ACL table according to the parent interface identifier, and second scheduling is done through the parent interface. In this configuration, the pre-configured second scheduling strategy is bound to the parent interface (the HQoS scheduling strategy is bound in the overwrite mode). The network communication device attaches queue to each of sub-interfaces according to the bound second scheduling strategy. Each queue has a different priority. In actual operation, when multiple traffic presents on an identical interface, the service traffic in queues with higher priorities may be preferentially forwarded. After the second scheduling, the service traffic is sent through a downlink line-side to complete the entire scheduling process of the service traffic.

In an example, a traffic scheduling system in the embodiment has a structure as shown in <FIG>, and includes elements as follow.

A network process (NP) is configured to parse traffic received at a downlink switching-side interface, identify, according to an interface identifier of the service traffic, a queue identifier having a mapping relationship with the interface identifier of the service traffic in the ACL table, then forward the parsed service traffic to a traffic manager TM1, and send related information such as the queue identifier to the traffic manager TM1. After first scheduling on the service traffic, the traffic manager TM1 forwards the service traffic to an uplink line-side interface through a loopback port. The NP is further configured to forward the service traffic to the downlink switching-side interface by means of transparent transmission. A forwarding path of the service traffic during the first scheduling is represented by the solid arrows in the figure, and a forwarding path of the service traffic during the second scheduling is represented by the dashed arrows in the figure.

The traffic manager TM1 is configured to add, according to the queue identifier sent by the NP, the service traffic parsed by the NP to a corresponding queue, then assign different priorities to queues according to a preset HQoS strategy, and complete scheduling and flow limiting on the service traffic according to the priorities of the queues. During the first traffic scheduling, the service traffic is directly added, according to the queue identifier, to a corresponding queue attached to a TM loopback port LP, forwarded to the uplink line-side interface after the first scheduling, and then transparently transmitted to the downlink switching-side interface by the NP. Second scheduling on the traffic starts. Upon completion of the second scheduling, the service traffic is forwarded from the downlink line-side interface through a logical port P2.

In an example, after the NP receives service traffic from the downlink switching-side interface for the first time and parses the service traffic, if a queue identifier having a mapping relationship with a sub-interface identifier is not found in a preset ACL table according to the sub-interface identifier of the service traffic, it is continuously identified whether there is a queue identifier having a mapping relationship with a parent interface identifier in the preset ACL table according to the parent interface identifier of the service traffic. If a queue identifier having a mapping relationship with the parent interface is not found in the preset ACL table according to the parent interface identifier of the service traffic, the NP sends default queue information to the traffic manager TM1, and then the traffic manager TM1 adds the service traffic to a default queue, and forwards the service traffic according to a priority of the default queue, to complete scheduling on the service traffic.

Division of the steps of the above method is only for ease of description, and during implementation, the steps may be combined into one step or some steps may be split into multiple steps, all of which fall within the protection scope of the present patent as long as an identical logical relationship is included. Insignificant modifications added to or insignificant designs introduced in an algorithm or a procedure without changing the core of the algorithm or the procedure fall within the protection scope of the patent.

A third embodiment of the present application relates to a traffic scheduling method. The third embodiment is substantially the identical to the second embodiment, with a main difference as follows. In the second embodiment, during the first scheduling on the service traffic, according to a sub-interface identifier of the service traffic, a first scheduling queue corresponding to the sub-interface identifier is identified in a first mapping relationship; during the second scheduling on the service traffic, according to a parent interface identifier of the service traffic, a second scheduling queue corresponding to the parent interface identifier is identified in a second mapping relationship. In the third embodiment of the present application, during the first scheduling on the service traffic, according to an interface identifier of the service traffic, a first scheduling queue corresponding to the interface identifier is identfied in a first mapping relationship; during the second scheduling on the traffic, according to an Internet protocol (IP) priority field of the service traffic, a second scheduling queue corresponding to the IP priority field is identified in a second mapping relationship.

A traffic scheduling method according to the third embodiment of the present application, as shown in <FIG>, includes steps as follow.

At a step of <NUM>, a first scheduling strategy corresponding to an interface identifier of the service traffic is identified in a preset first mapping relationship, where the interface identifier is a combination of a sub-interface identifier and a parent interface identifier. If the first scheduling queue corresponding to the interface identifier of the service traffic presents in the preset first mapping relationship, a step of <NUM> is performed. If the first scheduling queue corresponding to the interface identifier of the service traffic does not present in the preset first mapping relationship, a step of <NUM> is performed.

At the step of <NUM>, the service traffic is added to the first scheduling queue corresponding to the interface identifier of the service traffic in the first mapping relationship.

In some cases, the first mapping relationship stored in the ACL table in the embodiment is a mapping relationship between combinations of sub-interface identifiers and parent interface identifier of service traffic and first scheduling queues. The first scheduling strategy is an HQoS strategy bound to a parent interface in a multiple-level mode. The HQoS strategy distinguishes priorities of service traffic based on user information. Steps S402 to S404 are similar to steps S202 to S204 in the second embodiment of the present application. Other implementation details have been described in the second embodiment of the present application, which are not described in detail herein.

At the step of <NUM>, a second scheduling queue corresponding to an IP priority field of the service traffic is identified in a preset second mapping relationship.

In some cases, a QoS-template (port-based <NUM> PHB scheduling and flow limiting) scheduling and flow limiting strategy is pre-bound to the parent interface. This strategy distinguishes priorities of service traffic based on IP priority fields in service traffic messages. Therefore, in this embodiment, the second mapping relationship is a mapping relationship between IP priority fields and second scheduling queues. The second mapping relationship is stored in an outbound port table. After the service traffic is parsed, the IP priority field in the service traffic needs to be acquired, and then a second scheduling queue corresponding to the service traffic according to the IP priority field is identified in the outbound port table. Because all traffic needs to be forwarded from a logical outbound port through the parent interface, this strategy binding manner can implement port-level-based traffic scheduling.

In an example, after parsing the service traffic, the NP queries a corresponding queue identifier in the outbound port table based on the IP priority field, and then simultaneously forwards the service traffic and the corresponding queue identifier to the traffic manager TM1. Then, the traffic manager TM1 adds the service traffic to a corresponding queue, and forwards the service traffic according to a priority of the queue, to complete the port-level-based traffic scheduling.

Because the second embodiment and this embodiment are interchangeable, relevant technical details mentioned in the second embodiment are still valid in this embodiment, and the technical effects that can be achieved in the second embodiment can also be achieved in this embodiment, the details are not described herein in order to reduce repetition. Accordingly, relevant technical details mentioned in this embodiment may also be applied to the second embodiment.

In addition, the first scheduling performed on service traffic according to a preset first scheduling strategy includes: adding, according to a sub-interface identifier of the service traffic and a preset first mapping relationship between sub-interface identifiers and first scheduling queues, the service traffic to a first scheduling queue corresponding to the sub-interface identifier of the service traffic in the first mapping relationship; and sending the service traffic according to a priority of the first scheduling queue to which the service traffic is added. A user-level scheduling strategy is selected based on the sub-interface identifier of the service traffic access to perform first scheduling on the service traffic.

In addition, the second scheduling performed on the service traffic according to a preset second scheduling strategy includes: adding, according to a parent interface identifier of the service traffic and a preset second mapping relationship between parent interface identifiers and second scheduling queues, the service traffic to a second scheduling queue corresponding to the parent interface identifier of the service traffic in the second mapping relationship; and sending the service traffic according to a priority of the second scheduling queue to which the service traffic is added. A port-level scheduling strategy is selected based on the parent interface identifier of the service traffic access to perform second scheduling on the service traffic.

In addition, the first scheduling performed on service traffic according to a preset first scheduling strategy includes: adding, according to an interface identifier of the service traffic and a preset first mapping relationship between interface identifiers and first scheduling queues, the service traffic to a first scheduling queue corresponding to the interface identifier of the service traffic in the first mapping relationship, where the interface identifier of the service traffic is a combination of sub-interface identifier and parent interface identifier; and sending the service traffic according to a priority of the first scheduling queue to which the service traffic is added. A user-level scheduling strategy is selected based on a combination of sub-interface identifiers and parent interface identifiers of the service traffic access to perform first scheduling on the service traffic.

In addition, the second scheduling performed on the service traffic according to a preset second scheduling strategy includes: adding, according to an IP priority field of the service traffic and a second mapping relationship between IP priority fields and second scheduling queues, the service traffic to a second scheduling queue corresponding to the IP priority field of the service traffic in the second mapping relationship; and sending the service traffic according to a priority of the second scheduling queue to which the service traffic is added. A port-level scheduling strategy is selected based on the IP priority field of the service traffic to schedule the service traffic after secondary enqueueing.

A fourth embodiment of the present application relates to a server. As shown in <FIG>, the server includes at least one processor <NUM>; and a memory <NUM> in communication connection with the at least one processor <NUM>. The memory <NUM> stores instructions executable by the at least one processor <NUM> which, when executed by the at least one processor <NUM>, cause the at least one processor <NUM> to perform the traffic scheduling method according to any one of the first to third embodiments.

The memory <NUM> and the processor <NUM> are connected by a bus which may include any number of interconnected buses and bridges. The bus connects various circuits of one or more processors <NUM> and the memory <NUM> together. The bus may further connect various other circuits, such as peripherals, regulators, and power management circuits, which are well known in the art and thus are not be further described herein. A bus interface is provided between the bus and a transceiver. The transceiver may be one or more elements, such as multiple receivers and transmitters, to provide units for communicating with various other apparatuses over a transmission medium. Data processed by the processor <NUM> is transmitted over a wireless medium through an antenna. Further, the antenna receives and transmits the data to the processor <NUM>.

The processor <NUM> is responsible for managing the bus and general processing, and may also provide a variety of functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory <NUM> may be configured to store data used by the processor <NUM> to perform operations.

A fifth embodiment of the present application relates to a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the method embodiment.

That is, those having ordinary skill in the art may understand that all or some of the steps of the methods in the embodiments may be implemented by a program instructing relevant hardware. The program is stored in a storage medium, and includes several instructions for instructing a device (which may be a single chip microcomputer, a chip, or the like) or a processor to perform all or some of the steps of the methods described in the embodiments of the present application. The storage medium includes various media that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.

Claim 1:
A traffic scheduling method, comprising:
performing (<NUM>) a first scheduling on service traffic according to a preset first scheduling strategy, wherein the first scheduling strategy is a user-level scheduling strategy;
forwarding (<NUM>) the service traffic on which the first scheduling is performed to a downlink switching-side interface, comprising:
forwarding the service traffic on which the first scheduling is performed to an uplink line-side interface through a loopback port; and
forwarding the service traffic on which the first scheduling is performed from the uplink line-side interface to the downlink switching-side interface by means of transparent transmission;
performing (<NUM>) a second scheduling on the service traffic on which the first scheduling is performed according to a preset second scheduling strategy, wherein the second scheduling strategy s a port-level scheduling strategy; and
sending (<NUM>) the service traffic on which the second scheduling is performed through a data sending port.