Resource Allocation Method, Apparatus and Device

By obtaining network traffic information and dynamically adjusting the allocation of speed limit resource, the problem of low flexibility in the allocation of speed limit resource of gateway equipment is solved, and the flexible allocation and efficient utilization of speed limit resources are achieved.

CN114615711BActive Publication Date: 2025-08-01ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210317295.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-08-01
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

In the prior art, the speed limit resource allocation flexibility of gateway equipment is low, resulting in the speed limit resource being unable to be flexibly adjusted and cannot meet the network traffic needs of different users.

Method used

By obtaining network traffic information of multiple bandwidth resources, determining the speed limit resources to be allocated and the speed limit resources to be recycled based on the traffic information, dynamically adjusting the allocation of speed limit resources, including using the speed limit resource allocation flags, the number of over-speed limit periods, network parameters, etc., forming a issuance and recycling queue to achieve flexible allocation of speed limit resources.

Benefits of technology

It improves the flexibility of speed limit resource allocation, can dynamically adjust speed limit resources according to network traffic, meet the network needs of different users, and improves the utilization efficiency of speed limit resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114615711B_ABST
    Figure CN114615711B_ABST
Patent Text Reader

Abstract

The present application provides a resource allocation method, apparatus and device. The method includes: obtaining network traffic information of multiple bandwidth resources; determining a first bandwidth resource for which speed limit resources are to be allocated and a second bandwidth resource for which speed limit resources are to be recycled among the multiple bandwidth resources according to the network traffic information; recycling the speed limit resources of the second bandwidth resource, and allocating speed limit resources to the first bandwidth resource. The flexibility of speed limit resource allocation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and particularly to a resource allocation method, apparatus, and device. Background Art

[0002] The gateway limits the network traffic of users through a speed limit function. For example, when the network traffic used by a user is greater than the network traffic purchased by the user, the gateway can limit the network traffic of the user.

[0003] Currently, in order to improve the efficiency of speed limiting, the gateway can limit the network traffic through the speed limit resources in the hardware device. For example, the hardware gateway device includes multiple speed limit units for speed limiting. When a user purchases bandwidth resources, the hardware gateway can pre-allocate a speed limit unit for the bandwidth resources. When the network traffic used by the user exceeds the purchased network traffic, the hardware gateway limits it through this speed limit unit. However, the speed limit resources of the hardware gateway are limited, and allocating corresponding speed limit resources to each bandwidth resource fixedly results in low flexibility in speed limit resource allocation. Summary of the Invention

[0004] This application provides a resource allocation method, apparatus, and device for solving the technical problem of low flexibility in speed limit resource allocation in the prior art.

[0005] In a first aspect, this application provides a resource allocation method, which includes:

[0006] Obtain the network traffic information of multiple bandwidth resources;

[0007] According to the network traffic information, determine a first bandwidth resource for which speed limit resources are to be allocated and a second bandwidth resource for which speed limit resources are to be recycled among the multiple bandwidth resources;

[0008] Recycle the speed limit resources of the second bandwidth resource and allocate speed limit resources for the first bandwidth resource.

[0009] In a possible implementation manner, determining a first bandwidth resource for which speed limit resources are to be allocated and a second bandwidth resource for which speed limit resources are to be recycled among the multiple bandwidth resources according to the network traffic information includes:

[0010] According to the network traffic information, determine a speed limit resource allocation flag bit corresponding to each bandwidth resource, where the speed limit resource allocation flag bit is used to indicate whether speed limit resources have been allocated to the bandwidth resource;

[0011] According to the speed limit resource allocation flag bit, determine the first bandwidth resource and the second bandwidth resource among the multiple bandwidth resources.

[0012] In a possible implementation, for any one of the bandwidth resources, determining the first bandwidth resource and the second bandwidth resource from the multiple bandwidth resources according to the throttling resource allocation flag bit includes:

[0013] If the throttling resource allocation flag bit corresponding to the bandwidth resource is the first preset bit, determining the bandwidth resource as the second bandwidth resource;

[0014] If the throttling resource allocation flag bit corresponding to the bandwidth resource is the second preset bit, determining the number of over-throttling cycles corresponding to the bandwidth resource according to the network traffic information, and determining the first bandwidth resource according to the number of over-throttling cycles. The number of over-throttling cycles is the cumulative quantity of the statistical periods in which the network rate of the bandwidth resource is greater than the first preset rate.

[0015] In a possible implementation, determining the first bandwidth resource according to the number of over-throttling cycles includes:

[0016] If the number of over-throttling cycles is greater than or equal to the first threshold, determining the bandwidth resource as the first bandwidth resource;

[0017] If the number of over-throttling cycles is less than the first threshold, determining the bandwidth resource as the third bandwidth resource, where the third bandwidth resource is a bandwidth resource for which no throttling resources need to be allocated or recycled.

[0018] In a possible implementation, recycling the throttling resources of the second bandwidth resource and allocating throttling resources to the first bandwidth resource includes:

[0019] Determining the network parameters corresponding to each bandwidth resource according to the network traffic information, where the network parameters include at least one of the following: the acquisition time of the network traffic information, the number of over-throttling cycles, the absolute value of over-throttling, and the over-throttling ratio. The absolute value of over-throttling is the value of the absolute number of times the network rate is continuously greater than or equal to the second preset rate in the previous cycle, and the over-throttling ratio is the proportion of the network rate greater than or equal to the second preset rate in the previous cycle;

[0020] Sorting the first bandwidth resources according to the acquisition time, the number of over-throttling cycles, the absolute value of over-throttling, and the over-throttling ratio to obtain the throttling resource distribution queue, and sorting the second bandwidth resources to obtain the throttling resource recycling queue;

[0021] Recycling the throttling resources of the second bandwidth resource according to the throttling resource recycling queue, and allocating the throttling resources to the first bandwidth resource according to the throttling resource distribution queue.

[0022] In a possible implementation, recycling the rate-limiting resources of the second bandwidth resource according to the recycled rate-limiting resource queue, and allocating the rate-limiting resources to the first bandwidth resource according to the issued rate-limiting resource queue includes:

[0023] Obtain the remaining amount of rate-limiting resources;

[0024] If the remaining amount of rate-limiting resources is greater than the second threshold, issue rate-limiting resources to the first bandwidth resource according to the issued rate-limiting resource queue, and recycle the rate-limiting resources of the second bandwidth resource;

[0025] If the remaining amount of rate-limiting resources is less than or equal to the second threshold, obtain the first issuance priority of the first bandwidth resource with the highest ranking in the issued rate-limiting resource queue, and the second issuance priority of the second bandwidth resource with the highest ranking in the recycled rate-limiting resource queue. According to the first issuance priority and the second issuance priority, recycle the rate-limiting resources of the second bandwidth resource, and allocate rate-limiting resources to the first bandwidth resource.

[0026] In a possible implementation, recycling the rate-limiting resources of the second bandwidth resource and allocating rate-limiting resources to the first bandwidth resource according to the first issuance priority and the second issuance priority includes:

[0027] If the first issuance priority is greater than the second issuance priority, recycle the rate-limiting resources of the second bandwidth resource with the highest ranking, and allocate rate-limiting resources to the first bandwidth resource with the highest ranking, and delete the first bandwidth resource with the highest ranking in the issued rate-limiting resource queue, and delete the second bandwidth resource with the highest ranking in the recycled rate-limiting resource queue;

[0028] If the first issuance priority is less than or equal to the second issuance priority, stop recycling the rate-limiting resources of the second bandwidth resource, and stop allocating rate-limiting resources to the first bandwidth resource.

[0029] In a second aspect, the present application provides a resource allocation device, including an acquisition module, a determination module, and a control module, where:

[0030] The acquisition module is configured to acquire network traffic information of multiple bandwidth resources;

[0031] The determination module is configured to determine a first bandwidth resource to which rate-limiting resources are to be allocated and a second bandwidth resource for which rate-limiting resources are to be recycled among the multiple bandwidth resources according to the network traffic information;

[0032] The control module is configured to recycle the rate-limiting resources of the second bandwidth resource, and allocate rate-limiting resources to the first bandwidth resource.

[0033] In a possible implementation manner, the determining module is specifically configured to:

[0034] According to the network traffic information, determine a speed limit resource allocation flag bit corresponding to each bandwidth resource, where the speed limit resource allocation flag bit is used to indicate whether speed limit resources have been allocated to the bandwidth resource;

[0035] According to the speed limit resource allocation flag bit, determine the first bandwidth resource and the second bandwidth resource among the multiple bandwidth resources.

[0036] In a possible implementation manner, the determining module is specifically configured to:

[0037] If the speed limit resource allocation flag bit corresponding to the bandwidth resource is a first preset bit, determine that the bandwidth resource is the second bandwidth resource;

[0038] If the speed limit resource allocation flag bit corresponding to the bandwidth resource is a second preset bit, then according to the network traffic information, determine the number of over-speed limit periods corresponding to the bandwidth resource, and according to the number of over-speed limit periods, determine the first bandwidth resource, where the number of over-speed limit periods is the cumulative number of statistical periods in which the network rate of the bandwidth resource is greater than a first preset rate.

[0039] In a possible implementation manner, the determining module is specifically configured to:

[0040] If the number of over-speed limit periods is greater than or equal to a first threshold, determine that the bandwidth resource is the first bandwidth resource;

[0041] If the number of over-speed limit periods is less than the first threshold, determine that the bandwidth resource is a third bandwidth resource, where the third bandwidth resource is a bandwidth resource for which no speed limit resources need to be allocated or recycled.

[0042] In a possible implementation manner, the control module is specifically configured to:

[0043] According to the network traffic information, determine network parameters corresponding to each bandwidth resource, where the network parameters include at least one of the following: the acquisition time of the network traffic information, the number of over-speed limit periods, the absolute value of over-speed limit, and the over-speed limit ratio, where the absolute value of over-speed limit is the value of the absolute number of times the network rate is continuously greater than or equal to a second preset rate in the previous period, and the over-speed limit ratio is the ratio of the number of times the network rate is greater than or equal to the second preset rate in the previous period;

[0044] Sort the first bandwidth resources according to the acquisition time, the number of over-speed periods, the absolute value of over-speed, and the over-speed ratio to obtain the allocated speed-limited resource queue, and sort the second bandwidth resources to obtain the recycled speed-limited resource queue;

[0045] Recycle the speed-limited resources of the second bandwidth resources according to the recycled speed-limited resource queue, and allocate the speed-limited resources to the first bandwidth resources according to the allocated speed-limited resource queue.

[0046] In a possible implementation manner, the control module is specifically configured to:

[0047] Obtain the remaining amount of speed-limited resources;

[0048] If the remaining amount of speed-limited resources is greater than the second threshold, allocate speed-limited resources to the first bandwidth resources according to the allocated speed-limited resource queue, and recycle the speed-limited resources of the second bandwidth resources;

[0049] If the remaining amount of speed-limited resources is less than or equal to the second threshold, obtain the first allocation priority of the first bandwidth resource with the highest ranking in the allocated speed-limited resource queue, and the second allocation priority of the second bandwidth resource with the highest ranking in the recycled speed-limited resource queue. According to the first allocation priority and the second allocation priority, recycle the speed-limited resources of the second bandwidth resources and allocate speed-limited resources to the first bandwidth resources.

[0050] In a possible implementation manner, the control module is specifically configured to:

[0051] If the first allocation priority is greater than the second allocation priority, recycle the speed-limited resources of the second bandwidth resource with the highest ranking, and allocate speed-limited resources to the first bandwidth resource with the highest ranking, and delete the first bandwidth resource with the highest ranking in the allocated speed-limited resource queue, and delete the second bandwidth resource with the highest ranking in the recycled speed-limited resource queue;

[0052] If the first allocation priority is less than or equal to the second allocation priority, stop recycling the speed-limited resources of the second bandwidth resources and stop allocating speed-limited resources to the first bandwidth resources.

[0053] In a third aspect, the present application provides a terminal device, including: a processor and a memory;

[0054] The memory stores computer execution instructions;

[0055] The processor executes the computer execution instructions stored in the memory, so that the processor executes the resource allocation method as described in the first aspect.

[0056] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the resource allocation method described in any one of the foregoing items.

[0057] In a fifth aspect, the present invention further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the resource allocation method described in any one of the foregoing items.

[0058] The present application provides a resource allocation method, device and equipment, which obtain network traffic information of multiple bandwidth resources, and determine a first bandwidth resource for which speed limit resources are to be allocated and a second bandwidth resource for which speed limit resources are to be recycled among the multiple bandwidth resources according to the network traffic information, recycle the speed limit resources of the second bandwidth resource, and allocate speed limit resources for the first bandwidth resource. According to the above method, the gateway device can dynamically recycle the speed limit resources allocated to the second bandwidth resource and dynamically issue speed limit resources to the first bandwidth resource that needs speed limiting, thereby improving the flexibility of speed limit resource allocation. Description of the Drawings

[0059] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0060] Figure 2 It is a schematic flowchart of a resource allocation method provided by an embodiment of the present application;

[0061] Figure 3 It is a schematic diagram of recycling speed limit resources and issuing speed limit resources provided by an embodiment of the present application;

[0062] Figure 4 It is a schematic diagram of the process of speed limit resource allocation provided by an embodiment of the present application;

[0063] Figure 5 It is a schematic diagram of the process of a resource allocation method provided by an embodiment of the present application;

[0064] Figure 6 It is a schematic structural diagram of a resource allocation device provided by an embodiment of the present application;

[0065] Figure 7 It is a schematic hardware structure diagram of a terminal device provided by the present application. Detailed Embodiments

[0066] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0067] It should be noted that in this document, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also 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 presence of additional identical elements in the process, method, article or device comprising that element.

[0068] By performing rate limiting on network traffic through the hardware devices in the gateway, the forwarding performance can be improved and the efficiency of rate limiting can be enhanced. In the related art, the gateway can use the rate limiting resources in the hardware devices to perform rate limiting on the network traffic of users. For example, if the hardware device of the gateway includes 1000 rate limiting units, the gateway can perform rate limiting on the network traffic used by 1000 users. However, the rate limiting resources of the hardware gateway are limited, and one rate limiting unit can only fixedly perform rate limiting on the network traffic of one user, thus resulting in a relatively low flexibility in the allocation of rate limiting resources.

[0069] To solve the technical problem of relatively low flexibility in the allocation of rate limiting resources in the related art, an embodiment of the present application provides a resource allocation method, which obtains the network traffic information of multiple bandwidth packets, determines the rate limiting resource allocation flag bit corresponding to each bandwidth packet according to the network traffic information. If the rate limiting resource allocation flag bit corresponding to the bandwidth packet is the first preset bit, it is determined that the bandwidth packet is a second bandwidth packet. If the rate limiting resource allocation flag bit corresponding to the bandwidth packet is the second preset bit, the over-rate limiting period corresponding to the bandwidth packet is determined. When the number of over-rate limiting periods is greater than or equal to the first threshold, it is determined that the bandwidth packet is a first bandwidth packet, the rate limiting resources of the second bandwidth packet are recycled, and rate limiting resources are allocated to the first bandwidth packet. In this way, the gateway device can flexibly recycle the rate limiting resources already allocated to the second bandwidth packet and flexibly issue rate limiting resources to the first bandwidth packet that needs rate limiting. By dynamically adjusting the rate limiting resources, the flexibility of rate limiting resource allocation can be improved.

[0070] Next, in combination with Figure 1 , the application scenarios of the embodiments of the present application will be described.

[0071] Figure 1A schematic diagram of an application scenario provided by an embodiment of the present application. Please refer to Figure 1 , including: a cloud network, Tenant A, and Tenant B. Among them, the cloud network is respectively connected to Tenant A and Tenant B, and a hardware virtual gateway is set in the cloud network. The cloud network obtains the bandwidth resources of Tenant A and Tenant B, and determines that the bandwidth resource of Tenant A is the first bandwidth resource, and the bandwidth resource of Tenant B is the second bandwidth resource. The cloud network allocates rate-limiting resources for Tenant A, and the cloud network reclaims the rate-limiting resources that have been allocated for Tenant B. In this way, the cloud network can flexibly adjust the rate-limiting resources in the hardware device, thereby improving the flexibility of rate-limiting resource allocation.

[0072] The following uses specific embodiments to detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of the present application with reference to the accompanying drawings.

[0073] Figure 2 A flowchart of a resource allocation method provided by an embodiment of the present application. Please refer to Figure 2 , the method may include:

[0074] S201. Obtain network traffic information of multiple bandwidth resources.

[0075] The execution subject of the embodiment of the present application may be a gateway device, or a resource allocation device set in the gateway device. Among them, the resource allocation device can be implemented by software, or by a combination of software and hardware.

[0076] Optionally, the bandwidth resource may be a bandwidth package purchased by a tenant in the cloud network. Among them, the cloud network may be a cloud computing network. For example, the cloud data center of the cloud computing network includes computing, network, and storage devices, and users can purchase bandwidth resources to use the functions in the cloud computing network. For example, if the bandwidth of the bandwidth resource purchased by a tenant is 10M, the tenant's IP can use at most 10M of bandwidth.

[0077] The network traffic information is the rate at which a user uses the network. For example, the network traffic information may be the real-time rate at which a user uses the network, or the average rate at which a user uses the network within a period of time. For example, if the network traffic information of the bandwidth resource is 10M, the real-time rate at which the user uses the network at this moment is 10M, or if the network traffic information of the bandwidth resource is 10M, the average rate at which the user uses the network within this period is 10M.

[0078] Optionally, the gateway device may be a hardware virtual gateway in a cloud computing network. As the main body for speed limiting, the hardware virtual gateway in the cloud computing network can be connected to multiple tenants (hundreds of thousands of tenants can be served in actual applications), and each tenant has corresponding bandwidth resources. The hardware virtual gateway can obtain the network traffic information of each tenant. For example, if the hardware virtual gateway is connected to 1000 tenants, the hardware virtual gateway can obtain the network traffic information of 1000 bandwidth resources. For example, the hardware virtual gateway can periodically obtain the traffic of the tenant passing through the hardware virtual gateway, and determine the network traffic information of the tenant based on the traffic obtained twice. For example, if the traffic of the tenant passing through the hardware virtual gateway at the 1st second is 5M and the traffic of the tenant passing through the virtual network at the 2nd second is 15M, then the network traffic information of the tenant within 1 second is 10M.

[0079] S202. Determine a first bandwidth resource for which speed limiting resources are to be allocated and a second bandwidth resource for which speed limiting resources are to be recycled among multiple bandwidth resources according to the network traffic information.

[0080] The speed limiting resources are used to limit the speed of the bandwidth resources. For example, if the network traffic information of the bandwidth resource is greater than the bandwidth of the bandwidth package purchased by the user in the cloud computing network, the hardware device in the hardware virtual gateway needs to limit the network traffic of the bandwidth package.

[0081] Optionally, multiple speed limiting resources may be included in the hardware virtual gateway. For example, multiple speed limiting units may be included in the programmable chip of the hardware virtual gateway, and each speed limiting unit is implemented by multiple stateful memories such as registers. In actual applications, 60,000 speed limiting units may be included in the programmable chip of the hardware virtual gateway.

[0082] The first bandwidth resource is the bandwidth resource for which speed limiting resources need to be allocated. For example, if the network traffic of the bandwidth resource accumulatively exceeds the bandwidth of the bandwidth resource purchased by the user for multiple times, the gateway device needs to limit the speed of this bandwidth resource, and this bandwidth resource is the first bandwidth resource.

[0083] The second bandwidth resource is the bandwidth resource for which speed limiting resources need to be recycled. For example, after the gateway device allocates speed limiting resources to the bandwidth resource, the speed limiting resources can be recycled under specific conditions (such as after a preset duration, or when the real-time rate of the bandwidth resource is relatively low, etc.) so that the gateway device can allocate the recycled speed limiting resources to other first bandwidth resources, improving the flexibility of speed limiting resource allocation.

[0084] The first bandwidth resource and the second bandwidth resource can be determined from multiple bandwidth resources according to the following feasible implementation methods: Determine the rate-limiting resource allocation flag bit corresponding to each bandwidth resource according to the network traffic information. The rate-limiting resource allocation flag bit is used to indicate whether rate-limiting resources have been allocated to the bandwidth resource. Determine the first bandwidth resource and the second bandwidth resource from multiple bandwidth resources according to the rate-limiting resource allocation flag bit.

[0085] Optionally, the rate-limiting resource allocation flag bit corresponding to the bandwidth resource can be obtained according to the following feasible implementation methods: Update the nodes of the hash table through the network traffic information of the bandwidth resource to obtain the rate-limiting resource allocation flag bit corresponding to the bandwidth resource. For example, the hardware virtual gateway can use the hash table to store the information of all bandwidth resources. After the hardware virtual gateway obtains the network traffic information of the bandwidth resource each time, the hash table (the nodes of the hash table include the rate-limiting resource allocation flag bit) can be updated through the network traffic information, and then the rate-limiting resource allocation flag bit of the bandwidth resource can be obtained.

[0086] Optionally, determining the first bandwidth resource and the second bandwidth resource from multiple bandwidth resources according to the rate-limiting resource allocation flag bit is specifically: If the rate-limiting resource allocation flag bit corresponding to the bandwidth resource is the first preset bit, determine that the bandwidth resource is the second bandwidth resource. The first preset bit can be set. For example, if the rate-limiting resource flag bit corresponding to the bandwidth resource is set, determine that the bandwidth resource is the second bandwidth resource.

[0087] Optionally, after determining that the rate-limiting resource flag bit corresponding to the bandwidth resource is set, it can be further determined whether the bandwidth resource is the second bandwidth resource through the number of stable periods and the stability factor. The number of stable periods is the cumulative number of statistical periods in which the network traffic fluctuation is less than the preset range. The stability factor is a preset parameter. For example, the number of stable periods is 2, the stability factor is 0.8, and the bandwidth of the bandwidth resource purchased by the user is 10 M / s. If the network rate is lower than 8 M / s in two consecutive statistical periods, it can be determined that the bandwidth resource is the second bandwidth resource. In this way, the second bandwidth resource can be accurately determined, and the reliability of rate-limiting resource allocation can be improved.

[0088] If the speed limit resource allocation flag bit corresponding to the bandwidth resource is the second preset bit, determine the number of over-speed limit periods corresponding to the bandwidth resource according to the network traffic information. The number of over-speed limit periods is the number of statistical periods in which the network rate of the bandwidth resource accumulatively exceeds the first preset rate. The first preset rate can be the bandwidth of the bandwidth resource of the cloud network purchased by the user, and the statistical period can be the period when the hardware virtual gateway obtains the network traffic information of the bandwidth resource. For example, the first preset rate is 10M, and the statistical period is 10 seconds. Within 60 seconds, if the network rates of the bandwidth resources obtained in 6 statistical periods are all greater than 10M, the number of over-speed limit periods is 6; if the network rates of the bandwidth resources obtained in the first 2 statistical periods are greater than 10M, the network rate of the bandwidth resource obtained in the 3rd statistical period is less than 10M, and the network rates of the bandwidth resources obtained in the last 3 statistical periods are greater than 10, the number of over-speed limit periods is 3 (accumulatively count the latest number of over-speed limit periods, if a statistical period within the preset time period does not exceed the first preset rate, the accumulation is cleared).

[0089] Determine the first bandwidth resource according to the number of over-speed limit periods. Optionally, if the number of over-speed limit periods is greater than or equal to the first threshold, determine that the bandwidth resource is the first bandwidth resource; if the number of over-speed limit periods is less than the first threshold, determine that the bandwidth resource is the third bandwidth resource. The third bandwidth resource is a bandwidth resource for which speed limit resources do not need to be issued or recycled. For example, when the bandwidth resource obtained by the hardware virtual gateway is the third bandwidth resource, if the hardware virtual gateway does not allocate speed limit resources to the third bandwidth resource, the hardware virtual gateway does not need to allocate speed limit resources to the third bandwidth resource; if the hardware virtual gateway has allocated speed limit resources to the third bandwidth resource, the hardware virtual gateway also does not need to recycle the speed limit resources of the third bandwidth resource. For example, the first threshold is 4. If the over-speed limit period of the bandwidth resource is 3, the bandwidth resource is the third bandwidth resource; if the over-speed limit period of the bandwidth resource is 5, the bandwidth resource is the first bandwidth resource. In this way, by the number of over-speed limit periods, the influence on the speed limit mechanism when the network rate jitters can be avoided, and the reliability of speed limit resource allocation can be improved.

[0090] S203. Recycle the speed limit resources of the second bandwidth resource and allocate speed limit resources to the first bandwidth resource.

[0091] The speed limit resources of the second bandwidth resource can be recycled and speed limit resources can be allocated to the first bandwidth resource according to the following feasible implementation methods: Determine the network parameters corresponding to each bandwidth resource according to the network traffic information. Optionally, the network parameters include at least one of the following: the acquisition time of the network traffic information, the number of over-speed limit periods, the absolute value of over-speed limit, and the over-speed limit ratio.

[0092] Among them, the acquisition time of the network traffic information is the time when the gateway device acquires the network rate of the bandwidth resource. For example, if the gateway device acquires the network rate used by the user at the first moment, the acquisition time of the network traffic information is the first moment.

[0093] The absolute value of over-limit speed is the value of the absolute number of times that the network rate is continuously greater than or equal to the second preset rate in the previous period. Among them, the second preset rate can be the bandwidth of the bandwidth resource of the cloud network purchased by the user, or it can be any set network rate. For example, if the bandwidth of the bandwidth resource of the cloud network purchased by the user is 10M, the second preset rate is 10M. For example, if the absolute number of times that the network rate of the bandwidth resource is continuously greater than the second preset rate in the previous period is 2M, the absolute value of over-limit speed is 2M; if the absolute number of times that the network rate of the bandwidth resource is continuously greater than the second preset rate in the previous period is 4M, the absolute value of over-limit speed is 4M.

[0094] The over-limit speed ratio is the ratio of the network rate greater than or equal to the second preset rate in the previous period. For example, the bandwidth of the bandwidth resource of the cloud network purchased by the user is 10M. If the average value of the network rate used by the user in the previous period is 15M, the over-limit speed ratio is 50%; if the average value of the network rate used by the user in the previous period is 17M, the over-limit speed ratio is 70%.

[0095] Optionally, the hash table can be updated through the network traffic information to obtain the network parameters corresponding to the bandwidth resource. The nodes of the hash table include: bandwidth resource identifier, limit speed resource allocation flag bit, over-limit speed period number, absolute value of over-limit speed, and over-limit speed ratio. For example, when the hardware virtual gateway acquires the network rate of the bandwidth resource, the gateway device updates the hash table through the network rate, and then obtains the network parameters corresponding to the bandwidth resource through the nodes of the updated hash table. Since one bandwidth resource can be bound to one or more IP addresses, by aggregating the network traffic through the hash table, the accuracy of resource allocation can be improved.

[0096] Sort the first bandwidth resource according to the acquisition time, over-limit speed period number, absolute value of over-limit speed, and over-limit speed ratio to obtain the issued limit speed resource queue, and sort the second bandwidth resource to obtain the recycled limit speed resource queue.

[0097] Optionally, the bandwidth throttling resource queue for distribution may store the identifier of the first bandwidth resource. For example, the bandwidth resource identifiers in the bandwidth throttling resource queue for distribution are all the identifiers of the first bandwidth resource. The gateway device may allocate throttling resources for the first bandwidth resource according to the identifier of the first bandwidth resource. Optionally, the bandwidth throttling resource queue for recovery may store the identifier of the second bandwidth resource. For example, the bandwidth resource identifiers in the bandwidth throttling resource queue for recovery are all the identifiers of the second bandwidth resource. The gateway device may recover the throttling resources of the second bandwidth resource according to the identifier of the second bandwidth resource.

[0098] Optionally, the bandwidth throttling resource queue for distribution and the bandwidth throttling resource queue for recovery may be obtained according to the following feasible implementation methods: Determine the priority order of network parameters. Optionally, the priority order may be: the priority of the acquisition time is greater than the priority of the number of over-throttling periods, the priority of the number of over-throttling periods is greater than the priority of the over-throttling absolute value, and the priority of the over-throttling absolute value is greater than the priority of the over-throttling ratio.

[0099] Sort the first bandwidth resources according to the value of the acquisition time, the value of the number of over-throttling periods, the value of the over-throttling absolute value, the value of the over-throttling ratio, and the priority order to determine the bandwidth throttling resource queue for distribution. For example, if the acquisition time field of the first bandwidth resource A is greater than the acquisition time field of the first bandwidth resource B, then in the bandwidth throttling resource queue for distribution, the first bandwidth resource A is before the first bandwidth resource B. If the acquisition time field of the first bandwidth resource A is equal to the acquisition time field of the first bandwidth resource B, then judge the positions of the first bandwidth resource A and the first bandwidth resource B according to the number of over-throttling periods field. If the number of over-throttling periods field of the first bandwidth resource A is greater than the number of over-throttling periods field of the first bandwidth resource B, then in the bandwidth throttling resource queue for distribution, the first bandwidth resource A is before the first bandwidth resource B. If the number of over-throttling periods field of the first bandwidth resource A is equal to the number of over-throttling periods field of the first bandwidth resource B, then judge the positions of the first bandwidth resource A and the first bandwidth resource B according to the over-throttling absolute value field. If the over-throttling absolute value field of the first bandwidth resource A is greater than the over-throttling absolute value field of the first bandwidth resource B, then in the bandwidth throttling resource queue for distribution, the first bandwidth resource A is before the first bandwidth resource B. If the over-throttling absolute value field of the first bandwidth resource A is equal to the over-throttling absolute value field of the first bandwidth resource B, then judge the positions of the first bandwidth resource A and the first bandwidth resource B according to the over-throttling ratio field. If the over-throttling ratio field of the first bandwidth resource A is greater than the over-throttling ratio field of the first bandwidth resource B, then in the bandwidth throttling resource queue for distribution, the first bandwidth resource A is before the first bandwidth resource B. If the over-throttling ratio field of the first bandwidth resource A is equal to the over-throttling ratio field of the first bandwidth resource B, then the sorting positions of the first bandwidth resource A and the first bandwidth resource B in the bandwidth throttling resource queue for distribution are the same.

[0100] Sort the second bandwidth resources according to the values of the acquisition time, the number of over-speed periods, the absolute value of over-speed, the over-speed ratio, and the priority order to obtain a queue of resources with speed limits for recovery. For example, if the acquisition time field of the second bandwidth resource A is greater than the acquisition time field of the second bandwidth resource B, then in the queue of resources with speed limits for recovery, the second bandwidth resource A is located after the second bandwidth resource B. If the acquisition time field of the second bandwidth resource A is equal to the acquisition time field of the second bandwidth resource B, then judge the positions of the second bandwidth resource A and the second bandwidth resource B according to the field of the number of over-speed periods. If the number of over-speed periods field of the second bandwidth resource A is greater than the number of over-speed periods field of the second bandwidth resource B, then in the queue of resources with speed limits for recovery, the second bandwidth resource A is located after the second bandwidth resource B. If the number of over-speed periods field of the second bandwidth resource A is equal to the number of over-speed periods field of the second bandwidth resource B, then judge the positions of the second bandwidth resource A and the second bandwidth resource B according to the field of the absolute value of over-speed. If the absolute value of over-speed field of the second bandwidth resource A is greater than the absolute value of over-speed field of the second bandwidth resource B, then in the queue of resources with speed limits for recovery, the second bandwidth resource A is located after the second bandwidth resource B. If the absolute value of over-speed field of the second bandwidth resource A is equal to the absolute value of over-speed field of the second bandwidth resource B, then judge the positions of the second bandwidth resource A and the second bandwidth resource B according to the field of the over-speed ratio. If the over-speed ratio field of the second bandwidth resource A is greater than the over-speed ratio field of the second bandwidth resource B, then in the queue of resources with speed limits for recovery, the second bandwidth resource A is located after the second bandwidth resource B. If the over-speed ratio field of the second bandwidth resource A is equal to the over-speed ratio field of the second bandwidth resource B, then the sorting positions of the second bandwidth resource A and the second bandwidth resource B in the queue of resources with speed limits for recovery are the same.

[0101] Recover the speed-limited resources of the second bandwidth resource according to the queue of resources with speed limits for recovery, and allocate speed-limited resources for the first bandwidth resource according to the queue of issued speed-limited resources. For example, recover the speed-limited resources of the second bandwidth resource according to the arrangement order of the second bandwidth resource in the queue of resources with speed limits for recovery, and allocate speed-limited resources for the first bandwidth resource according to the arrangement order of the second bandwidth resource in the issued speed-limited queue.

[0102] An embodiment of the present application provides a resource allocation method, which obtains network traffic information of multiple bandwidth resources, determines a speed limit resource allocation flag bit corresponding to each bandwidth resource according to the network traffic information. If the speed limit resource allocation flag bit corresponding to the bandwidth resource is the first preset bit, it is determined that the bandwidth resource is the second bandwidth resource. If the speed limit resource allocation flag bit corresponding to the bandwidth resource is the second preset bit, the over-speed limit period corresponding to the bandwidth resource is determined. When the number of over-speed limit periods is greater than or equal to the first threshold, it is determined that the bandwidth resource is the first bandwidth resource. According to the network parameters of each bandwidth resource, multiple first bandwidth resources are sorted to obtain a speed limit resource queue to be issued, and multiple second bandwidth resources are sorted to obtain a speed limit resource queue to be recycled. In this way, the gateway device can flexibly recycle the allocated speed limit resources according to the speed limit resource queue to be recycled, and flexibly issue speed limit resources according to the speed limit resource queue to be issued. By dynamically adjusting the speed limit resources, the flexibility of speed limit resource allocation can be improved.

[0103] Based on the Figure 2 embodiment shown below, combined with Figure 3 the above embodiment, the process of recycling the speed limit resources of the second bandwidth resource according to the speed limit resource queue to be recycled and allocating speed limit resources to the first bandwidth resource according to the speed limit resource queue to be issued will be described.

[0104] Figure 3 FIG. is a schematic diagram of recycling speed limit resources and issuing speed limit resources provided by an embodiment of the present application.

[0105] Please refer to Figure 3 , and the method flow includes:

[0106] S301. Obtain the remaining speed limit resource amount.

[0107] The remaining speed limit resource amount is the amount of speed limit resources that the gateway device can use. For example, the hardware device of the hardware virtual gateway in the cloud network includes 1000 speed limit units. If the hardware virtual gateway has limited the speed of 300 bandwidth resources, the remaining speed limit resource amount is 700.

[0108] S302. Recycle speed limit resources and issue speed limit resources according to the remaining speed limit resource amount.

[0109] Optionally, there are the following two situations for recycling speed limit resources and issuing speed limit resources according to the remaining speed limit resource amount:

[0110] Situation 1: The remaining resource amount is greater than the second threshold.

[0111] If the remaining speed limit resource amount is greater than the second threshold, then according to the issued speed limit resource queue, speed limit resources are issued for the first bandwidth resource, and the speed limit resources of the second bandwidth resource are recycled. For example, if the remaining resource amount is greater than 0, it means that there are still remaining speed limit resources in the hardware device. The gateway device allocates speed limit resources for the first bandwidth resource in the issued speed limit resource queue and recycles the speed limit resources of the second bandwidth resource.

[0112] Optionally, if the remaining speed limit resource amount can allocate speed limit resources for all the first bandwidth resources in the issued speed limit resource queue, the gateway device allocates speed limit resources for all the first bandwidth resources. If the remaining speed limit resource amount cannot allocate speed limit resources for all the first bandwidth resources in the issued speed limit resource queue, the gateway device sequentially allocates speed limit resources for the first bandwidth resources according to the order in the issued speed limit resource queue until the remaining speed limit resource amount is 0. For example, the remaining speed limit resource amount is 5 speed limit units. If there are 4 first bandwidth resources in the issued speed limit resource queue, the gateway device can allocate speed limit resources for 4 first bandwidth resources. If there are 10 first bandwidth resources in the issued speed limit resource queue, the gateway device allocates speed limit resources for the first 5 first bandwidth resources in the issued speed limit resource queue.

[0113] Case 2: The remaining speed limit resource amount is less than or equal to the second threshold.

[0114] If the remaining speed limit resource amount is less than or equal to the second threshold, then obtain the first issuance priority of the first bandwidth resource with the highest ranking in the issued speed limit resource queue (the bandwidth resource with the highest issuance priority in the issued speed limit resource queue), and the second issuance priority of the second bandwidth resource with the highest ranking in the recycled speed limit resource queue (the bandwidth resource with the highest recycling priority in the recycled speed limit resource queue). According to the first issuance priority and the second issuance priority, recycle the speed limit resources of the second bandwidth resource and allocate speed limit resources for the first bandwidth resource.

[0115] Optionally, if the first distribution priority is greater than the second distribution priority, the rate-limiting resources of the second bandwidth resource with the highest ranking are recycled, and rate-limiting resources are allocated to the first bandwidth resource with the highest ranking. The first bandwidth resource with the highest ranking is deleted from the distribution rate-limiting resource queue, and the second bandwidth resource with the highest ranking is deleted from the recycled rate-limiting resource queue. For example, if the field of the acquisition time of the first bandwidth resource is greater than the field of the acquisition time of the second bandwidth resource, the first distribution priority is greater than the second distribution priority. When the fields of the acquisition time are the same, if the number of over-limit periods of the first bandwidth resource is greater than the number of over-limit periods of the second bandwidth resource, the first distribution priority is greater than the second distribution priority. When the fields of the number of over-limit periods are the same, if the absolute value field of the over-limit of the first bandwidth resource is greater than the absolute value field of the over-limit of the second bandwidth resource, the first distribution priority is greater than the second distribution priority. When the absolute value fields of the over-limit are the same, if the over-limit ratio field of the first bandwidth resource is greater than the over-limit ratio field of the second bandwidth resource, the first distribution priority is greater than the second distribution priority. If the over-limit ratio fields are the same, the first distribution priority is equal to the second distribution priority. For example, if the first distribution priority is greater than the second distribution priority, the gateway device will recycle the rate-limiting resources of the second bandwidth resource with the highest ranking in the recycled rate-limiting resource queue, and delete the second bandwidth resource from the recycled rate-limiting resource queue. The gateway device allocates rate-limiting resources to the first bandwidth resource with the highest ranking in the distribution rate-limiting resource queue and deletes the first bandwidth resource from the distribution rate-limiting resource queue.

[0116] If the first distribution priority is less than or equal to the second distribution priority, the recycling of the rate-limiting resources of the second bandwidth resource is stopped, and the allocation of rate-limiting resources to the first bandwidth resource is stopped. For example, if the first distribution priority is less than the second distribution priority, it means that the priority of allocating rate-limiting resources is less than the priority of recycling rate-limiting resources. The gateway device stops recycling rate-limiting resources and also stops distributing rate-limiting resources.

[0117] Next, in combination with Figure 4 , the case where the remaining resource amount is less than or equal to the second threshold is described.

[0118] Figure 4 FIG. Figure 4, including: a downlink rate-limiting resource queue and a reclaim rate-limiting resource queue. Among them, the downlink rate-limiting resource queue includes bandwidth resources such as first bandwidth resource A and first bandwidth resource B, and the reclaim rate-limiting resource queue includes bandwidth resources such as second bandwidth resource A and second bandwidth resource B. When the remaining rate-limiting resource amount is 0, compare the priorities of the first bandwidth resource A and the second bandwidth resource A. Since the priority of the first bandwidth resource A is higher than that of the second bandwidth resource A, the gateway device can reclaim the rate-limiting resources of the second bandwidth resource A and allocate the rate-limiting resources to the first bandwidth resource A. The gateway device deletes the first bandwidth resource A in the downlink rate-limiting queue and the second bandwidth resource A in the reclaim rate-limiting resource queue.

[0119] An embodiment of the present application provides a method for reclaiming rate-limiting resources and downlinking rate-limiting resources. Obtain the remaining rate-limiting resource amount. If the rate-limiting resource amount is greater than the second threshold, according to the downlink rate-limiting resource queue, downlink rate-limiting resources for the first bandwidth resource and reclaim the rate-limiting resources of the second bandwidth resource. If the remaining rate-limiting resource amount is less than or equal to the second threshold, obtain the first downlink priority of the first bandwidth resource with the highest ranking in the downlink rate-limiting resource queue and the second downlink priority of the second bandwidth resource with the highest ranking in the reclaim rate-limiting resource queue. According to the first downlink priority and the second downlink priority, reclaim the rate-limiting resources of the second bandwidth resource and allocate rate-limiting resources to the first bandwidth resource. In this way, when there are more rate-limiting resources, the gateway device can timely allocate rate-limiting resources to the first bandwidth resource. When there are fewer rate-limiting resources, the gateway device can reclaim the rate-limiting resources of the second bandwidth resource by replacing the rate-limiting resources of the second bandwidth resource and allocate them to the first bandwidth resource, thereby improving the flexibility of rate-limiting resource allocation.

[0120] Based on any of the above embodiments, below, in combination with Figure 5 , the process of the above resource allocation method will be described.

[0121] Figure 5 It is a schematic diagram of the process of a resource allocation method provided by an embodiment of the present application. Please refer to Figure 5, including: a traffic collection and calculation module and a hardware speed limit resource replacement module. Among them, the traffic collection and calculation module can obtain multiple bandwidth resources to obtain a bandwidth resource set. The bandwidth resource set includes multiple bandwidth resources such as bandwidth resource A, bandwidth resource B, and bandwidth resource C. The gateway device determines multiple first bandwidth resources and multiple second bandwidth resources among the multiple bandwidth resources, and sorts the multiple first bandwidth resources according to the speed limit resource allocation sorting method to obtain a downlink speed limit resource queue, and sorts the multiple second bandwidth resources according to the speed limit resource recovery sorting method to obtain a recovery speed limit resource queue. Among them, the downlink speed limit resource queue includes bandwidth resources such as first bandwidth resource A and first bandwidth resource B, and the recovery speed limit resource queue includes bandwidth resources such as second bandwidth resource A and second bandwidth resource B.

[0122] Please refer to Figure 5 , the gateway device, according to the hardware speed limit resource replacement module, recovers the speed limit resources of the second bandwidth resources in the recovery speed limit resource queue in the queue order, and allocates speed limit resources for the first bandwidth resources in the downlink speed limit resource queue in the queue order. In this way, the gateway device can flexibly recover the allocated speed limit resources according to the recovery speed limit resource queue, and flexibly issue speed limit resources according to the downlink speed limit resource queue. By dynamically adjusting the speed limit resources, the flexibility of speed limit resource allocation can be improved.

[0123] Figure 6 It is a schematic structural diagram of a resource allocation device provided by an embodiment of the present application. Please refer to Figure 6 , the resource allocation device 10 includes an acquisition module 11, a determination module 12, and a control module 13, where:

[0124] The acquisition module 11 is used to obtain network traffic information of multiple bandwidth resources;

[0125] The determination module 12 is used to determine, according to the network traffic information, a first bandwidth resource for which speed limit resources are to be allocated and a second bandwidth resource for which speed limit resources are to be recovered among the multiple bandwidth resources;

[0126] The control module 13 is used to recover the speed limit resources of the second bandwidth resources and allocate speed limit resources for the first bandwidth resources.

[0127] In a possible implementation manner, the determination module 12 is specifically used for:

[0128] Determine a speed limit resource allocation flag bit corresponding to each bandwidth resource according to the network traffic information, and the speed limit resource allocation flag bit is used to indicate whether the bandwidth resource has been allocated speed limit resources;

[0129] Determine the first bandwidth resource and the second bandwidth resource from the multiple bandwidth resources according to the speed limit resource allocation flag bit.

[0130] In a possible implementation manner, the determining module 12 is specifically configured to:

[0131] If the speed limit resource allocation flag bit corresponding to the bandwidth resource is the first preset bit, determine that the bandwidth resource is the second bandwidth resource;

[0132] If the speed limit resource allocation flag bit corresponding to the bandwidth resource is the second preset bit, determine the number of over-speed limit periods corresponding to the bandwidth resource according to the network traffic information, and determine the first bandwidth resource according to the number of over-speed limit periods. The number of over-speed limit periods is the cumulative number of statistical periods in which the network rate of the bandwidth resource is greater than the first preset rate.

[0133] In a possible implementation manner, the determining module 12 is specifically configured to:

[0134] If the number of over-speed limit periods is greater than or equal to the first threshold, determine that the bandwidth resource is the first bandwidth resource;

[0135] If the number of over-speed limit periods is less than the first threshold, determine that the bandwidth resource is the third bandwidth resource. The third bandwidth resource is a bandwidth resource for which speed limit resources do not need to be allocated or recycled.

[0136] In a possible implementation manner, the control module 13 is specifically configured to:

[0137] Determine the network parameters corresponding to each bandwidth resource according to the network traffic information. The network parameters include at least one of the following: the acquisition time of the network traffic information, the number of over-speed limit periods, the absolute value of over-speed limit, and the over-speed limit ratio. The absolute value of over-speed limit is the value of the absolute number of consecutive network rates greater than or equal to the second preset rate in the previous period, and the over-speed limit ratio is the ratio of the network rate greater than or equal to the second preset rate in the previous period;

[0138] Sort the first bandwidth resources according to the acquisition time, the number of over-speed limit periods, the absolute value of over-speed limit, and the over-speed limit ratio to obtain the queue for distributing speed limit resources, and sort the second bandwidth resources to obtain the queue for recycling speed limit resources;

[0139] Recycle the speed limit resources of the second bandwidth resource according to the queue for recycling speed limit resources, and allocate the speed limit resources to the first bandwidth resource according to the queue for distributing speed limit resources.

[0140] In a possible implementation manner, the control module 13 is specifically configured to:

[0141] Obtain the remaining speed limit resources.

[0142] If the remaining speed limit resources are greater than the second threshold, then according to the issued speed limit resource queue, issue speed limit resources for the first bandwidth resource, and recycle the speed limit resources of the second bandwidth resource.

[0143] If the remaining speed limit resources are less than or equal to the second threshold, then obtain the first issue priority of the first bandwidth resource with the highest ranking in the issued speed limit resource queue, and the second issue priority of the second bandwidth resource with the highest ranking in the recycled speed limit resource queue. According to the first issue priority and the second issue priority, recycle the speed limit resources of the second bandwidth resource, and allocate speed limit resources for the first bandwidth resource.

[0144] In a possible implementation manner, the control module 13 is specifically configured to:

[0145] If the first issue priority is greater than the second issue priority, then recycle the speed limit resources of the second bandwidth resource with the highest ranking, and allocate speed limit resources for the first bandwidth resource with the highest ranking, and delete the first bandwidth resource with the highest ranking in the issued speed limit resource queue, and delete the second bandwidth resource with the highest ranking in the recycled speed limit resource queue.

[0146] If the first issue priority is less than or equal to the second issue priority, then stop recycling the speed limit resources of the second bandwidth resource, and stop allocating speed limit resources for the first bandwidth resource.

[0147] The resource allocation device provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, and will not be elaborated here.

[0148] Figure 7 It is a schematic hardware structure diagram of the terminal device provided by the present application. Please refer to Figure 7 , the terminal device 20 may include: a processor 21 and a memory 22. Among them, the processor 21 and the memory 22 can communicate; exemplarily, the processor 21 and the memory 22 communicate through a communication bus 23. The memory 22 is used to store program instructions, and the processor 21 is used to call the program instructions in the memory to execute the resource allocation method shown in any of the above method embodiments.

[0149] Optionally, the terminal device 20 may further include a communication interface, and the communication interface may include a transmitter and / or a receiver.

[0150] Optionally, the above-mentioned processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0151] An embodiment of the present application provides a readable storage medium, on which a computer program is stored; the computer program is used to implement the resource allocation method as described in any of the above embodiments.

[0152] An embodiment of the present application provides a computer program product, which includes instructions that, when executed, cause a computer to execute the above-mentioned resource allocation method.

[0153] All or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program may be stored in a readable memory. When the program is executed, it executes the steps including the above method embodiments; and the foregoing memory (storage medium) includes: read-only memory (abbreviation: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.

[0154] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processing machine, or other programmable terminal devices to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal devices generate for implementing in the process Figure 1 one process or multiple processes and / or blocks Figure 1 a device for the functions specified in one block or multiple blocks.

[0155] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device, and the instruction device implements the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks.

[0156] These computer program instructions can also be loaded onto a computer or other programmable terminal device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks.

[0157] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these changes and modifications.

[0158] In the present application, the term "including" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". In the present application, the terms "first", "second", etc. are used to distinguish similar objects and do not necessarily have to describe a specific order or sequence. In the present application, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

Claims

1. A resource allocation method, characterized in that, Including: Obtaining network traffic information of multiple bandwidth resources; According to the network traffic information, determining a first bandwidth resource for which speed limit resources are to be allocated and a second bandwidth resource for which speed limit resources are to be recycled among the multiple bandwidth resources; Obtaining the remaining amount of speed limit resources; If the remaining amount of speed limit resources is greater than a second threshold, allocating speed limit resources to the first bandwidth resource according to the issued speed limit resource queue and recycling the speed limit resources of the second bandwidth resource; If the remaining amount of speed limit resources is less than or equal to the second threshold, obtaining a first issued priority of the first bandwidth resource with the highest ranking in the issued speed limit resource queue and a second issued priority of the second bandwidth resource with the highest ranking in the speed limit resource recycling queue, and according to the first issued priority and the second issued priority, recycling the speed limit resources of the second bandwidth resource and allocating speed limit resources to the first bandwidth resource.

2. The method according to claim 1, wherein According to the network traffic information, determining a first bandwidth resource for which speed limit resources are to be allocated and a second bandwidth resource for which speed limit resources are to be recycled among the multiple bandwidth resources includes: According to the network traffic information, determining a speed limit resource allocation flag bit corresponding to each bandwidth resource, where the speed limit resource allocation flag bit is used to indicate whether the bandwidth resource has been allocated speed limit resources; According to the speed limit resource allocation flag bit, determining the first bandwidth resource and the second bandwidth resource among the multiple bandwidth resources.

3. The method according to claim 2, wherein For any one of the bandwidth resources; According to the speed limit resource allocation flag bit, determining the first bandwidth resource and the second bandwidth resource among the multiple bandwidth resources includes: If the speed limit resource allocation flag bit corresponding to the bandwidth resource is a first preset bit, determining the bandwidth resource as the second bandwidth resource; If the speed limit resource allocation flag bit corresponding to the bandwidth resource is a second preset bit, determining the number of over-speed limit cycles corresponding to the bandwidth resource according to the network traffic information, and determining the first bandwidth resource according to the number of over-speed limit cycles, where the number of over-speed limit cycles is the cumulative number of statistical periods in which the network rate of the bandwidth resource is greater than a first preset rate.

4. The method according to claim 3, characterized in that, Determining the first bandwidth resource according to the number of over-speed limit cycles includes: If the number of over-speed limit cycles is greater than or equal to a first threshold, determining the bandwidth resource as the first bandwidth resource; If the number of over-speed limit cycles is less than the first threshold, determining the bandwidth resource as a third bandwidth resource, where the third bandwidth resource is a bandwidth resource for which speed limit resources do not need to be allocated or recycled.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: According to the network traffic information, determining network parameters corresponding to each bandwidth resource, where the network parameters include at least one of the following: the acquisition time of the network traffic information, the number of over-speed limit cycles, the absolute value of over-speed limit, and the over-speed limit ratio, where the absolute value of over-speed limit is the value of the absolute number of times the network rate is continuously greater than or equal to a second preset rate in the previous period, and the over-speed limit ratio is the proportion of the network rate greater than or equal to the second preset rate in the previous period; Sort the first bandwidth resources according to the acquisition time, the number of over-speed periods, the absolute value of over-speed, and the over-speed ratio to obtain the queue of allocated bandwidth resources with speed limits, and sort the second bandwidth resources to obtain the queue of recycled bandwidth resources with speed limits.

6. The method according to claim 5, wherein Recycle the bandwidth resources with speed limits of the second bandwidth resources and allocate bandwidth resources with speed limits to the first bandwidth resources according to the first allocation priority and the second allocation priority, including: If the first allocation priority is greater than the second allocation priority, recycle the bandwidth resources with speed limits of the second bandwidth resource with the highest ranking, and allocate bandwidth resources with speed limits to the first bandwidth resource with the highest ranking, and delete the first bandwidth resource with the highest ranking from the queue of allocated bandwidth resources with speed limits, and delete the second bandwidth resource with the highest ranking from the queue of recycled bandwidth resources with speed limits; If the first allocation priority is less than or equal to the second allocation priority, stop recycling the bandwidth resources with speed limits of the second bandwidth resources and stop allocating bandwidth resources with speed limits to the first bandwidth resources.

7. A resource allocation device, characterized in that, It includes an acquisition module, a determination module, and a control module, where: The acquisition module is used to acquire the network traffic information of multiple bandwidth packets; The determination module is used to determine, according to the network traffic information, the first bandwidth packet to which bandwidth resources with speed limits are to be allocated and the second bandwidth packet for which bandwidth resources with speed limits are to be recycled among the multiple bandwidth packets; The control module is used to acquire the remaining amount of bandwidth resources with speed limits; If the remaining amount of bandwidth resources with speed limits is greater than the second threshold, allocate bandwidth resources with speed limits to the first bandwidth packet according to the queue of allocated bandwidth resources with speed limits, and recycle the bandwidth resources with speed limits of the second bandwidth resources; If the remaining amount of bandwidth resources with speed limits is less than or equal to the second threshold, acquire the first allocation priority of the first bandwidth resource with the highest ranking in the queue of allocated bandwidth resources with speed limits, and the second allocation priority of the second bandwidth resource with the highest ranking in the queue of recycled bandwidth resources with speed limits, and recycle the bandwidth resources with speed limits of the second bandwidth resources and allocate bandwidth resources with speed limits to the first bandwidth resources according to the first allocation priority and the second allocation priority.

8. A terminal device, characterized in that, It includes: A processor and a memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the resource allocation method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by the processor, they are used to implement the resource allocation method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes instructions, and when the instructions are executed by the processor, they are used to implement the resource allocation method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Flow control method and device

    CN108833292A