Flow rate-limiting scheduling service processing method, device and equipment and storage medium

By saving local token buckets for each working core in the NFV system, the problem of inefficient forwarding in the hierarchical queue scheduling process in the multi-core environment is solved, and efficient user message forwarding and performance improvement is achieved.

CN120378371APending Publication Date: 2025-07-25JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510486627.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the NFV system, in the process of hierarchical queue scheduling in a multi-core environment, the forwarding efficiency and insufficient performance caused by the use of critical resources of each check.

Method used

In a multi-core environment, each working core saves a local token bucket, reads the token from the global token bucket from the global token bucket into the local token bucket through a global lock, and performs lock-free packet speed limit scheduling on the local token bucket to avoid competing with the global token bucket by each core.

Benefits of technology

Improve the forwarding efficiency of user messages in multi-core environments, avoid CPU idleness and performance reduction, and improve message service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378371A_ABST
    Figure CN120378371A_ABST
Patent Text Reader

Abstract

Disclosed are a traffic rate-limiting scheduling service processing method, apparatus and device, and a storage medium, applied to an NFV system, relating to the technical field of communications, comprising: acquiring a service scheduling queue corresponding to a traffic rate-limiting scheduling service issued by a client, and determining a current working core corresponding to the service scheduling queue in a multi-core working environment; locking a corresponding global token bucket in the scheduler by using a preset global lock so as to read a plurality of tokens from the global token bucket and store the tokens into a local token bucket of the current working core; and calling the token of the local token bucket through the current working core to carry out lock-free message speed-limiting scheduling processing on the message in the service scheduling queue so as to complete the flow speed-limiting scheduling service. Namely, a local token bucket is stored by a working core to process the scheduling of the user message, so that the situation that all working cores compete for a global token bucket in the process of processing the user message, so that the cores wait for each other in the process of processing the message is avoided, and the message forwarding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular, to a method, apparatus, device, and storage medium for processing traffic rate-limiting scheduling services. Background Art

[0002] When forwarding service packets on traditional communication hardware devices, queue scheduling and traffic supervision and rate limiting are performed on traffic. The hardware forwarding performance is excellent, and there is no problem of low forwarding efficiency. When applying the NFV (Network Function Virtualization) system in the cloud computing virtualization platform for network communication services, hierarchical queue scheduling and traffic supervision and rate limiting functions are used on NFV network elements to handle packet forwarding of different users with large traffic. In the normal case, there is a global set of HQOS (Hierarchical Quality of Service) scheduler systems. Token buckets used for traffic supervision are set in the schedulers at each level. Each user uses a globally independent scheduling queue for user traffic scheduling. Since the token bucket resources used for traffic supervision in the schedulers at each level are global critical resources, when using the token buckets of the scheduler in the process of processing user packets in a multi-core environment, locking operations are required for each core's use of the critical resources, resulting in low forwarding efficiency and insufficient performance, which causes packet loss anomalies when using traffic supervision and rate limiting functions for service processing in the hierarchical queue scheduling process of user packets.

[0003] It can be seen that how to improve the forwarding efficiency during service processing in the hierarchical queue scheduling process is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a method, apparatus, device, and storage medium for processing traffic rate-limiting scheduling services, which can improve the forwarding efficiency during service processing in the hierarchical queue scheduling process. The specific solutions are as follows:

[0005] In a first aspect, the present application discloses a method for processing traffic rate-limiting scheduling services, which is applied to an NFV system and includes:

[0006] Obtain a service scheduling queue corresponding to a traffic rate-limiting scheduling service issued by a user terminal, and determine a current working core corresponding to the service scheduling queue in a multi-core working environment;

[0007] Lock a corresponding global token bucket in the scheduler by using a preset global lock, so as to read a plurality of tokens from the global token bucket and store them in the local token bucket of the current working core;

[0008] The tokens of the local token bucket are called by the current working core to perform lock-free packet rate-limiting scheduling processing on the packets in the service scheduling queue, so as to complete the traffic rate-limiting scheduling service.

[0009] Optionally, a preset global lock is used to lock the corresponding global token bucket in the scheduler, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core, including:

[0010] Use a preset global lock to lock the corresponding global token bucket in the scheduler, and based on a preset packet trigger condition, use a packet trigger operation to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core;

[0011] Among them, the number of tokens of the number of tokens is greater than the actual consumed token number of the data packets in the service scheduling queue.

[0012] Optionally, a preset global lock is used to lock the corresponding global token bucket in the scheduler, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core, including:

[0013] Use a preset global lock to lock the corresponding global token bucket in the scheduler, and perform periodic polling scheduling on the global token bucket based on a preset time period, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core;

[0014] Among them, the number of tokens of the number of tokens is greater than the actual consumed token number of the data packets in the service scheduling queue.

[0015] Optionally, before obtaining the service scheduling queue corresponding to the traffic rate-limiting scheduling service issued by the user side and determining the current working core corresponding to the service scheduling queue in a multi-core working environment, it further includes:

[0016] Determine the target number of tokens corresponding to the global token bucket based on a preset token calculation mechanism, and generate tokens with the target number of tokens based on a preset token generation rate and put them into the global token bucket.

[0017] Optionally, the tokens of the local token bucket are called by the current working core to perform lock-free packet rate-limiting scheduling processing on the packets in the service scheduling queue, including:

[0018] Lock the service scheduling queue through the current working core, and obtain the current packet of the service scheduling queue;

[0019] Call the tokens of the local token bucket to perform lock-free packet rate-limiting scheduling processing on the current packet in the service scheduling queue;

[0020] Obtain the remaining token number of the local token bucket, and judge whether the remaining token number of the local token bucket is greater than 0;

[0021] If the remaining token quantity of the local token bucket is greater than 0, obtain a new current message from the remaining unscheduled messages in the service scheduling queue;

[0022] Jump to the step of calling the token of the local token bucket to perform lock-free message rate-limiting scheduling processing on the current message in the service scheduling queue until there are no unscheduled messages in the service scheduling queue and / or the remaining token quantity of the local token bucket is equal to 0;

[0023] If the remaining token quantity of the local token bucket is equal to 0, unlock the service scheduling queue through the current working core to end the lock-free message rate-limiting scheduling processing of the current working core on the service scheduling queue.

[0024] Optionally, calling the token of the local token bucket to perform lock-free message rate-limiting scheduling processing on the current message in the service scheduling queue includes:

[0025] Match the token quantity of the local token bucket with the traffic demand of the current message in the service scheduling queue based on a preset traffic matching rule to obtain a traffic control matching result;

[0026] Determine the traffic processing operation corresponding to the current message based on the traffic control matching result, and perform lock-free message rate-limiting scheduling processing on the current message based on the traffic processing operation.

[0027] Optionally, after unlocking the service scheduling queue through the current working core to end the lock-free message rate-limiting scheduling processing of the current working core on the service scheduling queue, it further includes:

[0028] Determine whether there are unscheduled messages in the service scheduling queue;

[0029] If there are unscheduled messages in the service scheduling queue, determine a new current working core from other working cores in the multi-core working environment; the token quantity in the local token bucket corresponding to the new current working core is greater than 0;

[0030] Jump to the step of locking the service scheduling queue through the current working core and obtaining the current message of the service scheduling queue.

[0031] In a second aspect, the present application discloses a traffic rate-limiting scheduling service processing device, which is applied to an NFV system and includes:

[0032] A service scheduling queue determination module, configured to obtain the service scheduling queue corresponding to the traffic rate-limiting scheduling service issued by the user side and determine the current working core corresponding to the service scheduling queue in a multi-core working environment;

[0033] A token reading module, configured to lock a corresponding global token bucket in a scheduler by using a preset global lock, so as to read a plurality of tokens from the global token bucket and store them in a local token bucket of the current working core;

[0034] A service scheduling module, configured to perform lock-free message rate-limiting scheduling processing on messages in a service scheduling queue by invoking tokens in the local token bucket through the current working core, so as to complete the traffic rate-limiting scheduling service.

[0035] In a third aspect, the present application discloses an electronic device, including:

[0036] A memory, configured to store a computer program;

[0037] A processor, configured to execute the computer program to implement the foregoing traffic rate-limiting scheduling service processing method.

[0038] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program, and when the computer program is executed by a processor, the foregoing traffic rate-limiting scheduling service processing method is implemented.

[0039] It can be seen that in the present invention, a service scheduling queue corresponding to a traffic rate-limiting scheduling service sent by a user end is obtained, and a current working core corresponding to the service scheduling queue is determined in a multi-core working environment; a corresponding global token bucket in a scheduler is locked by using a preset global lock, so as to read a plurality of tokens from the global token bucket and store them in a local token bucket of the current working core; tokens in the local token bucket are invoked through the current working core to perform lock-free message rate-limiting scheduling processing on messages in the service scheduling queue, so as to complete the traffic rate-limiting scheduling service. That is, each working core stores a local token bucket to process the scheduling of user messages, and all working cores do not need to compete for a global token bucket during the process of processing user messages, avoiding the situation that each core waits for each other during the process of processing messages, resulting in the CPU (Central Processing Unit) idling and reducing the processing performance of the CPU.

[0040] It can be seen from the above technical solutions that in the present invention, each working core stores a local token bucket to process the scheduling of user messages, and all working cores do not need to compete for a global token bucket during the process of processing user messages. During this process, each working core only uses the local token bucket resources, and there will be no situation of mutual locking and waiting, greatly improving the forwarding efficiency of user messages when each working core uses the token bucket resources of traffic supervision during the hierarchical queue scheduling of user messages under congestion management. Description of the Drawings

[0041] To more clearly illustrate the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0042] Figure 1 Flowchart of a traffic speed limit scheduling service processing method disclosed by the present invention;

[0043] Figure 2 Flowchart of a specific traffic speed limit scheduling service processing method disclosed by the present invention;

[0044] Figure 3 Flowchart of a specific traffic speed limit scheduling service processing method disclosed by the present invention;

[0045] Figure 4 Schematic structural diagram of a traffic speed limit scheduling service processing device disclosed by the present invention;

[0046] Figure 5 Structural diagram of an electronic device disclosed by the present invention. Detailed implementation manners

[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.

[0048] The terms "including" and "having" in the specification of the present invention and any deformations related to "including" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0049] To enable those skilled in the art of the present technology to better understand the solution of the present invention, the following will further elaborate on the present invention in conjunction with the accompanying drawings and detailed implementation manners.

[0050] NFV is a specific application of virtualization technology. Its ultimate goal is to replace the private and dedicated network element devices in the communication network with industry-standard x86 servers (a 16-bit microprocessor), storage, and switching devices. The benefits brought by this are as follows: on the one hand, the IT (Information Technology) devices based on the x86 standard are inexpensive, which can save huge investment costs for operators; on the other hand, the open API (Application Programming Interface) can also help operators obtain more and more flexible network capabilities. Through software and hardware decoupling and function abstraction, the functions of network devices no longer depend on dedicated hardware, and resources can be fully and flexibly shared, enabling the rapid development and deployment of new services, and automatic deployment, elastic scaling, fault isolation, and self-healing based on actual business needs. Various network function processes can run in NFV network element devices to achieve the functions of traditional telecommunications network hardware devices, including hierarchical scheduling and traffic supervision functions for congestion management, which are used to be deployed at the access gateway or user gateway to perform queue scheduling for different user traffic, monitor the traffic rate entering the network, and discard the excess traffic to protect network resources and the interests of users. The present invention will specifically introduce a traffic rate limiting and scheduling service processing method, which can improve the processing efficiency of the message service quality function.

[0051] See Figure 1 As shown, the embodiment of the present application discloses a traffic rate limiting and scheduling service processing method, which is applied to the NFV system and includes:

[0052] Step S11: Obtain the service scheduling queue corresponding to the traffic rate limiting and scheduling service sent from the user side, and determine the current working core corresponding to the service scheduling queue in a multi-core working environment.

[0053] In this embodiment, before obtaining the service scheduling queue corresponding to the traffic speed limit scheduling service sent by the user side and determining the current working core corresponding to the service scheduling queue in a multi-core working environment, it further includes: determining the target number of tokens corresponding to the global token bucket based on a preset token calculation mechanism, and generating tokens with the target number of tokens based on a preset token generation rate and putting them into the global token bucket. First of all, it should be noted that in a multi-core environment, there is still a globally independent service scheduling queue for the user. The token bucket in the scheduler consists of a global token bucket and multiple local token buckets for working cores. The global token bucket generates tokens according to the set rate. That is to say, the global token bucket determines the target number of tokens corresponding to the global token bucket according to the preset token calculation mechanism, then produces tokens with the target number of tokens according to the set rate, and then adds the tokens to the global token bucket. Among them, the token calculation mechanism can be determined according to the token bucket algorithm, or a preset number of tokens can be generated according to the stability and availability of the system. In the actual operation process, the number of tokens can be increased once every preset time unit. Here, the time interval can be determined based on the real-time metrics of the system (such as request latency, error rate, system load). Specifically, the token generation rate or bucket capacity can be dynamically adjusted based on the real-time metrics of the system (such as request latency, error rate, system load).

[0054] Step S12: Lock the corresponding global token bucket in the scheduler by using a preset global lock, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core.

[0055] In this embodiment, when a certain CPU starts to process the traffic speed limit scheduling service, it uses a global lock to lock the global token bucket, takes all the tokens in the global token bucket into the local token bucket, and then releases the global lock. Specifically, the local token bucket can obtain tokens from the global token bucket through a message trigger method or a periodic polling method. The token buckets of each working core obtain tokens from the global token bucket respectively in the periodic polling scheduling method and save the tokens in the local token bucket.

[0056] Among them, in a specific embodiment, a preset global lock is used to lock the corresponding global token bucket in the scheduler, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core, including: using the preset global lock to lock the corresponding global token bucket in the scheduler, and based on a preset message trigger condition, using a message trigger operation to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core; wherein, the number of tokens of the number of tokens is greater than the actual consumed token number of the data packets in the service scheduling queue. That is, first, a global lock of the spin lock or read-write lock type can be used to lock the corresponding global token bucket in the scheduler, and then under the preset message trigger condition, a message trigger operation is used to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core. Among them, the preset message trigger condition can include the following several situations. For example, the token reading operation is triggered by an event. For example, when the queue scheduling operation starts, the token reading operation is triggered. Or, by setting a preset time period, such as every 10 milliseconds or 20 milliseconds, the token reading operation is triggered once. Or, a corresponding trigger instruction is set, and when the user side issues the corresponding trigger instruction, the token reading operation is triggered. After the tokens in the global token bucket are taken to the local token bucket, the global lock is released. It should be noted here that during the process of token generation to consumption, only the prefetch operation from the global bucket to the local bucket needs to be locked, and the number of tokens prefetched each time will be greater than the actual consumed token number of each packet.

[0057] Among them, in another specific embodiment, a preset global lock is used to lock the corresponding global token bucket in the scheduler, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core, including: using the preset global lock to lock the corresponding global token bucket in the scheduler, and performing periodic polling scheduling on the global token bucket based on a preset time period, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core; wherein, the number of tokens of the number of tokens is greater than the actual consumed token number of the data packets in the service scheduling queue. That is, first, a global lock of the spin lock or read-write lock type can be used to lock the corresponding global token bucket in the scheduler, and then periodic polling scheduling is performed on the global token bucket based on a preset time period. Specifically, the requests of the current working cores in each working core to read tokens from the global token bucket are alternately assigned to a management server, and then according to the assignment order, from the first to the Nth, the corresponding working cores are allowed to read a number of tokens from the global token bucket in turn, and then the cycle starts again. It should be noted here that during the process of token generation to consumption, only the prefetch operation from the global bucket to the local bucket needs to be locked, and the number of tokens prefetched each time will be greater than the actual consumed token number of each packet.

[0058] Step S13: Use the tokens in the local token bucket called by the current working core to perform lock-free packet rate-limiting scheduling processing on the packets in the service scheduling queue, so as to complete the traffic rate-limiting scheduling service.

[0059] In this embodiment, using the tokens in the local token bucket called by the current working core to perform lock-free packet rate-limiting scheduling processing on the packets in the service scheduling queue includes: locking the service scheduling queue by the current working core to obtain the current packet in the service scheduling queue; using the tokens in the local token bucket to perform lock-free packet rate-limiting scheduling processing on the current packet in the service scheduling queue; obtaining the remaining token quantity of the local token bucket and determining whether the remaining token quantity of the local token bucket is greater than 0; if the remaining token quantity of the local token bucket is greater than 0, obtaining a new current packet from the remaining unscheduled packets in the service scheduling queue; jumping to the step of using the tokens in the local token bucket to perform lock-free packet rate-limiting scheduling processing on the current packet in the service scheduling queue until there are no unscheduled packets in the service scheduling queue and / or the remaining token quantity of the local token bucket is equal to 0; if the remaining token quantity of the local token bucket is equal to 0, unlocking the service scheduling queue by the current working core to end the lock-free packet rate-limiting scheduling processing of the current working core on the service scheduling queue. That is, start using the tokens in the local token bucket to perform lock-free packet traffic rate-limiting scheduling processing on the globally independent service scheduling queue. During the use process, always check whether the tokens in the local token bucket have been all consumed. If the tokens in the local token bucket have not been consumed up, continue the packet rate-limiting scheduling processing until all the packets are scheduled or the tokens in the local token bucket are consumed up. If the tokens in the local token bucket are consumed up, end the packet rate-limiting scheduling processing.

[0060] Wherein, in this embodiment, after unlocking the service scheduling queue by the current working core to end the lock-free packet rate-limiting scheduling processing of the current working core on the service scheduling queue, it further includes: determining whether there are unscheduled packets in the service scheduling queue; if there are unscheduled packets in the service scheduling queue, determining a new current working core from other working cores in the multi-core working environment; the token quantity in the local token bucket corresponding to the new current working core is greater than 0; jumping to the step of locking the service scheduling queue by the current working core to obtain the current packet in the service scheduling queue.

[0061] Specifically, during the user queue scheduling process, the current working core locks the user service scheduling queue for user packet scheduling, and uses the local token bucket for user packet forwarding processing. When the tokens in the local token bucket are exhausted, the working core no longer processes the current user's service scheduling queue, releases the user service scheduling queue, and another working core locks the user service scheduling queue and uses the local token bucket of this core for user packet forwarding processing. This avoids the situation where the packets in the user queue cannot be normally forwarded when the tokens in the local token bucket are exhausted but there are still tokens in the local token buckets of other working cores, and the speed limit rate is lower than the target rate. Only when the tokens in the local token buckets of all working cores are exhausted, the packets in the user queue cannot be normally forwarded. It should be noted that during this process, each working core only uses the local token bucket resources and there will be no situation of mutual locking and waiting, which greatly improves the user packet forwarding efficiency when each working core uses the token bucket resources of traffic supervision during the hierarchical queue scheduling process of user packets under congestion management.

[0062] Generally speaking, that is, each working core saves a local token bucket to process the scheduling of user packets, avoiding all working cores competing for the global token bucket during the process of processing user packets, resulting in mutual waiting among the cores during the process of processing packets and causing the CPU to idle and reducing the CPU processing performance. The local token bucket of each working core can obtain token resources from the global token bucket in the way of packet-triggered or global periodic polling scheduling. During the current token acquisition process, the local token bucket will take all the tokens in the current global token bucket and save them locally to meet the demand for consuming tokens by this working core to process user packets. During the process of the working core scheduling the user packet for the current time, it will try its best to use the tokens in the local token bucket to send the user packet. If the local token bucket consumes all the tokens during the current user packet scheduling process, the working core exits the current user packet scheduling process and waits for the next round of scheduling to process the user queue packets.

[0063] In this embodiment, the tokens of the local token bucket are used to perform lock-free packet speed limit scheduling processing on the current packet in the service scheduling queue, including: matching the number of tokens of the local token bucket with the traffic demand of the current packet in the service scheduling queue based on a preset traffic matching rule to obtain a traffic control matching result; determining the traffic processing operation corresponding to the current packet based on the traffic control matching result, so as to perform lock-free packet speed limit scheduling processing on the current packet based on the traffic processing operation. For example Figure 2As shown, when performing scheduling, the number of tokens in the token bucket is used as the basis for determining whether there are enough tokens to forward the packets. If there are enough tokens in the bucket to forward the packets, the traffic is said to comply with or meet the agreed value; otherwise, it is called non-compliance or exceeding the standard. Among them, when the number of tokens in the token bucket is not enough to process all the packets but is enough to process some of the packets, it is called partial compliance. This means that although the traffic does not fully meet the preset specifications, it can still be processed to a certain extent. At this time, the packets can be marked and then forwarded. When the number of tokens in the token bucket is enough to process all the packets, it is called full compliance. This means that the traffic fully meets the preset specifications and all the packets can be processed normally. At this time, the packets can be forwarded normally. When the number of tokens in the token bucket is not enough to process all the packets, it is called exceeding the standard. This means that the traffic exceeds the preset specifications and some of the packets cannot be processed or will be delayed. At this time, the packets can be discarded. When setting bandwidth limits in network devices, the token bucket technology can be used to control the traffic entering the network and prevent network congestion caused by burst traffic. If the traffic is partially compliant or exceeds the standard, it may cause problems such as increased network latency and packet loss rate, affecting the user experience and data transmission efficiency.

[0064] It can be seen that in the present invention, as Figure 3 shown, obtain the service scheduling queue corresponding to the traffic rate limiting scheduling service issued by the user side, and determine the current working core corresponding to the service scheduling queue in the multi-core working environment; use a preset global lock to lock the corresponding global token bucket in the scheduler to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core; call the tokens of the local token bucket by the current working core to perform lock-free packet rate limiting scheduling processing on the packets in the service scheduling queue to complete the traffic rate limiting scheduling service. That is, each working core saves a local token bucket to process the scheduling of user packets. All working cores do not need to compete for the global token bucket during the process of processing user packets, avoiding the situation where each core waits for each other during the process of processing packets, resulting in the CPU (Central Processing Unit) idling and reducing the processing performance of the CPU.

[0065] Generally speaking, the local token bucket of each working core can obtain token resources from the global token bucket in a packet-triggered manner or a global periodic polling scheduling manner. During the current token acquisition process, the local token bucket will take all the tokens in the current global token bucket and save them locally to meet the demand for tokens consumed by this action core to process user packets. During the process from token generation to consumption, only the prefetch operation from the global bucket to the local bucket needs to be locked, and there will be no situation of mutual lock waiting during the whole operation process, which greatly improves the forwarding efficiency of user packets when each working core uses the token bucket resources of traffic supervision during the hierarchical queue scheduling process of user packets under congestion management.

[0066] As can be seen from the above technical solutions, in the present invention, each working core saves a local token bucket to process the scheduling of user packets. All working cores do not need to compete for the global token bucket during the process of processing user packets. During this process, each working core only uses the local token bucket resources, and there will be no situation of mutual lock waiting, which greatly improves the forwarding efficiency of user packets when each working core uses the token bucket resources of traffic supervision during the hierarchical queue scheduling process of user packets under congestion management.

[0067] Reference Figure 4 , the embodiment of the present application also correspondingly discloses a traffic rate-limiting scheduling service processing device, which is applied to the NFV system and includes:

[0068] A service scheduling queue determination module 11, configured to obtain the service scheduling queue corresponding to the traffic rate-limiting scheduling service issued by the user side, and determine the current working core corresponding to the service scheduling queue in a multi-core working environment;

[0069] A token reading module 12, configured to lock the corresponding global token bucket in the scheduler by using a preset global lock, so as to read a plurality of tokens from the global token bucket and store them in the local token bucket of the current working core;

[0070] A service scheduling module 13, configured to perform lock-free packet rate-limiting scheduling processing on the packets in the service scheduling queue by using the tokens of the local token bucket called by the current working core, so as to complete the traffic rate-limiting scheduling service.

[0071] It can be seen that in this embodiment, each working core saves a local token bucket to process the scheduling of user packets. All working cores do not need to compete for the global token bucket during the process of processing user packets. During this process, each working core only uses the local token bucket resources, and there will be no situation of mutual lock waiting, which greatly improves the forwarding efficiency of user packets when each working core uses the token bucket resources of traffic supervision during the hierarchical queue scheduling process of user packets under congestion management.

[0072] Furthermore, the embodiment of the present application also discloses an electronic deviceFigure 5 It is a structural diagram of an electronic device shown according to an exemplary embodiment. The content in the figure should not be considered as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the traffic speed limit scheduling service processing method disclosed in any of the foregoing embodiments. Additionally, the electronic device in this embodiment may specifically be an electronic computer.

[0073] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0074] In addition, as a carrier for resource storage, the memory 22 can be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method can be transient storage or permanent storage.

[0075] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the traffic speed limit scheduling service processing method executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks.

[0076] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the traffic speed limit scheduling service processing method disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0077] Furthermore, this application also discloses a computer program product, including a computer program / instructions; wherein, when the computer program / instructions are executed by a processor, they implement the alarm aggregation method disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0078] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0079] Those skilled in the art can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0080] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0081] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0082] The technical solutions provided in this application have been introduced in detail above. Specific examples are used in this article to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, based on the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A method for processing a traffic speed limit scheduling service, characterized in that, Applied to the NFV system, including: Obtain the service scheduling queue corresponding to the traffic rate limiting scheduling service sent by the user side, and determine the current working core corresponding to the service scheduling queue in a multi-core working environment; Lock the corresponding global token bucket in the scheduler using a preset global lock, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core; Call the tokens in the local token bucket through the current working core to perform lock-free message rate limiting scheduling processing on the messages in the service scheduling queue, so as to complete the traffic rate limiting scheduling service.

2. The traffic speed limit scheduling service processing method according to claim 1, wherein The locking the corresponding global token bucket in the scheduler using a preset global lock, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core includes: Lock the corresponding global token bucket in the scheduler using a preset global lock, and based on a preset message trigger condition, use a message trigger operation to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core; Wherein, the number of tokens of the number of tokens is greater than the actual consumed token number of the data packets in the service scheduling queue.

3. The traffic speed limit scheduling service processing method according to claim 1, characterized in that The locking the corresponding global token bucket in the scheduler using a preset global lock, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core includes: Lock the corresponding global token bucket in the scheduler using the preset global lock, and perform periodic polling scheduling on the global token bucket based on a preset time period, so as to read a number of tokens from the global token bucket and store them in the local token bucket of the current working core; Wherein, the number of tokens of the number of tokens is greater than the actual consumed token number of the data packets in the service scheduling queue.

4. The traffic speed limit scheduling service processing method according to claim 1, wherein Before the obtaining the service scheduling queue corresponding to the traffic rate limiting scheduling service sent by the user side and determining the current working core corresponding to the service scheduling queue in a multi-core working environment, further includes: Determine the target number of tokens corresponding to the global token bucket based on a preset token calculation mechanism, and generate tokens of the target number of tokens based on a preset token generation rate and put them into the global token bucket.

5. The traffic speed limit scheduling service processing method according to any one of claims 1 to 4, characterized in that The calling the tokens in the local token bucket through the current working core to perform lock-free message rate limiting scheduling processing on the messages in the service scheduling queue includes: Lock the service scheduling queue through the current working core, and obtain the current message of the service scheduling queue; Call the tokens in the local token bucket to perform lock-free message rate limiting scheduling processing on the current message in the service scheduling queue; Obtain the remaining token number of the local token bucket, and judge whether the remaining token number of the local token bucket is greater than 0; If the remaining token number of the local token bucket is greater than 0, obtain a new current message from the remaining unscheduled messages in the service scheduling queue; Jump to the step of calling the tokens in the local token bucket to perform lock-free message rate limiting scheduling processing on the current message in the service scheduling queue until there are no unscheduled messages in the service scheduling queue, and / or, the remaining token number of the local token bucket is equal to 0; If the remaining token quantity of the local token bucket is equal to 0, unlock the service scheduling queue through the current worker to end the lock-free packet rate-limiting scheduling process of the current worker for the service scheduling queue.

6. The traffic speed limit scheduling service processing method according to claim 5, wherein The step of performing lock-free packet rate-limiting scheduling on the current packet in the service scheduling queue by invoking the tokens of the local token bucket includes: Matching the token quantity of the local token bucket with the traffic demand of the current packet in the service scheduling queue based on a preset traffic matching rule to obtain a traffic control matching result; Determining the traffic processing operation corresponding to the current packet based on the traffic control matching result, and performing lock-free packet rate-limiting scheduling on the current packet based on the traffic processing operation.

7. The traffic speed limit scheduling service processing method according to claim 6, wherein After unlocking the service scheduling queue through the current worker to end the lock-free packet rate-limiting scheduling process of the current worker for the service scheduling queue, it further includes: Determining whether there are unscheduled packets in the service scheduling queue; If there are unscheduled packets in the service scheduling queue, determining a new current worker from other worker cores in the multi-core working environment; the token quantity in the local token bucket corresponding to the new current worker is greater than 0; Jumping to the step of locking the service scheduling queue through the current worker and obtaining the current packet of the service scheduling queue.

8. A traffic speed limit scheduling service processing device, characterized in that, Applied to the NFV system, it includes: A service scheduling queue determination module, configured to obtain the service scheduling queue corresponding to the traffic rate-limiting scheduling service issued by the user side, and determine the current worker corresponding to the service scheduling queue in the multi-core working environment; A token reading module, configured to lock the corresponding global token bucket in the scheduler by using a preset global lock, and read a plurality of tokens from the global token bucket and store them in the local token bucket of the current worker; A service scheduling module, configured to perform lock-free packet rate-limiting scheduling on the packets in the service scheduling queue by invoking the tokens of the local token bucket through the current worker to complete the traffic rate-limiting scheduling service.

9. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the traffic rate-limiting scheduling service processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the traffic rate-limiting scheduling service processing method according to any one of claims 1 to 7 are implemented.