WO2021057607A1 - 一种节点限速的方法、装置、电子设备及存储介质 - Google Patents

一种节点限速的方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021057607A1
WO2021057607A1 PCT/CN2020/116095 CN2020116095W WO2021057607A1 WO 2021057607 A1 WO2021057607 A1 WO 2021057607A1 CN 2020116095 W CN2020116095 W CN 2020116095W WO 2021057607 A1 WO2021057607 A1 WO 2021057607A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
bandwidth
quota
domain name
target domain
Prior art date
Application number
PCT/CN2020/116095
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 北京金山云网络技术有限公司
Priority to US17/626,352 priority Critical patent/US11824787B2/en
Priority to EP20868442.3A priority patent/EP3985932A4/en
Priority to JP2022501137A priority patent/JP7383113B2/ja
Publication of WO2021057607A1 publication Critical patent/WO2021057607A1/zh

Links

Images

Classifications

    • 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/76Admission control; Resource allocation using dynamic resource allocation, e.g. in-call renegotiation requested by the user or requested by the network in response to changing network conditions
    • H04L47/765Admission control; Resource allocation using dynamic resource allocation, e.g. in-call renegotiation requested by the user or requested by the network in response to changing network conditions triggered by the end-points
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/26Flow control; Congestion control using explicit feedback to the source, e.g. choke packets
    • H04L47/267Flow control; Congestion control using explicit feedback to the source, e.g. choke packets sent by the destination endpoint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • H04L43/065Generation of reports related to network devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/20Traffic policing
    • 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
    • H04L47/785Distributed allocation of resources, e.g. bandwidth brokers among multiple network domains, e.g. multilateral agreements
    • H04L47/786Mapping reservation between domains
    • 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
    • H04L47/787Bandwidth trade among domains
    • 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/82Miscellaneous aspects
    • H04L47/822Collecting or measuring resource availability data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames

Definitions

  • This application relates to the field of computer technology, and in particular to a method, device, electronic equipment, and storage medium for speed limiting of nodes.
  • the current method of limiting the speed of each node is to set a bandwidth limit for each node.
  • the bandwidth of the node exceeds the bandwidth limit corresponding to the node, the electronic device can limit the speed of the node to make the node's bandwidth limit.
  • the bandwidth is less than the bandwidth limit.
  • the bandwidth limit set by the electronic device for each node is a fixed value, it will cause the nodes with large traffic to be continuously limited, and the bandwidth of the nodes with small traffic cannot easily reach the bandwidth limit. Therefore, the setting of each node The bandwidth limit of does not apply to the situation corresponding to the bandwidth of each node.
  • the purpose of the embodiments of the present application is to provide a method, a device, an electronic device, and a storage medium for limiting the speed of a node, so as to accurately calculate the bandwidth quota corresponding to each node.
  • the specific technical solutions are as follows:
  • a method for node rate limiting is provided.
  • the method is applied to an electronic device.
  • the method includes: receiving bandwidth data reported by a node under a target domain name, wherein the bandwidth data includes the number of node connections and the node bandwidth.
  • the number of node connections is the number of connections of the devices in the aforementioned node;
  • the bandwidth quota corresponding to the aforementioned node is calculated according to the aforementioned bandwidth data and the upper limit of the quota corresponding to the aforementioned target domain name, where the aforementioned bandwidth quota is the maximum value of the aforementioned node after the speed limit policy is enabled. Available bandwidth.
  • a device for node rate limiting is provided.
  • the device is applied to electronic equipment.
  • the device includes: a receiving module for receiving bandwidth data reported by a node under a target domain name, wherein the bandwidth data includes the number of node connections And node bandwidth, the number of node connections is the number of connections of devices in the node; the calculation module is used to calculate the bandwidth quota corresponding to the node based on the bandwidth data and the upper limit of the quota corresponding to the target domain name, where the bandwidth quota is in After enabling the speed limit policy, the maximum available bandwidth of the above nodes.
  • an electronic device which includes a processor, a communication interface, a memory, and a communication bus.
  • the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is set to store computer programs; processing The device is set to implement the steps of the method described in the first aspect when the program stored in the memory is executed.
  • a computer-readable storage medium is provided, and a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in the first aspect are implemented.
  • a computer program product containing instructions which when run on a computer, causes the computer to execute the method described in the first aspect.
  • a computer program is provided.
  • the computer program runs on a computer, the computer executes the method described in the first aspect.
  • the electronic device can receive the bandwidth data reported by the node under the target domain name, and calculate the bandwidth quota corresponding to the node based on the bandwidth data and the upper limit of the quota corresponding to the target domain name. In this way, because different nodes have different bandwidth data, the electronic device can calculate the bandwidth quota corresponding to each node separately for each node according to the bandwidth data of each node under the target domain name. Therefore, the bandwidth quota corresponding to each node calculated by the electronic device can accurately match the bandwidth status of each node, so that the electronic device can more accurately allocate bandwidth quota to each node under the target domain name.
  • Figure 1(a) is a schematic diagram of the structure of a content distribution network
  • Figure 1(b) is a schematic flow chart of a method for node speed limitation provided by an embodiment of this application;
  • FIG. 2 is a flow chart of a method for node speed limitation provided by an embodiment of the application
  • FIG. 3 is a schematic structural diagram of a device for limiting node speed according to an embodiment of this application.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • the embodiment of the present application provides a method for node rate limiting, which can be applied to an electronic device, and the electronic device can allocate bandwidth quotas to each node under at least one domain name.
  • the above-mentioned electronic device may be a content delivery network (Content Delivery Network, CDN) central server.
  • CDN Content Delivery Network
  • the CDN central server can manage multiple domain names, each domain name can have at least one node, each node can be a server, or a collection of multiple servers, and the servers under each node can be connected There is at least one terminal device. In this way, the CDN central server can manage each terminal device connected to the node through the server under each node.
  • FIG. 1(a) it is a schematic diagram of the structure of a content distribution network.
  • the CDN central server can manage domain name 1, domain name 2, and domain name 3.
  • node 1 is Server 1, and server 1 is connected to terminal device 1 and terminal device 2;
  • node 2 is a collection of server 2 and server 3, and server 2 is connected to terminal device 3, and server 3 is connected to terminal device 4, terminal device 5 and terminal device 6;
  • Node 3 is server 4, and server 4 is connected to terminal device 7;
  • node 4 is a collection of server 5 and server 6, and server 5 is connected to terminal device 8 and terminal device 9, server 6 is connected to terminal device 10 and terminal Device 11;
  • Node 5 is server 7, and server 7 is connected to terminal device 12.
  • Figure 1 (a) is only an example of the structure of the content distribution network, and is not a limitation, and the embodiment of the present application does not limit the specific structure of the content distribution network.
  • the electronic device can realize the purpose of managing the node by assigning bandwidth quota to the node (that is, limiting the speed of the node), and further realize the purpose of managing each terminal device connected under the node.
  • the bandwidth quota is the upper limit of the bandwidth allocated by the electronic device to each node, and each node can limit the speed of the terminal device connected to itself according to the bandwidth quota.
  • the above-mentioned bandwidth data includes the number of node connections and node bandwidth
  • the number of node connections is the number of connections of devices in the node
  • the node bandwidth is the sum of the bandwidth used by the node and each device under the node.
  • the number of devices in the node is the number of terminal devices connected to the server included in the node, that is, the number of node connections is the number of terminal devices connected under the node.
  • the node connection number of the node is the number of terminal devices connected to the server; when the node is a collection of multiple servers, the node connection number of the node is the number of all the servers under the node. The sum of the number of connected terminal devices.
  • the aforementioned target domain name is any domain name managed by the electronic device, and at least one node may exist under the target domain name. Then the electronic device can receive the bandwidth data reported by each node under the target domain name.
  • the node reporting bandwidth data is a collection of multiple servers
  • there may be a management server for managing the multiple servers in the multiple servers then in the above step S101, the electronic device receives That is, the bandwidth data reported by the management server, that is, the sum of the number of terminal devices connected to the multiple servers, and the sum of the bandwidth used by the multiple servers and each terminal device connected to the multiple servers;
  • the multiple servers may report their own bandwidth data to the electronic device at the same time, where the bandwidth data reported by each server includes: the number of terminal devices connected to the server, and the server and each terminal device connected to the server The total bandwidth used.
  • the electronic device receives the bandwidth data reported by each of the multiple servers, it can determine the bandwidth data of the node based on the multiple bandwidth data, that is, determine the connection of the multiple servers The sum of the number of terminal devices, and the sum of bandwidth used by the multiple servers and each terminal device connected to the multiple servers.
  • the node may also send a bandwidth quota query request while reporting bandwidth data.
  • the electronic device may also receive the bandwidth quota query request sent by the node.
  • the node may carry bandwidth data and bandwidth quota query request in one message, or may carry bandwidth data and bandwidth quota query request in different messages respectively, that is, report bandwidth data in one message , And send a bandwidth quota query request through another message.
  • each node under the target domain name can report bandwidth data and send bandwidth quota query requests every other reporting period (for example, every 5 seconds).
  • the embodiment of the present application takes one reporting period of one of the nodes as an example for description, and the method for each node to report bandwidth data and query the bandwidth quota in each reporting period may be the same.
  • the bandwidth quota is the maximum available bandwidth of the node after the speed limit policy is enabled.
  • each node under the target domain name can report its own bandwidth data every other reporting period (for example, 5 seconds), and then the electronic device can calculate the bandwidth quota corresponding to each node according to the bandwidth data reported by each node.
  • the electronic device can allocate the calculated bandwidth quota to the node, so that the electronic device can limit the speed of the node according to the bandwidth quota. That is, when the total bandwidth used by the node and the devices under the node exceeds the calculated bandwidth quota, the node is subject to rate limit.
  • the electronic device can allocate the calculated bandwidth quota corresponding to the node to the server. Furthermore, when the bandwidth used by the server exceeds the bandwidth quota allocated by the electronic device to the server, the electronic device can limit the rate of the node, that is, the electronic device can limit the rate of the server.
  • the electronic device can allocate the calculated bandwidth quota corresponding to the node to each server under the node.
  • the electronic device can use any allocation principle to allocate the bandwidth quota corresponding to the node to the above-mentioned servers.
  • the electronic device can allocate the bandwidth quota corresponding to the node to each server according to the load situation of each server.
  • the electronic device can According to the current time and the predetermined time when the load of each server is relatively large, each server is allocated a bandwidth quota corresponding to the node. This is all reasonable.
  • the electronic device when a node is a collection of multiple servers, when the bandwidth used by a certain server exceeds the bandwidth quota allocated by the electronic device for the server, the electronic device can limit the speed of the node, that is, the electronic device can The server limits the speed; when there is no server that uses bandwidth that exceeds the bandwidth allocated by the electronic device, and the sum of the bandwidth used by the node and the devices under the node exceeds the bandwidth quota calculated above, the electronic device will The rate of the node can be limited, that is, the electronic device can limit the rate of at least one of the multiple servers.
  • each node can report its own bandwidth data every other reporting period. Since each node reports bandwidth data in a discrete form, the electronic device can cache the bandwidth data reported by each node, and calculate the bandwidth quota corresponding to the bandwidth data reported by each node every other calculation cycle, that is, calculate the corresponding bandwidth data of each node. Bandwidth quota. For example, each node under the target domain name reports bandwidth data every 5 seconds, but the time when each node reports bandwidth data can be different. For example, node A reports bandwidth data in the 12th second, and node B reports bandwidth data in the 12.3 second, so The electronic device can start the process of calculating the bandwidth quota every 1 second.
  • the electronic device can cache the bandwidth data, and in the next calculation cycle, calculate the bandwidth quota corresponding to the bandwidth data, that is, calculate the bandwidth quota corresponding to each node.
  • the electronic device can calculate the bandwidth quota corresponding to the node that reports the cached bandwidth data based on the bandwidth data that has been cached in the calculation period.
  • the embodiment of the present application takes the method of calculating the bandwidth quota corresponding to one of the nodes in one calculation cycle as an example for description, and the method of calculating the bandwidth quota corresponding to each node may be the same.
  • the electronic device may set a quota upper limit corresponding to the target domain name for the target domain name, and the quota upper limit is used to limit the speed of each node under the target domain name.
  • the electronic device can receive the bandwidth data reported by the node under the target domain name, and calculate the bandwidth quota corresponding to the node based on the bandwidth data and the upper limit of the quota corresponding to the target domain name. In this way, because different nodes have different bandwidth data, the electronic device can calculate the bandwidth quota corresponding to each node separately for each node according to the bandwidth data of each node under the target domain name. Therefore, the bandwidth quota corresponding to each node calculated by the electronic device can accurately match the bandwidth status of each node, so that the electronic device can more accurately allocate bandwidth quota to each node under the target domain name.
  • the bandwidth quota corresponding to the node is calculated according to the bandwidth data and the upper limit of the quota corresponding to the target domain name.
  • the embodiment of the present application may provide two achievable ways to calculate the bandwidth quota.
  • Method 1 The electronic device can determine the total allocatable quota, and calculate the bandwidth quota corresponding to the node based on the total allocatable quota and bandwidth data.
  • the total allocable quota is the product of the upper limit of the quota corresponding to the target domain name and the first preset ratio.
  • the embodiment of the present application does not limit the specific value of the above-mentioned first preset ratio.
  • the first preset ratio can be determined according to the actual application, the size of other traffic under the target domain name except the traffic of each node, so as to ensure the quantity transmission of various types of information under the target domain name and the smoothness of various tasks run.
  • the above-mentioned first preset ratio is determined according to the amount of traffic required by the electronic device to send the control management instruction to each node under the target domain name.
  • the above-mentioned first preset ratio may be 98.5%, and if the upper limit of the quota corresponding to the target domain name is X, the total quota that can be allocated is 0.985X; for another example, the above-mentioned first preset ratio may be 98%, and if the target domain name The corresponding quota upper limit is X, and the total quota that can be allocated is 0.98X; of course, the first preset ratio can also be other specific values, such as 99%, 97.5%, and so on. This is all reasonable.
  • the electronic device After the electronic device determines the total allocatable quota, it can calculate the bandwidth quota corresponding to the node based on the total allocatable quota and bandwidth data.
  • the bandwidth quota corresponding to the above node total allocable quota*(the second preset ratio*the number of node connections/the total number of node connections under the target domain name+the third preset ratio*the bandwidth of the node/the total bandwidth of the node under the target domain name ).
  • the total number of connections to nodes under the target domain name is: the sum of the number of devices connected to all nodes under the target domain name
  • the total bandwidth of nodes under the target domain name is: the sum of the bandwidth of all nodes under the target domain name.
  • the sum of the number of devices connected to all nodes under the target domain name is: the sum of the number of terminal devices connected to all servers in all nodes under the target domain name.
  • the embodiment of the present application does not limit the specific numerical values of the above-mentioned second preset ratio and the third preset ratio.
  • the second preset ratio and the third preset ratio can be determined according to the actual application, the number of tasks processed by the terminal devices connected to each node under the target domain name and the amount of traffic required to process these tasks to ensure the target The terminal equipment connected to each node under the domain name can complete their tasks quickly and smoothly.
  • the second preset ratio and the third preset ratio may be the same or different, and when the second preset ratio and the third preset ratio are different, the second preset ratio may be greater than the third preset ratio, It can also be smaller than the third preset ratio, which is all reasonable.
  • the total allocable quota is Y
  • the number of node connections is 5
  • each node under the target domain name is connected to a total of 100 terminals
  • the total number of nodes under the target domain name is The number of connections is 100
  • the second preset ratio is 50%
  • the node bandwidth is 0.8Gbps
  • the total bandwidth of the nodes under the target domain name is 10Gbps
  • the third preset ratio is 50%.
  • the bandwidth quota corresponding to node A is calculated by the electronic device based on the number of node connections and node bandwidth of node A, so that excess bandwidth will not be wasted Resources, there will be no shortage of bandwidth.
  • node B For another example, for node B, assuming that the total allocation quota is Z, if node B is connected to 10 terminals, the number of node connections is 10, and each node under the target domain name is connected to a total of 150 terminals, then the node under the target domain name The total number of connections is 150, the second preset ratio is 60%, the node bandwidth is 1.0Gbps, the total bandwidth of the nodes under the target domain name is 15Gbps, and the third preset ratio is 40%.
  • the bandwidth quota corresponding to node B is calculated by the electronic device according to the number of node connections and node bandwidth of node B, so that no excess bandwidth is wasted Resources, there will be no shortage of bandwidth.
  • second preset ratio and third preset ratio may also be other specific values, for example, 65%, 55%, etc. This is all reasonable.
  • each node under the target domain name can report bandwidth data every other reporting period (for example, 5 seconds) and obtain a bandwidth quota.
  • the electronic device can allocate bandwidth quota to each node in real time according to the real-time bandwidth situation of each node, so that the bandwidth quota allocated to each node can have higher accuracy and real-time performance.
  • Method 2 If the electronic device does not obtain the bandwidth data reported by each node under the target domain name or the bandwidth data reported by each node is inaccurate, the electronic device can determine the total allocatable quota, and calculate the average bandwidth corresponding to the node based on the total allocatable quota quota.
  • the average bandwidth quota total allocable quota/total number of nodes under the target domain name.
  • the electronic device can evenly allocate the total allocatable quota corresponding to the target domain name to the target domain name. Of each node. In this way, the bandwidth quota (average bandwidth quota) obtained by each node under the target domain name is equal, so that the bandwidth demand of each node under the target domain name can be met as much as possible.
  • the electronic device can determine that the acquired bandwidth data reported by each node is inaccurate in a variety of ways, which is not specifically limited in the embodiment of the present invention. For example, there are garbled codes in the bandwidth data reported by each node received by the electronic device, which causes the electronic device to be unable to read the specific content of the bandwidth data; for another example, the node in the bandwidth data reported by each node received by the electronic device The bandwidth exceeds the total allocable quota of the target domain name, etc. This is all reasonable.
  • the electronic device may also store the bandwidth quota corresponding to the node. That is to say, the method for limiting the speed of a node provided in an embodiment of the present application may further include the following steps:
  • the electronic device can update the bandwidth quota corresponding to the node to the bandwidth quota calculated this time;
  • the electronic device may store the bandwidth quota corresponding to the node.
  • the central server is used to manage the nodes under the target domain name.
  • the electronic device used to execute the method for node rate limiting when the above-mentioned electronic device used to execute the method for node rate limiting provided by the embodiment of the present application is the central server, after calculating the bandwidth quota corresponding to a node, the electronic device can determine that its own memory Whether there is a bandwidth quota corresponding to the node. Furthermore, when the result of the judgment is that it exists, the electronic device can update the existing bandwidth quota to the bandwidth quota calculated above. Correspondingly, when the result of the judgment is that it does not exist, the electronic device can have the bandwidth obtained by the calculation. quota.
  • the electronic device can It is determined whether there is a bandwidth quota corresponding to the node in the memory of the central server in a variety of ways. For example, the electronic device may send to the central server a query request for querying whether there is a bandwidth quota corresponding to the node in the memory of the central server, and receive the query result fed back by the central server.
  • the electronic device can send the calculated bandwidth quota to the central server, so that the central server can update the existing bandwidth quota to the above calculation
  • the electronic device can send the calculated bandwidth quota to the central server, so that the central server stores the calculated bandwidth Bandwidth quota.
  • the central server may be a CDN central server.
  • the electronic device may also determine the current domain name bandwidth corresponding to the target domain name every preset period, and determine whether the current domain name bandwidth is greater than the fourth preset ratio of the upper limit of the quota corresponding to the target domain name.
  • the current domain name bandwidth is the total real-time bandwidth corresponding to the target domain name at the current moment. After determining the current domain name bandwidth, the electronic device can determine whether the current domain name bandwidth is greater than the fourth preset ratio of the quota upper limit corresponding to the target domain name, and cache the judgment result .
  • the bandwidth of the current domain name is greater than the fourth preset ratio of the upper limit of the quota corresponding to the target domain name, it can be proved that the bandwidth usage of the target domain name is relatively large, and further, the electronic device needs to limit the rate of the target domain name.
  • the bandwidth of the current domain name is not greater than the fourth preset ratio of the online quota corresponding to the target domain name, it can be proved that the bandwidth usage of the target domain name is small, and further, the electronic device may not need to limit the target domain name.
  • the embodiment of the present application does not limit the specific value of the foregoing fourth preset ratio.
  • the fourth preset ratio may be determined according to the bandwidth usage rate of the target domain name and the load of the target domain name in actual applications, so as to ensure that each task in the target domain name can be responded to in a timely manner.
  • the foregoing fourth preset ratio may be 90%, 98%, etc., of course, the fourth preset ratio may also be other values, which are all reasonable.
  • the period for the electronic device to determine the bandwidth of the current domain name may be the aforementioned calculation period, that is, the electronic device may determine the current domain name bandwidth corresponding to the target domain name while calculating the bandwidth quota corresponding to the node in each calculation period.
  • the electronic device may determine the current domain name bandwidth corresponding to the target domain name every other calculation period, and in each calculation period, the electronic device may determine the current domain name bandwidth corresponding to the target domain name. If the calculation period is relatively short (for example, 1 second), the electronic device can realize the effect of determining the bandwidth of the current domain name in real time.
  • the process of the electronic device determining the current domain name bandwidth corresponding to the target domain name will be performed synchronously with the process of the electronic device determining the bandwidth quota corresponding to the node, that is, The electronic device can determine the bandwidth of the current domain name every time the bandwidth quota corresponding to the node is determined.
  • the process of the electronic device determining the bandwidth of the current domain name will be performed asynchronously with the process of determining the bandwidth quota corresponding to the node by the electronic device.
  • the electronic device when the electronic device receives the bandwidth quota query request sent by the node, the electronic device can obtain the last determination result of the fourth preset ratio of determining whether the current domain name bandwidth is greater than the upper limit of the quota corresponding to the target domain name.
  • the electronic device may send the stored bandwidth quota corresponding to the node to the node.
  • the electronic device may send an unlimited rate instruction to the node.
  • the node may report bandwidth data and bandwidth quota query requests every 5 seconds (reporting period). Between the node a-th reporting bandwidth data and the a+1-th reporting bandwidth data, the electronic device calculates and stores the bandwidth quota corresponding to the bandwidth data reported by the node a-th time based on the bandwidth data reported by the node a-th time. When the node reports bandwidth data for the a+1th time, the node may send a bandwidth quota query request.
  • the electronic device After receiving the bandwidth quota query request, the electronic device can obtain the latest judgment result. If the judgment result is: the bandwidth of the current domain name is greater than 80% of the quota upper limit corresponding to the target domain name (80% is the fourth preset ratio), then the electronic device The bandwidth quota corresponding to the bandwidth data reported by the node a-th stored by the electronic device may be sent to the node. That is, if the bandwidth of the current domain name is greater than 80% of the upper limit of the quota corresponding to the target domain name, the electronic device can activate the speed limit policy to limit the speed of each node under the target domain name.
  • the electronic device can save an action of searching for the node between the ath reporting bandwidth data of the node and the a+1th reporting bandwidth data. Since the electronic device needs to continuously calculate the bandwidth quotas of a large number of nodes, the efficiency of the electronic device's bandwidth quota allocation for a large number of nodes can be greatly improved.
  • the electronic device limits the rate of domain names that exceed the fourth preset percentage of the quota upper limit, which can be used to prevent network attacks.
  • programs that invade the network may cause the real-time bandwidth of the network to increase rapidly, which in turn causes the bandwidth of the current domain name corresponding to the target domain name to increase rapidly. If the bandwidth of the current domain name exceeds the fourth preset ratio of the upper limit of the quota, the electronic device can automatically limit the rate of the target domain name and limit the bandwidth occupied by programs that invade the network, thereby achieving the purpose of preventing network attacks.
  • the electronic device may also calculate the minimum bandwidth quota for each node under the target domain name, and send the minimum bandwidth quota to each node under the target domain name. That is to say, the method for limiting the speed of a node provided in an embodiment of the present application may further include the following steps:
  • the minimum bandwidth quota (the upper limit of the quota of the target domain name-the total quota that can be allocated) / the total number of nodes under the target domain name.
  • this embodiment of the present application provides another method of determining the total allocatable quota and another method of determining the minimum bandwidth quota, in which:
  • the minimum bandwidth quota the upper limit of the quota of the target domain name*the preset value/100/total number of nodes under the target domain name.
  • the total allocable quota the upper limit of the quota of the target domain name-the minimum bandwidth quota * the total number of nodes under the target domain name.
  • the preset value is any one of (0, 100), and the embodiment of the present application does not limit the foregoing preset value.
  • the preset value can be determined according to the actual application, the number of tasks processed by the terminal equipment connected to each node under the target domain name and the amount of traffic required to process these tasks, so as to ensure that each node under the target domain name is connected to The terminal equipment can complete their tasks quickly and smoothly.
  • the preset value may be 1.5, 1.2, etc., of course, the preset value may also be other values in (0, 100), which are all reasonable.
  • the method of determining the minimum bandwidth quota may be any method disclosed in the embodiment of the present application, which is not limited in the embodiment of the present application.
  • the electronic device may send a minimum bandwidth quota to each node for each node under the target domain name. Therefore, even if the bandwidth quota of the node calculated by the electronic device according to the foregoing S102 is zero, the node can obtain a minimum bandwidth quota to ensure the basic bandwidth requirements of each device connected to the node.
  • the embodiment of the present application provides an example of reporting bandwidth data once for a node.
  • the example may include the following steps:
  • S201 Receive bandwidth data and a bandwidth quota query request reported by node A under the target domain name.
  • steps 202 and 208 can be executed simultaneously.
  • S203 Determine whether the current time reaches the start time of the calculation period. If the start time of the calculation cycle is reached, S204 and S206 are executed, and if the start time of the calculation cycle is not reached, S203 is executed.
  • the electronic device can execute S206 to S207 and S204 to S205 in each calculation cycle.
  • S204 and S206 are taken as an example.
  • S206 may also be executed after S205.
  • the electronic device can update the bandwidth quota corresponding to node A to the bandwidth quota calculated this time. If the bandwidth quota corresponding to node A does not exist in the memory, then The electronic device can store the bandwidth quota corresponding to node A.
  • S207 Determine whether the bandwidth of the current domain name is greater than 80% of the upper limit of the quota corresponding to the target domain name, and cache the determination result.
  • the current domain name bandwidth can meet the judgment results in two cases: a.
  • the current domain name bandwidth is greater than 80% of the upper limit of the quota corresponding to the target domain name; b.
  • the current domain name bandwidth is less than or equal to 80% of the upper limit of the quota corresponding to the target domain name.
  • S208 Determine whether the current cached judgment result is that the bandwidth of the current domain name is greater than 80% of the upper limit of the quota corresponding to the target domain name. If yes, go to S209, otherwise go to S210.
  • the judgment result judged in S208 is the judgment result cached when S207 was executed last time.
  • S209 Send a speed limit instruction to node A, where the speed limit instruction includes the currently stored bandwidth quota of node A.
  • the electronic device Upon receiving the bandwidth quota query request reported by node A, the electronic device determines that the current cached judgment result is: the bandwidth of the current domain name is greater than 80% of the upper limit of the quota corresponding to the target domain name, and it can send to node A the node including the current storage A speed limit instruction of the bandwidth quota in response to the bandwidth quota query request.
  • the speed limit instruction sent by node A is the response to the bandwidth quota query request reported by node A.
  • the above-mentioned speed limit instruction sent to node A includes the currently stored bandwidth quota of node A, that is to say, in response to the bandwidth quota query request reported by node A, the above-mentioned currently stored bandwidth quota can be sent to node A Bandwidth quota for node A.
  • node A when node A is a server, the above-mentioned currently stored bandwidth quota of node A is sent to the server, so that the electronic device can limit the rate of node A according to the bandwidth quota.
  • node A is a collection of multiple servers, according to the preset allocation principle, the bandwidth quota of node A currently stored is allocated to each server under node A, so that the electronic device can be based on the aforementioned currently stored node
  • the bandwidth quota of A and the bandwidth quota allocated to each server limit the speed of node A.
  • S210 Send an unlimited speed instruction to node A.
  • node A if node A receives an unlimited speed instruction, node A does not limit the speed of each device under node A.
  • the electronic device Upon receiving the bandwidth quota query request reported by node A, the electronic device determines that the current cached judgment result is not: the current domain name bandwidth is greater than 80% of the quota upper limit corresponding to the target domain name, and it can send an unlimited rate instruction to node A In response to the bandwidth quota query request.
  • the unlimited rate instruction sent by node A is the response to the bandwidth quota query request reported by node A.
  • an embodiment of the present application also provides a device for limiting node speed.
  • the device includes: a receiving module 301 and a calculation module 302;
  • the receiving module 301 is configured to receive bandwidth data reported by nodes under the target domain name, where the bandwidth data includes the number of node connections and node bandwidth, and the number of node connections is the number of connections of devices in the node;
  • the calculation module 302 is set to calculate the bandwidth quota corresponding to the node according to the bandwidth data and the upper limit of the quota corresponding to the target domain name, where the bandwidth quota is the maximum available bandwidth of the node after the speed limit policy is enabled.
  • the calculation module 302 is specifically configured as follows:
  • the bandwidth quota the total allocatable quota * (the second preset ratio * the number of node connections / the total number of node connections under the target domain name + the third preset Ratio*Node bandwidth/total bandwidth of nodes under the target domain name), the total number of connections to nodes under the target domain name is the sum of the number of devices connected to all nodes under the target domain name, and the total bandwidth of nodes under the target domain name is all nodes under the target domain name The sum of bandwidth.
  • the device further includes: an update module
  • the update module is set to update the bandwidth quota corresponding to the node to the bandwidth quota obtained this time if there is a bandwidth quota corresponding to the node in the memory of the central server; or,
  • the update module is used to store the bandwidth quota corresponding to the node if there is no bandwidth quota corresponding to the node in the memory of the central server, and the central server is used to manage each node under the target domain name.
  • the device further includes: a determining module
  • the determining module is configured to determine the current domain name bandwidth corresponding to the target domain name every preset period, and determine whether the current domain name bandwidth is greater than the fourth preset ratio of the upper limit of the quota corresponding to the target domain name.
  • the device further includes: an acquisition module and a sending module;
  • the obtaining module is configured to obtain a fourth preset ratio of the last judgment result of whether the bandwidth of the current domain name is greater than the upper limit of the quota corresponding to the target domain name when the bandwidth quota query request sent by the node is received;
  • the sending module is configured to send a bandwidth quota query response to the node if the judgment result is that the bandwidth of the current domain name is greater than the fourth preset ratio of the upper limit of the quota corresponding to the target domain name.
  • the bandwidth quota query response includes the bandwidth quota corresponding to the node currently stored.
  • the device further includes: a distribution module
  • the allocation module is configured to send a minimum bandwidth quota to each node under the target domain name, so that when the bandwidth quota corresponding to the node is zero, the node limits the speed of each device under the node according to the minimum bandwidth quota.
  • the electronic device can receive the bandwidth data reported by the node under the target domain name, and calculate the bandwidth quota corresponding to the node based on the bandwidth data and the upper limit of the quota corresponding to the target domain name. In this way, because different nodes have different bandwidth data, the electronic device can calculate the bandwidth quota corresponding to each node separately for each node according to the bandwidth data of each node under the target domain name. Therefore, the bandwidth quota corresponding to each node calculated by the electronic device can accurately match the bandwidth status of each node, so that the electronic device can more accurately allocate bandwidth quota to each node under the target domain name.
  • the embodiment of the present application also provides an electronic device, as shown in FIG. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404.
  • the processor 401, the communication interface 402, and the memory 403 pass through the communication bus 404. Complete the communication between each other,
  • the memory 403 is set to store computer programs
  • bandwidth data reported by a node under the target domain name where the bandwidth data includes the number of node connections and node bandwidth, and the number of node connections is the number of connections of devices in the node;
  • the bandwidth quota corresponding to the node is calculated, where the bandwidth quota is the maximum available bandwidth of the node after the speed limit policy is enabled.
  • processor 401 when used to execute the program stored in the memory 403, it is also used to implement other steps described in the above method embodiment. You can refer to the relevant description in the above method embodiment. Go into details.
  • the communication bus mentioned by the aforementioned network device may be a peripheral component interconnection standard (English: Peripheral Component Interconnect, referred to as PCI) bus or an extended industry standard architecture (English: Extended Industry Standard Architecture, referred to as EISA) bus, etc.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface is used for communication between the aforementioned network device and other devices.
  • the memory may include random access memory (English: Random Access Memory, abbreviated as: RAM), and may also include non-volatile memory (English: Non-Volatile Memory, abbreviated as: NVM), for example, at least one disk storage.
  • RAM Random Access Memory
  • NVM Non-Volatile Memory
  • the memory may also be at least one storage device located far away from the foregoing processor.
  • the above-mentioned processor may be a general-purpose processor, including a central processing unit (English: Central Processing Unit, abbreviated as: CPU), a network processor (English: Network Processor, abbreviated as: NP), etc.; it may also be a digital signal processor (English: : Digital Signal Processing, abbreviation: DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, abbreviation: ASIC), Field-Programmable Gate Array (English: Field-Programmable Gate Array, abbreviation: FPGA) or other programmable logic devices , Discrete gates or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • the embodiments of the present application also provide a computer-readable storage medium in which a computer program is stored, and when the computer program is executed by a processor, the method for implementing the above-mentioned node speed limit step.
  • the embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the steps of the method for limiting the speed of a node.
  • the embodiments of the present application also provide a computer program, which when running on a computer, causes the computer to execute the steps of the method for limiting the speed of a node.
  • the computer may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the bandwidth quota corresponding to each node can be calculated separately for each node based on the bandwidth data of each node under the target domain name. Therefore, there is no need to set a fixed bandwidth quota for each node, which avoids that the bandwidth quota set by each node is not applicable to the bandwidth situation of each node, and can improve the allocation accuracy of the bandwidth quota of each node under the target domain name.

Abstract

本申请实施例提供了一种节点限速的方法、装置、电子设备及存储介质,涉及计算机技术领域,所述方法包括:接收目标域名下的节点上报的带宽数据,带宽数据包括节点连接数和节点带宽,节点连接数为节点内设备连接的数量。根据带宽数据和目标域名对应的配额上限,计算节点对应的带宽配额。采用本申请可以更准确的分配目标域名下各节点的带宽配额。

Description

一种节点限速的方法、装置、电子设备及存储介质
本申请要求于2019年9月29日提交中国专利局、申请号为201910935647.6发明名称为“一种节点限速的方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及一种节点限速的方法、装置、电子设备及存储介质。
背景技术
目前,各个领域对互联网的需求越来越大,为了保证互联网正常运行,需要对属于同一域名下的各节点进行限速。
目前对各节点进行限速的方法为:分别对每个节点设置一个带宽限额,当节点的带宽超过该节点对应的带宽限额时,电子设备可以对该节点进行限速处理,以使该节点的带宽小于该带宽限额。
然而,由于电子设备对每个节点设置的带宽限额是一个固定值,因此,会导致流量大的节点被一直限速,流量小的节点的带宽不易达到该带宽限额,从而,出现对各节点设置的带宽限额并不适用于对应各节点的带宽的情况。
发明内容
本申请实施例的目的在于提供一种节点限速的方法、装置、电子设备及存储介质,以准确计算各节点对应的带宽配额。具体技术方案如下:
第一方面,提供了一种节点限速的方法,该方法应用于电子设备,该方法包括:接收目标域名下的节点上报的带宽数据,其中,上述带宽数据包括节点连接数和节点带宽,上述节点连接数为上述节点内设备的连接数量;根据上述带宽数据和上述目标域名对应的配额上限,计算上述节点对应的带宽配额,其中,上述带宽配额为在启用限速策略后,上述节点的最大可用带宽。
第二方面,提供了一种节点限速的装置,该装置应用于电子设备,该装置包括:接收模块,用于接收目标域名下的节点上报的带宽数据,其中,上述带宽数据包括节点连接数和节点带宽,上述节点连接数为上述节点内设备 的连接数量;计算模块,用于根据上述带宽数据和上述目标域名对应的配额上限,计算上述节点对应的带宽配额,其中,上述带宽配额为在启用限速策略后,上述节点的最大可用带宽。
第三方面,提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;存储器,设置为存放计算机程序;处理器,设置为执行存储器上所存放的程序时,实现上述第一方面所述的方法步骤。
第四方面,提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,该计算机程序被处理器执行时实现上述第一方面所述的方法步骤。
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。
第六方面,提供了一种计算机程序,该计算机程序在计算机上运行时,使得计算机执行上述第一方面所述的方法。
应用本申请实施例提供的方案,电子设备可以接收目标域名下的节点上报的带宽数据,并根据带宽数据和目标域名对应的配额上限,计算节点对应的带宽配额。这样,由于不同的节点有不同的带宽数据,因此电子设备可以根据目标域名下各节点的带宽数据,针对各节点单独计算该节点对应的带宽配额。因此电子设备计算的各节点对应的带宽配额可以准确匹配各节点的带宽状况,从而电子设备可以更准确地为目标域名下各节点分配带宽配额。
当然,实施本申请的任一产品或方法并不一定需要同时达到以上所述的所有优点。
附图说明
为了更清楚地说明本申请实施例和相关技术的技术方案,下面对实施例和相关技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1(a)为一种内容分发网络的结构示意图;
图1(b)为本申请实施例提供的一种节点限速的方法的流程示意图;
图2为本申请实施例提供的一种节点限速的方法流程图;
图3为本申请实施例提供的一种节点限速的装置的结构示意图;
图4为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供了一种节点限速的方法,该方法可以应用于电子设备,该电子设备可以对至少一个域名下的各节点进行带宽配额分配。
其中,在本申请一实施例中,上述电子设备可以为内容分发网络(Content Delivery Network,CDN)中心服务器。
其中,CDN中心服务器可以对多个域名进行管理,每个域名下可以存在至少一个节点,每个节点可以是一个服务器,也可以是多个服务器的集合,并且,每个节点下的服务器可以连接有至少一个终端设备。这样,CDN中心服务器便可以通过各个节点下的服务器,管理该节点下连接的各终端设备。
例如,如图1(a)所示,为一种内容分发网络的结构示意图。其中,CDN中心服务器可以对域名1、域名2和域名3进行管理,域名1下存在节点1和节点2,域名2下存在节点3和节点4,域名3下存在节点5;其中,节点1为服务器1,且服务器1连接有终端设备1和终端设备2;节点2为服务器2和服务器3的集合,且服务器2连接有终端设备3,服务器3连接有终端设备4、终端设备5和终端设备6;节点3为服务器4,且服务器4连接有终端设备7;节点4为服务器5和服务器6的集合,且服务器5连接有终端设备8和终端设备9,服务器6连接有终端设备10和终端设备11;节点5为服务器7,且服务器7连接有终端设备12。
其中,上述图1(a)仅仅是对内容分发网络的结构的举例说明,而非限定,本申请实施例不对内容分发网络的具体结构进行限定。
在本申请实施例中,电子设备可以通过对节点进行带宽配额分配(即对节点进行限速),实现管理节点的目的,进而实现管理节点下连接的各终端设备的目的。其中,带宽配额为电子设备为各节点分配的带宽上限,各节点可以根据该带宽配额对连接于自身的终端设备进行限速。
下面将结合具体实施方式,对本申请实施例提供的一种节点限速的方法进行详细的说明,如图1(b)所示,该节点限速的方法所包括的步骤如下:
S101、接收目标域名下的节点上报的带宽数据。
其中,上述带宽数据包括节点连接数和节点带宽,节点连接数为节点内设备的连接数量,节点带宽为节点以及节点下各设备使用的带宽总和。
需要说明的是,上述节点内设备的数量为:节点所包括的服务器连接的终端设备的数量,也就是说,上述节点连接数为:节点下所连接的终端设备的数量。其中,当节点为一个服务器时,该节点的节点连接数为该服务器所连接的终端设备的数量;当节点为多个服务器的集合时,该节点的节点连接数为该节点下的各个服务器所连接的终端设备的数量的和值。
此外,上述目标域名为电子设备所管理的任一域名,该目标域名下可以存在至少一个节点。则电子设备可以接收该目标域名下的每一节点上报的带宽数据。
其中,当上述上报带宽数据的节点为一个服务器时,则在上述步骤S201中,电子设备接收的即为该服务器上报的带宽数据。
相应的,当上述上报带宽数据的节点为多个服务器的集合时,该多个服务器中可以存在一用于对该多个服务器进行管理的管理服务器,则在上述步骤S101中,电子设备接收的即为该管理服务器上报的带宽数据,即上报该多个服务器连接的终端设备的数量的和值,以及该多个服务器和该多个服务器所连接的各个终端设备使用的带宽总和;
或者,该多个服务器可以同时向电子设备上报自身的带宽数据,其中,每个服务器上报的带宽数据包括:该服务器所连接的终端设备的数量,以及该服务器和该服务器所连接的各个终端设备使用的带宽总和,这样,电子设备在接收到该多个服务器中的各个服务器上报的带宽数据后,便可以基于该多个带宽数据,确定该节点的带宽数据,即确定该多个服务器连接的终端设备的数量的和值,以及该多个服务器和该多个服务器所连接的各个终端设备使用的带宽总和。
此外,在本申请一实施例中,在上述步骤S101中,节点在上报带宽数据的同时,还可以发送带宽配额查询请求。相应的,电子设备在接收目标域名下的节点上报的带宽数据的同时,也可以接收节点发送的带宽配额查询请求。
其中,在本申请一实施例中,节点可以在一条消息中携带带宽数据和带宽配额查询请求,也可以分别在不同的消息中携带带宽数据和带宽配额查询请求,即通过一条消息中上报带宽数据,并通过另一条消息发送带宽配额查询请求。
实际应用中,目标域名下的各个节点可以每隔一个上报周期(例如每隔5秒)上报带宽数据并发送带宽配额查询请求。本申请实施例以其中一个节点的一个上报周期为例进行说明,并且,每个节点在每个上报周期上报带宽数据并查询带宽配额的方法可以是相同的。
S102、根据带宽数据和目标域名对应的配额上限,计算节点对应的带宽配额。
其中,带宽配额为在启用限速策略后,节点的最大可用带宽。
其中,目标域名下的各个节点可以每隔一个上报周期(比如5秒)上报一次自身的带宽数据,然后电子设备便可以分别根据每个节点上报的带宽数据计算各节点对应的带宽配额。
进而,在计算得到该节点对应的带宽配额后,电子设备便可以为该节点分配所计算得到的带宽配额,从而,电子设备便可以根据该带宽配额对该节点进行限速。即当该节点以及该节点下的各设备所使用的带宽总和超过该计算得到的带宽配额时,对该节点进行限速。
其中,当节点为一个服务器时,电子设备便可以将所计算得到的该节点对应的带宽配额分配给该服务器。进而,当该服务器所使用的带宽超过电子设备为该服务器所分配的带宽配额时,电子设备便可以对该节点进行限速,即电子设备可以对该服务器进行限速。
当节点为多个服务器的集合时,电子设备便可以将所计算得到的该节点对应的带宽配额分配给该节点下的各个服务器。其中,电子设备可以采用任一分配原则为上述各个服务器分配该节点对应的带宽配额,例如,电子设备根据各个服务器的负载情况,为各个服务器分配该节点对应的带宽配额,又例如,电子设备可以根据当前时刻,以及预先确定的各个服务器的负载较大的时刻,为各个服务器分配该节点对应的带宽配额。这都是合理的。
进而,当节点为多个服务器的集合时,当存在某个服务器所使用的带宽超过电子设备为该服务器所分配的带宽配额时,电子设备便可以对该节点进行限速,即电子设备可以对该服务器进行限速;当不存在所使用的带宽超过电子设备所分配的带宽的服务器,且该节点以及该节点下的各设备所使用的带宽总和超过上述计算得到的带宽配额时,电子设备便可以对该节点进行限速,即电子设备可以对该多个服务器中的至少一个服务器进行限速。
在实际应用中,目标域名下可能存在多个节点,各节点均可以每隔一个上报周期上报自身的带宽数据。由于各节点以离散的形式上报带宽数据,因此电子设备可以将各节点上报的带宽数据进行缓存,并每隔一个计算周期,计算各节点上报的带宽数据对应的带宽配额,即计算各节点对应的带宽配额。例如,目标域名下的各节点每5秒上报一次带宽数据,但是各节点上报带宽数据的时刻可以不同,例如,节点A在第12秒上报带宽数据,节点B在第12.3秒上报带宽数据,所以电子设备可以每隔1秒启动一次计算带宽配额的流程。
电子设备接收到目标域名下的各节点上报的带宽数据时,电子设备可以缓存该带宽数据,并在下一个计算周期中,计算该带宽数据对应的带宽配额,即计算各节点对应的带宽配额。
每一个计算周期中,电子设备可以根据本计算周期中已缓存的带宽数据,计算上报该已缓存的带宽数据的节点对应的带宽配额。
本申请实施例以在一个计算周期中计算其中一个节点对应的带宽配额的方法为例进行说明,并且,计算每个节点对应的带宽配额的方法可以相同。
其中,电子设备可以为目标域名设置目标域名对应的配额上限,该配额上限用于对目标域名下的各节点进行限速。
应用本申请实施例提供的方案,电子设备可以接收目标域名下的节点上报的带宽数据,并根据带宽数据和目标域名对应的配额上限,计算节点对应的带宽配额。这样,由于不同的节点有不同的带宽数据,因此电子设备可以根据目标域名下各节点的带宽数据,针对各节点单独计算该节点对应的带宽配额。因此电子设备计算的各节点对应的带宽配额可以准确匹配各节点的带宽状况,从而电子设备可以更准确地为目标域名下各节点分配带宽配额。
在本申请一实施例中,针对上述S102、根据带宽数据和目标域名对应的配额上限,计算节点对应的带宽配额,本申请实施例可以提供两种计算带宽配额的可实现方式。
方式一、电子设备可以确定可分配总配额,并根据可分配总配额和带宽数据,计算节点对应的带宽配额。
其中,可分配总配额为目标域名对应的配额上限与第一预设比例的乘积。
此外,本申请实施例不对上述第一预设比例的具体数值进行限定。其中,该第一预设比例可以根据实际应用中,目标域名下除各个节点的流量外的其他流量的大小进行确定,以保证目标域名下的各类信息的数量传输,以及各类任务的流畅运行。例如,根据电子设备向目标域名下的各个节点发送控制管理指令所需的流量大小,确定上述第一预设比例。
例如,上述第一预设比例可以为98.5%,则若目标域名对应的配额上限为X,可分配总配额为0.985X;又例如,上述第一预设比例可以为98%,则若目标域名对应的配额上限为X,可分配总配额为0.98X;当然,该第一预设比例还可以为其他具体数值,例如,99%,97.5%等。这都是合理的。
电子设备确定可分配总配额后,可以根据可分配总配额和带宽数据,计 算节点对应的带宽配额。
其中,上述节点对应的带宽配额=可分配总配额*(第二预设比例*节点连接数/目标域名下的节点总连接数+第三预设比例*节点带宽/目标域名下的节点总带宽)。
目标域名下的节点总连接数为:目标域名下的所有节点所连接设备数量的总和,目标域名下的节点总带宽为:目标域名下的所有节点带宽的总和。
其中,上述目标域名下的所有节点所连接设备数量的总和为:目标域名下的所有节点中的所有服务器所连接的终端设备的数量的总和。
此外,本申请实施例不对上述第二预设比例和第三预设比例的具体数值进行限定。其中,该第二预设比例和第三预设比例可以根据实际应用中,目标域名下各个节点所连接的终端设备所处理任务的数量和处理这些任务所需流量的大小进行确定,以保证目标域名下的各个节点所连接的终端设备能够快速、流畅地完成各自的任务。
其中,该第二预设比例和第三预设比例可以相同,也可以不同,且当第二预设比例和第三预设比例不同时,第二预设比例可以大于第三预设比例,也可以小于第三预设比例,这都是合理的。
例如,针对节点A,假设可分配总配额为Y,若节点A连接了5个终端,则节点连接数为5,目标域名下的各节点一共连接了100个终端,则目标域名下的节点总连接数100,第二预设比例为50%,节点带宽为0.8Gbps,目标域名下的节点总带宽为10Gbps,第三预设比例为50%。
则节点A对应的带宽配额=Y*(50%*5/100+50%*0.8/10)=0.065Y。
因为节点A对应的带宽配额是电子设备根据节点A的节点连接数和节点带宽计算得到的,所以节点A对应的带宽配额是符合节点A带宽状况的带宽配额,这样,即不会浪费多余的带宽资源,也不会出现带宽不足的情况。
又例如,针对节点B,假设可分配总配额为Z,若节点B连接了10个终端,则节点连接数为10,目标域名下的各节点一共连接了150个终端,则目标域名下的节点总连接数150,第二预设比例为60%,节点带宽为1.0Gbps,目标域名 下的节点总带宽为15Gbps,第三预设比例为40%。
则节点B对应的带宽配额=Z*(60%*10/150+40%*1.0/15)=0.067Z。
因为节点B对应的带宽配额是电子设备根据节点B的节点连接数和节点带宽计算得到的,所以节点B对应的带宽配额是符合节点B带宽状况的带宽配额,这样,即不会浪费多余的带宽资源,也不会出现带宽不足的情况。
当然,上述第二预设比例和第三预设比例还可以为其他具体数值,例如,65%,55%等。这都是合理的。
在实际应用中,目标域名下的各节点可以每隔一个上报周期(比如5秒)上报一次带宽数据,并获得带宽配额。这样,电子设备便可以实现根据各节点的实时带宽情况,对各节点实时分配带宽配额,从而,使得对各节点所分配的带宽配额可以具有较高的准确性以及实时性。
方式二、若电子设备未获取到目标域名下各节点上报的带宽数据或者各节点上报的带宽数据不准确时,电子设备可以确定可分配总配额,并根据可分配总配额计算节点对应的平均带宽配额。
其中,平均带宽配额=可分配总配额/目标域名下的节点总数。
在实际应用中,若电子设备未获取到目标域名下各节点上报的带宽数据或者各节点上报的带宽数据不准确时,电子设备可以将目标域名对应的可分配总配额,平均分配给目标域名下的各节点。这样,目标域名下的各节点获得的带宽配额(平均带宽配额)相等,从而,可以尽可能满足目标域名下各节点的带宽需求。
其中,电子设备可以通过多种方式确定所获取到的各节点上报的带宽数据不准确,对此,本发明实施例不做具体限定。例如,电子设备所接收到的各节点上报的带宽数据中存在乱码,导致电子设备无法读取到该带宽数据的具体内容;又例如,电子设备所接收到的各节点上报的带宽数据中的节点带宽超过目标域名的可分配总配额等。这都是合理的。
在本申请一实施例中,在上述S102、根据带宽数据和目标域名对应的配 额上限,计算节点对应的带宽配额之后,电子设备还可以存储该节点对应的带宽配额。也就是说,本申请实施例提供的一种节点限速的方法还可以包括如下步骤:
若中心服务器的内存中存在该节点对应的带宽配额,则电子设备可以将该节点对应的带宽配额更新为此次计算得到的带宽配额;
或者,
若中心服务器的内存中不存在该节点对应的带宽配额,则电子设备可以存储该节点对应的带宽配额。
其中,中心服务器用于管理目标域名下的各节点。
其中,当上述用于执行本申请实施例提供的一种节点限速的方法的电子设备即为该中心服务器时,则在计算得到一节点对应的带宽配额后,电子设备可以判断自身的内存中是否存在该节点对应的带宽配额。进而,当判断结果为存在时,电子设备便可以将该所存在的带宽配额更新为上述计算得到的带宽配额,相应的,当判断结果为不存在时,电子设备便可以存在上述计算得到的带宽配额。
此外,当上述用于执行本申请实施例提供的一种节点限速的方法的电子设备与上述中心服务器为不同的设备时,则在计算得到一节点对应的带宽配额后,该电子设备便可以通过多种方式确定该中心服务器的内存中是否存在该节点对应的带宽配额。例如,电子设备可以向该中心服务器发送用于查询该中心服务器的内存中是否存在该节点对应的带宽配额的查询请求,并接收该中心服务器反馈的查询结果。
进而,当确定中心服务器的内存中存在该节点对应的带宽配额时,电子设备便可以将所计算得到的带宽配额发送给中心服务器,以使该中心服务器可以将所存在的带宽配额更新为上述计算得到的带宽配额,相应的,当确定中心服务器的内存中不存在该节点对应的带宽配额时,电子设备便可以将所计算得到的带宽配额发送给中心服务器,以使该中心服务器存储上述计算得到的带宽配额。
其中,在本申请一实施例中,中心服务器可以是CDN中心服务器。
在本申请一实施例中,电子设备还可以每隔预设周期确定一次目标域名对应的当前域名带宽,并判断当前域名带宽是否大于目标域名对应的配额上限的第四预设比例。
其中,当前域名带宽为目标域名在当前时刻对应的实时带宽总量,电子设备确定当前域名带宽后,可以判断当前域名带宽是否大于目标域名对应的配额上限的第四预设比例,并缓存判断结果。
其中,若当前域名带宽大于目标域名对应的配额上限的第四预设比例,则可以证明目标域名的带宽使用量较大,进而,则电子设备需要对目标域名进行限速。
相应的,若当前域名带宽不大于目标域名对应的配额上线的第四预设比例,则可以证明目标域名的带宽使用量较小,进而,则电子设备可以不需要对目标域名进行限速。
本申请实施例不对上述第四预设比例的具体数值进行限定。其中,该第四预设比例可以根据实际应用中,目标域名的带宽使用率以及目标域名的负载进行确定,以保证能够及时响应目标域名中的各个任务。
例如,上述第四预设比例可以为90%,98%等,当然,该第四预设比例还可以为其他数值,这都是合理的。
其中,电子设备确定当前域名带宽的周期可以是上述计算周期,即电子设备在每个计算周期中,在计算节点对应的带宽配额的同时,还可以确定目标域名对应的当前域名带宽。
电子设备可以每隔一个计算周期确定一次目标域名对应的当前域名带宽,每个计算周期中,电子设备可以确定目标域名对应的当前域名带宽。若计算周期比较短(比如1秒),则电子设备可以实现实时确定当前域名带宽的效果。
其中,当电子设备确定一次目标域名对应的当前域名带宽的周期为计算周期时,电子设备确定目标域名对应的当前域名带宽的过程,会与电子设备确定节点对应的带宽配额的过程同步进行,即电子设备每确定一次节点对应 的带宽配额就可以确定一次当前域名带宽。
相应的,当电子设备确定一次当前域名带宽的周期与计算周期不相同时,电子设备确定当前域名带宽的过程,会与电子设备确定节点对应的带宽配额的过程异步进行。
在实际应用中,不论电子设备确定当前域名带宽的过程,与电子设备确定节点对应的带宽配额的过程,是同步进行还是异步进行,都可以实现实时确定当前域名带宽的效果。
因此在本申请实施例中,对电子设备执行上述两个过程是同步进行还是异步进行不做限定。
在本申请一实施例中,当电子设备接收到节点发送的带宽配额查询请求时,电子设备可以获取最近一次判断当前域名带宽是否大于目标域名对应的配额上限的第四预设比例的判断结果.
其中,若判断结果为当前域名带宽大于目标域名对应的配额上限的第四预设比例,则电子设备可以向该节点发送该节点对应的已存储的带宽配额。
相应的,若判断结果为当前域名带宽不大于目标域名对应的配额上限的第四预设比例,则电子设备可以向该节点发送不限速指令。
例如,节点可以每隔5秒的时间间隔(上报周期),上报一次带宽数据和带宽配额查询请求。在节点第a次上报带宽数据和第a+1次上报带宽数据之间,电子设备会根据节点第a次上报的带宽数据,计算该节点第a次上报的带宽数据对应的带宽配额并存储。在该节点第a+1次上报带宽数据时,该节点可以发送带宽配额查询的请求。
电子设备接收到带宽配额查询请求后,可获取最近一次的判断结果,若判断结果为:当前域名带宽大于目标域名对应的配额上限的80%(80%为第四预设比例),则电子设备可以向该节点发送电子设备存储的该节点第a次上报的带宽数据对应的带宽配额。即,若当前域名带宽大于目标域名对应的配额上限的80%,则电子设备可以启用限速策略,对目标域名下的各节点进行限速。
这样,电子设备在该节点第a次上报带宽数据和第a+1次上报带宽数据之间,可以节省一次寻找该节点的动作。由于电子设备需要不断计算大量节点的带宽配额,因此可以大大提高电子设备针对大量节点进行带宽配额分配的效率。
在实际应用中,电子设备对超过配额上限的第四预设比例的域名进行限速,可以应用于防止网络攻击。当网络受到攻击时,侵入该网络的程序可能会使该网络中的实时带宽迅速升高,进而使目标域名对应的当前域名带宽迅速升高。若当前域名带宽超过配额上限的第四预设比例,电子设备可以自动对目标域名进行限速,限制侵入该网络的程序所占用的带宽,从而实现防止网络攻击的目的。
同样在实际应用中,电子设备对超过配额上限的第四预设比例的域名进行限速的应用,还可以满足企业用户的需求,从而,既可以节约成本,还可以具有较好的可扩展性。例如:企业用户在提供下载业务中的限速需求或者企业用户在提供线上视频播放服务的限速需求。
在本申请一实施例中,电子设备还可以针对目标域名下的各节点,计算最小带宽配额,并向目标域名下的各节点发送最小带宽配额。也就是说,本申请实施例提供的一种节点限速的方法还可以包括如下步骤:
确定最小带宽配额,并向目标域名下的各节点发送最小带宽配额,以使得当计算得到的该节点对应的带宽配额为零时,节点根据该最小带宽配额对节点下的各设备进行限速。
其中,最小带宽配额=(目标域名的配额上限-可分配总配额)/目标域名下的节点总数。
结合上述确定可分配总配额的方式和确定最小带宽配额的方式,本申请实施例提供了另一种确定可分配总配额的方式和另一种确定最小带宽配额的方式,其中:
最小带宽配额=目标域名的配额上限*预设数值/100/目标域名下的节点总数。
可分配总配额=目标域名的配额上限-最小带宽配额*目标域名下的节点总数。
其中,该预设数值为(0,100)中的任意一个数值,本申请实施例不对上述预设数值进行限定。其中,该预设数值可以根据实际应用中,目标域名下各个节点所连接的终端设备所处理任务的数量和处理这些任务所需流量的大小进行确定,以保证目标域名下的各个节点所连接的终端设备能够快速、流畅地完成各自的任务。
例如,该预设数值可以为1.5,1.2等,当然,该预设数值还可以为(0,100)中的其他数值,这都是合理的。
其中,在该确定可分配总配额的方式中,最小带宽配额的确定方式可以由本申请实施例中公开的任一方式,本申请实施例不做限定。
在实际应用中,为保证目标域名下的各节点的节点带宽不为零,电子设备可以针对目标域名下的各节点,向各节点发送最小带宽配额。从而,即使电子设备根据上述S102计算出的节点的带宽配额为零,节点也可以获得一个最小带宽配额,以保证节点连接的各设备的基本带宽需求。
如图2所示,本申请实施例提供了一种针对一个节点上报一次带宽数据的示例,该示例可以包括以下步骤:
S201、接收目标域名下节点A上报的带宽数据和带宽配额查询请求。
其中,电子设备执行步骤201后,可以同时执行步骤202和208。
S202、缓存节点A的带宽数据。
S203、判断当前时刻是否达到计算周期开始时刻。若达到计算周期开始时刻,则执行S204以及S206,若未达到计算周期开始时刻,则执行S203。
其中,电子设备每个计算周期均可以执行S206至S207和S204至S205。
图2中以S204和S206并列执行为例,相应的,在另外的实施方式中,S206也可以在S205之后执行。
S204、根据带宽数据以及目标域名对应的配额上限,计算节点A对应的带宽配额。
S205、存储节点A对应的带宽配额。
可以理解的是,若内存中存在节点A对应的带宽配额,则电子设备可以将节点A对应的带宽配额更新为此次计算得到的带宽配额,若内存中不存在节点A对应的带宽配额,则电子设备可以存储节点A对应的带宽配额。
S206、确定目标域名对应的当前域名带宽。
S207、判断当前域名带宽是否大于目标域名对应的配额上限的80%,并缓存判断结果。
其中,当前域名带宽可以满足的判断结果有两种情况:a.当前域名带宽大于目标域名对应的配额上限的80%;b.当前域名带宽小于或者等于目标域名对应的配额上限的80%。
S208、判断当前缓存的判断结果是否为当前域名带宽大于目标域名对应的配额上限的80%。若是,则执行S209,否则执行S210。
其中,在S208中所判断的判断结果为上一次执行S207时缓存的判断结果。
S209、向节点A发送限速指令,该限速指令包括当前存储的节点A的带宽配额。
在接收到节点A上报的带宽配额查询请求时,电子设备在判断出当前缓存的判断结果为:当前域名带宽大于目标域名对应的配额上限的80%,便可以向节点A发送包括当前存储的节点A的带宽配额的限速指令,以响应该带宽配额查询请求。也就是说,节点A所发送的限速指令即为对节点A上报的带宽配额查询请求的响应。
并且,由于上述向节点A发送的限速指令中包括当前存储的节点A的带宽配额,也就是说,在对节点A上报的带宽配额查询请求进行响应时,可以向节点A发送上述当前存储的节点A的带宽配额。
其中,当节点A为一个服务器时,即向该服务器发送上述当前存储的节点A的带宽配额,从而,电子设备便可以根据该带宽配额对节点A进行限速。当 节点A为多个服务器的集合时,即按照预设的分配原则,将上述当前存储的节点A的带宽配额分配给节点A下的各个服务器,从而,电子设备便可以根据上述当前存储的节点A的带宽配额,以及为各个服务器所分配的带宽配额对节点A进行限速。
S210、向节点A发送不限速指令。
其中,若节点A接收到不限速指令,则节点A不对节点A下的各设备进行限速。
在接收到节点A上报的带宽配额查询请求时,电子设备在判断出当前缓存的判断结果不为:当前域名带宽大于目标域名对应的配额上限的80%,便可以向节点A发送不限速指令,以响应该带宽配额查询请求。也就是说,节点A所发送的不限速指令即为对节点A上报的带宽配额查询请求的响应。
基于相同的技术构思,本申请实施例还提供了一种节点限速的装置,如图3所示,该装置包括:接收模块301和计算模块302;
接收模块301,设置为接收目标域名下的节点上报的带宽数据,其中,带宽数据包括节点连接数和节点带宽,节点连接数为节点内设备的连接数量;
计算模块302,设置为根据带宽数据和目标域名对应的配额上限,计算节点对应的带宽配额,其中,带宽配额为在启用限速策略后,节点的最大可用带宽。
在本申请一实施例中,计算模块302,具体设置为:
确定可分配总配额,其中,可分配总配额为目标域名对应的配额上限与第一预设比例的乘积;
根据可分配总配额和带宽数据,计算节点对应的带宽配额,其中,带宽配额=可分配总配额*(第二预设比例*节点连接数/目标域名下的节点总连接数+第三预设比例*节点带宽/目标域名下的节点总带宽),目标域名下的节点总连接数为目标域名下的所有节点所连接设备数量的总和,目标域名下的节点总带宽为目标域名下的所有节点带宽的总和。
在本申请一实施例中,该装置还包括:更新模块;
该更新模块,设置为若中心服务器的内存中存在节点对应的带宽配额,则将节点对应的带宽配额更新为此次计算得到的带宽配额;或者,
该更新模块,用于若中心服务器的内存中不存在节点对应的带宽配额,则存储节点对应的带宽配额,中心服务器用于管理目标域名下的各节点。
在本申请一实施例中,该装置还包括:确定模块;
该确定模块,设置为每隔预设周期确定一次目标域名对应的当前域名带宽,并判断当前域名带宽是否大于目标域名对应的配额上限的第四预设比例。
在本申请一实施例中,该装置还包括:获取模块和发送模块;
该获取模块,设置为当接收到节点发送的带宽配额查询请求时,获取最近一次判断当前域名带宽是否大于目标域名对应的配额上限的第四预设比例的判断结果;
该发送模块,设置为若判断结果为当前域名带宽大于目标域名对应的配额上限的第四预设比例,则向节点发送带宽配额查询响应,带宽配额查询响应包括当前存储的节点对应的带宽配额。
在本申请一实施例中,装置还包括:分配模块;
该计算模块302,还设置为确定最小带宽配额,最小带宽配额=(目标域名的配额上限-可分配总配额)/目标域名下的节点总数;
该分配模块,设置为向目标域名下的各节点发送最小带宽配额,以使得当节点对应的带宽配额为零时,节点根据最小带宽配额对节点下的各设备进行限速。
应用本申请实施例提供的方案,电子设备可以接收目标域名下的节点上报的带宽数据,并根据带宽数据和目标域名对应的配额上限,计算节点对应的带宽配额。这样,由于不同的节点有不同的带宽数据,因此电子设备可以根据目标域名下各节点的带宽数据,针对各节点单独计算该节点对应的带宽配额。因此电子设备计算的各节点对应的带宽配额可以准确匹配各节点的带宽状况,从而电子设备可以更准确地为目标域名下各节点分配带宽配额。
本申请实施例还提供了一种电子设备,如图4所示,包括处理器401、通信接口402、存储器403和通信总线404,其中,处理器401,通信接口402,存储器403通过通信总线404完成相互间的通信,
存储器403,设置为存放计算机程序;
处理器401,设置为执行存储器403上所存放的程序时,实现如下步骤:
接收目标域名下的节点上报的带宽数据,其中,带宽数据包括节点连接数和节点带宽,节点连接数为所述节点内设备的连接数量;
根据带宽数据和目标域名对应的配额上限,计算所述节点对应的带宽配额,其中,带宽配额为在启用限速策略后,节点的最大可用带宽。
需要说明的是,处理器401,用于执行存储器403上所存放的程序时,还用于实现上述方法实施例中描述的其他步骤,可参考上述方法实施例中的相关描述,此处不再赘述。
上述网络设备提到的通信总线可以是外设部件互连标准(英文:Peripheral Component Interconnect,简称:PCI)总线或扩展工业标准结构(英文:Extended Industry Standard Architecture,简称:EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口用于上述网络设备与其他设备之间的通信。
存储器可以包括随机存取存储器(英文:Random Access Memory,简称:RAM),也可以包括非易失性存储器(英文:Non-Volatile Memory,简称:NVM),例如至少一个磁盘存储器。在本申请一实施例中,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述的处理器可以是通用处理器,包括中央处理器(英文:Central Processing Unit,简称:CPU)、网络处理器(英文:Network Processor,简称:NP)等;还可以是数字信号处理器(英文:Digital Signal Processing,简称:DSP)、专用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC)、现场可编程门阵列(英文:Field-Programmable Gate Array,简称:FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
基于相同的技术构思,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述节点限速的方法步骤。
基于相同的技术构思,本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述节点限速的方法步骤。
基于相同的技术构思,本申请实施例还提供了一种计算机程序,该计算机程序在计算机上运行时,使得计算机执行上述节点限速的方法步骤。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除 在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。
工业实用性
基于本申请实施例提供的节点限速的方法、装置、电子设备及存储介质,能够根据目标域名下各节点的带宽数据,针对各节点单独计算该节点对应的带宽配额。因此不需要为每个节点设置固定的带宽限额,避免了各节点设置的带宽限额并不适用于对应各节点的带宽情况,可以提高目标域名下各节点的带宽配额的分配准确度。

Claims (16)

  1. 一种节点限速的方法,所述方法包括:
    接收目标域名下的节点上报的带宽数据,其中,所述带宽数据包括节点连接数和节点带宽,所述节点连接数为所述节点内设备的连接数量;
    根据所述带宽数据和所述目标域名对应的配额上限,计算所述节点对应的带宽配额,其中,所述带宽配额为在启用限速策略后,所述节点的最大可用带宽。
  2. 根据权利要求1所述的方法,其中,所述根据所述带宽数据和所述目标域名对应的配额上限,计算所述节点对应的带宽配额,包括:
    确定可分配总配额,其中,所述可分配总配额为所述目标域名对应的配额上限与第一预设比例的乘积;
    根据所述可分配总配额和所述带宽数据,计算所述节点对应的带宽配额,其中,所述带宽配额=所述可分配总配额*(第二预设比例*所述节点连接数/所述目标域名下的节点总连接数+第三预设比例*所述节点带宽/所述目标域名下的节点总带宽),所述目标域名下的节点总连接数为所述目标域名下的所有节点所连接设备数量的总和,所述目标域名下的节点总带宽为所述目标域名下的所有节点带宽的总和。
  3. 根据权利要求1或2所述的方法,其中,在所述根据所述带宽数据和所述目标域名对应的配额上限,计算所述节点对应的带宽配额之后,所述方法还包括:
    若中心服务器的内存中存在所述节点对应的带宽配额,则将所述节点对应的带宽配额更新为此次计算得到的带宽配额;或者,
    若所述中心服务器的内存中不存在所述节点对应的带宽配额,则存储所述节点对应的带宽配额;
    其中,所述中心服务器用于管理所述目标域名下的各节点。
  4. 根据权利要求3所述的方法,其中,所述方法还包括:
    每隔预设周期确定一次所述目标域名对应的当前域名带宽,并判断所述 当前域名带宽是否大于所述目标域名对应的配额上限的第四预设比例。
  5. 根据权利要求4所述的方法,其中,所述方法还包括:
    当接收到所述节点发送的带宽配额查询请求时,获取最近一次判断所述当前域名带宽是否大于所述目标域名对应的配额上限的第四预设比例的判断结果;
    若判断结果为所述当前域名带宽大于所述目标域名对应的配额上限的第四预设比例,则向所述节点发送带宽配额查询响应,所述带宽配额查询响应包括当前存储的所述节点对应的带宽配额。
  6. 根据权利要求2所述的方法,其中,所述方法还包括:
    确定最小带宽配额,其中,所述最小带宽配额=(所述目标域名的配额上限-所述可分配总配额)/所述目标域名下的节点总数;
    向所述目标域名下的各节点发送所述最小带宽配额,以使得当所述节点对应的带宽配额为零时,所述节点根据所述最小带宽配额对所述节点下的各设备进行限速。
  7. 一种节点限速的装置,所述装置包括:
    接收模块,设置为接收目标域名下的节点上报的带宽数据,其中,所述带宽数据包括节点连接数和节点带宽,所述节点连接数为所述节点内设备的连接数量;
    计算模块,设置为根据所述带宽数据和所述目标域名对应的配额上限,计算所述节点对应的带宽配额,其中,所述带宽配额为在启用限速策略后,所述节点的最大可用带宽。
  8. 根据权利要求7所述的装置,其中,所述计算模块,具体设置为:
    确定可分配总配额,其中,所述可分配总配额为所述目标域名对应的配额上限与第一预设比例的乘积;
    根据所述可分配总配额和所述带宽数据,计算所述节点对应的带宽配额,其中,所述带宽配额=所述可分配总配额*(第二预设比例*所述节点连接数/ 所述目标域名下的节点总连接数+第三预设比例*所述节点带宽/所述目标域名下的节点总带宽),所述目标域名下的节点总连接数为所述目标域名下的所有节点所连接设备数量的总和,所述目标域名下的节点总带宽为所述目标域名下的所有节点带宽的总和。
  9. 根据权利要求7或8所述的装置,其中,所述装置还包括:更新模块;
    所述更新模块,设置为若中心服务器的内存中存在所述节点对应的带宽配额,则将所述节点对应的带宽配额更新为此次计算得到的带宽配额;或者,
    所述更新模块,设置为若所述中心服务器的内存中不存在所述节点对应的带宽配额,则存储所述节点对应的带宽配额;
    其中,所述中心服务器用于管理所述目标域名下的各节点。
  10. 根据权利要求9所述的装置,其中,所述装置还包括:确定模块;
    所述确定模块,设置为每隔预设周期确定一次所述目标域名对应的当前域名带宽,并判断所述当前域名带宽是否大于所述目标域名对应的配额上限的第四预设比例。
  11. 根据权利要求10所述的装置,其中,所述装置还包括:获取模块和发送模块;
    所述获取模块,设置为当接收到所述节点发送的带宽配额查询请求时,获取最近一次判断所述当前域名带宽是否大于所述目标域名对应的配额上限的第四预设比例的判断结果;
    所述发送模块,设置为若判断结果为所述当前域名带宽大于所述目标域名对应的配额上限的第四预设比例,则向所述节点发送带宽配额查询响应,所述带宽配额查询响应包括当前存储的所述节点对应的带宽配额。
  12. 根据权利要求8所述的装置,其中,所述装置还包括:分配模块;
    所述计算模块,还设置为确定最小带宽配额,其中,所述最小带宽配额=(所述目标域名的配额上限-所述可分配总配额)/所述目标域名下的节点总数;
    所述分配模块,设置为向所述目标域名下的各节点发送所述最小带宽配 额,以使得当所述节点对应的带宽配额为零时,所述节点根据所述最小带宽配额对所述节点下的各设备进行限速。
  13. 一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
    存储器,设置为存放计算机程序;
    处理器,设置为执行存储器上所存放的程序时,实现权利要求1-6任一所述的方法步骤。
  14. 一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-6任一所述的方法步骤。
  15. 一种包含指令的计算机程序产品,所述包含指令的计算机程序产品在计算机上运行时,使得计算机执行权利要求1-6任一所述的方法步骤。
  16. 一种计算机程序,所述计算机程序在计算机上运行时,使得计算机执行权利要求1-6任一所述的方法步骤。
PCT/CN2020/116095 2019-09-29 2020-09-18 一种节点限速的方法、装置、电子设备及存储介质 WO2021057607A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US17/626,352 US11824787B2 (en) 2019-09-29 2020-09-18 Method and apparatus for node speed limiting, electronic device and storage medium
EP20868442.3A EP3985932A4 (en) 2019-09-29 2020-09-18 NODE SPEED LIMITING METHOD AND DEVICE, ELECTRONIC DEVICE AND STORAGE MEDIA
JP2022501137A JP7383113B2 (ja) 2019-09-29 2020-09-18 ノードの速度制限方法、装置、電子デバイス及び記憶媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910935647.6A CN110519183B (zh) 2019-09-29 2019-09-29 一种节点限速的方法、装置、电子设备及存储介质
CN201910935647.6 2019-09-29

Publications (1)

Publication Number Publication Date
WO2021057607A1 true WO2021057607A1 (zh) 2021-04-01

Family

ID=68634051

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116095 WO2021057607A1 (zh) 2019-09-29 2020-09-18 一种节点限速的方法、装置、电子设备及存储介质

Country Status (5)

Country Link
US (1) US11824787B2 (zh)
EP (1) EP3985932A4 (zh)
JP (1) JP7383113B2 (zh)
CN (1) CN110519183B (zh)
WO (1) WO2021057607A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514713A (zh) * 2022-09-16 2022-12-23 苏州浪潮智能科技有限公司 一种业务处理方法、系统、装置及可读存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519183B (zh) * 2019-09-29 2022-12-02 北京金山云网络技术有限公司 一种节点限速的方法、装置、电子设备及存储介质
CN110880991B (zh) * 2019-12-06 2021-09-03 北京金山云网络技术有限公司 一种带宽限制方法、装置及系统
CN114095443B (zh) * 2020-08-24 2023-11-03 百度在线网络技术(北京)有限公司 用于管控流量的方法、装置、电子设备及可读存储介质
CN115134369B (zh) * 2021-03-26 2024-01-19 北京金山云网络技术有限公司 一种cdn节点分配方法、装置、电子设备及存储介质
CN113886078B (zh) * 2021-09-28 2022-06-17 江苏安超云软件有限公司 基于动态阈值机制实现配额统一管理的方法、装置、电子设备及计算机可读存储介质
CN115460090B (zh) * 2022-08-31 2024-03-19 上海哔哩哔哩科技有限公司 边缘记录上传速度动态设置方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090180430A1 (en) * 2008-01-10 2009-07-16 Fadell Anthony M Apparatus and methods for network resource allocation
CN101702669A (zh) * 2009-11-18 2010-05-05 上海网宿科技股份有限公司 带宽分配方法和系统
CN105530202A (zh) * 2015-12-31 2016-04-27 迈普通信技术股份有限公司 一种带宽分配方法及服务器
CN110519183A (zh) * 2019-09-29 2019-11-29 北京金山云网络技术有限公司 一种节点限速的方法、装置、电子设备及存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4520705B2 (ja) 2003-04-11 2010-08-11 パナソニック株式会社 通信システム及び通信方法
CA3051918A1 (en) 2013-11-25 2015-05-28 Amazon Technologies, Inc. Customer-directed networking limits in distributed systems
US11575725B2 (en) * 2015-12-29 2023-02-07 Verizon Patent And Licensing Inc. Content delivery network streaming optimization
WO2018112895A1 (zh) 2016-12-23 2018-06-28 华为技术有限公司 一种切换方法、终端及域主节点
US10298744B2 (en) * 2017-10-24 2019-05-21 Comptel Oyj Method and arrangement for policy regulation of electronic communication devices
CN109412977B (zh) * 2018-10-18 2022-05-17 网宿科技股份有限公司 一种域名带宽调节方法及相关设备
CN109361622B (zh) * 2018-11-30 2022-04-05 网宿科技股份有限公司 对cdn系统的业务连接进行带宽控制的方法及cdn系统
CN110048968B (zh) * 2019-04-12 2021-06-22 网宿科技股份有限公司 一种域名带宽调整方法及装置
US10958592B2 (en) * 2019-04-12 2021-03-23 Wangsu Science & Technology Co., Ltd. Domain name bandwidth adjustment method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090180430A1 (en) * 2008-01-10 2009-07-16 Fadell Anthony M Apparatus and methods for network resource allocation
CN101702669A (zh) * 2009-11-18 2010-05-05 上海网宿科技股份有限公司 带宽分配方法和系统
CN105530202A (zh) * 2015-12-31 2016-04-27 迈普通信技术股份有限公司 一种带宽分配方法及服务器
CN110519183A (zh) * 2019-09-29 2019-11-29 北京金山云网络技术有限公司 一种节点限速的方法、装置、电子设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3985932A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514713A (zh) * 2022-09-16 2022-12-23 苏州浪潮智能科技有限公司 一种业务处理方法、系统、装置及可读存储介质
CN115514713B (zh) * 2022-09-16 2023-07-25 苏州浪潮智能科技有限公司 一种业务处理方法、系统、装置及可读存储介质

Also Published As

Publication number Publication date
US20220263768A1 (en) 2022-08-18
CN110519183A (zh) 2019-11-29
EP3985932A1 (en) 2022-04-20
US11824787B2 (en) 2023-11-21
EP3985932A4 (en) 2022-07-27
CN110519183B (zh) 2022-12-02
JP7383113B2 (ja) 2023-11-17
JP2022549055A (ja) 2022-11-24

Similar Documents

Publication Publication Date Title
WO2021057607A1 (zh) 一种节点限速的方法、装置、电子设备及存储介质
CN109660607B (zh) 一种业务请求分发方法、接收方法、装置及服务器集群
US10110671B2 (en) Method, system, and device for managing server hardware resources in a cloud scheduling environment
JP7127010B2 (ja) リソースの割り当て方法、装置、電子設備、コンピュータ可読媒体およびコンピュータプログラム
CN110677405B (zh) 一种数据处理方法、装置、电子设备及存储介质
WO2019165665A1 (zh) 一种域名解析方法、服务器及系统
US10235047B2 (en) Memory management method, apparatus, and system
WO2021254331A1 (zh) 资源管理方法、系统、代理服务器及存储介质
US20190268213A1 (en) Network function management method, management unit, and system
CN108667744B (zh) 流量控制方法及装置
CN112445857A (zh) 一种基于数据库的资源配额管理方法和装置
WO2021109726A1 (zh) 一种带宽限制方法、装置及系统
TWI795565B (zh) 資源分享方法、裝置、電腦裝置及存儲介質
CN113361913A (zh) 一种通信业务编排方法、装置、计算机设备及存储介质
CN110336888B (zh) 一种服务器分配方法、装置、系统及介质
US11709707B2 (en) Low latency distributed counters for quotas
CN114090623A (zh) 一种缓存资源的创建方法、装置、电子设备及存储介质
CN109862134B (zh) 一种ip地址的租约时间配置方法和系统及dhcp客户端
CN115665054A (zh) 带宽分配的方法和模块、以及数据传输管理系统
CN112860432A (zh) 一种进程管理方法、装置及服务器
WO2021008569A1 (zh) 一种集群中资源管理的方法及装置
CN111767132A (zh) 分配资源的方法、装置、设备和计算机可读介质
CN114201302A (zh) 一种应用资源分配方法和装置
CN117527702A (zh) 一种流量数据的迁移方法、装置、设备及介质
CN116886775A (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: 20868442

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022501137

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2020868442

Country of ref document: EP

Effective date: 20220114

NENP Non-entry into the national phase

Ref country code: DE