WO2021169299A1 - 用户带宽控制方法、装置、计算机设备及存储介质 - Google Patents

用户带宽控制方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021169299A1
WO2021169299A1 PCT/CN2020/119138 CN2020119138W WO2021169299A1 WO 2021169299 A1 WO2021169299 A1 WO 2021169299A1 CN 2020119138 W CN2020119138 W CN 2020119138W WO 2021169299 A1 WO2021169299 A1 WO 2021169299A1
Authority
WO
WIPO (PCT)
Prior art keywords
bandwidth
actual bandwidth
preset
user
physical machine
Prior art date
Application number
PCT/CN2020/119138
Other languages
English (en)
French (fr)
Inventor
匡光彩
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021169299A1 publication Critical patent/WO2021169299A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/78Architectures of resource allocation
    • H04L47/783Distributed allocation of resources, e.g. bandwidth brokers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • This application relates to the field of big data technology, and in particular to a user bandwidth control method, device, computer equipment, and computer-readable storage medium based on distributed multi-physical machines.
  • the router receives external traffic and first allocates it to the primary physical machine A for processing, and the physical machine B does not participate in the traffic. Processing, if the main physical machine A is down, the router will distribute the received business traffic to the standby physical machine B for processing, and the physical machine B starts to work, and the physical machine A does not work. Because there are the main physical machine A and the standby physical machine B. There are two classifications. Either physical machine A is working or physical machine B is working. There is always one of physical machine A and physical machine B in an idle state, which makes the performance of the physical machine unable to be fully used, and the physical machine cannot be scaled horizontally. When the business continues to increase, there will be performance bottlenecks.
  • FIG. 2 is a schematic diagram of the architecture of the traffic folding method provided by an embodiment of the application. As shown in FIG. 2, the physical machine A and the physical machine B work at the same time, but the physical machine A and the physical machine B have a division of labor, for example, The business traffic of user 2 is divided into two parts: user 2 (1) and user 2 (2).
  • Physical machine A processes the traffic of user 1 and user 2 (1)
  • physical machine B processes the traffic of user 2 (2) and user 3
  • the router receives external traffic, and distributes the received traffic to physical machine A or physical machine B according to the preset settings. For example, the router receives the business traffic of user 1, and distributes the business traffic of user 1 to physical machine A for processing , Even if physical machine B receives the service traffic of user 1, it will forward it to physical machine A for processing.
  • the router receives the service traffic of user 2 (2) and distributes the service traffic of user 2 (2) to physical machine B Processing, even if physical machine A receives the service traffic of user 2(2), it will be forwarded to physical machine B for processing.
  • This application provides a user bandwidth control method, device, computer equipment, and computer-readable storage medium based on distributed multi-physical machines, which can solve the problem of low efficiency in the use of physical machine performance in the traditional technology of bandwidth limitation.
  • this application provides a user bandwidth control method based on distributed multi-physical machines, which is applied to each physical machine in a distributed deployment in the same network.
  • the method includes: obtaining a first actual bandwidth, and An actual bandwidth is the actual bandwidth occupied by the router on the first physical machine by the service traffic of the preset user sent by the router in a random manner; receiving the second actual bandwidth sent by each of the other second physical machines through the synchronization technology, the second The actual bandwidth is the actual bandwidth occupied by the service traffic of the preset user on each of the other second physical machines, where each second physical machine receives the service traffic of the preset user individually Is obtained by the router allocating the service traffic of the preset user in the random manner; obtaining the preset threshold of the bandwidth packet of the preset user; according to the first actual bandwidth, the first 2.
  • the actual bandwidth and the preset threshold are used to control the bandwidth of the preset user on the first physical machine according to a preset control manner.
  • the present application also provides a user bandwidth control device based on distributed multi-physical machines, which is applied to each physical machine distributedly deployed in the same network, and includes: a first obtaining unit, configured to obtain the first actual Bandwidth, the first actual bandwidth is the actual bandwidth occupied on the first physical machine by the service traffic of the preset user sent by the router in a random manner; the receiving unit is used to receive each other second physical machine sent by synchronization technology The second actual bandwidth is the actual bandwidth occupied by the service traffic of the preset user on each of the other second physical machines, where each second physical machine is The received service flow of the preset user is obtained by the router allocating the service flow of the preset user in the random manner; the second obtaining unit is configured to obtain the bandwidth of the preset user The preset threshold of the packet; a control unit, configured to control the preset user's access to the preset user on the first physical machine according to the preset control method according to the first actual bandwidth, the second actual bandwidth, and the preset threshold. Bandwidth is controlled.
  • the present application also provides a computer device, which includes a memory and a processor, and a computer program is stored on the memory.
  • the processor runs the computer program, the following steps are executed: obtaining the first actual bandwidth, The first actual bandwidth is the actual bandwidth occupied on the first physical machine by the preset user's service traffic sent by the router in a random manner; receiving the second actual bandwidth sent by each of the other second physical machines through the synchronization technology, so The second actual bandwidth is the actual bandwidth occupied by the service traffic of the preset user on each of the other second physical machines, where each of the preset users received by each second physical machine
  • the service traffic is obtained by the router allocating the service traffic of the preset user in the random manner; obtaining the preset threshold of the bandwidth packet of the preset user; according to the first actual bandwidth, The second actual bandwidth and the preset threshold are used to control the bandwidth of the preset user on the first physical machine according to a preset control manner.
  • the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the following steps: The actual bandwidth, the first actual bandwidth is the actual bandwidth occupied by the preset user’s service traffic sent by the router in a random manner on the first physical machine; receiving the second actual data sent by each of the other second physical machines through synchronization technology Bandwidth, the second actual bandwidth is the actual bandwidth occupied by the service traffic of the preset user on each of the other second physical machines, wherein each of the second physical machines receives the The service flow of the preset user is obtained by the router allocating the service flow of the preset user in the random manner; the preset threshold of the bandwidth packet of the preset user is acquired; according to the first The actual bandwidth, the second actual bandwidth, and the preset threshold are used to control the bandwidth of the preset user on the first physical machine according to a preset control manner.
  • this application obtains the first actual bandwidth, where the first actual bandwidth is the actual bandwidth occupied on the first physical machine by the service traffic of the preset user sent by the router in a random manner ; Receive the second actual bandwidth sent by each other second physical machine through the synchronization technology, the second actual bandwidth is the actual occupation of the preset user's business traffic on each of the other second physical machines Bandwidth, further acquiring the preset threshold of the bandwidth package of the preset user, and according to the first actual bandwidth, the second actual bandwidth, and the preset threshold, the first physical machine is controlled in a preset control manner. Controlling the bandwidth of the preset user can accurately implement rate limiting on the bandwidth of the preset user on the first physical machine, improve the utilization efficiency of the performance of the physical machine, and realize the accuracy of user flow control.
  • FIG. 1 is a schematic diagram of the architecture of a master/standby speed limit method provided by an embodiment of the application
  • FIG. 2 is a schematic structural diagram of a traffic folding method provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of an application environment of a user bandwidth control method based on distributed multi-physical machines provided by an embodiment of the application;
  • FIG. 4 is a schematic flowchart of a user bandwidth control method based on distributed multi-physical machines provided by an embodiment of the application;
  • FIG. 5 is a schematic diagram of an application environment architecture of a user bandwidth control method based on distributed multi-physical machines provided by an embodiment of the application;
  • FIG. 6 is a schematic diagram of another application environment of the user bandwidth control method based on distributed multi-physical machines provided by an embodiment of the application;
  • FIG. 7 is a schematic block diagram of a user bandwidth control apparatus based on distributed multi-physical machines according to an embodiment of the application.
  • FIG. 8 is a schematic block diagram of a computer device provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of an application environment of a user bandwidth control method based on distributed multi-physical machines provided by an embodiment of the application.
  • the router receives the bandwidth packet traffic transmitted from the outside, and according to the random traffic distribution algorithm configured by the router itself, distributes the user's business traffic to any one of physical machine 1, physical machine 2 or physical machine 3 in Figure 3 in a random manner.
  • a router is a hardware device that connects two or more networks and acts as a gateway between networks. It is a dedicated intelligent network device that reads the address in each data packet and then decides how to transmit it.
  • Physical machine Physical machine.
  • a physical machine refers to a physical machine, a server in a real physical form, and a physical device in a physical form relative to a cloud server.
  • the physical machines in FIG. 3 include physical machine 1, physical machine 2, and physical machine 3.
  • the physical machines in the embodiments of the present application refer to physical machines.
  • each subject in Figure 3 receives the service traffic of user 1 transmitted from the external network, and randomly distributes the service traffic of user 1 to the physical machine 1 and the physical machine according to the random flow distribution algorithm configured on the router.
  • the router receives the service traffic of user 1 transmitted from the external network, and randomly distributes the service traffic of user 1 to the physical machine 1 and the physical machine according to the random flow distribution algorithm configured on the router.
  • 2 or any one of physical machines 3 for processing, physical machine 1, physical machine 2 and physical machine 3 use multicast technology and other synchronous methods to transmit their respective user 1’s business traffic on their respective physical machines
  • the actual bandwidth is based on the preset threshold of the user’s bandwidth package set based on the upper limit of the bandwidth purchased by the user.
  • Each physical machine is based on the first actual bandwidth of user 1 on its own machine and the services of user 1 on each other physical machine.
  • the second actual bandwidth occupied by the traffic on the physical machine corresponding to itself is limited according to the preset control method for the bandwidth of the preset user on the physical machine.
  • Physical machine 1, physical machine 2 and physical machine 3 are all According to the foregoing manner, the actual bandwidth occupied by the service flow of user 1 is limited, so that the total actual bandwidth occupied by the service flow of user 1 is limited.
  • Each physical machine also limits the total bandwidth occupied by user 2 and user 3’s respective business traffic through the above method to complete physical machine 1, physical machine 2, and physical machine 3 for user 1, user 2, and user 3 respectively.
  • the bandwidth occupied by the business traffic is limited.
  • FIG. 4 is a schematic flowchart of a user bandwidth control method based on distributed multi-physical machines provided by an embodiment of the application.
  • the user bandwidth control method based on distributed multi-physical machines is applied to the physical machine 1 shown in FIG. 3 , Physical machine 2 and physical machine 3.
  • the method includes the following steps S401-S404:
  • bandwidth English as Band Width
  • bandwidth also known as bandwidth or channel width
  • bandwidth refers to the amount of data that can be transmitted in a unit of time (usually 1 second), used to describe the allowable channel The highest frequency signal to pass.
  • the bandwidth is similar to that of an expressway. The larger the bandwidth, the more lanes that resemble an expressway and the stronger its traffic capacity.
  • the performance of each physical machine cannot be fully utilized, and the performance of the physical machine cannot be expanded.
  • the traffic folding method is adopted, even if the traffic of a user is assigned to be distributed to different physical machines for processing, for example, the user's traffic is distributed to different physical machines for processing according to the traffic type, so that multiple physical machines can process one user at the same time.
  • the traffic in the bandwidth package belonging to the user is distributed to multiple physical machines for processing, the function of full-active rate limiting cannot be realized, that is, when the traffic in the bandwidth package is distributed to multiple physical machines, Multiple physical machines cannot jointly implement precise rate limiting on a single user's bandwidth package, and the total bandwidth occupied by the user's business traffic cannot achieve precise rate limiting so as not to allow the total bandwidth to exceed the bandwidth purchased by the user.
  • the full-live rate limit means that if multiple physical machines process the same user's business traffic at the same time, the multiple physical machines simultaneously limit the bandwidth occupied by the user's business traffic at the same time to achieve the user's business.
  • the total bandwidth occupied by the traffic is controlled.
  • the full-live rate limit refers to the processing of a bandwidth packet by multiple physical machines, and multiple physical machines limit the rate of the bandwidth packet at the same time.
  • the service traffic of user 1 is distributed to physical machine 1, physical machine 2, or physical machine 3 for processing, so as to realize the full-active speed limit of user 1's bandwidth package on physical machine 1, physical machine 2 and physical machine 3 at the same time
  • the effect is that the actual bandwidth occupied by the service traffic of user 1 on physical machine 1, physical machine 2 and physical machine 3 is respectively limited at the same time, so that the speed of physical machine 1, physical machine 2 and physical machine 3
  • the total actual bandwidth occupied by user 1's business traffic does not exceed the upper bandwidth limit of user 1, and the upper bandwidth limit of user 1 generally refers to the bandwidth purchased by the user.
  • the router controls which physical machine the bandwidth packet traffic is sent to according to the allocation algorithm, and the router only controls which physical machine the traffic is forwarded to.
  • BGP Border Gateway Protocol
  • ECMP English for Equal-CostMultipathRouting
  • BFD Bidirectional Forwarding Detection
  • the first physical machine obtains the first actual bandwidth occupied by the service traffic of the preset user sent by the router in a random manner on the first physical machine corresponding to it, because in the embodiment of the present application, the router The user's business traffic is distributed to different physical machines in a random manner. The randomness of random distribution can achieve the effects of horizontal expansion of multiple physical machines and high available bandwidth.
  • the physical machine 1 obtains the first actual bandwidth occupied on the physical machine 1 by the service traffic of the user 1 randomly sent by the router.
  • shared bandwidth package (Bandwidth Package in English, BWP for short) is a multi-IP aggregation mode.
  • BWP Bandwidth Package
  • bandwidth aggregation charging can be realized through the shared bandwidth package.
  • the traffic packets corresponding to the multiple IPs in the shared bandwidth package are randomly distributed to the physical machine for traffic processing according to the traffic distribution algorithm, for example, by ABCDE A shared bandwidth package formed by the aggregation of five IPs.
  • the router randomly distributes the service traffic of the five IPs of ABCDE according to the traffic distribution algorithm to distribute the five services corresponding to the five IPs of ABCDE.
  • the traffic packets are distributed to different physical machines for processing.
  • the directional forwarding method due to the directional forwarding method, it can only be forwarded to the preset physical machine, and there is no way to flexibly forward to the newly-added physical machine or avoid forwarding to the failed physical machine. Therefore, the preset fixed forwarding method is adopted.
  • the realization of directional forwarding cannot make full use of the horizontal high scalability of multiple physical machines to realize the flexible forwarding of traffic. For example, when a new physical machine is added, or when a physical machine fails, it must be reset through manual intervention to realize forwarding to the newly added physical machine or avoid forwarding to the failed physical machine.
  • the router uses random forwarding to forward traffic to any physical machine in the physical unit, and then it can forward the traffic to the newly added physical machine, or avoid forwarding the traffic to the failed physical machine. , And only forward to the physical machine in the normal state. Therefore, in this embodiment of the application, the router sends traffic to multiple distributed physical machines in a random manner. Due to the randomness of random forwarding, the traffic on each physical machine is uncertain for a user’s traffic. At the same time, through the random forwarding method, due to the probability of random forwarding, when the physical machine needs to be expanded, only the physical machine connection needs to be added to the distributed physical machine group to realize the horizontal expansion of multiple physical machines without human intervention. Settings to achieve flexibility in adding physical machines. At the same time, since the traffic is distributed in a random manner in the embodiment of the present application, it can be controlled that the traffic will not be distributed to the physical machine that has a fault.
  • the traffic distribution algorithm configured by the router may be a common algorithm of the switch, such as IP_HASH.
  • FIG. 5 is a schematic diagram of an application environment architecture of a user bandwidth control method based on distributed multi-physical machines provided by an embodiment of this application. Another application environment schematic diagram of the user bandwidth control method for multi-physical machines.
  • the CXP board is an IO controller, a device that controls the output and input of the flow, including the output port 192.168.1.1, the input port includes 192.168.1.5 and 192.168.2.1, and the input flow passes through 192.168.1.1 Ports are randomly assigned to speed-limiting gateway 1, speed-limiting gateway 2 or speed-limiting gateway 3 for input and output control, and the traffic after speed-limiting through speed-limiting gateway 1, speed-limiting gateway 2 or speed-limiting gateway 3 passes through the input port 192.168.
  • the output flow is the reverse process of the input flow, that is, the traffic passing through the NAT gateway 1 is randomly allocated to the speed limit gateway 1, the speed limit gateway 2 or the speed limit gateway 3 through the port 192.168.2.1, and then passes through the port 192.168.1.1 output.
  • the distributed multi-physical machine control method for user bandwidth in the embodiment of this application is not only suitable for "upload” traffic from the outside to the inside, that is, access
  • the "incoming" traffic of the physical machine such as the upload speed limit for uploading movies, songs or pictures
  • the downloading traffic from the inside to the outside that is, the "output” traffic, such as the download speed limit for downloading movies, songs or pictures.
  • S402. Receive a second actual bandwidth sent by each of the other second physical machines through synchronization technology, where the second actual bandwidth is the amount occupied by the service traffic of the preset user on each of the other second physical machines.
  • the actual bandwidth, wherein the service traffic of the preset user received by each of the second physical machines is obtained by the router allocating the service traffic of the preset user in the random manner.
  • the router sends the traffic of the same user to multiple physical machines in a distributed manner in a random manner, the service traffic allocated on each physical machine is uncertain and different from each other.
  • the actual bandwidth packet data of the user on the physical machine is inconsistent with the traffic data allocated from the router. For example, if there are three users of ABC visiting a website, the traffic of users of this website may be very large.
  • the router receives the total traffic bandwidth package M'including traffic bandwidth package M1' corresponding to user A and traffic bandwidth.
  • Package M2’ corresponds to user B and traffic bandwidth package M3’ corresponds to user C.
  • the router distributes traffic bandwidth package M1’ to physical machine 1 according to the traffic distribution algorithm.
  • the actual bandwidth of traffic bandwidth package M1’ on physical machine 1 is M1.
  • Bandwidth package M2' is allocated to physical machine 2
  • the actual bandwidth of traffic bandwidth package M2' on physical machine 2 is M2
  • traffic bandwidth package M3' is allocated to physical machine 3.
  • the first physical machine receives each of the other second physical machines in the physical machine group to which the multiple physical machines in distributed deployment belong.
  • the second actual bandwidth occupied by the physical machine is synchronized between multiple physical machines, so that each first physical machine obtains the service traffic of the users in the distributed deployment of the physical machine group.
  • the second actual bandwidth occupied by each physical machine can then be implemented between multiple physical machines to achieve the same bandwidth package full-active speed limit function, and the preset user’s business traffic is calculated separately on other physical machines.
  • the second actual bandwidth is the sum of the actual bandwidth occupied by the service traffic of the preset user on all other physical machines, so that the total service traffic of the preset user on all other physical machines can be accurately obtained.
  • the actual bandwidth of the preset user, where each of the other second physical machines received the service traffic of the preset user is also obtained by the router allocating the service traffic of the preset user in the random manner of.
  • the router distributes the traffic of user 1 to physical machine 1, physical machine 2, or physical machine 3 in a random manner.
  • Physical machine 1 receives the service traffic of user 1 sent by physical machine 2 through synchronization technology.
  • the second actual bandwidth occupied by physical machine 2 physical machine 1 receives the second actual bandwidth occupied by user 1’s service traffic on physical machine 3 sent by physical machine 3 through the synchronization technology, and the second actual bandwidth occupied by user 1’s service traffic on physical machine 3
  • the second actual bandwidth occupied by machine 2 is summed with the second actual bandwidth occupied by user 1’s service traffic on physical machine 3 to obtain the total amount of user 1’s service traffic on physical machine 2 and physical machine 3.
  • the step of receiving the second actual bandwidth sent by each of the other second physical machines via synchronization technology includes:
  • the physical machines send the actual bandwidth occupied by the service traffic of the preset user on the respective physical machines through multicast, so that multiple physical machines use multicast technology to synchronize the bandwidth packets between each other.
  • a first physical machine receives the second actual bandwidth occupied on the respective physical machine by the service traffic of the preset user sent by each other second physical machine in a multicast manner.
  • multicast Multicast in English transmission realizes a point-to-multipoint network connection between the sender and each receiver.
  • Physical machine 1, physical machine 2 and physical machine 3 use multicast to synchronize the actual bandwidth occupied by each user's business traffic on their respective physical machines. For example, physical machine 1 obtains routers according to the random traffic The first actual bandwidth occupied by the service traffic of user 1 sent by the allocation algorithm on physical machine 1, and the second actual bandwidth occupied by the service traffic of user 1 on physical machine 2 sent by physical machine 2 through multicast. Actual bandwidth, physical machine 1 receives the second actual bandwidth occupied by user 1’s service traffic on physical machine 3 sent by physical machine 3 through multicast, and puts the second actual bandwidth occupied by user 1’s service traffic on physical machine 2 on physical machine 2. 2. The actual bandwidth is summed with the second actual bandwidth occupied by the service traffic of user 1 on the physical machine 3 to obtain the common share of the service traffic of the user 1 on the physical machine 2 and the physical machine 3 belonging to the same physical group. The actual bandwidth occupied.
  • the physical machine group can contain two or more physical machines
  • the user’s business traffic on each of the other second physical machines will be different.
  • the sum of the occupied second actual bandwidth is the actual bandwidth jointly occupied by all other physical machines.
  • other physical machines can include one physical machine or multiple physical machines. Therefore, the actual bandwidth occupied by each other second physical machine can be that of user 1.
  • the actual bandwidth occupied by the service traffic on one physical machine may also be the sum of the second actual bandwidth occupied by the service traffic of the user 1 on the other multiple physical machines.
  • unicast can also be used, but the use of unicast will double the communication traffic.
  • S403 Acquire a preset threshold of the bandwidth package of the preset user.
  • the preset threshold of the bandwidth package of the preset user refers to the total upper limit of the bandwidth package of the preset user.
  • the total upper limit of the bandwidth package generally refers to the upper limit of the bandwidth purchased by the user.
  • the corresponding bandwidth upper limit value is set for the user, so as to obtain the corresponding data according to the size of the bandwidth package purchased by the user. It can be called a total bandwidth package, for example, the total upper limit of the bandwidth package is 6Mb/s.
  • the total upper limit of the bandwidth package refers to the upper limit of the bandwidth that the user rents in the network rental service.
  • a bandwidth package defines the rate of traffic, such as 1M/s. Please continue to refer to Figure 3, the physical machine 1 obtains the total upper limit of the bandwidth package of the user 1, and the total upper limit of the bandwidth package of the user 1 is the bandwidth purchased by the user 1.
  • the sum of the first actual bandwidth and all the second actual bandwidths is the total bandwidth.
  • the total bandwidth refers to the total actual bandwidth occupied on all physical machines by the bandwidth packets corresponding to the service traffic of the same user, which can also be called the total bandwidth.
  • the upper limit is used to describe the actual bandwidth required by the user's business traffic.
  • the first physical machine determines the relationship between the total upper limit of the bandwidth of the service traffic sent by the user and the total upper limit of the bandwidth package purchased by the user, that is, the first physical machine determines the relationship between the first actual bandwidth and the second actual bandwidth.
  • the preset threshold controlling the bandwidth of the preset user on the first physical machine according to a preset control manner.
  • the user's traffic may not be controlled, or the actual bandwidth occupied by the user's business traffic on the first physical machine can be increased to the bandwidth purchased by the user
  • the upper limit of the total package to improve the ability to process the user’s business traffic; if the total upper limit of the bandwidth of the service traffic sent by the user is greater than the total upper limit of the bandwidth package purchased by the user, the actual bandwidth occupied by the user’s business traffic on the first physical machine is reduced to the user
  • the total upper limit of the purchased bandwidth package is used to control the actual bandwidth used by the user to prevent the actual bandwidth occupied by the user's business traffic on the first physical machine from being greater than the total upper limit of the bandwidth package purchased by the user, resulting in out of control of bandwidth resources and achieving a moderate Reasonable allocation of bandwidth resources.
  • the physical machine 1 calculates the total bandwidth of the bandwidth package corresponding to the service traffic of the user 1 according to the first actual bandwidth and the second actual bandwidth, and the physical machine 1 calculates the total bandwidth of the bandwidth package according to the total bandwidth of the bandwidth package.
  • the bandwidth of the user 1 on the physical machine 1 is controlled according to a preset control method. For example, if the total upper limit of the bandwidth package purchased by the user is 6MB, the bandwidth required for the service traffic sent by the user is 4M, and the total upper limit of the bandwidth package purchased by the user can meet the bandwidth requirements of the user’s service traffic, the physical machine 1 may not affect the user’s traffic.
  • physical machine 1 can also increase the actual bandwidth occupied by the user’s business traffic on physical machine 1 to the upper limit of the total bandwidth package purchased by the user to improve the ability to process the user’s business traffic.
  • the upper limit is 6MB
  • the bandwidth required for the business traffic sent by the user is 8MB.
  • the total upper limit of the bandwidth package purchased by the user cannot meet the bandwidth requirements of the user’s business traffic.
  • Physical machine 1 needs to reduce the amount occupied by the user's business traffic on physical machine 1.
  • the actual bandwidth is up to the total upper limit of the bandwidth package purchased by the user to limit the user's business traffic to avoid the actual bandwidth occupied by the user's business traffic on the physical machine 1 being greater than the total upper limit of the bandwidth package purchased by the user to achieve a reasonable and reasonable allocation of bandwidth Resources, otherwise, the actual bandwidth occupied by the user will exceed the total upper limit of the bandwidth package purchased by the user, resulting in loss of control and waste of bandwidth resources.
  • physical machine 2 and physical machine 3 also adopt the same bandwidth control method as that on physical machine 1, so as to control the total bandwidth of the same user on physical machine 1, physical machine 2 and physical machine 3 at the same time. The total bandwidth of the user does not exceed the bandwidth purchased by the user.
  • the service traffic of the same user is distributed to different physical machines in a random manner through the router, because the router distributes the service traffic of the same user to different physical machines in a random manner.
  • the router instead of being directed to the designated physical machine, not only can the performance of each physical machine be fully utilized to achieve high availability of the physical machine, and to avoid the physical machine’s resources and performance caused by the idleness of the physical machine. Waste, you can also add new physical machines as needed to realize the horizontal and flexible expansion of the physical machines, and can prevent the router from sending the user's business traffic to the failed physical machine to cause business loss, thereby achieving high performance of the physical machine Availability and full capacity expansion.
  • Different physical machines use synchronization technology to synchronize the actual bandwidth occupied by the user’s business traffic on their respective physical machines.
  • a physical machine can not only accurately obtain the user’s business traffic sent by the router in a random manner.
  • the first actual bandwidth occupied by the first physical machine corresponding to itself, and the user's service flow can be accurately obtained according to the second actual bandwidth corresponding to each other second physical machine of the user's service flow
  • the preset threshold of the bandwidth package of the preset user is further obtained, and according to the preset threshold, the first actual bandwidth, the second actual bandwidth, and the preset threshold are used.
  • the control method controls the bandwidth of the preset user on the first physical machine.
  • the first actual bandwidth, the second actual bandwidth, and the preset threshold are all accurate, according to the above data It is possible to accurately limit the bandwidth of the preset user on the first physical machine, so as to accurately limit the bandwidth packets of the user's bandwidth on multiple physical machines.
  • the bandwidth of the preset user is limited according to the above method, and the bandwidth package full active speed limit for the business traffic of the same user can be realized between multiple physical machines, thereby realizing the high-available bandwidth speed limit of multiple physical machines , It can also ensure that the service traffic of the same user can be accurately controlled on the total actual bandwidth occupied by the bandwidth package of the service traffic of the same user under different traffic conditions between multiple physical machines, thus achieving both It achieves the effect of horizontal expansion and high-availability bandwidth speed limit for physical machines, and can achieve accurate and full active limit on all physical machines for the bandwidth package corresponding to the same user's business traffic in a distributed system containing multiple physical machines. Speed, thereby improving the control ability of the physical machine performance, and on the basis of improving the control ability of the physical machine performance, improving the utilization efficiency of the physical machine performance, and realizing the accuracy of user flow control.
  • the bandwidth of the preset user on the first physical machine is performed according to the preset control method according to the first actual bandwidth, the second actual bandwidth, and the preset threshold.
  • the control steps include:
  • the preset threshold value of the preset ratio is used as the first speed limit value, and the first actual bandwidth is reduced until the first speed limit value, so as to reduce the preset threshold value on the first physical machine.
  • the steps for setting the user's bandwidth to limit the speed include:
  • the rate limit value refers to the upper limit value for controlling the actual bandwidth occupied by the user's business traffic.
  • the first physical machine determines whether the sum of the first actual bandwidth and the second actual bandwidth is greater than the preset threshold, and if the sum of the first actual bandwidth and the second actual bandwidth is greater than the A preset threshold, using a preset ratio of the preset threshold as the first speed limit value, and reducing the first actual bandwidth to the first speed limit value, so as to set the preset threshold on the first physical machine
  • the user's bandwidth is limited to the first rate limit value, so that the total actual bandwidth occupied by the user's business traffic on multiple physical machines does not exceed the bandwidth purchased by the user.
  • the ratio of the first actual bandwidth to the sum of the first actual bandwidth and the second actual bandwidth is used as the ratio value
  • the value of the preset threshold corresponding to the ratio value is used as the first speed limit Value
  • the first actual bandwidth is reduced to the first rate limit value, so as to limit the rate of the bandwidth of the preset user on the first physical machine.
  • the flow control method in the traditional technology can be used to achieve the speed limit, such as data flow control or network flow control included in the flow control method.
  • network traffic control (Network traffic control in English) is a way to use software or hardware to control the network traffic of computer equipment.
  • RTS/CTS hardware traffic control
  • XON/XOFF control for example, through the speed limit gateway control in Figure 5. Its main method is to introduce the concept of QoS, from marking different types of network data packets to determine the priority of data packet traffic, including delaying data packet transmission or dropping data packets.
  • the difference between the preset threshold and the second actual bandwidth is used as the second speed limit value, The first actual bandwidth is increased until the first actual bandwidth reaches the second speed limit value, so as to control the bandwidth of the preset user on the first physical machine.
  • the difference between the preset threshold and the second actual bandwidth is used as the first
  • the second speed limit value may not control the user’s traffic, or increase the first actual bandwidth until the first actual bandwidth reaches the second speed limit value to control all the traffic on the first physical machine.
  • the bandwidth of the preset user is limited to the speed limit value. In this way, the sum of the respective speed limit values on all the physical machines is the preset threshold value, that is, the sum of the actual bandwidth occupied by the user's business traffic on each physical machine is not greater than the bandwidth package purchased by the user The total upper limit.
  • each physical machine limits the user's bandwidth according to the following preset rate limiting method. Please refer to Table 1 to Table 9, where M1, M2, and M3 respectively refer to the actual bandwidth of user 1 on each physical machine.
  • Set the total upper limit of the bandwidth package to 6Mb, and the total upper limit of the bandwidth package (total bandwidth package) is purchased by the user
  • the actual bandwidth is the actual bandwidth data occupied by the user's business traffic obtained in real time.
  • the speed limit methods include:
  • the method for limiting the bandwidth of the first physical machine is: the total upper limit of the bandwidth package-the second actual bandwidth.
  • Table 1 is an example of the speed limit of M1
  • Table 2 is an example of the speed limit of M2
  • Table 3 is an example of the speed limit of M3
  • the speed limits for M1, M2 and M3 are as follows:
  • the bandwidth rate limit of M1 is shown in Table 1:
  • the method of limiting the bandwidth of the first physical machine is as follows:
  • Tables 4 to 9 where this machine is the first physical machine
  • Tables 4 to 6 are examples of speed limits for M1, M2, and M3 in Case 1
  • Tables 7 to 9 are Case 2 respectively.
  • Examples of speed limits for M1, M2, and M3, the specific speed limits are as follows:
  • the bandwidth rate limit of M2 is shown in Table 5:
  • the bandwidth rate limit of M1 is shown in Table 7:
  • the method for limiting the rate of user bandwidth implemented in the embodiments of the present application can independently implement the accurate rate limiting of the service traffic of the same user by multiple physical machines, ensuring that the same bandwidth package can be achieved between physical machines under different traffic conditions.
  • Accurate traffic rate limit is achieved between different physical machines. For example, in the above example, the total bandwidth package purchased by the user is 6M/S. To make the user's business traffic accurately distributed on the three machines of M1, M2, and M3, the sum of the speed limit is 6M/S.
  • the preset threshold of a preset ratio is used as the first speed limit value, and the first actual bandwidth is reduced to the first speed limit value, so as to reduce the speed limit value on the first physical machine.
  • the step of limiting the rate of the bandwidth of the preset user includes:
  • the preset threshold of a preset ratio is used as the first speed limit value, and the first actual bandwidth is successively reduced by the first preset step size until the first speed limit value, so that the The preset user's bandwidth is rate limited.
  • the step of controlling the bandwidth of the preset user on the first physical machine includes:
  • the difference between the preset threshold and the second actual bandwidth is used as the second speed limit value, and the first actual bandwidth is successively increased by a second preset step size until the first actual bandwidth reaches the second speed limit.
  • the rate limit value is used to control the bandwidth of the preset user on the first physical machine.
  • the step length in the computer programming language, is the increase in the exponential value or the decrease in the value, that is, a value is added to a preset value or decreased by a preset value (the preset value is the step length) in each calculation, and repeat Perform this operation.
  • the first preset step length and the second preset step length may be the same or different.
  • the step size for controlling the user's bandwidth setting is 5M each time the bandwidth is increased.
  • the reduced bandwidth is 5M, so that the first actual bandwidth is reduced by a first preset step size until the first speed limit value, so as to slow down the bandwidth of the preset user on the first physical machine, Decelerate to the first speed limit value, and use the preset threshold value of the preset ratio as the first speed limit value.
  • the first actual bandwidth is increased each time by a second preset step length until the first actual bandwidth reaches the second speed limit value, so as to reduce the bandwidth of the preset user on the first physical machine.
  • Control to control the actual bandwidth occupied by the user's service traffic on the first physical machine to a second rate limit value, and use the difference between the preset threshold value and the second actual bandwidth as the second rate limit value, To limit the user's actual bandwidth, and control the fluctuation range of the speed limit, so as to achieve slow start, realize the peak-shaving of the traffic on the physical machine, and avoid excessive flow fluctuations, causing the physical machine to malfunction, and realize the physical machine's failure. Smooth fluctuations are conducive to maintaining the stability of the system.
  • the method further includes: respectively setting the first preset step size and the second preset step size corresponding to the preset time period according to a preset time period.
  • the method further includes:
  • the time unit refers to a time measurement in a time period such as one day, one week, one month, one quarter, or one year.
  • Time period refers to the division of smaller time periods included in the time unit.
  • the time period in the time unit corresponding to a day can be divided into time periods such as morning, morning, afternoon, and evening, and within the time unit corresponding to a week
  • the time period can be divided into working days and rest days.
  • the time period in the time unit corresponding to a month can be divided into time periods such as the beginning of the month, the middle of the month, and the end of the month.
  • the time period in the time unit corresponding to a year can be divided into It is the beginning of the year, the middle of the year, and the end of the year.
  • one day is used as the time unit, due to different time periods of the day, such as the morning, morning, afternoon, and evening corresponding time periods, or one week as the time unit, due to the different time periods of the week, such as Monday and The time period corresponding to Saturday and Sunday, or one month as the time unit, due to the different time periods of the month, such as the beginning and end of the month, or for example, one year as the time unit, In different time periods of the year, such as during holidays and activities and normal working days, the user’s business traffic may be different.
  • the user’s business traffic can be restricted to a greater extent, so that the bandwidth resources of the physical machine can be allocated to another user with a larger business traffic in the morning.
  • the method further includes: according to the statistical historical data of the actual bandwidth occupied by the user's service flow in the preset time period within the preset time unit, the requirements for the user's service flow The actual bandwidth prompts recommendations.
  • the user is advised to purchase bandwidth, and the user can purchase the service flow suitable for his own service flow.
  • the total upper limit of the bandwidth package, the reasonable allocation of the bandwidth occupied by the user's business traffic and the speed limit of the user's business traffic, can not only realize the reasonable allocation and full utilization of physical machine resources, but also avoid the business traffic to the user Limit the speed to process the user's business data, and cause damage to the user's business data, thereby improving the processing efficiency and quality of the user's business flow.
  • the step of receiving the second actual bandwidth sent by each of the other second physical machines through the synchronization technology further includes:
  • the router distributes the service traffic of the same user to different physical machines in a random manner, instead of sending it to the designated physical machine in a directional manner, new physical machines can be added as needed. Connecting the physical machine to the distributed physical machine group can realize the horizontal and flexible expansion of the physical machine.
  • the newly added physical machine receives the service traffic of the user allocated by the router in a random manner
  • the newly added physical machine and the original physical machine group All physical machines will use synchronization technology to synchronize the actual bandwidth and other data occupied by the user’s business traffic on the first physical machine.
  • the original physical machine in the physical machine group will receive the new addition in the same network.
  • the second actual bandwidth occupied by the service traffic of the preset user on the newly added physical machine sent by the physical machine through synchronization technology, so as to compare the second actual bandwidth data of the actual bandwidth occupied by the user’s service traffic on all physical machines.
  • the actual bandwidth occupied by the user's business traffic on a physical machine is limited, so as to improve the accuracy of limiting the user's business traffic.
  • the embodiment of this application can realize that the traffic of a bandwidth package is distributed among multiple physical machines.
  • the number of physical machines can be increased at any time to expand the performance of the physical machines, and the traffic can be imported to the newly added machines. To share the original traffic of each machine.
  • one downtime will not affect it.
  • the physical machine with a single point of failure can be excluded from the physical processing of business traffic through fault detection.
  • the step of obtaining the first actual bandwidth includes:
  • the step of receiving the second actual bandwidth sent by each of the other second physical machines through the synchronization technology includes:
  • the user's traffic control will be too frequent and will consume a lot of the performance of the physical machine. Therefore, the user's traffic can be controlled according to a certain period of time, such as 30 seconds or One minute and other time periods, the average value of the actual bandwidth occupied by the user’s business traffic in this time period is obtained as the actual bandwidth occupied by the user’s business traffic.
  • the physical machine obtains the preset time period sent by the router in a random manner. Suppose the average value of the actual bandwidth occupied by the user’s service traffic on the first physical machine is taken as the first actual bandwidth, and receive the preset user’s data in the preset time period sent by each other second physical machine through synchronization technology.
  • the average value of the actual bandwidth occupied by the service traffic on each of the physical machines, and the average value is taken as the service traffic occupied by the preset user on each of the other second physical machines within the preset time period
  • the bandwidth of the preset user on the first physical machine is controlled according to a preset control method, so that It can not only realize the accurate full-live speed limit of user traffic, but also alleviate the waste of physical machine performance caused by too frequent control, and improve the utilization rate of physical machine performance.
  • FIG. 7 is a schematic block diagram of a user bandwidth control apparatus based on distributed multi-physical machines according to an embodiment of the application.
  • an embodiment of the present application also provides a user bandwidth control device based on distributed multi-physical machines.
  • the user bandwidth control device based on distributed multi-physical machines includes a unit for executing the above-mentioned user bandwidth control method based on distributed multi-physical machines.
  • the device can be configured in computer equipment such as servers, especially It is applied to each physical machine distributed in the same network.
  • the apparatus 700 for controlling user bandwidth based on distributed multi-physical machines includes a first obtaining unit 701, a receiving unit 702, a second obtaining unit 703, and a control unit 704.
  • the first obtaining unit 701 is configured to obtain a first actual bandwidth, where the first actual bandwidth is the actual bandwidth occupied on the first physical machine by the service traffic of the preset user sent by the router in a random manner; the receiving unit 702, It is used to receive the second actual bandwidth sent by each other second physical machine through the synchronization technology, and the second actual bandwidth is the amount occupied by the service traffic of the preset user on each of the other second physical machines.
  • the actual bandwidth wherein the service traffic of the preset user received by each of the second physical machines is obtained by the router allocating the service traffic of the preset user in the random manner;
  • the second obtaining unit 703 is configured to obtain the preset threshold of the bandwidth package of the preset user;
  • the control unit 704 is configured to obtain the preset threshold according to the first actual bandwidth, the second actual bandwidth, and the preset threshold.
  • the preset control method controls the bandwidth of the preset user on the first physical machine.
  • the receiving unit 702 is configured to receive the second actual bandwidth sent by each of the other second physical machines in a multicast manner.
  • control unit 704 includes: a judging subunit, configured to determine whether the sum of the first actual bandwidth and the second actual bandwidth is greater than the preset threshold; and a reduction subunit, for determining whether The sum of the first actual bandwidth and the second actual bandwidth is greater than the preset threshold, and the preset threshold of a preset ratio is used as the first speed limit value, and the first actual bandwidth is reduced until the first speed limit is reached.
  • a speed limit value is used to limit the bandwidth of the preset user on the first physical machine, and the sum of the respective speed limit values on all the physical machines is the preset threshold value.
  • the reduction subunit is configured to use the ratio of the first actual bandwidth to the sum of the first actual bandwidth and the second actual bandwidth as a ratio, and the ratio corresponds to The value of the preset threshold is used as the first rate limit value, and the first actual bandwidth is reduced to the first rate limit value, so as to limit the bandwidth of the preset user on the first physical machine .
  • the reduction subunit is configured to use a preset ratio of the preset threshold value as the first speed limit value, and successively reduce the first actual bandwidth by the first preset step length until the first speed limit is reached.
  • a rate limit value to limit the rate of the bandwidth of the preset user on the first physical machine.
  • the receiving unit 702 is further configured to receive the second actual bandwidth sent by each newly added physical machine in the same network through synchronization technology.
  • the first obtaining unit 701 is configured to obtain the average value of the actual bandwidth occupied on the first physical machine by the service traffic of the preset user sent by the router in a random manner within a preset time period as The first actual bandwidth;
  • the receiving unit 702 is configured to receive the second actual bandwidth sent by each of the other second physical machines through synchronization technology, where the second actual bandwidth is the service traffic of the preset user within the preset time period. The average value of the actual bandwidth occupied by each of the other second physical machines.
  • the division and connection of the various units in the user bandwidth control device based on distributed multi-physical machines are only used for illustration.
  • the user bandwidth control device based on distributed multi-physical machines can be divided as needed.
  • the units in the user bandwidth control device based on distributed multi-physical machines can also adopt different connection sequences and methods to complete all or part of the functions of the user bandwidth control device based on distributed multi-physical machines.
  • the above-mentioned user bandwidth control device based on distributed multi-physical machines can be implemented in the form of a computer program, and the computer program can be run on a computer device as shown in FIG. 8.
  • FIG. 8 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 800 may be a computer device such as a desktop computer or a server, or may be a component or component in other devices.
  • the computer device 800 includes a processor 802, a memory, and a network interface 805 connected through a system bus 801, where the memory may include a non-volatile storage medium 803 and an internal memory 804.
  • the non-volatile storage medium 803 can store an operating system 8031 and a computer program 8032.
  • the processor 802 can execute a user bandwidth control method based on distributed multi-physical machines.
  • the processor 802 is used to provide calculation and control capabilities to support the operation of the entire computer device 800.
  • the internal memory 804 provides an environment for the operation of the computer program 8032 in the non-volatile storage medium 803.
  • the processor 802 can execute the aforementioned distributed multi-physical machine-based user Bandwidth control method.
  • the network interface 805 is used for network communication with other devices.
  • the structure shown in FIG. 8 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 800 to which the solution of the present application is applied.
  • the specific computer device 800 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the computer device may only include a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are consistent with the embodiment shown in FIG. 8 and will not be repeated here.
  • the processor 802 is configured to run a computer program 8032 stored in a memory to implement the user bandwidth control method described in the embodiment of the present application.
  • the processor 802 may be a central processing unit (Central Processing Unit, CPU), and the processor 802 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is executed by the processor When the processor executes the steps of the user bandwidth control method based on distributed multi-physical machines described in the above embodiments.
  • the storage medium is a physical, non-transitory storage medium, for example, it can be a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk or an optical disk, and various computer programs that can store program codes. Read the storage medium.

Abstract

本申请提供了一种基于分布式多物理机的用户带宽控制方法、装置、计算机设备及计算机可读存储介质,属于大数据技术领域,通过获取第一实际带宽,第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,第二实际带宽为预设用户的业务流量在其它每台第二物理机上各自所占用的实际带宽;获取预设用户的带宽包的预设阈值;根据第一实际带宽、第二实际带宽及预设阈值,按照预设控制方式对第一物理机上预设用户的带宽进行控制。

Description

用户带宽控制方法、装置、计算机设备及存储介质
本申请要求于2020年02月26日提交中国专利局、申请号为202010120282.4、申请名称为“用户带宽控制方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及大数据技术领域,尤其涉及一种基于分布式多物理机的用户带宽控制方法、装置、计算机设备及计算机可读存储介质。
背景技术
在云网络环境中存在带宽限速的需求,所述限速为控制用户的业务流量所占用的实际带宽不超过用户购买的带宽所对应的预设阈值。目前云厂商在限速方案的实现上采用主备限速方案或者流量折叠方案等。具体如下:
1)主备限速方式。对于主备限速方案,它是使用两台物理机来进行限速,但是同一时间点只有一台机器工作,另外一台机器作为备机不参与限速,主备之间不进行数据同步。当主机宕机之后,所有流量切换到备机上。这样的缺点就是有一台物理机处于闲置状态导致物理机的性能没办法充分发挥,并且没办法横向扩展物理机,在业务持续增加的时候,会存在性能瓶颈。请参阅图1,图1为本申请实施例提供的主备限速方式的架构示意图,如图1所示,路由器接收外部流量,首先分配至主物理机A进行处理,物理机B不参与流量处理,若主物理机A宕机,路由器将接收的业务流量分配至备物理机B进行处理,物理机B开始工作,物理机A不进行工作,由于存在主物理机A和备物理机B主备两个分类,要么物理机A进行工作,要么物理机B进行工作,物理机A和物理机B中总有一台处于闲置状态导致物理机的性能没办法充分使用,并且物理机无法横向扩展,在业务持续增加的时候,会存在性能瓶颈。
2)流量折叠方式。对于流量折叠方案,是两台机器同时工作,但一个带宽包只在一个机器上面处理,如果其它每台机器接收到了不在本机器上处理的带宽包流量,会转发到相应的物理机上去。请参阅图2,图2为本申请实施例提供的流量折叠方式的架构示意图,如图2所示,物理机A和物理机B同时工作,但物理机A和物理机B有分工,比如,用户2的业务流量分为用户2(1)和用户2(2)两部分,物理机A处理用户1及用户2(1)的流量,物理机B处理用户2(2)及用户3的流量,路由器接收到外部流量,根据预先设置将接收到的流量分配到物理机A或者物理机B上,比如,路由器接收到用户1的业务流量,将用户1的业务流量分配至物理机A上处理,即使物理机B接收到用户1的业务流量,也会转发给物理机A进行处理,路由器接收到用户2(2)的业务流量,将用户2(2)的业务流量分配至物理机B上处理,即使物理机A接收到用户2(2)的业务流量,也会转发至物理机B进行处理。由于将用户2(1)的流量分配至物理机A进行处理,用户2(2)的流量分配至物理机B进行处理,则没办法对用户2的带宽进行准确限速。因此,这种方式,由于业务流量会被预先设置分配至指定的物理机进行处理,没办法精准控制用户的实际带宽以对用户的带宽进行限速,同时物理机也没法灵活进行扩展,要进行物理机的扩展,需要进行分配算法的重新调整并进行软件的重新部署,并且业务流量增加时,物理机也存在性能瓶颈。
因此,发明人发现,传统技术中针对用户流量进行限速,不能充分发挥每台物理机的性能,并且不能进行灵活扩展物理机,从而导致对物理机性能利用效率不高的问题。
发明内容
本申请提供了一种基于分布式多物理机的用户带宽控制方法、装置、计算机设备及计算机可读存储介质,能够解决对带宽限速的传统技术中对物理机性能利用效率较低的问题。
第一方面,本申请提供了一种基于分布式多物理机的用户带宽控制方法,应用于同一网络中分布式部署的每台物理机上,所述方法包括:获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用 户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;获取所述预设用户的带宽包的预设阈值;根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
第二方面,本申请还提供了一种基于分布式多物理机的用户带宽控制装置,应用于同一网络中分布式部署的每台物理机上,包括:第一获取单元,用于获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;接收单元,用于接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;第二获取单元,用于获取所述预设用户的带宽包的预设阈值;控制单元,用于根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
第三方面,本申请还提供了一种计算机设备,其包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器运行所述计算机程序时执行如下步骤:获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;获取所述预设用户的带宽包的预设阈值;根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
第四方面,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如下步骤:获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;获取所述预设用户的带宽包的预设阈值;根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
本申请实现基于分布式多物理机的用户带宽控制时,获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,进一步获取所述预设用户的带宽包的预设阈值,根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制,可以准确实现对所述第一物理机上所述预设用户的带宽进行限速,提高对物理机性能的利用效率,实现对用户流量控制的准确度。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本申请实施例提供的主备限速方式的架构示意图;
图2为本申请实施例提供的流量折叠方式的架构示意图;
图3为本申请实施例提供的基于分布式多物理机的用户带宽控制方法的一个应用环境示意图;
图4为本申请实施例提供的基于分布式多物理机的用户带宽控制方法中的一个示意性流程图;
图5为本申请实施例提供的基于分布式多物理机的用户带宽控制方法的一个应用环境架构示意图;
图6为本申请实施例提供的基于分布式多物理机的用户带宽控制方法的另一个应用环境示意图;
图7为本申请实施例提供的基于分布式多物理机的用户带宽控制装置的示意性框图;以及
图8为本申请实施例提供的计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
请参阅图3,图3为本申请实施例提供的基于分布式多物理机的用户带宽控制方法的一个应用环境示意图。包括:1)路由器。路由器接收外部传送的带宽包流量,根据路由器自身配置的流量随机分发算法,通过随机方式将用户的业务流量分发到图3中的物理机1、物理机2或者物理机3中的任一台物理机上,以使物理机1、物理机2或者物理机3处理接收的流量。其中,路由器是连接两个或多个网络的硬件设备,在网络间起网关的作用,是读取每一个数据包中的地址然后决定如何传送的专用智能性的网络设备。2)物理机。物理机是指物理机器,是真实存在的物理形式的服务器,是相对于云服务器而言的实体形式的物理设备,图3中的物理机包括物理机1、物理机2及物理机3。服务器一般分两种,物理机器和云服务器,本申请实施例中的物理机是指物理机器。
图3中的各个主体工作过程如下:路由器接收外部网络传送过来的用户1的业务流量,根据路由器上配置的流量随机分发算法按照随机方式将用户1的业务流量随机分发到物理机1、物理机2或者物理机3中的任一台物理机上进行处理,物理机1、物理机2及物理机3之间使用组播技术等同步方式传送各自的用户1的业务流量在各自的物理机上所占用的实际带宽,基于用户购买的带宽上限设定的用户的带宽包的预设阈值,每台物理机根据自己机器上用户1的第一实际带宽,及其它每台物理机上各自的用户1的业务流量在自身所对应的本台物理机上所占用的第二实际带宽,按照预设控制方式对自身物理机上所述预设用户的带宽进行限速,物理机1、物理机2及物理机3均按照上述方式对用户1的业务流量所占用的实际带宽进行限速,从而对用户1的业务流量所占用的总的实际带宽进行限速。每台物理机对用户2及用户3各自的业务流量所占用的总带宽也通过上述方式进行限速,以完成物理机1、物理机2及物理机3对用户1、用户2及用户3各自的业务流量所占用的带宽进行限速。
图4为本申请实施例提供的基于分布式多物理机的用户带宽控制方法的一个示意性流程图,所述基于分布式多物理机的用户带宽控制方法应用于图3所示的物理机1、物理机2及物理机3上。如图4所示,该方法包括以下步骤S401-S404:
S401、获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽。
其中,带宽,英文为Band Width,是“频带宽度”的简称,又称频宽或者信道宽度,是指在单位时间(一般指1秒钟)内能传输的数据量,用来描述信道能允许最高多大频率的信号通过。带宽和高速公路类似,带宽越大,就类似高速公路的车道越多,其通行能力越强。
具体地,传统技术中针对用户流量进行限速时,无论是采用主备限速方式,还是采用流量折叠方式,均无法充分发挥每台物理机的性能,并且无法对物理机的性能进行扩展。同时 若采用流量折叠方式,即使将一个用户的流量指定分发到不同的物理机上进行处理,例如将用户的流量按照流量类型分发到不同的物理机上进行处理,以实现多台物理机同时处理一个用户的业务流量,但当属于该用户的带宽包里面的流量分布到多台物理机上进行处理时,不能实现全活限速的功能,即当带宽包里面的流量分发到多台物理机上去时,多台物理机无法共同实现对单个用户的带宽包的精准限速,对该用户的业务流量所占用的带宽总量无法实现精准限速以不让该带宽总量超过用户购买的带宽。例如用户购买了1M的带宽,若用户的流量分配到了物理机A和物理机B上,需要针对用户的总流量限速为1M/s时,由于涉及到物理机A和物理机B分别处理用户的流量,而无法对用户的流量进行精准限速为1M/s。其中,全活限速是指若多台物理机同时处理同一个用户的业务流量,使多台物理机同时对该用户的业务流量所占用的带宽分别进行限速,以实现对该用户的业务流量所占用的总带宽实现控制,简单说,全活限速是指针对一个带宽包有多台物理机进行处理,多台物理机对该带宽包同时限速。
由于传统技术中针对用户流量进行限速时,不能实现物理机的灵活扩展,并且不能实现全活功能,在本申请实施例中,为了达到对于物理机的横向扩展和高可用带宽限速的效果,需要在多台物理机之间实现针对同一个带宽包全活限速效果。为了在多台物理机之间实现针对同一个带宽包进行全活限速,在物理架构方面,多台物理机通过BGP的ECMP功能和BFD检测与路由器进行连接。例如在图3中,物理机1、物理机2及物理机3通过BGP的ECMP功能和BFD检测与路由器进行连接,路由器接收到用户1的业务流量后,路由器根据配置的流量随机分发算法将该用户1的业务流量分发到物理机1、物理机2或者物理机3上进行处理,以实现在物理机1、物理机2及物理机3上同时实现对用户1的带宽包全活限速的效果,也即同时对物理机1、物理机2及物理机3上各自的用户1的业务流量所占用的实际带宽分别进行限速,以使物理机1、物理机2及物理机3上的用户1的业务流量所占用的总实际带宽不超过用户1的带宽上限,用户1的带宽上限一般是指用户购买的带宽。其中,路由器根据分配算法控制带宽包的流量发送到哪台物理机上,路由器只控制流量转发给哪台物理机。其中,BGP,英文为Border Gateway Protocol,边界网关协议,主要用于互联网AS(自治系统)之间的互联,BGP的最主要功能在于控制路由的传播和选择最好的路由。ECMP,英文为Equal-CostMultipathRouting,存在多条不同链路到达同一目的地址的网络环境中,是一种网络术语。BFD是Bidirectional Forwarding Detection的缩写,它是一个用于检测两个转发点之间故障的网络协议。
在本申请实施例中,第一物理机获取路由器按照随机方式发送的预设用户的业务流量在自身所对应的第一物理机上所占用的第一实际带宽,由于在本申请实施例中,路由器是按照随机方式将用户的业务流量分发到不同的物理机上,随机分发的随机性可以实现多物理机横向扩展和高可用带宽的效果。请继续参阅图3,例如物理机1获取路由器随机发送的用户1的业务流量在物理机1上所占用的第一实际带宽。
进一步地,一个带宽包里面可以添加多个IP,多个IP之间共享一个带宽包,该带宽包称为共享带宽包。共享带宽包(英文为Bandwidth Package,简称BWP)是一种多IP聚合的模式,当业务中公网流量高峰分布在不同时间段内,可通过共享带宽包实现带宽聚合计费。对于共享带宽包,由于共享带宽包是一种多IP聚合的模式,根据流量分配算法将共享带宽包内的多个IP各自对应的流量包分别随机分发到物理机上进行流量处理,比如,由ABCDE五个IP聚合而成的一个共享带宽包,路由器接收到该共享带宽包后,将ABCDE五个IP的业务流量各自根据流量分发算法分别进行随机分发,以将ABCDE五个IP对应的五个业务流量包分别分发到不同的物理机上进行处理。
进一步地,由于定向转发的方式,就只能转发到预设的物理机上,没有办法灵活转发到新增的物理机上,或者避免转发到出现故障的物理机上,因此,采用预设的固定转发方式实现定向转发不能充分利用多个物理机的横向高扩展性以实现流量的灵活转发。例如新增物理机时,或者物理机出现故障时,而必须通过人为介入重新设置才能实现转发到新增物理机上 或者避免转发到出现故障的物理机上。在本申请实施例中,路由器采用随机转发的方式将流量转发到物理机组中的任一台物理机上,就可以将流量转发到新增的物理机上,或者避免将流量转发到出现故障的物理机上,而只转发到正常状态的物理机上。因此,本申请实施例中,路由器通过随机方式将流量发送到分布式的多台物理机上,由于随机转发的随机性,针对一个用户的流量,每一台物理机上的流量都是不确定的,同时通过随机转发方式,由于随机转发的概率性,需要扩展物理机时,只需要将物理机连接添加至分布式的物理机群组中即可实现多物理机横向扩展,并不需人为介入进行设置,以实现灵活增加物理机。同时,由于本申请实施例中通过随机的方式分配流量,可以控制不会将流量分配到出现故障的物理机上。
进一步地,路由器配置的流量分发算法可以是交换机普通算法,例如IP_HASH。
进一步地,请参阅图5和图6,图5为本申请实施例提供的基于分布式多物理机的用户带宽控制方法的一个应用环境架构示意图,图6为本申请实施例提供的基于分布式多物理机的用户带宽控制方法的另一个应用环境示意图。如图5所示,CXP板为一种IO控制器,是一种控制流量输出输入的设备,包括输出端口192.168.1.1,输入端口包括192.168.1.5和192.168.2.1,输入的流量经192.168.1.1端口随机分配至限速网关1、限速网关2或者限速网关3上进行输入输出的控制,经限速网关1、限速网关2或者限速网关3限速后的流量经输入端口192.168.2.1进入NAT网关1,输出流量为输入流量的逆过程,即经NAT网关1的流量通过端口192.168.2.1随机分配至限速网关1、限速网关2或者限速网关3限速后,经过端口192.168.1.1输出。请继续参阅图5和图6,如图5和图6所示,本申请实施例的用户带宽的分布式多物理机控制方法,不但适用于由外至内的“上传”流量,也就是进入物理机的“进入”流量,比如上传电影、歌曲或者图片的上传限速,也适用于由内至外的下载流量,也就是“输出”流量,比如下载电影、歌曲或者图片的下载限速。
S402、接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的。
具体地,由于路由器将同一用户的流量按照随机方式发送到分布式部署的多台物理机上,因此,每台物理机上被分配的业务流量是不确定的,并且彼此是不相同的。同时,由于每台物理机会对接收到的用户流量进行限速等因素,导致物理机上用户的实际带宽包数据与从路由器处分配过来的流量数据存在不一致的情形。例如,假如有一个网站有ABC三个用户访问,由于该网站用户的业务流量可能很大,假设路由器接收到该网站用户的总流量带宽包M'包括流量带宽包M1'对应用户A、流量带宽包M2'对应用户B及流量带宽包M3'对应用户C,路由器根据流量分配算法将流量带宽包M1'分配至物理机1,物理机1上流量带宽包M1'的实际带宽为M1,将流量带宽包M2'分配至物理机2,物理机2上流量带宽包M2'的实际带宽为M2,将流量带宽包M3'分配至物理机3,物理机3上流量带宽包M3'的实际带宽为M3,其中,M'=M1'+M2'+M3',物理机的实际带宽为M=M1+M2+M3,其中,M'与M、M1'与M1、M2'与M2、M3'与M3不一定一致,也即路由器分配至各个物理机的带宽与各个物理机接收的实际带宽之间有可能存在差异。因此,第一物理机接收分布式部署的多台物理机所属的物理机群组中的其它每台第二物理机各自通过同步技术发送的所述预设用户的业务流量在各自所述第二物理机上所占用的第二实际带宽,通过多台物理机之间采取的同步技术,以使每台第一物理机获取分布式部署的物理机群组中用户的业务流量在其它每台第二物理机上各自所占用的第二实际带宽,后续才能在多台物理机之间实现同一个带宽包全活限速功能,并通过计算所述预设用户的业务流量在其它物理机上各自所占用的第二实际带宽之和,得到所述预设用户的业务流量在其它所有所述物理机上总共所占用的实际带宽,才能准确获取该预设用户的业务流量在其它所有所述物理机上总共所占用的实际带宽,其中,其它每台所述第二物理机各自所接收的所述预设用户的业务流量也是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的。例如,请继续参阅图3, 路由器将用户1的流量按照随机方式分发到物理机1、物理机2或者物理机3上,物理机1接收物理机2通过同步技术发送的用户1的业务流量在物理机2上所占用的第二实际带宽,物理机1接收物理机3通过同步技术发送的用户1的业务流量在物理机3上所占用的第二实际带宽,将用户1的业务流量在物理机2上所占用的第二实际带宽与用户1的业务流量在物理机3上所占用的第二实际带宽求和,从而得到用户1的业务流量在物理机2上和物理机3上总共所占用的实际带宽。
进一步地,所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤包括:
接收其它每台第二物理机各自通过组播方式发送的第二实际带宽。
具体地,物理机之间通过组播方式发送所述预设用户的业务流量在各自所述物理机上所占用的实际带宽,从而多台物理机之间利用组播技术同步相互之间的带宽包数据,一台第一物理机接收其它每台第二物理机各自通过组播方式发送的所述预设用户的业务流量在各自所述物理机上所占用的第二实际带宽。其中,组播(英文为Multicast)传输,在发送者和每一接收者之间实现点对多点网络连接。
请继续参阅图3,物理机1、物理机2和物理机3彼此之间使用组播方式同步每个用户的业务流量在各自物理机上所占用的实际带宽,例如物理机1获取路由器按照流量随机分配算法发送的用户1的业务流量在物理机1上所占用的第一实际带宽,物理机1接收物理机2通过组播方式发送的用户1的业务流量在物理机2上所占用的第二实际带宽,物理机1接收物理机3通过组播方式发送的用户1的业务流量在物理机3上所占用的第二实际带宽,并将用户1的业务流量在物理机2上所占用的第二实际带宽与用户1的业务流量在物理机3上所占用的第二实际带宽求和,以得到属于同一个物理群组的物理机2和物理机3上的该用户1的业务流量共同所占用的实际带宽。
进一步地,由于物理机群组中可以包含两台或者两台以上的物理机,若物理机群组中包含两台以上的物理机,其它每台所述第二物理机上该用户的业务流量各自所占用的第二实际带宽之和即为所有其它物理机共同所占用的实际带宽。例如图3中,除物理机1外,其它物理机可以包含一台物理机,也可以包含多台物理机,因此,其它每台第二物理机共同所占用的实际带宽可以为该用户1的业务流量在一台物理机上所占用的实际带宽,也可以为该用户1的业务流量在其它多台物理机上各自所占用的第二实际带宽的总和。
进一步地,物理机之间相互同步带宽包数据,也可以使用单播,但使用单播会使通信流量成倍增加。
S403、获取所述预设用户的带宽包的预设阈值。
具体地,预设用户的带宽包的预设阈值,是指该预设用户的带宽包的总上限。带宽包总上限一般是指用户购买的带宽的上限,一般会在用户购买带宽时,为用户设置相应的带宽上限数值,从而根据用户购买的带宽包的大小获取相应的数据,带宽包总上限又可以称为总带宽包,例如带宽包总上限为6Mb/s。带宽包总上限是指在网络租赁服务中用户租用的带宽大小的上限,一个带宽包定义流量的速率,比如1M/s。请继续参阅图3,物理机1获取该用户1的带宽包总上限,用户1的带宽包总上限也就是用户1购买的带宽。
S404、根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
其中,第一实际带宽与所有第二实际带宽之和为总带宽,总带宽是指同一个用户的业务流量所对应的带宽包在所有物理机上所占用的总共实际带宽,又可以称为带宽总上限,用来描述用户的业务流量所需要的实际带宽,实际带宽又可以理解为该用户的业务流量所对应的外部用户的访问带宽,访问的用户越多,实际带宽越大。例如,带宽总上限(总带宽)=M1实际带宽+M2实际带宽+M3实际带宽。
具体地,第一物理机判断用户发送的业务流量的带宽总上限与用户购买的带宽包总上限之间的关系,也即第一物理机根据所述第一实际带宽、所述第二实际带宽及所述预设阈值, 按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。若用户发送的业务流量的带宽总上限不大于用户购买的带宽包总上限,可以不对用户的流量进行控制操作,也可以增加第一物理机上用户的业务流量所占用的实际带宽至用户购买的带宽包总上限,以提高对用户的业务流量处理的能力;若用户发送的业务流量的带宽总上限大于用户购买的带宽包总上限,减少第一物理机上用户的业务流量所占用的实际带宽至用户购买的带宽包总上限以对用户使用的实际带宽进行限速控制,以避免第一物理机上用户的业务流量所占用的实际带宽大于用户购买的带宽包总上限,造成带宽资源的失控,实现适度的合理分配带宽资源。请继续参阅图3,物理机1根据所述第一实际带宽和所述第二实际带宽,计算该用户1的业务流量所对应的带宽包的总带宽,物理机1根据该带宽包的总带宽与用户购买的带宽包总上限的关系,按照预设控制方式对该物理机1上的用户1的带宽进行控制。例如,若用户购买的带宽包总上限为6MB,用户发送的业务流量需要的带宽为4M,用户购买的带宽包总上限能够满足用户的业务流量对带宽的需求,物理机1可以不对用户的流量进行控制操作,物理机1也可以增加物理机1上用户的业务流量所占用的实际带宽至用户购买的带宽包总上限,以提高对用户的业务流量处理的能力,若用户购买的带宽包总上限为6MB,用户发送的业务流量需要的带宽为8MB,用户购买的带宽包总上限不能够满足用户的业务流量对带宽的需求,物理机1需要减少物理机1上用户的业务流量所占用的实际带宽至用户购买的带宽包总上限,以对用户的业务流量进行限速,避免物理机1上用户的业务流量所占用的实际带宽大于用户购买的带宽包总上限,实现适度的合理分配带宽资源,否则,用户占用的实际带宽会超过用户购买的带宽包总上限,从而造成带宽资源的失控与浪费。同样,物理机2及物理机3上也采取与物理机1上相同的带宽控制方法,以实现在物理机1、物理机2及物理机3上同时对同一个用户的总带宽进行控制,以使用户的总带宽不超过用户购买的带宽。
本申请实施例实现基于分布式多物理机的用户带宽控制时,通过路由器按照随机方式将同一个用户的业务流量分发至不同的物理机上,由于路由器将同一个用户的业务流量按照随机方式分发至不同的物理机上,而不是定向发送至指定的物理机,因此,不但可以充分利用每一台物理机的性能,以实现对物理机的高可用性,避免物理机闲置导致对物理机资源和性能的浪费,还可以根据需要增加新的物理机以实现物理机的横向灵活扩展,并且可以避免路由器将该用户的业务流量发送至出现故障的物理机上造成对业务的损失,从而实现物理机性能的高可用性和充分扩容。不同的物理机之间各自通过同步技术同步所述用户的业务流量在各自所述物理机上所占用的实际带宽,一台物理机不仅能够准确获取路由器按照随机方式发送的所述用户的业务流量在自身所对应的第一物理机上所占用的第一实际带宽,而且能够根据所述用户的业务流量在其它每台第二物理机各自所对应的第二实际带宽,准确获取所述用户的业务流量在其它所有物理机上总共所占用的实际带宽,进一步获取所述预设用户的带宽包的预设阈值,根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制,由于所述第一实际带宽、所述第二实际带宽及所述预设阈值都是准确的,因此,根据上述数据可以准确实现对所述第一物理机上所述预设用户的带宽进行限速,以实现对用户带宽在多台物理机上的带宽包准确限速,对同一网络中的多台物理机上的所述预设用户的带宽均按照上述方式进行限速,就既可以在多台物理机之间实现针对同一个用户的业务流量的带宽包全活限速,从而实现多物理机的高可用带宽限速,又可保障同一用户的业务流量在多台物理机之间在不同的流量情况下,也能做到对同一个用户的业务流量的带宽包所占用的总实际带宽的精准控制,从而既实现对物理机达到横向扩展和高可用带宽限速的效果,又能在包含多台物理机的分布式系统中针对同一个用户的业务流量所对应的带宽包实现在所有物理机上的准确全活限速,从而提高对物理机性能的控制能力,并在提高对物理机性能的控制能力的基础上,提高对物理机性能的利用效率,实现对用户流量控制的准确度。
在一实施例中,所述根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上的所述预设用户的带宽进行控制的步骤包括:
判断所述第一实际带宽与所述第二实际带宽之和是否大于所述预设阈值;若所述第一实际带宽与所述第二实际带宽之和大于所述预设阈值,以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速,所有所述物理机上各自的限速值之和为所述预设阈值。
进一步地,所述以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速的步骤包括:
以所述第一实际带宽与所述第一实际带宽和所述第二实际带宽之和的比值作为比例值,以所述比例值所对应的所述预设阈值的值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
其中,限速值是指对用户的业务流量所占用的实际带宽进行控制的上限值。
具体地,第一物理机判断所述第一实际带宽与所述第二实际带宽之和是否大于所述预设阈值,若所述第一实际带宽与所述第二实际带宽之和大于所述预设阈值,以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速至第一限速值,以使用户的业务流量在多台物理机上所占用的总的实际带宽不超过用户购买的带宽。例如以所述第一实际带宽与所述第一实际带宽和所述第二实际带宽之和的比值作为比例值,以所述比例值所对应的所述预设阈值的值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。其中,每一台物理机上具体实现限速功能时,采用传统技术中的流量控制方式实现限速即可,比如流量控制方式中包含的数据流量控制或者网络流量控制。以网络流量控制为例,其中,网络流量控制(英文为Network traffic control)是一种利用软件或硬件方式来实现对计算机设备网络流量进行控制,通常有硬件流量控制(RTS/CTS)和软件流量(XON/XOFF)控制,比如通过图5中的限速网关的控制。它的最主要方法,是引入QoS的概念,从通过为不同类型的网络数据包标记,从而决定数据包通行的优先次序,包括延迟数据包发送或者丢弃数据包等方式。
进一步地,若所述第一实际带宽与所述第二实际带宽之和不大于所述预设阈值,以所述预设阈值与所述第二实际带宽的差值作为第二限速值,增加所述第一实际带宽直至所述第一实际带宽达到所述第二限速值,以对所述第一物理机上的所述预设用户的带宽进行控制。
具体地,第一物理机若判断所述第一实际带宽与所述第二实际带宽之和不大于所述预设阈值,以所述预设阈值与所述第二实际带宽的差值作为第二限速值,可以不对用户的流量进行控制操作,也可以通过增加所述第一实际带宽直至所述第一实际带宽达到所述第二限速值,以对所述第一物理机上的所述预设用户的带宽进行限速至限速值。从而实现使所有所述物理机上的各自所述限速值之和为所述预设阈值,也即让用户的业务流量在各台物理机上所占用的实际带宽之和不大于用户购买的带宽包总上限。
进一步地,为了对每个用户的带宽实现精准限速,需要实现分布式物理机的全活限速,也即在多台物理机上对同一个用户的带宽同时限速。其中,每台物理机根据如下预设限速方式对用户的带宽进行限速。请参阅表格1至表格9,其中,M1、M2、M3分别指代每一台物理机上的用户1的实际带宽,设置带宽包总上限为6Mb,带宽包总上限(总带宽包)是用户购买带宽时进行设置的,实际带宽是实时获取的用户的业务流量所占用的实际带宽数据。限速方式具体包括:
1)如果带宽总上限未大于带宽包总上限,第一物理机限速带宽的方式为:带宽包总上限-第二实际带宽。
具体地,请参阅表格1、表格2和表格3,其中,本机为第一物理机,表格1为M1的限速示例,表格2为M2的限速示例,表格3为M3的限速示例,对M1、M2及M3分别限速如下:
M1的带宽限速如表格1所示:
表格1
本机M1限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
4Mb 1Mb 1Mb 1Mb
M2的带宽限速如表格2所示:
表格2
本机M2限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
4Mb 1Mb 1Mb 1Mb
M3的带宽限速如表格3所示:
表格3
Figure PCTCN2020119138-appb-000001
2)如果带宽总上限大于带宽包总上限,第一物理机限速带宽的方式为:
Figure PCTCN2020119138-appb-000002
Figure PCTCN2020119138-appb-000003
具体地,请参阅表格4至表格9,其中,本机为第一物理机,表格4至表格6分别为情形1中M1、M2及M3的限速示例,表格7至表格9分别为情形2中M1、M2及M3的限速示例,具体限速如下:
①情形一。
M1的带宽限速如表格4所示:
表格4
本机M1限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
2Mb 4Mb 4Mb 4Mb
M2的带宽限速如表格5所示:
表格5
本机M2限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
2Mb 4Mb 4Mb 4Mb
M3的带宽限速如表格6所示:
表格6
本机M3限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
2Mb 4Mb 4Mb 4Mb
②情形二。
M1的带宽限速如表格7所示:
表格7
本机M1限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
1.6Mb 4Mb 5Mb 6Mb
M2的带宽限速如表格8所示:
表格8
本机M2限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
2.0Mb 4Mb 5Mb 6Mb
M3的带宽限速如表格9所示:
表格9
本机M3限速带宽 M1实际带宽 M2实际带宽 M3实际带宽
2.4Mb 4Mb 5Mb 6Mb
本申请实施例实现的用户带宽的限速方法,能够自主实现多物理机对同一用户的业务流量的准确限速,保障了物理机之间在不同的流量情况下也能做到同一个带宽包在不同物理机 之间做到精准的流量限速,例如上述举例中,用户购买的总带宽包为6M/S。要使用户的业务流量准确限速分布在M1、M2及M3等三台机器上的总和是6M/S。
在一实施例中,所述以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速的步骤包括:
以预设比例的所述预设阈值作为第一限速值,以第一预设步长逐次减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
进一步地,所述以所述预设阈值与所述第二实际带宽的差值作为第二限速值,增加所述第一实际带宽直至所述第一实际带宽达到所述第二限速值,以对所述第一物理机上的所述预设用户的带宽进行控制的步骤包括:
以所述预设阈值与所述第二实际带宽的差值作为第二限速值,以第二预设步长逐次增加所述第一实际带宽直至所述第一实际带宽达到所述第二限速值,以对所述第一物理机上的所述预设用户的带宽进行控制。
其中,步长,在计算机程序语言中,是指数值增加量或者数值减少量,即让一个数值在每次运算中加上预设值或者减少预设值(预设值即步长),重复执行此项运算。所述第一预设步长和第二预设步长可以相同,也可以不相同。
具体地,在对业务流量进行控制时,由于控制的时间很短,比如50毫秒等,可以为控制用户的带宽设置步长,例如控制用户的带宽设置的步长为每次增加的带宽为5M或者减少的带宽为5M,从而以第一预设步长减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行减速,减速至第一限速值,以预设比例的所述预设阈值作为第一限速值。或者,以第二预设步长每次增加所述第一实际带宽直至所述第一实际带宽达到所述第二限速值,以对所述第一物理机上的所述预设用户的带宽进行控制,控制用户的业务流量在所述第一物理机上所占用的实际带宽至第二限速值,以所述预设阈值与所述第二实际带宽的差值作为第二限速值,以对用户的实际带宽进行限速,同时控制限速的波动幅度,从而做到慢启动,实现对物理机上的流量进行削峰,避免流量波动太厉害,造成物理机出现故障,实现物理机的平滑波动,有利于维护系统的稳定性。
进一步地,所述方法还包括:按照预设时间段对所述预设时间段所对应的所述第一预设步长及所述第二预设步长分别进行设置。
所述按照预设时间段对所述预设时间段所对应的所述第一预设步长及所述第二预设步长分别进行设置的步骤之前,还包括:
统计所述用户的业务流量在预设时间单位内的所述预设时间段所占用的实际带宽的历史数据,以根据所述历史数据对所述预设时间段所对应的所述第一预设步长及所述第二预设步长分别进行设置。
其中,时间单位是指以一天、一周、一个月、一个季度或者一年等时间周期为单位的时间度量。时间段是指对时间单位内包含的更小时间周期的划分,比如,一天所对应的时间单位内的时间段可以分为早上、上午、下午及晚上等时间周期,一周所对应的时间单位内的时间段可以分为工作日和休息日等,一个月所对应的时间单位内的时间段可以分为月初、月中及月末等时间周期,一年所对应的时间单位内的时间段可以分为年初、年中及年末等。
具体地,以一天为时间单位,由于在一天的不同时间段,比如早上、上午、下午及晚上所各自对应的时间段,或者以一周为时间单位,由于在一周的不同时间段,比如周一及周六和周日各自所对应的时间段,或者以一个月为时间单位,由于在一个月的不同时间段,比如月初和月末的时间段,再比如,以一年为时间单位,由于在一年的不同时间段,比如节假日活动期间与平时的工作日等,用户的业务流量都可能存在不同,可以根据对不同时间单位内的不同时间段的用户流量所占用实际带宽的历史数据统计,基于用户的业务流量所占用的实际带宽的大数据分析,实现针对不同时间单位内各个时间段的灵活限速,以更好的满足用户的业务流量对带宽的需求,比如,以一天为时间单位,由于早上用户的业务流量可能相对较小,可以对用户的业务流量进行较大幅度的限制,从而将物理机的带宽资源分配至业务流量 在早上较大的另一用户,由于晚上用户的业务流量可能相对较大,可以对用户的业务流量进行较小幅度的限制,以充分满足用户的业务流量对带宽的需求,从而将物理机的带宽资源根据用户的业务流量在不同的时间段对不同用户进行合理分配与调度,以使物理机的带宽资源得到充分利用,提高对物理机带宽资源的利用效率。
进一步地,所述方法还包括:根据所统计的所述用户的业务流量在预设时间单位内的所述预设时间段所占用的实际带宽的历史数据,对所述用户的业务流量所需要的实际带宽提示建议。
具体地,根据所统计的所述用户的业务流量在预设时间单位内的所述预设时间段所占用的实际带宽的历史数据,给用户购买带宽以建议,通过用户购买适合自己业务流量的带宽包总上限,对用户的业务流量所占用的带宽进行合理分配和对用户的业务流量进行限速,既能实现对物理机资源的合理分配和充分利用,又能避免由于对用户的业务流量进行限速,以对用户的业务数据进行处理,而对用户的业务数据造成损害,从而提高对用户的业务流量的处理效率和质量。
在一实施例中,所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤还包括:
接收所述同一网络中每台新增物理机通过同步技术发送的第二实际带宽。
具体地,本申请实施例中,由于路由器将同一个用户的业务流量按照随机方式分发至不同的物理机上,而不是定向发送至指定的物理机,因此可以根据需要增加新的物理机,只需要将物理机连接至该分布式部署的物理机群组中即可实现物理机的横向灵活扩展。当有新的物理机添加至分布式部署的物理机群组中,并且新增加的物理机接收到路由器按照随机方式分配的用户的业务流量,新增加的物理机和物理机群组中的原有物理机之间均会通过同步技术同步彼此的用户的业务流量在第一物理机上所占用的实际带宽等数据,该物理机群组中原有的物理机就会接收所述同一网络中新增物理机通过同步技术发送的所述预设用户的业务流量在所述新增物理机上所占用的第二实际带宽,从而根据用户的业务流量在所有物理机上各自所占用的实际带宽的数据对第一物理机上用户的业务流量所占用的实际带宽进行限速,从而提高对用户的业务流量进行限速的准确性。
因此,本申请实施例可以实现一个带宽包的流量分布在多台物理机之间,当流量持续增加的时候可以随时增加物理机的数量来进行物理机性能的扩容,让流量导入到新增机器上,分担原先每个机器的流量。同时,因为有多台物理机,一台宕机也不影响,即使一台物理机出现宕机等单点故障,通过故障检测也可以将出现单点故障的物理机排除在处理业务流量的物理机之外,而实现在处理流量的物理机中不会存在单点故障,这样当其中的一台物理机发生故障的时候,可以做到用户无感知的流量分担,后续只需要运维人员将新的机器添加进去即可达到横向扩展和高可用带宽限速的效果。
在一实施例中,所述获取第一实际带宽的步骤包括:
获取预设时间周期内路由器按照随机方式发送的预设用户的业务流量在所述第一物理机上所占用的实际带宽的平均值作为第一实际带宽;
所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤包括:
接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设时间周期内所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽的平均值。
具体地,由于根据实时数据对用户流量进行控制,会导致对用户的流量控制太频繁,也会消耗物理机的大量性能,因此,可以按照一定时间周期对用户的流量进行控制,比如30秒或者一分钟等时间周期,获取该时间周期内用户的业务流量所占用的实际带宽的平均值作为该用户的业务流量所占用的实际带宽,物理机获取预设时间周期内路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽的平均值作为第一实际带宽,接收其它每台第二物理机通过同步技术发送的所述预设时间周期内所述预设用户的业务流量在各 自所述物理机上所占用的实际带宽的平均值,将所述平均值作为所述预设时间周期内所述预设用户的业务流量在其它每台所述第二物理机上所占用的第二实际带宽,根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制,从而既能实现对用户流量的精准全活限速,又能缓解太过频繁的控制造成的对物理机性能的浪费,提高对物理机性能的使用率。
需要说明的是,上述各个实施例所述的基于分布式多物理机的用户带宽控制方法,可以根据需要将不同实施例中包含的技术特征重新进行组合,以获取组合后的实施方案,但都在本申请要求的保护范围之内。
请参阅图7,图7为本申请实施例提供的基于分布式多物理机的用户带宽控制装置的示意性框图。对应于上述基于分布式多物理机的用户带宽控制方法,本申请实施例还提供一种基于分布式多物理机的用户带宽控制装置。如图7所示,该基于分布式多物理机的用户带宽控制装置包括用于执行上述基于分布式多物理机的用户带宽控制方法的单元,该装置可以被配置于服务器等计算机设备中,尤其应用于同一网络中分布式部署的每台物理机上。具体地,请参阅图7,该基于分布式多物理机的用户带宽控制装置700包括第一获取单元701、接收单元702、第二获取单元703及控制单元704。
其中,第一获取单元701,用于获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;接收单元702,用于接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;第二获取单元703,用于获取所述预设用户的带宽包的预设阈值;控制单元704,用于根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
在一实施例中,所述接收单元702,用于接收其它每台第二物理机各自通过组播方式发送的第二实际带宽。
在一实施例中,所述控制单元704包括:判断子单元,用于判断所述第一实际带宽与所述第二实际带宽之和是否大于所述预设阈值;减少子单元,用于若所述第一实际带宽与所述第二实际带宽之和大于所述预设阈值,以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速,所有所述物理机上各自的限速值之和为所述预设阈值。
在一实施例中,所述减少子单元,用于以所述第一实际带宽与所述第一实际带宽和所述第二实际带宽之和的比值作为比例值,以所述比例值所对应的所述预设阈值的值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
在一实施例中,所述减少子单元,用于以预设比例的所述预设阈值作为第一限速值,以第一预设步长逐次减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
在一实施例中,所述接收单元702,还用于接收所述同一网络中每台新增物理机通过同步技术发送的第二实际带宽。
在一实施例中,所述第一获取单元701,用于获取预设时间周期内路由器按照随机方式发送的预设用户的业务流量在所述第一物理机上所占用的实际带宽的平均值作为第一实际带宽;
所述接收单元702,用于接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设时间周期内所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽的平均值。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述基于分布式多物理机的用 户带宽控制装置和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
同时,上述基于分布式多物理机的用户带宽控制装置中各个单元的划分和连接方式仅用于举例说明,在其它实施例中,可将基于分布式多物理机的用户带宽控制装置按照需要划分为不同的单元,也可将基于分布式多物理机的用户带宽控制装置中各单元采取不同的连接顺序和方式,以完成上述基于分布式多物理机的用户带宽控制装置的全部或部分功能。
上述基于分布式多物理机的用户带宽控制装置可以实现为一种计算机程序的形式,该计算机程序可以在如图8所示的计算机设备上运行。
请参阅图8,图8是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备800可以是台式机电脑或者服务器等计算机设备,也可以是其它设备中的组件或者部件。
参阅图8,该计算机设备800包括通过系统总线801连接的处理器802、存储器和网络接口805,其中,存储器可以包括非易失性存储介质803和内存储器804。
该非易失性存储介质803可存储操作系统8031和计算机程序8032。该计算机程序8032被执行时,可使得处理器802执行一种上述基于分布式多物理机的用户带宽控制方法。
该处理器802用于提供计算和控制能力,以支撑整个计算机设备800的运行。
该内存储器804为非易失性存储介质803中的计算机程序8032的运行提供环境,该计算机程序8032被处理器802执行时,可使得处理器802执行一种上述基于分布式多物理机的用户带宽控制方法。
该网络接口805用于与其它设备进行网络通信。本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备800的限定,具体的计算机设备800可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图8所示实施例一致,在此不再赘述。
其中,所述处理器802用于运行存储在存储器中的计算机程序8032,以实现本申请实施例所描述的用户带宽控制方法。
应当理解,在本申请实施例中,处理器802可以是中央处理单元(Central Processing Unit,CPU),该处理器802还可以是其它通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来完成,该计算机程序可存储于一计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。
因此,本申请实施例还提供一种计算机可读存储介质。该计算机可读存储介质可以为非易失性的计算机可读存储介质,也可以为易失性的计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时使处理器执行以上各实施例中所描述的基于分布式多物理机的用户带宽控制方法的步骤。
所述存储介质为实体的、非瞬时性的存储介质,例如可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的计算机可读存储介质。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员 可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
以上所述,仅为本申请的具体实施方式,但本申请明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种基于分布式多物理机的用户带宽控制方法,应用于同一网络中分布式部署的每台物理机上,包括:
    获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;
    接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;
    获取所述预设用户的带宽包的预设阈值;
    根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
  2. 根据权利要求1所述基于分布式多物理机的用户带宽控制方法,其中,所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤包括:
    接收其它每台第二物理机各自通过组播方式发送的第二实际带宽。
  3. 根据权利要求1或者2所述基于分布式多物理机的用户带宽控制方法,其中,所述根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上的所述预设用户的带宽进行控制的步骤包括:
    判断所述第一实际带宽与所述第二实际带宽之和是否大于所述预设阈值;
    若所述第一实际带宽与所述第二实际带宽之和大于所述预设阈值,以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速,所有所述物理机上各自的限速值之和为所述预设阈值。
  4. 根据权利要求3所述基于分布式多物理机的用户带宽控制方法,其中,所述以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速的步骤包括:
    以所述第一实际带宽与所述第一实际带宽和所述第二实际带宽之和的比值作为比例值,以所述比例值所对应的所述预设阈值的值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
  5. 根据权利要求3所述基于分布式多物理机的用户带宽控制方法,其中,所述以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速的步骤包括:
    以预设比例的所述预设阈值作为第一限速值,以第一预设步长逐次减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
  6. 根据权利要求3所述基于分布式多物理机的用户带宽控制方法,其中,所述根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上的所述预设用户的带宽进行控制的步骤还包括:
    若所述第一实际带宽与所述第二实际带宽之和不大于所述预设阈值,以所述预设阈值与所述第二实际带宽的差值作为第二限速值,增加所述第一实际带宽直至所述第一实际带宽达到所述第二限速值,以对所述第一物理机上的所述预设用户的带宽进行控制。
  7. 根据权利要求1所述基于分布式多物理机的用户带宽控制方法,其中,所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤还包括:
    接收所述同一网络中每台新增物理机通过同步技术发送的第二实际带宽。
  8. 根据权利要求1所述基于分布式多物理机的用户带宽控制方法,其中,所述获取第一实际带宽的步骤包括:
    获取预设时间周期内路由器按照随机方式发送的预设用户的业务流量在所述第一物理机上所占用的实际带宽的平均值作为第一实际带宽;
    所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤包括:
    接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设时间周期内所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽的平均值。
  9. 一种基于分布式多物理机的用户带宽控制装置,应用于同一网络中分布式部署的每台物理机上,包括:
    第一获取单元,用于获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;
    接收单元,用于接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;
    第二获取单元,用于获取所述预设用户的带宽包的预设阈值;
    控制单元,用于根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
  10. 一种计算机设备,其中,所述计算机设备包括存储器以及与所述存储器相连的处理器;所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行如下步骤:
    获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;
    接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;
    获取所述预设用户的带宽包的预设阈值;
    根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
  11. 根据权利要求10所述计算机设备,其中,所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤包括:
    接收其它每台第二物理机各自通过组播方式发送的第二实际带宽。
  12. 根据权利要求10或者11所述计算机设备,其中,所述根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上的所述预设用户的带宽进行控制的步骤包括:
    判断所述第一实际带宽与所述第二实际带宽之和是否大于所述预设阈值;
    若所述第一实际带宽与所述第二实际带宽之和大于所述预设阈值,以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速,所有所述物理机上各自的限速值之和为所述预设阈值。
  13. 根据权利要求12所述计算机设备,其中,所述以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速的步骤包括:
    以所述第一实际带宽与所述第一实际带宽和所述第二实际带宽之和的比值作为比例值,以所述比例值所对应的所述预设阈值的值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
  14. 根据权利要求12所述计算机设备,其中,所述以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速的步骤包括:
    以预设比例的所述预设阈值作为第一限速值,以第一预设步长逐次减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速。
  15. 根据权利要求12所述计算机设备,其中,所述根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上的所述预设用户的带宽进行控制的步骤还包括:
    若所述第一实际带宽与所述第二实际带宽之和不大于所述预设阈值,以所述预设阈值与所述第二实际带宽的差值作为第二限速值,增加所述第一实际带宽直至所述第一实际带宽达到所述第二限速值,以对所述第一物理机上的所述预设用户的带宽进行控制。
  16. 根据权利要求10所述计算机设备,其中,所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤还包括:
    接收所述同一网络中每台新增物理机通过同步技术发送的第二实际带宽。
  17. 根据权利要求10所述计算机设备,其中,所述获取第一实际带宽的步骤包括:
    获取预设时间周期内路由器按照随机方式发送的预设用户的业务流量在所述第一物理机上所占用的实际带宽的平均值作为第一实际带宽;
    所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤包括:
    接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设时间周期内所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽的平均值。
  18. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如下步骤:
    获取第一实际带宽,所述第一实际带宽为路由器按照随机方式发送的预设用户的业务流量在第一物理机上所占用的实际带宽;
    接收其它每台第二物理机各自通过同步技术发送的第二实际带宽,所述第二实际带宽为所述预设用户的业务流量在其它每台所述第二物理机上各自所占用的实际带宽,其中,每台所述第二物理机各自所接收的所述预设用户的业务流量是由所述路由器按照所述随机方式对所述预设用户的业务流量进行分配而得到的;
    获取所述预设用户的带宽包的预设阈值;
    根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上所述预设用户的带宽进行控制。
  19. 根据权利要求18所述计算机可读存储介质,其中,所述接收其它每台第二物理机各自通过同步技术发送的第二实际带宽的步骤包括:
    接收其它每台第二物理机各自通过组播方式发送的第二实际带宽。
  20. 根据权利要求18或者19所述计算机可读存储介质,其中,所述根据所述第一实际带宽、所述第二实际带宽及所述预设阈值,按照预设控制方式对所述第一物理机上的所述预设用户的带宽进行控制的步骤包括:
    判断所述第一实际带宽与所述第二实际带宽之和是否大于所述预设阈值;
    若所述第一实际带宽与所述第二实际带宽之和大于所述预设阈值,以预设比例的所述预设阈值作为第一限速值,减少所述第一实际带宽直至所述第一限速值,以对所述第一物理机上的所述预设用户的带宽进行限速,所有所述物理机上各自的限速值之和为所述预设阈值。
PCT/CN2020/119138 2020-02-26 2020-09-30 用户带宽控制方法、装置、计算机设备及存储介质 WO2021169299A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010120282.4A CN111447100B (zh) 2020-02-26 2020-02-26 用户带宽控制方法、装置、计算机设备及存储介质
CN202010120282.4 2020-02-26

Publications (1)

Publication Number Publication Date
WO2021169299A1 true WO2021169299A1 (zh) 2021-09-02

Family

ID=71627162

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119138 WO2021169299A1 (zh) 2020-02-26 2020-09-30 用户带宽控制方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111447100B (zh)
WO (1) WO2021169299A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111447100B (zh) * 2020-02-26 2023-06-06 平安科技(深圳)有限公司 用户带宽控制方法、装置、计算机设备及存储介质
CN115333982B (zh) * 2021-05-11 2024-02-09 北京金山云网络技术有限公司 流量监控方法、装置、设备及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103118134A (zh) * 2013-02-28 2013-05-22 浙江大学 一种面向任务级的大数据分发质量保障方法及装置
JP2016225729A (ja) * 2015-05-28 2016-12-28 株式会社日立製作所 ネットワークシステム、データ転送制御方法及び制御装置
US20190089645A1 (en) * 2015-08-25 2019-03-21 Shanghai Jiao Tong University Dynamic Network Flows Scheduling Scheme in Data Center
CN110177056A (zh) * 2019-06-06 2019-08-27 杭州商湾网络科技有限公司 一种自动适应的带宽控制方法
CN111447100A (zh) * 2020-02-26 2020-07-24 平安科技(深圳)有限公司 用户带宽控制方法、装置、计算机设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103118134A (zh) * 2013-02-28 2013-05-22 浙江大学 一种面向任务级的大数据分发质量保障方法及装置
JP2016225729A (ja) * 2015-05-28 2016-12-28 株式会社日立製作所 ネットワークシステム、データ転送制御方法及び制御装置
US20190089645A1 (en) * 2015-08-25 2019-03-21 Shanghai Jiao Tong University Dynamic Network Flows Scheduling Scheme in Data Center
CN110177056A (zh) * 2019-06-06 2019-08-27 杭州商湾网络科技有限公司 一种自动适应的带宽控制方法
CN111447100A (zh) * 2020-02-26 2020-07-24 平安科技(深圳)有限公司 用户带宽控制方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN111447100B (zh) 2023-06-06
CN111447100A (zh) 2020-07-24

Similar Documents

Publication Publication Date Title
CN109787921B (zh) Cdn带宽调度方法、采集及调度服务器和存储介质
US10735323B2 (en) Service traffic allocation method and apparatus
US7965654B2 (en) System and method for designing a network
EP3949293A1 (en) Slice-based routing
CN109818881B (zh) Cdn带宽调度方法、采集及调度服务器和存储介质
EP3754915B1 (en) Data processing method and apparatus
WO2021169299A1 (zh) 用户带宽控制方法、装置、计算机设备及存储介质
US9979656B2 (en) Methods, systems, and computer readable media for implementing load balancer traffic policies
JP7313480B2 (ja) スライスベースネットワークにおける輻輳回避
JP2008527848A (ja) ハードウェア・ベースのメッセージング・アプライアンス
US7656797B2 (en) Method, computer program product, and apparatus for providing a distributed router architecture
CN112242949A (zh) 路由分发方法及控制器、信息路由方法及网络节点设备
US11228529B1 (en) Local and global quality of service shaper on ingress in a distributed system
CN109873776B (zh) 一种组播报文负载分担的均衡方法及装置
US20040081091A1 (en) Priority-based efficient fair queuing for quality of service classificatin for packet processing
WO2006074832A1 (en) On-demand group communication services with quality of service (qos) guarantees
CN113364809A (zh) 分流网络数据以执行负载平衡
US20180302329A1 (en) Output rates for virtual output queues
WO2023142937A1 (zh) 一种网络拥塞控制方法及相关装置
CN112087382B (zh) 一种服务路由方法及装置
CN102448120A (zh) 多路径负荷分担方法及装置
CN112052075A (zh) 云桌面虚拟机的热迁移方法、服务器及存储介质
CN113630319B (zh) 一种数据分流方法、装置及相关设备
CN113395362B (zh) 移动边缘计算的服务链分群和重整方法
WO2022193885A1 (zh) 一种用户上线的处理方法以及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20921064

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20921064

Country of ref document: EP

Kind code of ref document: A1