CN114124829A - Service forwarding control method and device and electronic equipment - Google Patents
Service forwarding control method and device and electronic equipment Download PDFInfo
- Publication number
- CN114124829A CN114124829A CN202111130161.9A CN202111130161A CN114124829A CN 114124829 A CN114124829 A CN 114124829A CN 202111130161 A CN202111130161 A CN 202111130161A CN 114124829 A CN114124829 A CN 114124829A
- Authority
- CN
- China
- Prior art keywords
- service
- token
- target
- rate
- forwarding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/215—Flow control; Congestion control using token-bucket
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2416—Real-time traffic
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a service forwarding control method, a service forwarding control device and electronic equipment. In the application, by acquiring the sending rate of the target service, adjusting the generation rate of the token, and utilizing the dynamic adjustment of the generation rate of the token, the current total token amount in the token bucket for controlling the flow of the target service is indirectly adjusted, so that when data forwarding is required, dynamic service forwarding control can be realized according to the current total token amount in the token bucket and the service packet of the target service. When the actually needed resources of the current service packet to be forwarded are smaller than the existing network resources of the target service, the resources can be dynamically and adaptively adjusted according to the actually needed resources of the current service packet to be forwarded, so that the waste of network resources is reduced.
Description
Technical Field
The present application relates to the field of network communications, and in particular, to a method and an apparatus for controlling service forwarding, and an electronic device.
Background
In the field of network communication, in order to guarantee the service quality requirement of a service, the forwarding flow of the service needs to be controlled.
In the existing scheme, after the network device receives the service packet, the network device directly calls the existing network resources to forward the received service packet, the number of the called network resources lacks pertinence, and when the actually needed resources of the service packet are few, the resources cannot be fully utilized, so that the waste of the network resources is caused.
Disclosure of Invention
The application provides a service forwarding control method, a service forwarding control device and electronic equipment, which are used for dynamically controlling service packet forwarding according to a target service sending rate so as to achieve the effect of reducing network resource waste.
According to a first aspect of an embodiment of the present application, a method for controlling service forwarding is provided, where the method includes:
acquiring a target service sending rate of a target port on the electronic equipment for forwarding a target service in a specified period;
adjusting the token generation rate of a token bucket for controlling the flow of the target service according to the target service sending rate, generating tokens according to the adjusted token generation rate and storing the tokens into the token bucket;
and when data forwarding is carried out, controlling and forwarding the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service.
According to a second aspect of the embodiments of the present application, there is provided a service forwarding control apparatus, including:
a rate obtaining unit, configured to obtain a target service sending rate at which a target port on the electronic device forwards a target service in a specified period;
a token adjusting unit, configured to adjust a token generation rate of a token bucket for performing flow control on the target service according to the target service sending rate, generate a token according to the adjusted token generation rate, and store the token into the token bucket;
and the forwarding control unit is used for controlling and forwarding the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service when data forwarding is carried out.
According to a third aspect of the embodiments of the present application, an electronic device for controlling service forwarding is provided, where the electronic device includes: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor;
the processor is configured to execute machine-executable instructions to implement the steps of the above-disclosed method.
It can be seen from the above technical solutions that, in this embodiment, by obtaining a target service sending rate, adjusting a token generation rate, and using dynamic adjustment on the token generation rate, a current total token amount in a token bucket for performing flow control on a target service is indirectly adjusted, so that when data forwarding is required, dynamic service forwarding control can be implemented according to the current total token amount in the token bucket and a service packet of the target service. When the actually needed resources of the current service packet to be forwarded are smaller than the existing network resources of the target service, the resources can be dynamically and adaptively adjusted according to the actually needed resources of the current service packet to be forwarded, so that the waste of network resources is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart of a method provided by an embodiment of the present application;
FIG. 2 is an exemplary flow chart provided by an embodiment of the present application;
FIG. 3 is an exemplary flow chart provided by an embodiment of the present application;
FIG. 4 is an exemplary flow chart provided by an embodiment of the present application;
FIG. 5 is an exemplary flow chart provided by an embodiment of the present application;
FIG. 6 is a block diagram of an apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In order to make the technical solutions provided in the embodiments of the present application better understood and make the above objects, features and advantages of the embodiments of the present application more comprehensible, the technical solutions in the embodiments of the present application are described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of a method provided in an embodiment of the present application. Alternatively, as an embodiment, the flow may be applied to an electronic device. As an embodiment, the electronic device here may be a device related to service forwarding in network communication, for example, a network device on a service packet forwarding path such as a server, an exchange, and a base station, which is not limited in this embodiment.
In this embodiment, the flow shown in fig. 1 is forwarding control performed for a target service, and if a plurality of services exist in a system, corresponding service forwarding control may be performed on each service according to the flow shown in fig. 1.
As shown in fig. 1, the process may include the following steps:
In this embodiment, for the target service, a port for forwarding the target service, referred to as a target port, may exist on the electronic device.
In addition, in the embodiment, the designated period may be set according to actual requirements, and the embodiment is not particularly limited.
In this embodiment, there are many implementation manners in the step 101, and fig. 2 shows one of the implementation manners by way of example, which is not described herein again.
And step 102, adjusting the token generation rate of a token bucket for controlling the flow of the target service according to the target service sending rate, generating tokens according to the adjusted token generation rate, and storing the tokens into the token bucket.
In this embodiment, the target traffic may be forwarded under control of a token bucket. When a service packet of a target service is received and the service packet needs to be forwarded, the token in the token bucket can be consumed and the service packet can be forwarded, and when the token in the token bucket is insufficient, the service packet cannot be forwarded. In the prior art, in a specific implementation, the token bucket generates tokens at a fixed rate and stores the tokens into the token bucket, and in this embodiment, the dynamic adjustment is performed on the tokens generated in the token bucket, which does not generate tokens at a fixed rate, but adjusts the token generation rate of the token bucket for controlling the flow of the target traffic according to the target traffic sending rate.
Optionally, how to adjust the token generation rate of the token bucket for performing flow control on the target traffic according to the target traffic sending rate has many implementation manners, and fig. 3 illustrates one of the implementation manners, which is not described herein again.
In this embodiment, once the token generation rate is adjusted, tokens can be subsequently generated according to the adjusted token generation rate and stored in the token bucket.
And 103, when data forwarding is performed, controlling and forwarding the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service.
Optionally, in this embodiment, the total amount of current tokens in the token bucket may be a current token amount of the token bucket, which may be obtained intuitively.
In this embodiment, as described above, once the token generation rate is adjusted, the tokens may be subsequently generated according to the adjusted token generation rate and stored in the token bucket, and based on this, in this step 103, the total amount of the current tokens in the token bucket may be determined according to the adjusted token generation rate. For example, if the data forwarding in step 103 is the first forwarding after adjusting the token generation rate, the total number of tokens currently in the token bucket can be determined by the following steps:
step a1, a historical token quantity in the token bucket is obtained, the historical token quantity being the number of tokens held in the token bucket before the token generation rate is adjusted.
Step a2, determining the total amount of current tokens in the token bucket according to the historical token amount and the quantity of tokens generated and stored in the token bucket according to the adjusted token generation rate.
Alternatively, in one case, when the sum of the historical token amount and the number of tokens generated and stored to the token bucket according to the adjusted token generation rate is greater than the token capacity upper limit of the token bucket, the token capacity upper limit of the token bucket may be directly determined as the current token total amount. In other cases, the historical token amount and the sum of the token amounts of the number of tokens generated according to the adjusted token generation rate and stored in the token bucket may be directly determined as the current total token amount.
It should be noted that the current token total determined in steps a1 and a2 is only performed on the premise that the data forwarding in step 103 is performed on the first forwarding after the token generation rate is adjusted, and on other premises, the current token total in the token bucket can be finally presented in a similar manner.
As to how to determine the service packet cached in the service cache space corresponding to the target service in this step 103, there are many implementation manners, and fig. 4 illustrates one of the implementation manners, which is not described herein for the moment; how to control and forward the service packets cached in the service cache space according to the total amount of the current token in the token bucket and the service packets cached in the service cache space corresponding to the target service also has many embodiments, and fig. 5 illustrates one of the embodiments, which is not described herein for the time being.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, in this embodiment, by obtaining the sending rate of the target service, adjusting the token generation rate, and using the dynamic adjustment of the token generation rate, the current total token amount in the token bucket for performing flow control on the target service is indirectly adjusted, so that when data forwarding is required, dynamic service forwarding control can be implemented according to the current total token amount in the token bucket and the service packet of the target service. When the actually needed resources of the current service packet to be forwarded are smaller than the existing network resources of the target service, the resources can be dynamically and adaptively adjusted according to the actually needed resources of the current service packet to be forwarded, so that the waste of network resources is reduced.
One implementation of the above step 101 is described in detail below with reference to the flowchart shown in fig. 2.
As shown in fig. 2, one implementation of step 101 may include the following steps:
step 101_1, determine whether the target period of the statistical target service rate is reached.
If the target service rate counting period is reached, executing step 101_2, otherwise, continuing to wait until the target service rate counting period is reached.
And step 101_2, counting the service sending reference rate in the target period.
And acquiring the target service data transmission quantity in the target period, calculating the service transmission reference rate, and if the target service does not transmit data in the target period, considering the service transmission reference rate as 0.
Optionally, as an embodiment, there are many ways of sending the reference rate of the traffic in the statistical target period, for example, the following equation 1 may be used to implement:
rprd ═ S/T (equation 1)
Wherein Rprd is a service sending reference rate, S is a total amount of data sent by the target service in the target period, if the target service in the target period does not send data, S is 0, and T is a time length of the target period.
And step 101_3, smoothing the service transmission reference rate to obtain a target service transmission rate.
As an optional embodiment, the Service transmission reference rate is smoothed, and at least one of the purposes of the smoothing and the smoothing is to satisfy the rate requirement of the target Service at the target Service transmission rate obtained after the smoothing is guaranteed (the rate requirement is determined according to the Quality of Service (QoS) set for the target Service).
Optionally, as an embodiment, there are many ways to calculate the smoothing process, for example, the following equation 2 can be used to implement:
r ═ α × R + (1- α) × (Rprd (formula 2)
Wherein, R is a target service sending rate, α is a smoothing coefficient, and has a value range of 0 to 1, the larger the value of α is, the more R can represent a transmission rate of long-time statistical significance, and the smaller the value of α is, the more R can represent a recent transmission rate.
To this end, one implementation of step 101 shown in fig. 2 is completed.
In the following, a detailed description is given of one implementation manner of how to adjust the token generation rate of the token bucket for controlling the flow of the target traffic according to the sending rate of the target traffic in step 102, in conjunction with the flow shown in fig. 3.
As shown in fig. 3, one implementation of how to adjust the token generation rate of the token bucket for controlling the flow of the target traffic according to the target traffic sending rate in step 102 may include the following steps:
step 102_1, judging whether the target service sending rate is greater than a first set threshold.
Optionally, the first set threshold may be set according to a rate requirement of the target service, or may be associated with a token generation rate, and the first set threshold is adjusted after the token generation rate is adjusted.
The Rate requirement of the target service may be a Maximum Bit Rate (MBR) requirement for a Maximum Bit Rate (MBR) of Guaranteed Bit Rate (GBR) service and a GBR requirement for a lower limit of the Rate, or a Rate requirement set according to other rules or requirements, which is not limited in this embodiment.
Optionally, as an embodiment, there are many ways to set the first setting threshold, for example, the following equation 3 may be used to set:
thup (token rate) factor1 (equation 3)
Wherein, Thup is a first set threshold, token rate is a token generation rate, factor1 is a first threshold coefficient, the value range is 0-1, and the larger the value of factor1 is, the more difficult the token rate is to be adjusted upwards.
And when R is greater than Thup, judging that the target service sending rate is greater than a first set threshold, and executing a step 102_2, otherwise, executing a step 102_ 3.
For example, when the factor1 is 0.7, the threshold rate representing the first set threshold is 0.7 times the token generation rate, i.e., when the target traffic sending rate is greater than 0.7 times the token generation rate, the token generation rate needs to be adjusted up.
Step 102_2, adjust token generation rate up.
When the target service sending rate is greater than the first set threshold, it may be considered that the network resources are sufficient, and may attempt to allocate more network resources to the service packet, and it is necessary to adjust the token generating rate up, optionally, as an embodiment, there are many ways to adjust the token generating rate up, for example, the following equation 4 may be used to adjust up:
token rate MIN (MBR, token rate upsstep) (formula 4)
The token rate is a token generation rate, the MBR represents an upper limit of a rate of a service, and the token generation rate cannot exceed the upper limit, so that a smaller value between the MBR and the token rate upStep is obtained, the upStep is a token rate up-regulation coefficient, the value of the upStep is greater than 1, and the larger the value of the upStep is, the larger the amplitude of single upscaling of the token rate is under the premise that the MBR is not exceeded.
And step 102_3, judging whether the target service sending rate is less than a second set threshold.
Optionally, the second set threshold may be set according to a rate requirement of the target service, or may be associated with a token generation rate, and when the second set threshold is adjusted, the second set threshold is also adjusted, and the setting manner of the second set threshold is not limited in this embodiment.
Optionally, as an embodiment, there are many ways to set the second setting threshold, for example, the following equation 5 may be used to set:
thdown (token rate) factor2 (formula 5)
Wherein, Thdown is a second set threshold, the factor2 is a second threshold coefficient, the value range is 0 to 1, and the smaller the value of the factor2 is, the less the token rate is adjusted downwards.
And when R < Thdown, judging that the target service sending rate is less than a second set threshold, executing a step 102_4, otherwise executing a step 102_ 5.
For example, when the factor2 is 0.5, the threshold rate representing the second set threshold is 0.5 times the token generation rate, that is, when the target traffic sending rate is less than 0.5 times the token generation rate, the token generation rate needs to be decreased.
Step 102_4, the token generation rate is adjusted downward.
When the target service sending rate is less than the second set threshold, it may be considered that the network resources are insufficient, and it may try to reduce the network resources allocated to the service packet, so as to save the limited network resources and preferentially guarantee the minimum rate requirement. The token generation rate needs to be adjusted downward, and optionally, as an embodiment, there are many ways to adjust the token generation rate downward, for example, the following equation 6 can be used to adjust downward:
token rate MAX (GBR, token rate down step) (equation 6)
Wherein GBR represents the lower limit of the rate of the traffic, the token generation rate must not be lower than the lower limit,
therefore, the larger value of the GBR and the token rate descending step is taken, the descending step is a token rate descending coefficient and ranges from 0 to 1, and the smaller the descending step is, the larger the amplitude of single descending of the token rate is on the premise that the GBR is not lower.
In step 102_5, the token generation rate is unchanged.
When the target service sending rate does not exceed the first set threshold and is not lower than the second set threshold, the token generation rate is appropriate at the moment, and no adjustment is needed.
The flow shown in fig. 3 is completed.
In the following, a detailed description is given, with reference to the flow shown in fig. 4, on how to determine one implementation manner of the service packet cached in the service cache space corresponding to the target service in step 103.
As shown in fig. 4, one implementation manner of how to determine the service packet cached in the service cache space corresponding to the target service in step 103 may include the following steps:
and step 103_1, receiving the current service packet, and judging whether the service cache space is full.
When the electronic device receives the current service packet, it determines whether the service cache space is full, if the service cache space is full, step 103_2 is executed, and if the service cache space is not full, step 103_3 is executed. The service cache space is a space for temporarily storing the service packet after the device receives the service packet until the service packet is forwarded and leaves the service cache space.
And step 103_2, discarding the current service packet.
When the electronic equipment receives the current service packet, if the service cache space is full, the current service packet is discarded. Optionally, the service packet discarding situation can be reduced by expanding the service buffer space capacity.
And step 103_3, caching the current service packet.
When the electronic equipment receives the current service packet, if the service cache space is not full, the current service packet is cached and enters the service cache space.
Optionally, the service packets cached in the service cache space are sequenced according to the sequence of the caching time, so that when the service forwarding control is performed subsequently, the forwarding is performed according to the sequence of the service packets in the service cache space.
The flow shown in fig. 4 is completed.
In the following, a specific description is given, with reference to the flow shown in fig. 5, on how to perform control forwarding on the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service in step 103.
As shown in fig. 5, one implementation manner of how to control and forward the service packets cached in the service cache space according to the total amount of the current tokens in the token bucket and the service packets cached in the service cache space corresponding to the target service in step 103 may include the following steps:
and step 103_4, judging whether the token quantity required by the service packet cached in the service cache space is less than the total quantity of the current tokens in the token bucket.
When data forwarding is performed, if the quantity of tokens required by the service packets cached in the service cache space is less than the total quantity of current tokens in the token bucket, step 103_5 is performed, otherwise, step 103_6 is performed.
And step 103_5, scheduling network resources matched with the service packets cached in the service cache space.
And when the token quantity required by the service packet cached in the service cache space corresponding to the target service is less than the total quantity of the current tokens in the token bucket, scheduling network resources matched with the service packet cached in the service cache space, and forwarding the service packet cached in the service cache space through the scheduled network resources.
Optionally, the network Resource may be a Resource required for forwarding a service packet in network communication, such as a bandwidth Resource, a spectrum Resource, and the like, which is not limited in this embodiment, for example, as a specific embodiment, when the electronic device is a base station in a 5G network, the network Resource may be a Resource Block (RB) Resource, and the following network resources are the same.
And step 103_6, scheduling network resources matched with the current total token amount in the token bucket.
When the token quantity required by the service package cached in the service cache space corresponding to the target service is greater than the current token total quantity in the token bucket, scheduling network resources matched with the current token total quantity in the token bucket, and forwarding part of the service package cached in the service cache space through the scheduled network resources, wherein the part of the service package cached in the service cache space is the service package of which the required network resources are less than or equal to the scheduled network resources.
Optionally, the service packets cached in the service cache space may be sorted according to the order of the caching time, and a part of the service packets matching the scheduled network resource is selected from the sequence according to the order, and the selected part of the service packets is forwarded.
The flow shown in fig. 5 is completed.
The method provided by the embodiment is described above, and the device provided by the embodiment is described below:
referring to fig. 6, fig. 6 is a structural diagram of an apparatus according to an embodiment of the present disclosure. The apparatus corresponds to the flow shown in fig. 1. As shown in fig. 7, the apparatus may include:
601, a rate obtaining unit, configured to obtain a target service sending rate at which a target port on the electronic device forwards a target service in a specified period.
And 602, a token adjusting unit, configured to adjust a token generation rate of a token bucket for performing flow control on the target service according to the target service sending rate, and generate a token according to the adjusted token generation rate and store the token into the token bucket.
603, a forwarding control unit, configured to control forwarding of the service packet cached in the service cache space according to the total current token amount in the token bucket and the service packet cached in the service cache space corresponding to the target service when data forwarding is performed.
Optionally, in the rate obtaining unit, the obtaining a target service sending rate at which a target port on the electronic device forwards a target service in a specified period includes:
acquiring a target service sending data volume of a target port on the electronic equipment for forwarding a target service in a specified period;
calculating a service sending reference rate according to the target service sending data volume and the duration of the specified period;
and smoothing the service sending reference rate to obtain the target service sending rate.
Optionally, in the token adjusting unit, the adjusting, according to the target traffic sending rate, a token generation rate of a token bucket for performing flow control on the target traffic includes:
when the target service sending rate is greater than a first set threshold, the token generation rate of the token bucket is adjusted up; the first set threshold is set according to the sending rate of the target service;
when the target service sending rate is smaller than a second set threshold, the token generation rate of the token bucket is adjusted downwards; and the second set threshold is smaller than the first set threshold, and is set according to the sending rate of the target service.
Optionally, in the forwarding control unit, the total current amount of tokens in the token bucket is determined by:
obtaining a historical amount of tokens in a token bucket, the historical amount of tokens being a number of tokens deposited in the token bucket before adjusting a token generation rate;
and determining the total quantity of the current tokens in the token bucket according to the historical token quantity and the quantity of the tokens generated and stored in the token bucket according to the adjusted token generation rate.
Optionally, in the forwarding control unit, the controlling and forwarding the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service includes:
and when the token quantity required by the service packet cached in the service cache space corresponding to the target service is less than the total quantity of the current tokens in the token bucket, scheduling Resource Block (RB) resources matched with the service packet cached in the service cache space, and forwarding the service packet cached in the service cache space through the scheduled RB resources.
Optionally, in the forwarding control unit, the controlling and forwarding the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service includes:
and when the token quantity required by the service packet cached in the service cache space corresponding to the target service is greater than the current token quantity in the token bucket, scheduling RB resources matched with the current token quantity in the token bucket, and forwarding part of the service packet cached in the service cache space through the scheduled RB resources, wherein the RB resources required by the part of the service packet are less than or equal to the scheduled RB resources.
Optionally, in the forwarding control unit, the forwarding, through the scheduled RB resource, the part of the service packet cached in the service cache space includes:
sequencing the service packets cached in the service caching space according to the sequence of the caching time;
and selecting a part of service packets matched with the scheduled RB resources from the sequence according to the sequence, and forwarding the selected part of service packets.
Thus, the description of the structure of the device shown in fig. 6 is completed.
The embodiment of the application also provides a hardware structure of the device shown in fig. 6. Referring to fig. 7, fig. 7 is a structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 7, the hardware structure may include: a processor and a machine-readable storage medium having stored thereon machine-executable instructions executable by the processor; the processor is configured to execute machine-executable instructions to implement the methods disclosed in the above examples of the present application.
Based on the same application concept as the method, embodiments of the present application further provide a machine-readable storage medium, where several computer instructions are stored, and when the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.
The machine-readable storage medium may be, for example, any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A service forwarding control method is applied to an electronic device, and the method comprises the following steps:
acquiring a target service sending rate of a target port on the electronic equipment for forwarding a target service in a specified period;
adjusting the token generation rate of a token bucket for controlling the flow of the target service according to the target service sending rate, generating tokens according to the adjusted token generation rate and storing the tokens into the token bucket;
and when data forwarding is carried out, controlling and forwarding the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service.
2. The method of claim 1, wherein obtaining a target traffic transmission rate at which a target port on the electronic device forwards target traffic during a specified period comprises:
acquiring a target service sending data volume of a target port on the electronic equipment for forwarding a target service in a specified period;
calculating a service sending reference rate according to the target service sending data volume and the duration of the specified period;
and smoothing the service sending reference rate to obtain the target service sending rate.
3. The method of claim 1, wherein the adjusting a token generation rate of a token bucket for traffic control of the target traffic according to the target traffic sending rate comprises:
when the target service sending rate is greater than a first set threshold, the token generation rate of the token bucket is adjusted up; the first set threshold is set according to the sending rate of the target service;
when the target service sending rate is smaller than a second set threshold, the token generation rate of the token bucket is adjusted downwards; and the second set threshold is smaller than the first set threshold, and is set according to the sending rate of the target service.
4. The method of claim 1, wherein the total number of current tokens in the token bucket is determined by:
obtaining a historical amount of tokens in a token bucket, the historical amount of tokens being a number of tokens deposited in the token bucket before adjusting a token generation rate;
and determining the total quantity of the current tokens in the token bucket according to the historical token quantity and the quantity of the tokens generated and stored in the token bucket according to the adjusted token generation rate.
5. The method according to claim 1 or 4, wherein the controlling and forwarding the service packet cached in the service cache space according to the total current token amount in the token bucket and the service packet cached in the service cache space corresponding to the target service comprises:
and when the token quantity required by the service packet cached in the service cache space corresponding to the target service is less than the total quantity of the current tokens in the token bucket, scheduling Resource Block (RB) resources matched with the service packet cached in the service cache space, and forwarding the service packet cached in the service cache space through the scheduled RB resources.
6. The method according to claim 1 or 4, wherein the controlling and forwarding the service packet cached in the service cache space according to the total current token amount in the token bucket and the service packet cached in the service cache space corresponding to the target service comprises:
and when the token quantity required by the service packet cached in the service cache space corresponding to the target service is greater than the current token quantity in the token bucket, scheduling RB resources matched with the current token quantity in the token bucket, and forwarding part of the service packet cached in the service cache space through the scheduled RB resources, wherein the RB resources required by the part of the service packet are less than or equal to the scheduled RB resources.
7. The method of claim 6, wherein the forwarding the part of the service packets buffered in the service buffer space through the scheduled RB resource comprises:
sequencing the service packets cached in the service caching space according to the sequence of the caching time;
and selecting a part of service packets matched with the scheduled RB resources from the sequence according to the sequence, and forwarding the selected part of service packets.
8. A service forwarding control apparatus, applied to an electronic device, the apparatus comprising:
a rate obtaining unit, configured to obtain a target service sending rate at which a target port on the electronic device forwards a target service in a specified period;
a token adjusting unit, configured to adjust a token generation rate of a token bucket for performing flow control on the target service according to the target service sending rate, generate a token according to the adjusted token generation rate, and store the token into the token bucket;
and the forwarding control unit is used for controlling and forwarding the service packet cached in the service cache space according to the total amount of the current token in the token bucket and the service packet cached in the service cache space corresponding to the target service when data forwarding is carried out.
9. The apparatus of claim 8, wherein the token adjusting unit adjusts a token generation rate of a token bucket for controlling the flow of the target traffic according to the target traffic sending rate comprises:
when the target service sending rate is greater than a first set threshold, the token generation rate of the token bucket is adjusted up; the first set threshold is set according to the sending rate of the target service;
when the target service sending rate is smaller than a second set threshold, the token generation rate of the token bucket is adjusted downwards; and the second set threshold is smaller than the first set threshold, and is set according to the sending rate of the target service.
10. An electronic device, comprising: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor;
the processor is configured to execute machine executable instructions to implement the method steps of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111130161.9A CN114124829A (en) | 2021-09-26 | 2021-09-26 | Service forwarding control method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111130161.9A CN114124829A (en) | 2021-09-26 | 2021-09-26 | Service forwarding control method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114124829A true CN114124829A (en) | 2022-03-01 |
Family
ID=80441451
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111130161.9A Withdrawn CN114124829A (en) | 2021-09-26 | 2021-09-26 | Service forwarding control method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114124829A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114567601A (en) * | 2022-03-02 | 2022-05-31 | 统信软件技术有限公司 | Flow limiting method and system |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101360049A (en) * | 2008-09-23 | 2009-02-04 | 福建星网锐捷网络有限公司 | Packet forwarding method and apparatus |
CN102082693A (en) * | 2011-02-15 | 2011-06-01 | 中兴通讯股份有限公司 | Method and device for monitoring network traffic |
CN106411773A (en) * | 2016-08-29 | 2017-02-15 | 武汉微创光电股份有限公司 | Traffic shaping method and system in video transmission based on token bucket |
CN106713168A (en) * | 2016-12-21 | 2017-05-24 | 上海艾融软件股份有限公司 | Flow control method and system |
CN111049756A (en) * | 2019-12-24 | 2020-04-21 | 北京奇艺世纪科技有限公司 | Request response method and device, electronic equipment and computer readable storage medium |
CN112003795A (en) * | 2020-07-17 | 2020-11-27 | 苏州浪潮智能科技有限公司 | Method, system, equipment and storage medium for dynamically preventing traffic attack |
CN112350953A (en) * | 2019-08-07 | 2021-02-09 | 亿度慧达教育科技(北京)有限公司 | Flow limiting method and device, electronic equipment and computer readable storage medium |
CN112395053A (en) * | 2019-08-13 | 2021-02-23 | 阿里巴巴集团控股有限公司 | Data processing method and device |
-
2021
- 2021-09-26 CN CN202111130161.9A patent/CN114124829A/en not_active Withdrawn
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101360049A (en) * | 2008-09-23 | 2009-02-04 | 福建星网锐捷网络有限公司 | Packet forwarding method and apparatus |
CN102082693A (en) * | 2011-02-15 | 2011-06-01 | 中兴通讯股份有限公司 | Method and device for monitoring network traffic |
CN106411773A (en) * | 2016-08-29 | 2017-02-15 | 武汉微创光电股份有限公司 | Traffic shaping method and system in video transmission based on token bucket |
CN106713168A (en) * | 2016-12-21 | 2017-05-24 | 上海艾融软件股份有限公司 | Flow control method and system |
CN112350953A (en) * | 2019-08-07 | 2021-02-09 | 亿度慧达教育科技(北京)有限公司 | Flow limiting method and device, electronic equipment and computer readable storage medium |
CN112395053A (en) * | 2019-08-13 | 2021-02-23 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN111049756A (en) * | 2019-12-24 | 2020-04-21 | 北京奇艺世纪科技有限公司 | Request response method and device, electronic equipment and computer readable storage medium |
CN112003795A (en) * | 2020-07-17 | 2020-11-27 | 苏州浪潮智能科技有限公司 | Method, system, equipment and storage medium for dynamically preventing traffic attack |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114567601A (en) * | 2022-03-02 | 2022-05-31 | 统信软件技术有限公司 | Flow limiting method and system |
CN114567601B (en) * | 2022-03-02 | 2024-04-12 | 统信软件技术有限公司 | Flow limiting method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8649389B2 (en) | Prioritising data transmission | |
CN100353696C (en) | Triggered packet data rate change in communication system | |
KR100984982B1 (en) | Admission control and resource allocation in a communication system supporting quality of service | |
EP3171629B1 (en) | Access network congestion control method and base station device | |
US20140098778A1 (en) | Scheduling concept | |
US20110075562A1 (en) | Rate Shaping For Wireless Communication Using Token Bucket That Allows Token Debt | |
KR100699531B1 (en) | Apparatus and method of providing qos for a mobile internet service | |
Choi et al. | MAC scheduling scheme for VoIP traffic service in 3G LTE | |
JP2010141893A (en) | Resource scheduling method in radio communication system, and base station | |
KR20030094075A (en) | Method and apparatus for scheduling users to allocate data transmissions in communications systems | |
CN112968845B (en) | Bandwidth management method, device, equipment and machine-readable storage medium | |
WO2011137727A1 (en) | Method and system for transmitting message | |
JP6695980B2 (en) | Using network-assisted protocols to improve network utilization | |
US20070147388A1 (en) | Terminal and method for setting quality of service therein | |
CN113067778B (en) | Flow management method and flow management chip | |
CN111245732A (en) | Flow control method, device and equipment | |
CN101114988A (en) | Flow control algorithm for non-continuous emission based forecasting self-adaption multi-velocity service | |
CN114124829A (en) | Service forwarding control method and device and electronic equipment | |
JP2007300642A (en) | High-throughput scheduler with guaranteed fairness for wireless network and other application | |
CN108023938B (en) | Message sending method and server | |
JP2000069548A (en) | Communication band assignment method | |
JP2001036503A (en) | Method for distributing capacity in code division multiple access mobile radio communication system | |
CN111163016A (en) | Queue management method and device | |
CN112367708B (en) | Network resource allocation method and device | |
Radics et al. | Insight based dynamic QoE management in LTE |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220301 |
|
WW01 | Invention patent application withdrawn after publication |