CN106612238B - Flow control method, device and system - Google Patents

Flow control method, device and system Download PDF

Info

Publication number
CN106612238B
CN106612238B CN201510689426.7A CN201510689426A CN106612238B CN 106612238 B CN106612238 B CN 106612238B CN 201510689426 A CN201510689426 A CN 201510689426A CN 106612238 B CN106612238 B CN 106612238B
Authority
CN
China
Prior art keywords
current
threshold
network
value
flow
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.)
Active
Application number
CN201510689426.7A
Other languages
Chinese (zh)
Other versions
CN106612238A (en
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510689426.7A priority Critical patent/CN106612238B/en
Publication of CN106612238A publication Critical patent/CN106612238A/en
Application granted granted Critical
Publication of CN106612238B publication Critical patent/CN106612238B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a flow control method and a device, and the flow control method comprises the following steps: detecting a current network flow value; comparing the current network flow value with a plurality of preset threshold values, including: when the current network flow value is larger than a first threshold value and smaller than a second threshold value, a first current limiting notice is returned to a client initiating a network request; when the current network flow value is larger than a second threshold value, a second current limiting notice is returned to the client side which initiates the network request; wherein the first threshold is less than the second threshold; the first current limit notification comprises a transmission time interval and a first effective time after the adjustment of the network request, so that the client sends the network request according to the transmission time interval in the first effective time; the second current limit notification includes: a second validity time, so that the client stops sending network requests within the second validity time. The method can solve the problems existing when only a single threshold value is set during flow control.

Description

Flow control method, device and system
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, and a system for controlling a flow.
Background
With the popularization of the internet, more and more users use the internet to perform information inquiry, online shopping and the like. When the number of users of the client is large, a great traffic pressure is caused to the server. In the prior art, a threshold is usually set at a server, when a traffic exceeds the threshold, the server sends an error code to a client, and the client stops sending a network request to the server within a period of time after receiving the error code.
However, the scheme of setting only one threshold at the server has the problems of poor user experience, difficulty in reasonably setting a single threshold, easiness in being washed down by burst traffic, and the like.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
For this reason, an object of the present application is to provide a flow control method that can solve the above-described problem that exists when only a single threshold value is set at the time of flow control.
It is another object of the present application to provide a flow control device.
It is another object of the present application to provide a flow control system.
In order to achieve the above object, an embodiment of the present application provides a flow control method, including: detecting a current network flow value; comparing the current network flow value with a plurality of preset threshold values; when the current network flow value is larger than a first threshold value and smaller than a second threshold value, a first current limiting notice is returned to a client initiating a network request; when the current network flow value is larger than a second threshold value, a second current limiting notice is returned to the client side which initiates the network request; wherein the first threshold is less than the second threshold; the first current limit notification comprises the adjusted sending time interval and the first effective time of the network request, so that the client sends the network request according to the sending time interval in the first effective time; the second current limit notification includes: a second validity time, so that the client stops sending network requests within the second validity time.
The flow control method provided by the embodiment of the first aspect of the application can realize hierarchical flow control by setting a plurality of thresholds, thereby solving some problems existing in a single threshold.
In order to achieve the above object, an embodiment of a second aspect of the present application provides a flow control method, including: receiving a current limiting notice sent by a server, wherein the current limiting notice is obtained by comparing a current network flow value with a plurality of preset threshold values by the server; wherein the current flow limit notification is a first flow limit notification including an adjusted transmission time interval of the network request and a first active time when the current network flow value is greater than a first threshold and less than a second threshold, and the flow limit notification is a second flow limit notification including a second active time when the current network flow value is greater than the second threshold; wherein the first threshold is less than the second threshold; flow control is carried out according to the flow limiting notice; wherein, when the current limit notification is a first current limit notification, a network request is sent according to the sending time interval within the first effective time, and when the current limit notification is a second current limit notification, the sending of the network request is stopped within the second effective time.
According to the flow control method provided by the embodiment of the second aspect of the application, hierarchical flow control can be realized by setting a plurality of thresholds, so that some problems existing in a single threshold are solved.
In order to achieve the above object, an embodiment of a third aspect of the present application provides a flow control device, including: the detection module is used for detecting the current network flow value; the determining module is used for comparing the current network flow value with a plurality of preset threshold values; the sending module is used for returning a first current limiting notice to the client initiating the network request when the current network flow value is larger than a first threshold and smaller than a second threshold; when the current network flow value is larger than a second threshold value, a second current limiting notice is returned to the client side which initiates the network request; wherein the first threshold is less than the second threshold; the first current limit notification comprises the adjusted sending time interval and the first effective time of the network request, so that the client sends the network request according to the sending time interval in the first effective time; the second current limit notification includes: a second validity time, so that the client stops sending network requests within the second validity time.
The flow control device provided by the embodiment of the third aspect of the present application can implement hierarchical flow control by setting multiple threshold values, thereby solving some problems existing in a single threshold value.
In order to achieve the above object, a flow control device according to a fourth aspect of the present invention includes: the receiving module is used for receiving a current limiting notice sent by the server, wherein the current limiting notice is obtained by comparing the current network flow value with a plurality of preset threshold values by the server; wherein the current flow limit notification is a first flow limit notification including an adjusted transmission time interval of the network request and a first active time when the current network flow value is greater than a first threshold and less than a second threshold, and the flow limit notification is a second flow limit notification including a second active time when the current network flow value is greater than the second threshold; wherein the first threshold is less than the second threshold; the control module is used for controlling the flow according to the flow limiting notice; wherein, when the current limit notification is a first current limit notification, a network request is sent according to the sending time interval within the first effective time, and when the current limit notification is a second current limit notification, the sending of the network request is stopped within the second effective time.
The flow control device provided by the embodiment of the fourth aspect of the present application can realize hierarchical flow control by setting a plurality of thresholds, thereby solving some problems existing in a single threshold.
In order to achieve the above object, an embodiment of the fifth aspect of the present application provides a flow control system, including: the flow control device provided by the embodiment of the third aspect of the present application, and the flow control device provided by the embodiment of the fourth aspect of the present application.
The flow control system provided by the embodiment of the fifth aspect of the present application can implement hierarchical flow control by setting multiple thresholds, thereby solving some problems existing in a single threshold.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flow chart of a flow control method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a flow control method according to another embodiment of the present application;
fig. 3 is a schematic flow chart of a flow control method according to another embodiment of the present application;
FIG. 4 is a schematic view of a flow control device according to another embodiment of the present application;
FIG. 5 is a schematic view of a flow control device according to another embodiment of the present application;
FIG. 6 is a schematic view of a flow control device according to another embodiment of the present application;
fig. 7 is a schematic structural diagram of a flow control system according to another embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar modules or modules having the same or similar functionality throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application. On the contrary, the embodiments of the application include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a schematic flow chart of a flow control method according to an embodiment of the present application, where the method takes an execution flow of a server as an example, and the method includes:
s11: and detecting the current network flow value.
The network traffic value may be represented by a QPS (query per second), and each server may detect its QPS in real time, so as to obtain the current network traffic value. When each server detects its own QPS, for example, the server receives a network request sent by a client, and performs quantity statistics on the network requests within 1 second, thereby obtaining the QPS.
S12: comparing the current network flow value with a plurality of preset threshold values, including: when the current network flow value is larger than a first threshold value and smaller than a second threshold value, a first current limiting notice is returned to a client initiating a network request; when the current network flow value is larger than a second threshold value, a second current limiting notice is returned to the client side which initiates the network request; wherein the first threshold is less than the second threshold.
In this embodiment, the multiple set thresholds include a first threshold and a second threshold, for example, where the first threshold is smaller than the second threshold.
The first current limit notification comprises the adjusted sending time interval and the first effective time of the network request, so that the client sends the network request according to the sending time interval in the first effective time; the second current limit notification includes: a second validity time, so that the client stops sending network requests within the second validity time.
The client and the server can be configured with a consistent current limiting strategy in advance, so that the client can perform corresponding flow control according to the current limiting notification message sent by the server and the preset current limiting strategy.
For simplicity of illustration, the relationship between the current network traffic value and the preset multiple threshold values and the current limiting policy may be represented by a relationship between the state and the current limiting policy.
For example, after the first threshold and the second threshold are set, the first threshold and the second threshold may divide the state into three kinds, which are respectively represented by a normal state, a low voltage current limiting state, and a high voltage current limiting state.
Specifically, if the current network flow value is smaller than a first threshold, it is determined that the current state is the normal state, if the current network flow value is larger than the first threshold and smaller than a second threshold, it is determined that the current state is the low-pressure current limiting state, and if the current network flow value is larger than the second threshold, it is determined that the current state is the high-pressure current limiting state.
As shown in table 1, the relationship between the state and the throttling strategy may include:
TABLE 1
Figure GDA0002620565000000041
In some embodiments, the server in this embodiment specifically refers to a single server, and correspondingly, the preset threshold is determined according to a single current limiting threshold and a preset coefficient, where the single current limiting threshold is determined according to the cluster whole capability value and the total number of cluster servers.
The server usually represents the cluster whole ability value externally, for example, when the current QPS is greater than the cluster whole ability value m, it is determined that the current state is the high-voltage current limiting state, if the total number of the machine servers is n, the single current limiting threshold corresponding to the second threshold is m/n, and in addition, different preset coefficients may be set corresponding to different servers, so that the second threshold corresponding to each server is obtained by multiplying the m/n by the corresponding preset coefficient. Similarly, the first threshold value may be determined according to the corresponding individual current limiting threshold value and a preset coefficient.
In this embodiment, by setting a plurality of thresholds, hierarchical flow control can be realized, thereby solving some problems existing in a single threshold. Furthermore, the client performs flow control according to the first flow limiting notification or the second flow limiting notification sent by the server and a preset flow limiting strategy, so that the linkage between the client and the server can be realized, the user experience and the system safety are considered, and the system flexibility and usability are realized. Further, by the execution of a single server, the reaction speed can be improved.
In some embodiments, the flow control may be divided into a global control mode and a sub-service control mode, and accordingly, the network flow value may include: a global network traffic value and/or a sub-traffic network traffic value.
Fig. 2 is a schematic flow chart of a flow control method according to another embodiment of the present application, where the present embodiment takes a network flow value including a global network flow value and a network flow value of a sub-service as an example, the method includes:
s21: the server receives a network request sent by the client.
The embodiment takes the execution of a single server at the server as an example.
Compared with a server cluster mode, a single server can be independently executed, state synchronization of the servers in the cluster is not needed, and therefore flow control can be timely and fast guaranteed.
S22: and the server counts to obtain the global QPS and obtains a plurality of thresholds of the global flow control.
For example, the server sets a global QPS counter and a sub-service QPS counter corresponding to the global traffic control and the traffic control of the sub-service, respectively, and further, different sub-service QPS counters may be adopted corresponding to different services.
When the global QPS is counted, for example, every time a network request is received, 1 is added to the original count value of the global QPS counter, the number of requests in one second is counted, so that the global QPS is obtained, and the global QPS is cleared after each second is finished, so that subsequent QPS is counted. The time is based on the time of the server.
In addition, the initial values of the global QPS and the split traffic QPS may be set to 0.
The server may be configured with multiple thresholds corresponding to global flow control and multiple thresholds corresponding to sub-service control in advance. The multiple thresholds corresponding to the global flow control and the multiple thresholds corresponding to the sub-service control may be the same or different, and the multiple thresholds corresponding to different sub-service controls may be the same or different.
S23: the global QPS is compared to a plurality of thresholds for global flow control.
Assuming that the multiple thresholds for global flow control are denoted by T11 and T12, where T11 is less than T12, the global QPS may be compared to T11 and T12, respectively.
In addition, it is understood that T11 and T12 may divide the global state into three types, respectively referred to as a global normal state, a global high voltage current limiting state, and a global low voltage current limiting state, and the global normal state is determined if the global QPS is less than or equal to T11, the global low voltage current limiting state is determined if the global QPS is greater than T11 and less than or equal to T12, and the global high voltage current limiting state is determined if the global QPS is greater than T12. S24: if the global QPS is greater than T11, a global throttling notification is sent to the client.
The global current limit notification may be divided into a global high-voltage current limit notification and a global low-voltage current limit notification, and corresponds to the first current limit notification and the second current limit notification, where the global high-voltage current limit notification and the global low-voltage current limit notification may be understood as a second current limit notification and a first current limit notification in the case of global flow control, specifically, when the global QPS is greater than T12, the server sends the global high-voltage current limit notification to the client, and when the global QPS is greater than T11 and less than T12, the server sends the global low-voltage current limit notification to the client.
The current limit notification may include a status code to distinguish between the global current limit notification and the sub-service current limit notification, and may further include status information and corresponding parameter information to distinguish between the high voltage current limit and the low voltage current limit.
As shown in table 2, the format of the global current limit notification is:
TABLE 2
Figure GDA0002620565000000061
In this embodiment, 4xx represents the global current limit notification, and 4xy represents the sub-service current limit notification.
x-delay is status information, e.g., -1 represents a high voltage current limit status, a positive integer represents a low voltage current limit status, and the time interval for the client to send a network request is the positive integer.
x-expire is the validity time.
S25: and if the global QPS is smaller than T11, determining the service to which the network request belongs, counting to obtain the sub-service QPS corresponding to the service, and obtaining a plurality of thresholds for controlling the sub-service flow corresponding to the service.
The association relationship between the network requests and the services can be configured in advance, so that the services to which each network request belongs, such as transactions, payments and the like, can be determined.
After the corresponding service is determined, the sub-service QPS can be obtained by the sub-service QPS counter corresponding to the corresponding service, similarly to the statistics of the global QPS. In addition, a plurality of thresholds for controlling the sub-traffic flow corresponding to each service may be configured in advance in the server, so that a plurality of thresholds for controlling the sub-traffic flow corresponding to the service may be obtained, for example, as indicated by T21 and T22.
S26: comparing the sub-traffic QPS with a plurality of thresholds for the sub-traffic flow control.
Assuming that the multiple thresholds for sub-traffic flow control are denoted by T21 and T22, where T21 is smaller than T22, the sub-traffic QPS may be compared with T21 and T22, respectively.
In addition, it may be understood that T21 and T22 may divide the sub traffic state into three kinds, which are respectively referred to as a sub traffic normal state, a sub traffic high voltage current limiting state, and a sub traffic low voltage current limiting state, and the sub traffic normal state is determined if the sub traffic QPS is less than or equal to T21, the sub traffic low voltage current limiting state is determined if the sub traffic QPS is greater than T21 and less than or equal to T22, and the sub traffic high voltage current limiting state is determined if the sub traffic QPS is greater than T22.
S27: and if the sub-service QPS is larger than T21, sending a sub-service flow limitation notice to the client.
The sub-service current limit notification may be divided into a sub-service high voltage current limit notification and a sub-service low voltage current limit notification, and corresponds to the first current limit notification and the second current limit notification, where the sub-service high voltage current limit notification and the sub-service low voltage current limit notification may be understood as a second current limit notification and a first current limit notification during sub-service flow control, specifically, when a sub-service QPS is greater than T22, the service end sends the sub-service high voltage current limit notification to the client, and when a global QPS is greater than T21 and less than T22, the service end sends the sub-service low voltage current limit notification to the client.
The current limit notification may include a status code to distinguish between the global current limit notification and the sub-service current limit notification, and may further include status information and corresponding parameter information to distinguish between the high voltage current limit and the low voltage current limit.
As shown in table 3, the format of the sub-service flow limit notification is:
TABLE 3
Figure GDA0002620565000000071
In this embodiment, 4xx represents the global current limit notification, and 4xy represents the sub-service current limit notification.
x-delay is status information, e.g., -1 represents a high voltage current limit status, a positive integer represents a low voltage current limit status, and the time interval for the client to send a network request is the positive integer.
x-expire is the validity time.
And x-api is the service identification.
S28: and if the sub-service QPS is smaller than T21, processing the network request normally.
In this embodiment, during low-voltage current limiting, the client may continue to send network requests at a lower frequency, which does not affect the use of core functions, and improves user experience in the current limiting state. When the flow of the server triggers high-pressure flow limitation, the client stops sending network requests to the server within the effective time so as to reduce the pressure of the server and ensure the safety of the system.
Fig. 3 is a schematic flow chart of a flow control method according to another embodiment of the present application, where the method takes an execution flow of a client as an example, and the method includes:
s31: and receiving a current limiting notice sent by the server, wherein the current limiting notice is obtained by comparing the current network flow value with a plurality of preset threshold values by the server.
Wherein the current flow limit notification is a first flow limit notification including an adjusted transmission time interval of the network request and a first active time when the current network flow value is greater than a first threshold and less than a second threshold, and the flow limit notification is a second flow limit notification including a second active time when the current network flow value is greater than the second threshold; wherein the first threshold is less than the second threshold.
S32: flow control is carried out according to the flow limiting notice;
wherein, when the current limit notification is a first current limit notification, a network request is sent according to the sending time interval within the first effective time, and when the current limit notification is a second current limit notification, the sending of the network request is stopped within the second effective time.
If the same type of current-limiting notice is received within the effective time, the latest received current-limiting notice is used for updating the original current-limiting notice, and the flow control is carried out according to the latest received current-limiting notice.
In some embodiments, the current limit notification comprises: a global current limit notification, and/or a sub-traffic current limit notification.
In some embodiments, the performing flow control according to the flow limit notification includes:
acquiring a network request to be sent;
if the current limit notification matched with the network request to be sent comprises the following steps: the method comprises the steps that global current-limiting notification and sub-service current-limiting notification are carried out, and next sending time is respectively determined according to the global current-limiting notification and the sub-service current-limiting notification to obtain two next sending times;
and sending the network request to be sent to a server at the time corresponding to the maximum value of the two next sending times.
For example, after receiving the global current limit notification and the sub-service current limit notification, the client stores the received global current limit notification and the sub-service current limit notification, and calculates the corresponding next sending time.
For example: the current time is t _ now, and the client has two rules:
(a) global rules: the minimum delay of packet transmission is 100ms, the effective time is not finished, the last transmission time is t1, and the next transmission time is r1 ═ max (t1+100ms, t _ now);
(b) sub-business rules (the current pending request belongs to the business): the minimum delay of packet transmission is 200ms, the effective time is not finished, the last transmission time is t2, and the next transmission time is r2 ═ max (t2+200ms, t _ now);
if the network request to be sent only matches the global rule, the final sending time point is r 1; if both global and sub-traffic rules are matched at the same time, the final transmittable point in time is max (r1, r 2).
In this embodiment, by setting a plurality of thresholds, hierarchical flow control can be realized, thereby solving some problems existing in a single threshold.
Fig. 4 is a schematic structural diagram of a flow control device according to another embodiment of the present application, where the device 40 includes: a detection module 41, a determination module 42 and a sending module.
The detection module 41 is configured to detect a current network traffic value;
the network traffic value may be represented by a QPS (query per second), and each server may detect its QPS in real time, so as to obtain the current network traffic value. When each server detects its own QPS, for example, the server receives a network request sent by a client, and performs quantity statistics on the network requests within 1 second, thereby obtaining the QPS.
The determining module 42 is configured to compare the current network traffic value with a plurality of preset thresholds, including: when the current network flow value is larger than a first threshold value and smaller than a second threshold value, a first current limiting notice is returned to a client initiating a network request; when the current network flow value is larger than a second threshold value, a second current limiting notice is returned to the client side which initiates the network request; wherein the first threshold is less than the second threshold;
the first current limit notification comprises the adjusted sending time interval and the first effective time of the network request, so that the client sends the network request according to the sending time interval in the first effective time; the second current limit notification includes: a second validity time, so that the client stops sending network requests within the second validity time.
In this embodiment, the multiple set thresholds include a first threshold and a second threshold, for example, where the first threshold is smaller than the second threshold.
The client and the server can be configured with a consistent current limiting strategy in advance, so that the client can perform corresponding flow control according to the current limiting notification message sent by the server and the preset current limiting strategy.
For simplicity of illustration, the relationship between the current network traffic value and the preset multiple threshold values and the current limiting policy may be represented by a relationship between the state and the current limiting policy.
For example, after the first threshold and the second threshold are set, the first threshold and the second threshold may divide the state into three kinds, which are respectively represented by a normal state, a low voltage current limiting state, and a high voltage current limiting state.
Specifically, if the current network flow value is smaller than a first threshold, it is determined that the current state is the normal state, if the current network flow value is larger than the first threshold and smaller than a second threshold, it is determined that the current state is the low-pressure current limiting state, and if the current network flow value is larger than the second threshold, it is determined that the current state is the high-pressure current limiting state.
The relationship between the states and the current limiting strategy may be as shown in table 1.
In some embodiments, when the current limit notification is divided into a global current limit notification and a traffic current limit notification, the current limit notification further includes: a status code for distinguishing between global current limit notifications and sub-traffic current limit notifications.
In some embodiments, the threshold is determined according to a single current limiting threshold and a preset coefficient, and the single current limiting threshold is determined according to the cluster whole ability value and the total number of cluster servers.
The server usually represents the cluster whole ability value externally, for example, when the current QPS is greater than the cluster whole ability value m, it is determined that the current state is the high-voltage current limiting state, if the total number of the machine servers is n, the single current limiting threshold corresponding to the second threshold is m/n, and in addition, different preset coefficients may be set corresponding to different servers, so that the second threshold corresponding to each server is obtained by multiplying the m/n by the corresponding preset coefficient. Similarly, the first threshold value may be determined according to the corresponding individual current limiting threshold value and a preset coefficient.
In this embodiment, by setting a plurality of thresholds, hierarchical flow control can be realized, thereby solving some problems existing in a single threshold. Furthermore, the client performs flow control according to the first flow limiting notification or the second flow limiting notification sent by the server and a preset flow limiting strategy, so that the linkage between the client and the server can be realized, the user experience and the system safety are considered, and the system flexibility and usability are realized. Further, by the execution of a single server, the reaction speed can be improved.
In some embodiments, the flow control may be divided into a global control mode and a sub-service control mode, and accordingly, the network flow value may include: a global network traffic value and/or a sub-traffic network traffic value.
When the network traffic value comprises: when the global network traffic value and the network traffic value of the sub-service are QPS, referring to fig. 5, the determining module 42 includes: the first unit 421, the second unit 422, the third unit 431, and the fourth unit 432 may further include: and a processing module.
A first unit 421, configured to obtain a global QPS by statistics after receiving a network request sent by a client, and obtain multiple thresholds for global traffic control; and comparing the global QPS to a plurality of thresholds for global flow control;
a third unit 431, configured to send a global flow restriction notification to the client if the global QPS is greater than a minimum threshold of the plurality of thresholds for global flow control;
the global current limit notification may specifically be a global high voltage current limit notification or a global low voltage current limit notification.
A second unit 422, configured to determine, if the global QPS is smaller than a minimum threshold among multiple thresholds for global traffic control, a service to which the network request belongs, and obtain a sub-service QPS corresponding to the service by statistics, and obtain multiple thresholds for sub-service traffic control corresponding to the service; and comparing the QPS of the sub-traffic with a plurality of thresholds for flow control of the sub-traffic;
a fourth unit 432, configured to send a sub-traffic flow limitation notification to the client if the sub-traffic QPS is greater than a minimum threshold of the multiple thresholds for sub-traffic flow control;
the sub-service current limit notification may specifically be a sub-service high voltage current limit notification or a sub-service low voltage current limit notification.
And the processing module is used for normally processing the network request if the QPS of the sub-service is smaller than the minimum threshold value in the plurality of threshold values of the sub-service flow control.
For specific content, reference may be made to corresponding descriptions in the method embodiments, which are not described herein again.
In this embodiment, during low-voltage current limiting, the client may continue to send network requests at a lower frequency, which does not affect the use of core functions, and improves user experience in the current limiting state. When the flow of the server triggers high-pressure flow limitation, the client stops sending network requests to the server within the effective time so as to reduce the pressure of the server and ensure the safety of the system.
Fig. 6 is a schematic structural view of a flow control device according to another embodiment of the present application, where the device 60 includes: a receiving module 61 and a control module 62.
The receiving module 61 is configured to receive a current limiting notification sent by a server, where the current limiting notification is obtained by the server comparing a current network flow value with a plurality of preset thresholds;
wherein the current flow limit notification is a first flow limit notification including an adjusted transmission time interval of the network request and a first active time when the current network flow value is greater than a first threshold and less than a second threshold, and the flow limit notification is a second flow limit notification including a second active time when the current network flow value is greater than the second threshold; wherein the first threshold is less than the second threshold.
A control module 62, configured to perform flow control according to the flow limit notification;
wherein, when the current limit notification is a first current limit notification, a network request is sent according to the sending time interval within the first effective time, and when the current limit notification is a second current limit notification, the sending of the network request is stopped within the second effective time.
If the same type of current-limiting notice is received within the effective time, the latest received current-limiting notice is used for updating the original current-limiting notice, and the flow control is carried out according to the latest received current-limiting notice.
In some embodiments, the current limit notification comprises: a global current limit notification, and/or a sub-traffic current limit notification.
In some embodiments, the control module 62 is specifically configured to:
acquiring a network request to be sent;
if the current limit notification matched with the network request to be sent comprises the following steps: the method comprises the steps that global current-limiting notification and sub-service current-limiting notification are carried out, and next sending time is respectively determined according to the global current-limiting notification and the sub-service current-limiting notification to obtain two next sending times;
and sending the network request to be sent to a server at the time corresponding to the maximum value of the two next sending times.
For example, after receiving the global current limit notification and the sub-service current limit notification, the client stores the received global current limit notification and the sub-service current limit notification, and calculates the corresponding next sending time.
For example: the current time is t _ now, and the client has two rules:
(a) global rules: the minimum delay of packet transmission is 100ms, the effective time is not finished, the last transmission time is t1, and the next transmission time is r1 ═ max (t1+100ms, t _ now);
(b) sub-business rules (the current pending request belongs to the business): the minimum delay of packet transmission is 200ms, the effective time is not finished, the last transmission time is t2, and the next transmission time is r2 ═ max (t2+200ms, t _ now);
if the network request to be sent only matches the global rule, the final sending time point is r 1; if both global and sub-traffic rules are matched at the same time, the final transmittable point in time is max (r1, r 2).
In this embodiment, by setting a plurality of thresholds, hierarchical flow control can be realized, thereby solving some problems existing in a single threshold.
Fig. 7 is a schematic structural diagram of a flow control system according to another embodiment of the present application, where the system 70 includes: a client device 71 and a server device 72.
The client device 71 may be as shown in fig. 4 or fig. 5, and the server device 72 may be as shown in fig. 6.
In this embodiment, by setting a plurality of thresholds, hierarchical flow control can be realized, thereby solving some problems existing in a single threshold.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (10)

1. A method of flow control, comprising:
detecting a current network flow value, wherein the current network flow value is determined according to the current network flow value of a single server;
comparing the current network flow value with a plurality of preset thresholds, wherein the thresholds are determined according to a single current limiting threshold and a preset coefficient, and the single current limiting threshold is determined according to the cluster whole ability value and the total number of cluster servers;
when the current network flow value is larger than a first threshold value and smaller than a second threshold value, a first current limiting notice is returned to a client initiating a network request; when the current network flow value is larger than a second threshold value, a second current limiting notice is returned to the client side which initiates the network request; wherein the first threshold is less than the second threshold; the first current limit notification comprises a transmission time interval and a first effective time after the adjustment of the network request, so that the client sends the network request according to the transmission time interval in the first effective time; the second current limit notification includes: a second validity time, so that the client stops sending network requests within the second validity time.
2. The method of claim 1, wherein the network traffic value comprises:
a global network flow value; and/or the presence of a gas in the gas,
network traffic values of the sub-services.
3. The method of claim 2, wherein when the network traffic value comprises: when the network flow value is a QPS, detecting the current network flow value; comparing the current network flow value with a plurality of preset threshold values, including:
after receiving a network request sent by a client, counting to obtain a global QPS and acquiring a plurality of thresholds of global flow control;
when the global QPS is smaller than the minimum threshold of a plurality of thresholds of global flow control, determining the service to which the network request belongs, counting to obtain a sub-service QPS corresponding to the service, and acquiring a plurality of thresholds of sub-service flow control corresponding to the service;
comparing the sub-traffic QPS with a plurality of thresholds for the sub-traffic flow control;
the method further comprises the following steps:
when the sub-traffic QPS is less than the minimum threshold of the plurality of thresholds for sub-traffic flow control,
the network request is processed normally.
4. The method of claim 2, wherein when the network traffic values include a global network traffic value and a sub-traffic network traffic value, the first and second current limit notifications further comprise: a status code for distinguishing between global current limit notifications and sub-traffic current limit notifications.
5. A method of flow control, comprising:
receiving a current limiting notification sent by a server, wherein the current limiting notification is obtained by comparing a current network flow value with a plurality of preset thresholds by the server, the current network flow value is determined according to the current network flow value of a single server, the thresholds are determined according to the single current limiting threshold and a preset coefficient, and the single current limiting threshold is determined according to the cluster integral ability value and the total number of cluster servers;
wherein the current flow limit notification is a first flow limit notification including an adjusted transmission time interval of the network request and a first active time when the current network flow value is greater than a first threshold and less than a second threshold, and the flow limit notification is a second flow limit notification including a second active time when the current network flow value is greater than the second threshold; wherein the first threshold is less than the second threshold;
flow control is carried out according to the flow limiting notice;
wherein, when the current limit notification is a first current limit notification, a network request is sent according to the sending time interval within the first effective time, and when the current limit notification is a second current limit notification, the sending of the network request is stopped within the second effective time.
6. The method of claim 5, wherein the flow limit notification comprises: a global current limit notification, and/or a sub-traffic current limit notification.
7. The method of claim 6, wherein the controlling flow based on the flow limit notification comprises:
acquiring a network request to be sent;
if the current limit notification matched with the network request to be sent comprises the following steps: the method comprises the steps that global current-limiting notification and sub-service current-limiting notification are carried out, and next sending time is respectively determined according to the global current-limiting notification and the sub-service current-limiting notification to obtain two next sending times;
and sending the network request to be sent to a server at the time corresponding to the maximum value of the two next sending times.
8. A flow control device, comprising:
the detection module is used for detecting a current network flow value, and the current network flow value is determined according to the current network flow value of the single server;
the determining module is used for comparing the current network flow value with a plurality of preset thresholds, wherein the thresholds are determined according to a single current limiting threshold and a preset coefficient, and the single current limiting threshold is determined according to the cluster whole ability value and the total number of cluster servers; when the current network flow value is larger than a first threshold value and smaller than a second threshold value, a first current limiting notice is returned to a client initiating a network request; when the current network flow value is larger than a second threshold value, a second current limiting notice is returned to the client side which initiates the network request; wherein the first threshold is less than the second threshold; the first current limit notification comprises a transmission time interval and a first effective time after the adjustment of the network request, so that the client sends the network request according to the transmission time interval in the first effective time; the second current limit notification includes: a second validity time, so that the client stops sending network requests within the second validity time.
9. A flow control device, comprising:
the receiving module is used for receiving a current limiting notice sent by a server, wherein the current limiting notice is obtained by comparing a current network flow value with a plurality of preset thresholds by the server, the current network flow value is determined according to the current network flow value of a single server, the thresholds are determined according to the single current limiting threshold and a preset coefficient, and the single current limiting threshold is determined according to the cluster whole body ability value and the total number of cluster servers; wherein the current flow limit notification is a first flow limit notification including an adjusted transmission time interval of the network request and a first active time when the current network flow value is greater than a first threshold and less than a second threshold, and the flow limit notification is a second flow limit notification including a second active time when the current network flow value is greater than the second threshold; wherein the first threshold is less than the second threshold;
the control module is used for controlling the flow according to the flow limiting notice; wherein, when the current limit notification is a first current limit notification, a network request is sent according to the sending time interval within the first effective time, and when the current limit notification is a second current limit notification, the sending of the network request is stopped within the second effective time.
10. A flow control system, comprising:
the apparatus of claim 8, and,
the apparatus of claim 9.
CN201510689426.7A 2015-10-21 2015-10-21 Flow control method, device and system Active CN106612238B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510689426.7A CN106612238B (en) 2015-10-21 2015-10-21 Flow control method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510689426.7A CN106612238B (en) 2015-10-21 2015-10-21 Flow control method, device and system

Publications (2)

Publication Number Publication Date
CN106612238A CN106612238A (en) 2017-05-03
CN106612238B true CN106612238B (en) 2020-11-27

Family

ID=58610269

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510689426.7A Active CN106612238B (en) 2015-10-21 2015-10-21 Flow control method, device and system

Country Status (1)

Country Link
CN (1) CN106612238B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107086932A (en) * 2017-05-22 2017-08-22 安徽电信规划设计有限责任公司 A kind of cloud platform virtualizes traffic security monitoring system
CN108989236B (en) 2017-05-31 2020-09-18 华为技术有限公司 Flow control method, equipment and system
CN108573013A (en) * 2017-12-08 2018-09-25 北京金山云网络技术有限公司 Request processing method, device, electronic equipment and computer readable storage medium
CN108173938B (en) * 2017-12-28 2021-01-29 泰康保险集团股份有限公司 Server load distribution method and device
CN110278160B (en) * 2018-03-15 2023-02-28 阿里巴巴集团控股有限公司 Rate control method and device and electronic equipment
CN108848037B (en) * 2018-05-31 2023-06-20 平安医疗科技有限公司 Service request processing method, device, computer equipment and storage medium
CN108683605B (en) * 2018-06-12 2021-08-24 创新先进技术有限公司 Current limiting method and device for service call
CN110659898B (en) * 2018-06-28 2023-03-21 腾讯科技(深圳)有限公司 Data control method, device and storage medium
CN110933241B (en) * 2018-09-19 2021-03-23 中移信息技术有限公司 Method, device, equipment and medium for sending online charging request
CN109284229B (en) * 2018-10-17 2022-02-22 武汉斗鱼网络科技有限公司 Dynamic adjustment method based on QPS and related equipment
CN109921962B (en) * 2019-04-16 2021-03-23 腾讯科技(深圳)有限公司 Bandwidth measuring method, device, computer readable storage medium and computer equipment
CN113472492B (en) * 2020-03-30 2023-04-07 维沃移动通信有限公司 Transmission method and device of flow control message
CN111555987B (en) * 2020-04-28 2023-01-24 深圳前海微众银行股份有限公司 Current limiting configuration method, device, equipment and computer storage medium
CN113923163A (en) * 2021-10-20 2022-01-11 广东亿迅科技有限公司 Long connection message channel based current limiting method and system
CN115865820B (en) * 2022-11-23 2024-05-28 四川天邑康和通信股份有限公司 Alarm clock reminding system and method based on light cat flow monitoring

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030926A (en) * 2006-02-28 2007-09-05 华为技术有限公司 Method for controlling network data flow of global microwave access inter-operation
CN101286937A (en) * 2008-05-16 2008-10-15 华为技术有限公司 Network flow control method, device and system
CN103905327A (en) * 2012-12-25 2014-07-02 中国科学院声学研究所 Stream state information based content-centric network congestion control method and system thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9054996B2 (en) * 2009-12-24 2015-06-09 Juniper Networks, Inc. Dynamic prioritized fair share scheduling scheme in over-subscribed port scenario
US20110264516A1 (en) * 2010-04-27 2011-10-27 Yahoo! Inc. Limiting latency due to excessive demand in ad exchange

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030926A (en) * 2006-02-28 2007-09-05 华为技术有限公司 Method for controlling network data flow of global microwave access inter-operation
CN101286937A (en) * 2008-05-16 2008-10-15 华为技术有限公司 Network flow control method, device and system
CN103905327A (en) * 2012-12-25 2014-07-02 中国科学院声学研究所 Stream state information based content-centric network congestion control method and system thereof

Also Published As

Publication number Publication date
CN106612238A (en) 2017-05-03

Similar Documents

Publication Publication Date Title
CN106612238B (en) Flow control method, device and system
US20210211379A1 (en) Method and System for Counting Quantity of Active Flows and Network Device
KR20210028722A (en) Congestion control method and network device
WO2014194616A1 (en) Systems and methods for data transmission
US20210377799A1 (en) Data Packet Distribution Method, Sender Device, Receiver Device and Storage Medium
EP3310093B1 (en) Traffic control method and apparatus
CN110944016B (en) DDoS attack detection method, device, network equipment and storage medium
CN103312593B (en) A kind of message distributing system and method
US20180115474A1 (en) Flow entry aging method, switch, and controller
CN109981225A (en) A kind of code rate predictor method, device, equipment and storage medium
CN103929372A (en) Active queue management method and device
CN105791144A (en) Method and apparatus for sharing link traffic
CN106210929A (en) Network flow download terminal based on HLS client and optimization method
US20160294569A1 (en) Quota control policy
CN112491658A (en) Bandwidth estimation method and device, electronic equipment and computer-readable storage medium
CN115208518A (en) Data transmission control method, device and computer readable storage medium
US8521869B2 (en) Method and system for reporting defects within a network
CN109756464B (en) Communication method, server and client
EP3637692A1 (en) Method, apparatus, and system for measuring transmission performance
WO2021234764A1 (en) Burst traffic detection device, burst traffic detection method and burst traffic detection program
CN103200124A (en) Service strategy adjustment method and service strategy adjustment device
CN110858844A (en) Service request processing method, control method, device, system and electronic equipment
CN110460486B (en) Service node monitoring method and system
CN114422079B (en) Data transmission method and device, computer equipment and storage medium
US10003470B2 (en) Method and terminal for transmitting and receiving data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant