WO2020220430A1 - 一种限流方法及系统 - Google Patents

一种限流方法及系统 Download PDF

Info

Publication number
WO2020220430A1
WO2020220430A1 PCT/CN2019/090339 CN2019090339W WO2020220430A1 WO 2020220430 A1 WO2020220430 A1 WO 2020220430A1 CN 2019090339 W CN2019090339 W CN 2019090339W WO 2020220430 A1 WO2020220430 A1 WO 2020220430A1
Authority
WO
WIPO (PCT)
Prior art keywords
access request
quota
distributed node
decision
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/090339
Other languages
English (en)
French (fr)
Inventor
叶文柏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology Co Ltd
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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to EP19894390.4A priority Critical patent/EP3758325B1/en
Priority to US16/902,800 priority patent/US11316792B2/en
Publication of WO2020220430A1 publication Critical patent/WO2020220430A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • 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/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2416Real-time traffic
    • 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/29Flow control; Congestion control using a combination of thresholds
    • 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/781Centralised allocation of resources
    • 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
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/82Miscellaneous aspects
    • H04L47/826Involving periods of time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • 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/22Traffic shaping
    • H04L47/225Determination of shaping rate, e.g. using a moving window

Definitions

  • This application relates to the field of Internet current limiting technology, and in particular to a current limiting method and system.
  • the disadvantage of the central type is that every current limiting decision of a distributed node needs to interact with the central node, and the decision path is long and the decision is slow.
  • the load of distributed nodes changes all the time.
  • the data when the decision is implemented is different from the data when the decision is generated and sent to the distributed node.
  • the central node cannot make decisions based on real-time data, and wrong decisions may occur, affecting the system Overall performance.
  • the average or weight distribution method is to allocate a fixed amount of service to each distributed node. Although the decision is faster, it is not accurate. Especially in the case of unbalanced load, some distributed nodes are overloaded, and the overall system traffic is not The upper limit is reached.
  • a current limiting method includes:
  • the distributed node sends the service volume in the current preset time period to the central node in a fixed period
  • the central node determines the decision quota of the distributed node based on the received service amount, and sends the decision quota to the distributed node;
  • the distributed node After receiving the access request, the distributed node judges whether the access request needs to be limited based on the newly received decision quota.
  • the service volume also includes the return-to-source volume
  • the step of judging whether the access request needs to be restricted based on the newly received decision quota includes:
  • the distributed node After receiving the access request, the distributed node determines whether it needs to send the source request back to the source station;
  • the service volume in the preset time period includes the traffic generated by the distributed node in the preset time period, the average bandwidth in the preset time period, and the preset time period One or more of the number of connections established within the network or the number of access requests within the preset time period.
  • the step of the distributed node judging whether it is necessary to limit the flow of the access request based on the newly received decision quota includes:
  • the distributed node compares the current service increment with the newly received decision quota
  • the flow is not limited, otherwise, the flow is limited for the access request.
  • the method further includes:
  • the time interval is greater than or equal to the preset time period, send the service volume in the current preset time period to the central node, and receive the new decision quota sent by the central node, and then based on the latest received decision quota Determine whether it is necessary to limit the current for the access request.
  • the step of the distributed node restricting the flow of the access request includes:
  • the distributed node refuses to service the access request; or,
  • the distributed node limits the response rate of the access request.
  • the method further includes:
  • the distributed node responds to the access request at a preset response rate
  • the distributed node receives the next access request, and if the current service increment is still greater than or equal to the newly received decision quota, then refuses to serve the next access request.
  • the method further includes:
  • the distributed node receives the next access request, and if the current service increment is less than the newly received decision quota, and the current average response rate is greater than the preset response rate, it will respond to the request at the preset response rate.
  • the next access request wherein the current average response rate is equal to the ratio between the traffic generated in the current preset time period and the number of access requests in the current preset time period;
  • the distributed node receives the next access request, and if the current service increment is less than the newly received decision quota, and the current average response rate is less than or equal to the preset response rate, the flow is not limited.
  • a current limiting system which includes distributed nodes and central nodes:
  • the distributed node is configured to send the service amount in the current preset time period to the central node according to a fixed period
  • the central node is configured to determine the decision quota of the distributed node based on the received service amount, and send the decision quota to the distributed node;
  • the distributed node is configured to receive the decision quota sent by the central node, and after receiving the access request, determine whether the access request needs to be limited based on the newly received decision quota.
  • the service volume also includes the return-to-source volume
  • the distributed node is used for:
  • the service volume in the preset time period includes the traffic generated by the distributed node in the preset time period, the average bandwidth in the preset time period, and the preset time period One or more of the number of connections established within the network or the number of access requests within the preset time period.
  • the distributed node is used for:
  • the flow is not limited, otherwise the flow is limited for the access request.
  • the distributed node is used for:
  • the time interval is greater than or equal to the preset time period, send the service volume in the current preset time period to the central node, and receive the new decision quota sent by the central node, and then based on the latest received decision quota Determine whether it is necessary to limit the current for the access request.
  • the distributed node is used for:
  • the current limit is performed by limiting the response rate of the access request.
  • the distributed node is used for:
  • next access request is received, and if the current service increment is still greater than or equal to the newly received decision quota, the next access request is rejected to be served.
  • the distributed node is used for:
  • the next access request is received. If the current service increment is less than the newly received decision quota, and the current average response rate is greater than the preset response rate, then The preset response rate responds to the next access request, wherein the current average response rate is equal to the ratio between the traffic generated in the current preset time period and the number of access requests in the current preset time period;
  • the flow is not limited.
  • a node device including:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the current limiting method in the first aspect.
  • a computer-readable storage medium that stores a computer program, wherein the computer program, when executed by a processor, implements what is executed by the distributed node in the current limiting method of the first aspect. Processing process.
  • the current limiting decision in the embodiment of the application is independently judged by distributed nodes.
  • the decision path is short and the decision is fast.
  • the decision quota of the corresponding size can be allocated according to the real-time service volume of each distributed node, that is In other words, the larger the service volume, the higher the allocated decision-making quota, so that distributed nodes in areas with larger service volume can receive and respond to access requests to the greatest extent, improve resource utilization, and the current limiting method is more Accurate, can improve the service performance of the distributed system.
  • FIG. 1 is a schematic diagram of a network framework provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a current limiting method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of another network framework provided by an embodiment of the present application.
  • Fig. 4 is a structural block diagram of a node device provided by an embodiment of the present application.
  • the embodiment of the present application provides a current limiting method, which can be applied to the network framework shown in FIG. 1.
  • the network framework includes a central node and multiple distributed nodes, and each distributed node is connected to the central node.
  • distributed nodes are CDN nodes. Among them, the distributed node is used to receive the access request sent by the client and perform services.
  • each distributed node first sends the service volume in the current preset time period to the central node according to a fixed cycle, and the central node determines each distribution based on the service volume sent by all distributed nodes And send the corresponding decision quota to each of the distributed nodes.
  • Each of the distributed nodes receives the decision quota, and after receiving the access request, judges whether it is necessary based on the newly received decision quota Perform current limiting for the access request. Since the current limit decision is made by the distributed nodes autonomously, the decision path is short and the decision is fast, and through the principle of statistics, the corresponding decision quota can be allocated according to the real-time service volume of each distributed node, that is, the service volume The larger the size, the higher the allocated decision-making quota, so that distributed nodes in areas with larger service volumes can receive and respond to access requests to the greatest extent, improve resource utilization, and the current limiting method is more accurate and can improve Service performance of distributed systems.
  • FIG. 2 a flow chart of a current limiting method provided in an embodiment of this application, the method specifically includes the following steps.
  • Step 201 The distributed node sends the service volume in the current preset time period to the central node in a fixed period.
  • Each distributed node in the distributed system sends the service amount in the current preset time period to the central node according to the same fixed cycle.
  • the duration of the fixed period can be set to any duration, such as one second or one minute.
  • the service volume in the current preset time period may be the service volume in a period of time forward from the current moment. For example, if the current time is t and the preset time period is 1 minute, the service volume in the current preset time period is the service volume from time t-1 to time t.
  • the CDN node distributed node
  • the cache is directly used to respond, that is, the service access request. If the content to be accessed is not cached in the CDN node, or the cached content has expired, it will send a back to the source request to obtain the content, that is, back to the source.
  • the embodiments of the present application may perform current limiting for the scenario of service access request, and may also perform current limiting for the scenario of returning to the source, that is, restricting the CDN node to send the request of returning to the source to the source station.
  • the service volume sent by the distributed node to the central node is the service volume generated in response to the access request.
  • the amount of service sent by the distributed node to the central node is the amount of service generated when returning to the source. That is to say, the service volume sent by the distributed node to the central node includes the service volume generated in response to the access request, or the service volume generated when returning to the source, that is, the amount of returning to the source. Limiting the current in the scenario of returning to the source can prevent the source station from carrying excessive access pressure and protect the stability of the source station.
  • Service volume can be expressed in terms of traffic, bandwidth, number of connections, or number of access requests.
  • the service volume sent by the distributed node to the central node is the service volume generated in response to the access request
  • the service volume in the preset time period includes the service volume of the distributed node in the preset time period.
  • the service volume in the preset time period is the number of connections established by the distributed node with the client in the preset time period.
  • the service volume in the preset time period is the number of access requests of the distributed node in the preset time period, where the number of access requests in the preset time period may be The number of access requests that have been responded to, or the sum of the number of access requests that have been responded to and the number of access requests that are currently being responded, or the number of access requests that have been responded to, the number of access requests that are currently responding, and the number of unresponsive accesses The sum of the number of requests.
  • the service volume in the preset time period includes the traffic generated by the distributed node in the preset time period (back-to-source traffic) One or more of the average bandwidth (back-to-source bandwidth) within the preset time period or the number of connections established within the preset time period.
  • the back-to-source traffic generated by the distributed node in the preset time period may be the size of the content obtained back to the source by the distributed node in the preset time period.
  • the service volume in the preset time period is the number of connections established by the distributed node with the source station in the preset time period.
  • Step 202 The central node determines the decision quota of the distributed node based on the received service amount, and sends the decision quota to the distributed node.
  • Each distributed node regularly sends the latest service volume to the central node.
  • the central node calculates the service share of each distributed node according to the latest service volume, and then calculates the decision quota corresponding to each distributed node according to the service share of each distributed node.
  • ECLi represents the decision quota corresponding to the i-th distributed node
  • LT represents the overall limit number
  • ECi represents the service volume corresponding to the i-th distributed node
  • ECPi represents the service proportion of the i-th distributed node
  • the overall limit number is a value pre-stored in the central node, which represents the total load allowed by the distributed system.
  • the overall limit number may be the overall limit number for the amount of service generated by the service access request or the overall limit number for the return-to-source amount.
  • the overall limit number may be the overall limit number of the service volume generated for the service access request.
  • the total limit number is the total limit number for the amount of returning to the source.
  • the overall limit number corresponds to the representation of the service volume reported by the distributed node to the central node, that is to say, if the service volume is represented by traffic, the overall limit number is also represented by traffic; if the service volume is represented by bandwidth, The overall limit number is also represented by bandwidth; if the service volume is represented by the number of connections, the overall limit number is also represented by the number of connections; if the service volume is represented by the amount of access requests, the overall limit number is also represented by the amount of access requests Said.
  • Step 203 The distributed node receives the decision quota sent by the central node.
  • Step 204 After receiving the access request, the distributed node determines whether the access request needs to be limited based on the newly received decision quota.
  • each time a distributed node receives an access request determines whether or not the access request needs to be limited.
  • the distributed node after receiving the access request, determines whether it needs to send a back-to-origin request to the source station; if necessary, it determines whether it needs to be targeted at all based on the latest received decision quota.
  • the access request is limited.
  • the specific process for the distributed node to determine whether or not to limit the access request based on the newly received decision quota is: after the distributed node receives the access request, it compares the current service increment with the latest received decision Quota, wherein the service increment is the difference between the service quantity in the current preset time period and the service quantity last sent to the central node; if the current service increment of the distributed node is less than the latest The received decision quota is not limited in flow, otherwise the flow is limited in response to the access request.
  • the distributed node determines that the current service increment is greater than or equal to the newly-received decision quota, it is determined between the current time and the time when the service amount was last sent to the central node If the time interval is less than the preset time period, the access request will be limited; if the time interval is greater than or equal to the preset time period, the current preset time period will be sent to the central node Service volume, and receive a new decision quota sent by the central node, and then determine whether it is necessary to limit the access request based on the newly received decision quota.
  • the above-mentioned preset time length is shorter than the fixed period in which the distributed node regularly reports the service volume to the central node.
  • the fixed period for the distributed node to regularly report the service volume to the central node is 1 minute, and the preset duration can be set to 30s.
  • the time from obtaining the decision quota is relatively long, that is, the time interval between the current time and the time when the service amount was sent to the central node last time exceeds the preset time, it means that a new decision quota needs to be obtained to prevent If the decision-making quota is not updated in time, there will be an error current limit, which affects the quality of service.
  • the distributed node sends the service volume ECi1 from t1-2 to t1 to the central node at time t1;
  • the distributed node receives the decision quota ECLi1 sent by the central node;
  • the distributed node receives the decision quota ECLi3 sent by the central node;
  • the distributed node compares the service increment Di2 with the decision quota ECLi3. If the service increment Di2 is less than the decision quota ECLi3, no current limit is performed, otherwise, the current limit is performed for the access request b.
  • the current can be limited by denying the service access request, that is, not sending back-to-origin requests to the source station.
  • the current can be limited by denying the service access request or limiting the response speed of the access request, or a combination of the two methods can be used for current limiting.
  • the flow of current limiting by combining the two methods is:
  • the distributed node receives the current access request, and after determining that the current service increment is greater than or equal to the newly received decision quota, responds to the access request at a preset response rate;
  • the distributed node receives the next access request, and if the current service increment is still greater than or equal to the newly received decision quota, refuses to serve the next access request; if the current service increment is less than the latest received decision If the current average response rate is greater than the preset response rate, respond to the next access request at the preset response rate, wherein the current average response rate is equal to the traffic generated in the current preset time period The ratio between the number of access requests in the current preset time period; if the current service increment is less than the newly received decision quota, and the current average response rate is less than or equal to the preset response rate, then there is no flow limit.
  • the access request is processed at a default response rate, and the above-mentioned preset response rate is less than the default response rate.
  • a backup central node can also be set, and the central node synchronizes data to the backup central node regularly.
  • the backup central node replaces the central node to provide services.
  • the central node and the backup central node are connected to the same access layer, and the access layer is connected to each of the distributed nodes.
  • the access layer is used to receive the data sent by each distributed node and divert the data to the central node or backup central node.
  • the access layer will divert the received data to the central node.
  • the access layer will divert the received data to the backup central node to ensure the normal progress of current limiting decisions , To ensure the service performance of the distributed system.
  • the current limiting decision in the embodiment of the application is independently judged by distributed nodes.
  • the decision path is short and the decision is fast.
  • the decision quota of the corresponding size can be allocated according to the real-time service volume of each distributed node, that is In other words, the larger the service volume, the higher the allocated decision-making quota, so that distributed nodes in areas with larger service volume can receive and respond to access requests to the greatest extent, improve resource utilization, and the current limiting method is more Accurate, can improve the service performance of the distributed system.
  • the embodiment of the present application also provides a current limiting system, which includes a distributed node and a central node;
  • the distributed node is configured to send the service amount in the current preset time period to the central node according to a fixed period
  • the central node is configured to determine the decision quota of the distributed node based on the received service amount, and send the decision quota to the distributed node;
  • the distributed node is configured to receive the decision quota sent by the central node, and after receiving the access request, determine whether the access request needs to be limited based on the newly received decision quota.
  • the service volume also includes the return-to-source volume
  • the distributed node is used for:
  • the service volume in the preset time period includes the traffic generated by the distributed node in the preset time period, the average bandwidth in the preset time period, and the service volume in the preset time period.
  • the distributed node is used for:
  • the flow is not limited, otherwise the flow is limited for the access request.
  • the distributed node is used for:
  • the time interval is greater than or equal to the preset time period, send the service volume in the current preset time period to the central node, and receive the new decision quota sent by the central node, and then based on the latest received decision quota Determine whether it is necessary to limit the current for the access request.
  • the distributed node is used for:
  • the current limit is performed by limiting the response rate of the access request.
  • the distributed node is used for:
  • next access request is received, and if the current service increment is still greater than or equal to the newly received decision quota, the next access request is rejected to be served.
  • the distributed node is used for:
  • the next access request is received. If the current service increment is less than the newly received decision quota, and the current average response rate is greater than the preset response rate, then The preset response rate responds to the next access request, wherein the current average response rate is equal to the ratio between the traffic generated in the current preset time period and the number of access requests in the current preset time period;
  • the flow is not limited.
  • the current limiting decision in the embodiment of the application is independently judged by distributed nodes.
  • the decision path is short and the decision is fast.
  • the decision quota of the corresponding size can be allocated according to the real-time service volume of each distributed node, that is In other words, the larger the service volume, the higher the allocated decision-making quota, so that distributed nodes in areas with larger service volume can receive and respond to access requests to the greatest extent, improve resource utilization, and the current limiting method is more Accurate, can improve the service performance of the distributed system.
  • Fig. 3 is a schematic structural diagram of a node device provided by an embodiment of the present application.
  • the node device 400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units 422 (for example, one or more processors) and a memory 432, and one or more storage application programs 442 or data 344 storage medium 430 (for example, one or a storage device with a large amount of storage).
  • the memory 432 and the storage medium 430 may be short-term storage or persistent storage.
  • the program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the node device.
  • the central processing unit 422 may be configured to communicate with the storage medium 430, and execute a series of instruction operations in the storage medium 430 on the node device 400.
  • the node device 400 may also include one or more power supplies 424, one or more wired or wireless network interfaces 350, one or more input and output interfaces 458, one or more keyboards 454, and/or, one or more operating systems 441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
  • the node device 400 may include a memory and one or more computer programs, wherein one or more computer programs are stored in the memory and configured to be executed by one or more processors to execute the one or more computer programs. Realize the processing performed by the distributed node in the above current limiting method:

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请公开了一种限流方法及系统,其中,所述方法包括:分布式节点按照固定周期向中心节点发送当前预设时间段内的服务量;所述中心节点基于接收到的服务量确定所述分布式节点的决策额度,并向所述分布式节点发送所述决策额度;所述分布式节点接收所述中心节点发送的决策额度;所述分布式节点在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。本申请的限流决策由分布式节点自主进行判断,决策路径短,决策快,并且决策准确。

Description

一种限流方法及系统
交叉引用
本申请引用于2019年04月30日递交的名称为“一种限流方法及系统”的第201910364818.4号中国专利申请,其通过引用被全部并入本申请
技术领域
本申请涉及互联网限流技术领域,特别涉及一种限流方法及系统。
背景技术
随着互联网的高速发展,计算机系统规模变得越来越大,分布式系统也就应用而生。为了保护系统的稳定性,会限制分布式系统的总体流量。当前限流方式有中心式以及按平均值或权重分配的方式,但是这两种方式都有各自的缺陷。
中心式的缺陷是分布式节点的每一次限流决策都需要跟中心节点进行交互,决策路径长,决策较慢。分布式节点的负载时刻在变化,决策实施时的数据与决策生成、下发到分布式节点时的数据有差异,中心节点无法依照实时的数据做出决策,可能会出现错的决策,影响系统整体性能。
按平均值或权重分配的方式是给每个分布式节点分配固定的服务量,虽然决策较快,但不准确,尤其在负载不均衡的情形下,部分分布式节点过载,而系统总体流量没达到上限值。
发明内容
为了解决现有技术的问题,本申请实施例提供了一种限流方法及系统。所述技术方案如下:
第一方面,提供了一种限流方法,所述方法包括:
分布式节点按照固定周期向中心节点发送当前预设时间段内的服务量;
所述中心节点基于接收到的服务量确定所述分布式节点的决策额度,并向 所述分布式节点发送所述决策额度;
所述分布式节点接收所述中心节点发送的决策额度;
所述分布式节点在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
可选的,所述服务量还包括回源量;
相应的,所述分布式节点在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流的步骤,包括:
所述分布式节点在接收到访问请求之后,判断是否需要向源站发送回源请求;
如果需要,则基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
可选的,所述预设时间段内的服务量包括所述分布式节点在所述预设时间段内所产生的流量、所述预设时间段内的平均带宽、所述预设时间段内所建立的连接数或者所述预设时间段内的访问请求数中的一种或多种。
可选的,所述分布式节点基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流的步骤,包括:
所述分布式节点对比当前的服务增量与最新接收到的决策额度;
如果所述分布式节点当前的服务增量小于最新接收到的决策额度,则不限流,否则针对所述访问请求进行限流。
可选的,所述分布式节点在判断出当前的服务增量大于或等于最新接收到的决策额度之后,还包括:
判断当前时刻与上一次向所述中心节点发送服务量的时刻之间的时间间隔;
如果所述时间间隔小于预设时长,则针对所述访问请求进行限流;
如果所述时间间隔大于或等于预设时长,则向所述中心节点发送当前预设时间段内的服务量,并接收所述中心节点发送的新的决策额度,再基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
可选的,所述分布式节点针对所述访问请求进行限流的步骤,包括:
所述分布式节点拒绝服务所述访问请求;或者,
所述分布式节点限制所述访问请求的响应速率。
可选的,所述分布式节点在判断出当前的服务增量大于或等于最新接收到的决策额度之后,还包括:
所述分布式节点以预设响应速率响应所述访问请求;
所述分布式节点接收下一个访问请求,如果当前的服务增量仍大于或等于最新接收到的决策额度,则拒绝服务所述下一个访问请求。
可选的,所述分布式节点以预设响应速率响应所述访问请求之后,还包括:
所述分布式节点接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率大于所述预设响应速率,则以所述预设响应速率响应所述下一个访问请求,其中,所述当前平均响应速率等于当前预设时间段内所产生的流量与当前预设时间段内的访问请求数之间的比值;
所述分布式节点接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率小于或等于所述预设响应速率,则不限流。
第二方面,提供了一种限流系统,该系统包括分布式节点和中心节点:
所述分布式节点,用于按照固定周期向所述中心节点发送当前预设时间段内的服务量;
所述中心节点,用于基于接收到的服务量确定所述分布式节点的决策额度,并向所述分布式节点发送所述决策额度;
所述分布式节点,用于接收所述中心节点发送的决策额度,并在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
可选的,所述服务量还包括回源量;
相应的,所述分布式节点,用于:
在接收到访问请求之后,判断是否需要向源站发送回源请求;
如果需要,则基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
可选的,所述预设时间段内的服务量包括所述分布式节点在所述预设时间段内所产生的流量、所述预设时间段内的平均带宽、所述预设时间段内所建立的连接数或者所述预设时间段内的访问请求数中的一种或多种。
可选的,所述分布式节点,用于:
对比当前的服务增量与最新接收到的决策额度;
如果当前的服务增量小于最新接收到的决策额度,则不限流,否则针对所述访问请求进行限流。
可选的,所述分布式节点,用于:
判断当前时刻与上一次向所述中心节点发送服务量的时刻之间的时间间隔;
如果所述时间间隔小于预设时长,则针对所述访问请求进行限流;
如果所述时间间隔大于或等于预设时长,则向所述中心节点发送当前预设时间段内的服务量,并接收所述中心节点发送的新的决策额度,再基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
可选的,所述分布式节点,用于:
通过拒绝服务所述访问请求进行限流;或者,
通过限制所述访问请求的响应速率进行限流。
可选的,所述分布式节点,用于:
在判断出当前的服务增量大于或等于最新接收到的决策额度之后,以预设响应速率响应所述访问请求;
接收下一个访问请求,如果当前的服务增量仍大于或等于最新接收到的决策额度,则拒绝服务所述下一个访问请求。
可选的,所述分布式节点,用于:
在以预设响应速率响应所述访问请求之后,接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率大于所述预设响应速率,则以所述预设响应速率响应所述下一个访问请求,其中,所述当前平均响应速率等于当前预设时间段内所产生的流量与当前预设时间段内的访问请求数之间的比值;
接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率小于或等于所述预设响应速率,则不限流。
第三方面,提供了一种节点设备,包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述第一方面的限流方法中所述分布式节点所执行的处理过程。
第四方面,提供了一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述第一方面的限流方法中所述分布式节点所执行的处理过程。
本申请实施例的限流决策由分布式节点自主进行判断,决策路径短,决策快,并且通过统计学原理,可以根据各个分布式节点实时的服务量大小,分配相应大小的决策额度,也就是说,服务量越大,分配的决策额度也就越高,从而使服务量较大地区的分布式节点能够最大程度地接收并响应访问请求,提高了资源的利用率,并且该限流方式更加准确,能够提高分布式系统的服务性能。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种网络框架示意图;
图2是本申请实施例提供的一种限流方法的流程图;
图3是本申请实施例提供的另一种网络框架示意图;
图4是本申请实施例提供的一种节点设备的结构框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作进一步地详细描述。
本申请实施例提供了一种限流方法,该方法可以应用于图1所示的网络框架中。该网络框架包括中心节点和多个分布式节点,每个分布式节点均连接中心节点。在CDN(Content Delivery Network,内容分发网络)系统中,分布式节点即为CDN节点。其中,分布式节点用于接收客户端发送的访问请求,并 进行服务。在限流应用的场景中,各个分布式节点首先按照固定周期向中心节点发送当前预设时间段内的服务量,所述中心节点再基于全部的分布式节点发送的服务量确定各个所述分布式节点对应的决策额度,并向各个所述分布式节点发送相应的决策额度,各个所述分布式节点接收所述决策额度,并在接收到访问请求之后基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。由于限流决策由分布式节点自主进行判断,决策路径短,决策快,并且通过统计学原理,可以根据各个分布式节点实时的服务量大小,分配相应大小的决策额度,也就是说,服务量越大,分配的决策额度也就越高,从而使服务量较大地区的分布式节点能够最大程度地接收并响应访问请求,提高了资源的利用率,并且该限流方式更加准确,能够提高分布式系统的服务性能。
参照图2,为本申请实施例提供的一种限流方法的流程图,该方法具体包括以下步骤。
步骤201,分布式节点按照固定周期向中心节点发送当前预设时间段内的服务量。
分布式系统中的各个分布式节点按照同一固定周期向中心节点发送当前预设时间段内的服务量。该固定周期的时长可以设置为任一时长,例如一秒或一分钟。当前预设时间段内的服务量可以是当前时刻往前推一段时间内的服务量。例如,当前时刻为t,预设时间段为1分钟,则当前预设时间段内的服务量为t-1时刻至t时刻这段时间内的服务量。
在CDN系统中,在CDN节点(分布式节点)接收到客户端发送的访问请求之后,如果该节点中缓存有待访问的内容,则直接使用缓存进行响应,即服务访问请求。如果该CDN节点中没有缓存待访问的内容,或缓存的内容已经到期,则会向源站发送回源请求获取内容,即回源。本申请实施例可以针对服务访问请求的场景进行限流,也可以针对回源的场景进行限流,即限制CDN节点向源站发送回源请求。在针对服务访问请求的场景进行限流时,分布式节点向中心节点发送的服务量为响应访问请求所产生的服务量。在针对回源的场景进行限流时,分布式节点向中心节点发送的服务量为回源时所产生的服务量。也就是说,分布式节点向中心节点发送的服务量包括响应访问请求所产生的服务量,或者回源时所产生的服务量,也即回源量。针对回源的场景进行限流, 可以防止源站承载过大的访问压力,保护源站的稳定性。
服务量可以用流量、带宽、连接数或访问请求数进行表示。具体的,当分布式节点向中心节点发送的服务量是响应访问请求所产生的服务量时,所述预设时间段内的服务量包括所述分布式节点在所述预设时间段内所产生的流量、所述预设时间段内的平均带宽,所述预设时间段内所建立的连接数或者所述预设时间段内的访问请求数中的一种或多种。当服务量用连接数表示时,所述预设时间段内的服务量为分布式节点在所述预设时间段内与客户端建立的连接数。当服务量用访问请求数表示时,所述预设时间段内的服务量为分布式节点在所述预设时间段内的访问请求数,其中预设时间段内的访问请求数可以是已响应完的访问请求数,或是已响应完的访问请求数与当前正响应的访问请求数之和,再或者是已响应完的访问请求数、当前正响应的访问请求数与未响应的访问请求数之和。
当分布式节点向中心节点发送的服务量是回源量时,所述预设时间段内的服务量包括所述分布式节点在所述预设时间段内所产生的流量(回源流量)、所述预设时间段内的平均带宽(回源带宽)或者所述预设时间段内所建立的连接数中的一种或多种。所述分布式节点在所述预设时间段内所产生的回源流量可以为所述分布式节点在所述预设时间段内回源获取到的内容的大小。当服务量用连接数表示时,所述预设时间段内的服务量为分布式节点在所述预设时间段内与源站建立的连接数。
步骤202,所述中心节点基于接收到的服务量确定所述分布式节点的决策额度,并向所述分布式节点发送所述决策额度。
各个分布式节点定时向中心节点发送最新的服务量,中心节点根据最新的服务量计算各个分布式节点的服务占,然后根据各个分布式节点的服务占比计算各个分布式节点对应的决策额度,服务占比越大,对应的决策额度也就越高,也就允许接收更多的服务访问请求,从而能够根据分布式节点实时的服务量大小,实时调节其决策额度,在根据该决策额度决定是否需要限流,保证限流的准确性,提高整个分布式系统的服务性能。
所述分布式节点对应的决策额度的表达式为:
ECLi=(LT-(EC1+EC2+……+ECn))*ECPi,i=1,2……n,
其中,ECLi表示第i个分布式节点对应的决策额度,LT表示总体限制数, ECi表示第i个分布式节点对应的服务量,ECPi表示第i个分布式节点的服务占比,ECPi=ECi/(EC1+EC2+……+ECn)。
总体限制数为预先存储在中心节点中的值,表示分布式系统所允许承载的总负载。在具体实施中,总体限制数可以是针对服务访问请求所产生的服务量的总体限制数也可以是针对回源量的总体限制数。在针对服务访问请求的场景进行限流时,总体限制数可以是针对服务访问请求所产生的服务量的总体限制数。在针对回源的场景进行限流时,总体限制数是针对回源量的总体限制数。
总体限制数与分布式节点上报给中心节点的服务量的表示方式相对应,也就是说,如果服务量使用流量进行表示,则总体限制数也使用流量进行表示;如果服务量使用带宽进行表示,则总体限制数也使用带宽进行表示;如果服务量使用连接数进行表示,则总体限制数也使用连接数进行表示;如果服务量使用访问请求量进行表示,则总体限制数也使用访问请求量进行表示。
步骤203,所述分布式节点接收所述中心节点发送的决策额度。
步骤204,所述分布式节点在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
在针对服务访问请求的场景进行限流时,分布式节点每接收到一个访问请求,便判断是否需要针对该访问请求进行限流。在针对回源的场景进行限流时,所述分布式节点在接收到访问请求之后,判断是否需要向源站发送回源请求;如果需要,则基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。分布式节点基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流的具体流程为:所述分布式节点在接收到访问请求之后,对比当前的服务增量与最新接收到的决策额度,其中,所述服务增量为当前预设时间段内的服务量与最后一次发送给所述中心节点的服务量之间的差值;如果所述分布式节点当前的服务增量小于最新接收到的决策额度,则不限流,否则针对所述访问请求进行限流。
在另一种实施例中,在所述分布式节点判断出当前的服务增量大于或等于最新接收到的决策额度之后,判断当前时刻与上一次向所述中心节点发送服务量的时刻之间的时间间隔;如果所述时间间隔小于预设时长,则针对所述访问请求进行限流;如果所述时间间隔大于或等于预设时长,则向所述中心节点发送当前预设时间段内的服务量,并接收所述中心节点发送的新的决策额度, 再基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
上述预设时长短于分布式节点定时向中心节点上报服务量的固定周期。例如,分布式节点定时向中心节点上报服务量的固定周期为1分钟,该预设时长可以设置为30s。分布式节点在接收到决策额度之后,距离得到该决策额度的时间越久,该决策额度可能就越不准确。所以当距离得到该决策额度的时间较久,也即当前时刻与上一次向所述中心节点发送服务量的时刻之间的时间间隔超过预设时长时,说明需要获取新的决策额度,防止由于决策额度更新不及时出现错误限流,而影响服务质量。
在具体实施中,即使还没有到定时向中心节点上报服务量的时刻,只要中心节点接收到某一分布式节点发送的服务量时,便重新计算一次决策额度,并将新的决策额度下发至该分布式节点。
以下,以针对服务访问请求的场景进行限流为例,对分布式节点的限流方法进行举例说明。
假设分布式节点定时向中心节点上报服务量的固定周期为1分钟,用于统计服务量的预设时间段为2分钟,限流响应流程为:
(1)分布式节点在t1时刻向中心节点发送t1-2至t1时刻内的服务量ECi1;
(2)分布式节点接收中心节点发送的决策额度ECLi1;
(3)分布式节点在t2时刻接收到访问请求a,计算当前的服务增量Di1,Di1=t2-2至t2时刻内的服务量ECi2-ECi1,如果服务增量Di1小于决策额度ECLi1,则不进行限流;
(4)分布式节点在t3时刻接收到下一个访问请求b,计算当前的服务增量Di2,Di2=t3-2至t3时刻内的服务量ECi3-ECi1,如果服务增量Di2小于决策额度ECLi1,则不进行限流,并结束该流程,否则判断当前时刻与上一次向所述中心节点发送服务量的时刻,即t1时刻之间的时间间隔;
(5)如果该时间间隔大于预设时长,则向中心节点发送t3-2至t3时刻内的服务量ECi3,并转下一步,否则针对访问请求b进行限流;
(6)分布式节点接收中心节点发送的决策额度ECLi3;
(7)分布式节点对比服务增量Di2与决策额度ECLi3,如果服务增量Di2小于决策额度ECLi3,则不进行限流,否则针对访问请求b进行限流。
在针对回源的场景进行限流时,可以通过拒绝服务访问请求进行限流,即不向源站发送回源请求。在针对服务访问请求的场景进行限流时,可以通过拒绝服务访问请求或限制访问请求的响应速度来进行限流,或者两种方式相结合进行限流。通过两种方式相结合进行限流的流程为:
所述分布式节点接收当前访问请求,在判断出当前的服务增量大于或等于最新接收到的决策额度之后,以预设响应速率响应所述访问请求;
所述分布式节点接收下一个访问请求,如果当前的服务增量仍大于或等于最新接收到的决策额度,则拒绝服务所述下一个访问请求;如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率大于所述预设响应速率,则以所述预设响应速率响应所述下一个访问请求,其中,所述当前平均响应速率等于当前预设时间段内所产生的流量与当前预设时间段内的访问请求数之间的比值;如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率小于或等于所述预设响应速率,则不限流。
当无需针对接收到的访问请求进行限流时,则以默认的响应速率处理该访问请求,上述预设响应速率小于该默认的响应速率。
如图3所示,还可以设置备用中心节点,中心节点定时将数据同步到该备用中心节点。当所述中心节点发生故障时,由备用中心节点代替所述中心节点提供服务。具体的,所述中心节点与所述备用中心节点连接同一接入层,所述接入层连接各个所述分布式节点。接入层用于接收各个分布式节点发送的数据,并将数据导流到中心节点或备用中心节点。当中心节点正常工作时,接入层将接收到的数据导流到中心节点,当中心节点发生故障时,接入层将接收到的数据导流到备用中心节点,从而保证限流决策正常进行,保证分布式系统的服务性能。
本申请实施例的限流决策由分布式节点自主进行判断,决策路径短,决策快,并且通过统计学原理,可以根据各个分布式节点实时的服务量大小,分配相应大小的决策额度,也就是说,服务量越大,分配的决策额度也就越高,从而使服务量较大地区的分布式节点能够最大程度地接收并响应访问请求,提高了资源的利用率,并且该限流方式更加准确,能够提高分布式系统的服务性能。
本申请实施例还提供了一种限流系统,该系统包括分布式节点和中心节点;
所述分布式节点,用于按照固定周期向所述中心节点发送当前预设时间段内的服务量;
所述中心节点,用于基于接收到的服务量确定所述分布式节点的决策额度,并向所述分布式节点发送所述决策额度;
所述分布式节点,用于接收所述中心节点发送的决策额度,并在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
例如,所述服务量还包括回源量;
相应的,所述分布式节点,用于:
在接收到访问请求之后,判断是否需要向源站发送回源请求;
如果需要,则基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
例如,所述预设时间段内的服务量包括所述分布式节点在所述预设时间段内所产生的流量、所述预设时间段内的平均带宽、所述预设时间段内所建立的连接数或者所述预设时间段内的访问请求数中的一种或多种。
例如,所述分布式节点,用于:
对比当前的服务增量与最新接收到的决策额度;
如果当前的服务增量小于最新接收到的决策额度,则不限流,否则针对所述访问请求进行限流。
例如,所述分布式节点,用于:
判断当前时刻与上一次向所述中心节点发送服务量的时刻之间的时间间隔;
如果所述时间间隔小于预设时长,则针对所述访问请求进行限流;
如果所述时间间隔大于或等于预设时长,则向所述中心节点发送当前预设时间段内的服务量,并接收所述中心节点发送的新的决策额度,再基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
例如,所述分布式节点,用于:
通过拒绝服务所述访问请求进行限流;或者,
通过限制所述访问请求的响应速率进行限流。
例如,所述分布式节点,用于:
在判断出当前的服务增量大于或等于最新接收到的决策额度之后,以预设响应速率响应所述访问请求;
接收下一个访问请求,如果当前的服务增量仍大于或等于最新接收到的决策额度,则拒绝服务所述下一个访问请求。
例如,所述分布式节点,用于:
在以预设响应速率响应所述访问请求之后,接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率大于所述预设响应速率,则以所述预设响应速率响应所述下一个访问请求,其中,所述当前平均响应速率等于当前预设时间段内所产生的流量与当前预设时间段内的访问请求数之间的比值;
接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率小于或等于所述预设响应速率,则不限流。
本申请实施例的限流决策由分布式节点自主进行判断,决策路径短,决策快,并且通过统计学原理,可以根据各个分布式节点实时的服务量大小,分配相应大小的决策额度,也就是说,服务量越大,分配的决策额度也就越高,从而使服务量较大地区的分布式节点能够最大程度地接收并响应访问请求,提高了资源的利用率,并且该限流方式更加准确,能够提高分布式系统的服务性能。
需要说明的是:上述实施例提供的限流系统与限流方法的实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图3是本申请实施例提供的节点设备的结构示意图。该节点设备400可因配置或性能不同而产生比较大差异,可以包括一个或一个以上中央处理器422(例如,一个或一个以上处理器)和存储器432,一个或一个以上存储应用程序442或数据344的存储介质430(例如一个或一个以上海量存储设备)。其中,存储器432和存储介质430可以是短暂存储或持久存储。存储在存储介质430的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对节点 设备中的一系列指令操作。更进一步地,中央处理器422可以设置为与存储介质430通信,在节点设备400上执行存储介质430中的一系列指令操作。
节点设备400还可以包括一个或一个以上电源424,一个或一个以上有线或无线网络接口350,一个或一个以上输入输出接口458,一个或一个以上键盘454,和/或,一个或一个以上操作系统441,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
节点设备400可以包括有存储器,以及一个或者一个以上的计算机程序,其中一个或者一个以上计算机程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上计算机程序以实现上述限流方法中分布式节点所执行的处理过程:
按照固定周期向中心节点发送当前预设时间段内的服务量;
接收所述中心节点发送的决策额度;
在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行拒绝服务或限流。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (12)

  1. 一种限流方法,其中,所述方法包括:
    分布式节点按照固定周期向中心节点发送当前预设时间段内的服务量;
    所述中心节点基于接收到的服务量确定所述分布式节点的决策额度,并向所述分布式节点发送所述决策额度;
    所述分布式节点接收所述中心节点发送的决策额度;
    所述分布式节点在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
  2. 根据权利要求1所述的方法,其中,所述服务量还包括回源量;
    相应的,所述分布式节点在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流的步骤,包括:
    所述分布式节点在接收到访问请求之后,判断是否需要向源站发送回源请求;
    如果需要,则基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
  3. 根据权利要求1或2所述的方法,其中,所述预设时间段内的服务量包括所述分布式节点在所述预设时间段内所产生的流量、所述预设时间段内的平均带宽、所述预设时间段内所建立的连接数或者所述预设时间段内的访问请求数中的一种或多种。
  4. 根据权利要求1所述的方法,其中,所述分布式节点基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流的步骤,包括:
    所述分布式节点对比当前的服务增量与最新接收到的决策额度;
    如果所述分布式节点当前的服务增量小于最新接收到的决策额度,则不限流,否则针对所述访问请求进行限流。
  5. 根据权利要求4所述的方法,其中,所述分布式节点在判断出当前的服务增量大于或等于最新接收到的决策额度之后,还包括:
    判断当前时刻与上一次向所述中心节点发送服务量的时刻之间的时间间隔;
    如果所述时间间隔小于预设时长,则针对所述访问请求进行限流;
    如果所述时间间隔大于或等于预设时长,则向所述中心节点发送当前预设时间段内的服务量,并接收所述中心节点发送的新的决策额度,再基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
  6. 根据权利要求4或5所述的方法,其中,所述分布式节点针对所述访问请求进行限流的步骤,包括:
    所述分布式节点拒绝服务所述访问请求;或者,
    所述分布式节点限制所述访问请求的响应速率。
  7. 根据权利要求4所述的方法,其中,所述分布式节点在判断出当前的服务增量大于或等于最新接收到的决策额度之后,还包括:
    所述分布式节点以预设响应速率响应所述访问请求;
    所述分布式节点接收下一个访问请求,如果当前的服务增量仍大于或等于最新接收到的决策额度,则拒绝服务所述下一个访问请求。
  8. 根据权利要求7所述的方法,其中,所述分布式节点以预设响应速率响应所述访问请求之后,还包括:
    所述分布式节点接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率大于所述预设响应速率,则以所述预设响应速率响应所述下一个访问请求,其中,所述当前平均响应速率等于当前预设时间段内所产生的流量与当前预设时间段内的访问请求数之间的比值;
    所述分布式节点接收所述下一个访问请求,如果当前的服务增量小于最新接收到的决策额度,并且当前平均响应速率小于或等于所述预设响应速率,则不限流。
  9. 一种限流系统,其中,所述系统包括分布式节点和中心节点;
    所述分布式节点,用于按照固定周期向所述中心节点发送当前预设时间段内的服务量;
    所述中心节点,用于基于接收到的服务量确定所述分布式节点的决策额度,并向所述分布式节点发送所述决策额度;
    所述分布式节点,用于接收所述中心节点发送的决策额度,并在接收到访问请求之后,基于最新接收到的决策额度判断是否需要针对所述访问请求进行限流。
  10. 根据权利要求9所述的系统,其中,所述预设时间段内的服务量包括所述分布式节点在所述预设时间段内所产生的流量、所述预设时间段内的平均带宽、所述预设时间段内所建立的连接数或者所述预设时间段内的访问请求数中的一种或多种。
  11. 一种节点设备,其中,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至8中任一项所述的限流方法中所述分布式节点所执行的处理过程。
  12. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至8中任一项所述的限流方法中所述分布式节点所执行的处理过程。
PCT/CN2019/090339 2019-04-30 2019-06-06 一种限流方法及系统 Ceased WO2020220430A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19894390.4A EP3758325B1 (en) 2019-04-30 2019-06-06 Traffic limiting method, node and system
US16/902,800 US11316792B2 (en) 2019-04-30 2020-06-16 Method and system of limiting traffic

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910364818.4A CN110138756B (zh) 2019-04-30 2019-04-30 一种限流方法及系统
CN201910364818.4 2019-04-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/902,800 Continuation US11316792B2 (en) 2019-04-30 2020-06-16 Method and system of limiting traffic

Publications (1)

Publication Number Publication Date
WO2020220430A1 true WO2020220430A1 (zh) 2020-11-05

Family

ID=67576039

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/090339 Ceased WO2020220430A1 (zh) 2019-04-30 2019-06-06 一种限流方法及系统

Country Status (4)

Country Link
US (1) US11316792B2 (zh)
EP (1) EP3758325B1 (zh)
CN (1) CN110138756B (zh)
WO (1) WO2020220430A1 (zh)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404824B (zh) * 2020-03-06 2023-05-19 抖音视界有限公司 用于转发请求的方法、装置、电子设备和计算机可读介质
CN112073329B (zh) * 2020-08-25 2023-01-24 北京五八信息技术有限公司 分布式限流方法、装置、电子设备和存储介质
CN112383486B (zh) * 2020-11-05 2024-12-03 北京同有飞骥科技股份有限公司 基于租约的分布式对象存储服务质量保证方法及系统
CN112702321B (zh) * 2020-12-15 2023-04-07 深圳市快付通金融网络科技服务有限公司 分布式交易限流方法、装置、设备及存储介质
CN112600932B (zh) * 2020-12-22 2023-04-07 百度在线网络技术(北京)有限公司 定量下发方法、控制台、下发节点、设备和介质
CN112887218B (zh) * 2020-12-22 2022-10-21 新华三技术有限公司 一种报文转发方法及装置
CN113328906B (zh) * 2021-04-22 2023-01-06 成都欧珀通信科技有限公司 一种流量实时监控方法、装置、存储介质及电子设备
CN113691596B (zh) * 2021-08-12 2023-06-30 北京奇艺世纪科技有限公司 一种网关控制方法、装置、电子设备及存储介质
CN113726683B (zh) * 2021-09-09 2023-08-15 海尔数字科技(青岛)有限公司 访问限流方法、装置、设备、存储介质及计算机程序产品
CN116418751B (zh) * 2021-12-30 2025-12-30 北京字跳网络技术有限公司 流量控制方法、装置、电子设备、介质及程序产品
CN114745338B (zh) * 2022-03-30 2024-09-06 Oppo广东移动通信有限公司 流量控制方法、装置、存储介质以及服务器
CN115242808B (zh) * 2022-07-13 2024-03-08 山东浪潮超高清智能科技有限公司 一种分布式系统限流控制系统和方法
CN116684355A (zh) * 2023-05-23 2023-09-01 北京奇艺世纪科技有限公司 一种分布式限流方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101702669A (zh) * 2009-11-18 2010-05-05 上海网宿科技股份有限公司 带宽分配方法和系统
CN103997522A (zh) * 2014-05-16 2014-08-20 广州金山网络科技有限公司 一种内容分发网络流量控制方法及终端
CN107733972A (zh) * 2017-08-28 2018-02-23 阿里巴巴集团控股有限公司 一种短链接解析方法、装置及设备
CN108574965A (zh) * 2017-03-09 2018-09-25 中国移动通信有限公司研究院 一种进行请求处理的方法及设备
WO2018206743A1 (en) * 2017-05-12 2018-11-15 Sky Cp Limited Media content delivery

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7412245B2 (en) * 2005-11-01 2008-08-12 Alpha Networks Inc. Dynamic wireless meshing network for supporting load balance and flow control
US8265086B2 (en) * 2009-06-26 2012-09-11 Nokia Corporation Multi-path transport
US9438487B2 (en) * 2012-02-23 2016-09-06 Ericsson Ab Bandwith policy management in a self-corrected content delivery network
US20150029851A1 (en) * 2013-07-26 2015-01-29 Telefonaktiebolaget L M Ericsson (Publ) Managing the traffic load of a delivery node
US9455932B2 (en) * 2014-03-03 2016-09-27 Ericsson Ab Conflict detection and resolution in an ABR network using client interactivity
US9336537B2 (en) * 2014-03-06 2016-05-10 Catalina Marketing Corporation System and method of providing a particular number of distributions of media content through a plurality of distribution nodes
CN104219319B (zh) * 2014-09-15 2017-06-09 南京邮电大学 一种分布式网络流量自组织调度方法
CN105450780B (zh) * 2015-12-31 2019-01-18 深圳市网心科技有限公司 一种cdn系统及其回源方法
CN107204933B (zh) * 2016-03-16 2021-03-23 华为技术有限公司 分布式流量调节方法及装置
CN106101183A (zh) * 2016-05-30 2016-11-09 乐视控股(北京)有限公司 回源请求的中转方法和装置及回源系统
CN108366020B (zh) * 2018-02-02 2020-09-18 网宿科技股份有限公司 一种发送数据资源的获取请求的方法和系统
CN108848038B (zh) * 2018-08-30 2021-01-29 华为技术有限公司 基于令牌桶的流量管理方法和令牌桶节点

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101702669A (zh) * 2009-11-18 2010-05-05 上海网宿科技股份有限公司 带宽分配方法和系统
CN103997522A (zh) * 2014-05-16 2014-08-20 广州金山网络科技有限公司 一种内容分发网络流量控制方法及终端
CN108574965A (zh) * 2017-03-09 2018-09-25 中国移动通信有限公司研究院 一种进行请求处理的方法及设备
WO2018206743A1 (en) * 2017-05-12 2018-11-15 Sky Cp Limited Media content delivery
CN107733972A (zh) * 2017-08-28 2018-02-23 阿里巴巴集团控股有限公司 一种短链接解析方法、装置及设备

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
CN110138756A (zh) 2019-08-16
EP3758325A4 (en) 2021-01-27
EP3758325B1 (en) 2022-03-23
US11316792B2 (en) 2022-04-26
US20200351207A1 (en) 2020-11-05
CN110138756B (zh) 2021-05-25
EP3758325A1 (en) 2020-12-30

Similar Documents

Publication Publication Date Title
WO2020220430A1 (zh) 一种限流方法及系统
US11743187B2 (en) Application programing interface (API) gateway cluster control method and API gateway cluster
US20240414063A1 (en) Method and apparatus for subscribing to analytics of model transfer status in network, and readable storage medium
WO2020228469A1 (zh) 一种移动边缘计算节点的选择方法、装置及系统
US10257288B2 (en) System and method for throttling service requests having non-uniform workloads
WO2020253266A1 (zh) 一种提供边缘服务的方法、装置和设备
US10140236B2 (en) Receiving buffer credits by a plurality of channels of one or more host computational devices for transmitting data to a control unit
EP3754915A1 (en) Data processing method, apparatus and system
US10289591B2 (en) Adjustment of buffer credits and other parameters in a startup phase of communications between a plurality of channels and a control unit
CN105049536B (zh) IaaS云环境中的负载均衡系统和负载均衡方法
CN112087382B (zh) 一种服务路由方法及装置
US10157150B2 (en) Adjustments of buffer credits for optimizing the number of retry operations and transfer ready operations
WO2021120633A1 (zh) 一种负载均衡方法及相关设备
US11316916B2 (en) Packet processing method, related device, and computer storage medium
CN105407057B (zh) 一种负载均衡的方法及装置
WO2022048559A1 (zh) 一种接入网关的方法及装置
CN112601232B (zh) 基于最小费用最大流的负载均衡的多服务迁移方法及系统
WO2021098730A1 (zh) 交换网络拥塞管理方法、装置、设备和存储介质
CN107786371B (zh) 一种数据的加速方法、装置及存储介质
US20160028834A1 (en) Traffic engineering of cloud services
EP3757781B1 (en) Data processing method and system
WO2024088079A1 (zh) 请求处理方法以及系统
EP4569800A1 (en) Methods and apparatuses for controlling federated learning being performed by a flock of wireless devices
WO2020248633A1 (zh) 群成员管理和群消息处理的方法、装置、设备及存储介质
TW202215262A (zh) 一種具延遲感知負載平衡的反向代理方法和存儲裝置

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2019894390

Country of ref document: EP

Effective date: 20200616

NENP Non-entry into the national phase

Ref country code: DE