CN117041163A - Flow control parameter adjustment method, device, equipment and readable storage medium - Google Patents

Flow control parameter adjustment method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN117041163A
CN117041163A CN202311100463.0A CN202311100463A CN117041163A CN 117041163 A CN117041163 A CN 117041163A CN 202311100463 A CN202311100463 A CN 202311100463A CN 117041163 A CN117041163 A CN 117041163A
Authority
CN
China
Prior art keywords
qps
priority
flow
request
requests
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.)
Pending
Application number
CN202311100463.0A
Other languages
Chinese (zh)
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.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing 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 Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202311100463.0A priority Critical patent/CN117041163A/en
Publication of CN117041163A publication Critical patent/CN117041163A/en
Pending legal-status Critical Current

Links

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/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2458Modification of priorities while in transit

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 parameter adjustment method, a related device, equipment and a readable storage medium, wherein the method comprises the following steps: receiving a flow request from an upstream system, wherein the flow request corresponds to one or more service priorities; judging whether a target priority exists in the service priorities corresponding to the received flow requests under the condition that the QPS of the flow control system does not exceed a first QPS limit value; the first QPS threshold corresponding to the target priority is a first QPS threshold to be updated; if so, updating a first QPS threshold corresponding to the target priority according to the buffer condition of the flow request in the buffer queue corresponding to the target priority; the first QPS threshold corresponding to the target priority is the upper limit value of the quantity of the target flow requests issued to the downstream system by the first gateway equipment, and the service priority of the target flow requests is the target priority.

Description

Flow control parameter adjustment method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of flow control technologies, and in particular, to a flow control parameter adjustment method, a related apparatus, a device, and a computer readable storage medium.
Background
In one flow system, an upstream system, a gateway service, a downstream system are included. The upstream system is used for sending a flow request to the downstream system, and the downstream system processes the flow request received by the upstream system after receiving the flow request from the upstream system. The flow processing system also comprises a gateway service, wherein the gateway service is used for receiving the flow request sent by the upstream system, detecting the flow request from the upstream system and sending the flow request which is qualified in detection to the downstream system for processing.
However, the processing power of the flow requests is limited for downstream systems. If a downstream system receives and processes a flow request that exceeds its processing capacity in a short period of time, it may cause a breakdown of the downstream system, thereby affecting the operational performance of the overall flow processing system.
Disclosure of Invention
The embodiment of the application provides a flow control parameter adjustment method, a related device, equipment and a readable storage medium, which solve the problem of downstream flow processing system breakdown caused by excessive flow requests.
In a first aspect, an embodiment of the present application provides a method for adjusting a flow control parameter, which is applied to a first gateway device in a flow control system, where the method includes: receiving a flow request from an upstream system, wherein the received flow request corresponds to one or more service priorities; judging whether a target priority exists in the service priorities corresponding to the received flow requests under the condition that the QPS of the flow control system does not exceed a first QPS limit value; the first QPS threshold corresponding to the target priority is a first QPS threshold to be updated; if so, updating a first QPS threshold corresponding to the target priority according to the buffer condition of the flow request in the buffer queue corresponding to the target priority; the first QPS threshold corresponding to the target priority is a number upper limit value of the first gateway device for sending the target traffic request to the downstream system, and the service priority of the target traffic request is the target priority.
In the above-described embodiment, the gateway device calculates a query rate per second (Queries Per Second, QPS) of traffic requests it receives, and the gateway device with gateway services deployed detects QPS based on the traffic requests it receives. In the case that the QPS of the traffic request received by the gateway device does not exceed the QPS of the traffic control system as a whole, the gateway device may determine whether the QPS of the traffic request of each traffic priority exceeds a first QPS threshold corresponding to the traffic priority. If yes, buffering part of the traffic requests of the service priority to a buffer queue corresponding to the service priority/rejecting the traffic requests of the service priority; if the traffic request does not exceed the traffic priority, the traffic request with the traffic priority is sent to a downstream system for processing. In addition, the gateway device can judge the buffering condition of the flow requests in the buffer queue corresponding to each service priority, and dynamically adjust the first QPS threshold of each service priority, so that the downstream system can reasonably allocate resources for processing the flow requests, and ensure that the flow requests of each service priority can be reasonably executed, thereby realizing the maximization of the utilization benefit of the flow requests of the downstream system.
By the method, on one hand, the problem that the first gateway equipment controls the flow when receiving a large amount of flow requests in a certain period of time, and the downstream system is crashed due to the fact that the flow requests exceed the processing capacity of the downstream system too much is solved; on the other hand, the first QPS threshold of the service priority is dynamically adjusted according to the buffer condition of the traffic request in the corresponding buffer queue of each service priority, so that the downstream system can reasonably allocate the traffic request processing resources of each service priority according to the received traffic request of the service priority, thereby realizing the maximum utilization of the traffic request processing resources of the downstream system.
With reference to the first aspect, in one possible implementation manner, determining whether a target priority exists in service priorities corresponding to the received traffic request specifically includes: judging whether a flow request is cached in a buffer queue corresponding to the service priority corresponding to the received flow request; if a buffer queue which does not buffer the flow request exists, the service priority corresponding to the buffer queue which does not buffer the flow is the target priority; if a buffer queue with flow requests is present and the number of the flow requests in the buffer queue with the flow requests is larger than the number of the flow requests detected last time, determining the service priority corresponding to the buffer queue as the target priority.
With reference to the first aspect, in one possible implementation manner, updating, according to a buffer condition of a traffic request in a buffer queue corresponding to a target priority, a first QPS threshold corresponding to the target priority includes: if the flow request is not cached in the buffer queue corresponding to the target priority, according to the SQP c =SQP 1i *(1-a 1 ) Calculation ofA second QPS threshold of target priority; if the flow requests are cached in the buffer queue corresponding to the target priority and the number of the flow requests is more than the number of the flow requests detected in the buffer queue last time, according to the SQP c =SQP 1i +SQP 2 *a 2 Calculating a second QPS threshold for the marked priority; in QPS 2 *x i <SQP c <QPS 2 *y i In the case of SQP c Is the updated first QPS threshold; at SQP c Greater than or equal to QPS 2 *x i In the case of (2), QPS 2 *x i Is the updated first QPS threshold; at SQP c Less than or equal to QPS 2 *y i In the case of (2), QPS 2 *y i Is the updated first QPS threshold; wherein, SQP c A second QPS threshold, SQP, being target priority 1i A is the first QPS threshold, a, before target priority update 1 A is a first ratio, a 2 For a second ratio, QPS 2 A second QPS limit value, x, for the first gateway device i High water level ratio, y, of flow request corresponding to target priority i The low water level ratio of the flow request corresponding to the target priority is obtained.
With reference to the first aspect, in one possible implementation manner, each service priority corresponding to the received traffic request corresponds to an original first QPS threshold, where the original first QPS threshold is a first QPS threshold calculated for the first time, and calculating an original first QPS threshold corresponding to each service priority specifically includes: according to the formulaCalculating an original first QPS threshold QPS with service priority being ith priority 1i The method comprises the steps of carrying out a first treatment on the surface of the In the case where i is smaller than N, i is updated according to i=i+1; in case k is smaller than N-1, k is updated according to k=k+1; execution according to the formula->Calculating an original first QPS threshold QPS with service priority being ith priority 1i Is carried out by the steps of (a); wherein i has an initial value of 1, kInitial value of 0, QPS 10 Is 0, x i For the high water level ratio, y, of the flow request corresponding to the ith priority i For the low water level ratio of the flow request corresponding to the ith priority, the ith priority is higher than the level of the (i+1) th priority, and N is the number of service priorities.
With reference to the first aspect, in one possible implementation manner, before determining whether a target priority exists in service priorities corresponding to the received traffic request, the method further includes: judging whether a source IP address in the flow request is in an IP address white list or not; if not, the flow request is refused.
With reference to the first aspect, in one possible implementation manner, before determining whether a target priority exists in service priorities corresponding to the received traffic request, the method further includes: judging whether the QPS of the flow control system exceeds a first QPS limit value or not, wherein the first QPS limit value is an upper limit value of a flow request sent to a downstream system by the flow control system; if so, rejecting the flow request from the upstream system.
With reference to the first aspect, in one possible implementation manner, before updating the first QPS threshold corresponding to the target priority according to the buffer condition of the traffic request in the buffer queue corresponding to the target priority, the method further includes: calculating the QPS of each service priority in the service priorities corresponding to the received flow requests; when the QPS with the service priority exceeds a first QPS threshold corresponding to the service priority, buffering the flow request exceeding the first QPS threshold into a buffer queue corresponding to the service priority.
In a second aspect, an embodiment of the present application provides a flow control parameter adjustment device, where the device includes a receiving unit, a judging unit, and an updating unit; the specific functions of each unit are as follows:
a receiving unit configured to receive a flow request from an upstream system;
A judging unit, configured to judge whether a target priority exists in service priorities corresponding to the received flow request, where the QPS of the flow control system does not exceed a first QPS limit value;
and the updating unit is used for updating the first QPS threshold corresponding to the target priority according to the buffer condition of the flow request in the buffer queue corresponding to the target priority.
With reference to the second aspect, in one possible implementation manner, determining whether a target priority exists in service priorities corresponding to the received traffic request specifically includes: judging whether a flow request is cached in a buffer queue corresponding to the service priority corresponding to the received flow request; if a buffer queue which does not buffer the flow request exists, the service priority corresponding to the buffer queue which does not buffer the flow is the target priority; if a buffer queue with flow requests is present and the number of the flow requests in the buffer queue with the flow requests is larger than the number of the flow requests detected last time, determining the service priority corresponding to the buffer queue as the target priority.
With reference to the second aspect, in one possible implementation manner, updating the first QPS threshold corresponding to the target priority according to the buffering condition of the traffic request in the buffer queue corresponding to the target priority includes: if the flow request is not cached in the buffer queue corresponding to the target priority, according to the SQP c =SQP 1i *(1-a 1 ) Calculating a second QPS threshold of the target priority; if the flow requests are cached in the buffer queue corresponding to the target priority and the number of the flow requests is more than the number of the flow requests detected in the buffer queue last time, according to the SQP c =SQP 1i +SQP 2 *a 2 Calculating a second QPS threshold for the marked priority; in QPS 2 *x i <SQP c <QPS 2 *y i In the case of SQP c Is the updated first QPS threshold; at SQP c Greater than or equal to QPS 2 *x i In the case of (2), QPS 2 *x i Is the updated first QPS threshold; at SQP c Less than or equal to QPS 2 *y i In the case of (2), QPS 2 *y i Is the updated first QPS threshold; wherein, SQP c A second QPS threshold, SQP, being target priority 1i A is the first QPS threshold, a, before target priority update 1 A is a first ratio, a 2 At a second ratio of QPS 2 A second QPS limit value, x, for the first gateway device i High water level ratio, y, of flow request corresponding to target priority i The low water level ratio of the flow request corresponding to the target priority is obtained.
With reference to the second aspect, in one possible implementation manner, the flow control parameter adjustment device further includes a calculation unit, where:
and the calculating unit is used for calculating the original first QPS threshold value corresponding to each service priority.
With reference to the second aspect, in a possible manner, the calculating an original first QPS threshold corresponding to each service priority specifically includes: according to the formula Calculating an original first QPS threshold QPS with service priority being ith priority 1i The method comprises the steps of carrying out a first treatment on the surface of the In the case where i is smaller than N, i is updated according to i=i+1; in case k is smaller than N-1, k is updated according to k=k+1; execution according to the formula->Calculating an original first QPS threshold QPS with service priority being ith priority 1i Is carried out by the steps of (a); wherein i has an initial value of 1, k has an initial value of 0, QPS 10 Is 0, x i For the high water level ratio, y, of the flow request corresponding to the ith priority i For the low water level ratio of the flow request corresponding to the ith priority, the ith priority is higher than the level of the (i+1) th priority, and N is the number of service priorities.
With reference to the second aspect, in one possible implementation manner, the flow control parameter adjustment device further includes an IP address determining unit and a first rejecting unit; wherein:
the IP address judging unit is used for judging whether the source IP address in the flow request is in an IP address white list or not;
and the first rejecting unit is used for rejecting the flow request.
With reference to the second aspect, in one possible implementation manner, the flow control parameter adjustment device further includes a QPS determining unit and a second rejecting unit; wherein:
a QPS judging unit configured to judge whether the QPS of the flow control system exceeds a first QPS limit value;
And a second rejecting unit for rejecting the flow request from the upstream system.
With reference to the second aspect, in one possible implementation manner, the flow control parameter adjustment device further includes a QPS calculation unit and a buffer unit; wherein:
the QPS calculating unit is used for calculating the QPS of each service priority in the service priorities corresponding to the received flow requests;
and the buffer unit is used for buffering the flow request exceeding the first QPS threshold part into a buffer queue corresponding to the service priority.
In a third aspect, an embodiment of the present application provides a flow control parameter adjustment device, which may be the first gateway device in the first aspect, including a memory, a communication module, and a processor;
wherein the memory is configured to store program code, and the processor is configured to invoke the program code stored in the memory to execute the flow control parameter adjustment method in the first aspect and various possible implementations thereof.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, which when executed by a processor, implements the method for adjusting a flow control parameter in the first aspect and various possible implementations thereof.
In a fifth aspect, embodiments of the present application provide a computer program comprising instructions which, when executed by a computer, enable a first gateway device to perform the procedure performed by the first gateway device in the first aspect and its various possible implementations.
Drawings
The drawings to which embodiments of the present application are applied are described below.
FIG. 1 is an exemplary diagram of a flow request processing system provided by an embodiment of the present application;
FIG. 2 is a system architecture diagram of a flow control parameter adjustment method according to an embodiment of the present application;
FIG. 3 is a flowchart of a flow control parameter adjustment method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a flow control parameter adjusting device 40 according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a flow control parameter adjusting apparatus 50 according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application for the embodiment. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second, third and the like in the description and in the claims and in the drawings are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprising," "including," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a series of steps or elements may be included, or alternatively, steps or elements not listed or, alternatively, other steps or elements inherent to such process, method, article, or apparatus may be included.
Only some, but not all, of the details relating to the application are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
As used in this specification, the terms "component," "module," "system," "unit," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a unit may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or being distributed between two or more computers. Furthermore, these units may be implemented from a variety of computer-readable media having various data structures stored thereon. The units may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., second unit data from another unit interacting with a local system, distributed system, and/or across a network).
The system comprises an upstream system, a flow control system and a downstream system, wherein the upstream system is used for sending flow requests to the downstream system, the downstream system is used for processing the flow requests from the upstream system so as to execute services corresponding to the flow requests, the flow control system is used for detecting and screening the flow requests sent by the upstream system, sending the flow requests passing the detection and screening to the downstream system, rejecting the flow requests not passing the detection and screening or buffering the flow requests not passing the detection and screening in a buffer queue. A plurality of gateway devices deployed with gateway services are included in the flow control system for detecting and screening flow requests.
However, the resources of the downstream system to handle the traffic requests are limited. If the downstream system receives the flow requests exceeding the processing capacity in a short time, the processing capacity of the downstream system may be insufficient to cause breakdown, thereby affecting the working performance of the whole flow request processing system. Therefore, when the upstream system issues excessive flow requests, the gateway service needs to perform flow restriction processing on the flow requests from the upstream, so as to avoid the downstream system from crashing. The gateway service may limit the flow request from upstream based on the flow limit value, and when the flow received by the gateway service exceeds the flow limit value, the gateway service may reject the flow request or buffer the flow request in a buffer queue. For the flow requests cached in the buffer queue, the flow requests in the buffer queue can be sent to the downstream system for processing under the condition that the downstream system has additional flow processing resources. However, since the gateway service may receive a large number of traffic requests at one time and a small number of traffic requests at another time, the gateway service may receive traffic requests at different times. Therefore, how the gateway service dynamically and scientifically sets the flow limit value, so that reasonable utilization of resources of the downstream system to process the flow request is a matter of increasing concern to the technicians.
Therefore, in order to solve the above-mentioned problems, an embodiment of the present application provides a flow control parameter adjustment method, including: the gateway device calculates a query rate per second (Queries Per Second, QPS) of traffic requests it receives, and the gateway device with the gateway service deployed detects QPS based on the traffic requests it receives. In the case that the QPS of the traffic request received by the gateway device does not exceed the QPS of the traffic control system as a whole, the gateway device may determine whether the QPS of the traffic request of each traffic priority exceeds a first QPS threshold corresponding to the traffic priority. If yes, buffering part of the traffic requests of the service priority to a buffer queue corresponding to the service priority/rejecting the traffic requests of the service priority; if the traffic request does not exceed the traffic priority, the traffic request with the traffic priority is sent to a downstream system for processing. In addition, the gateway device can judge the buffering condition of the flow requests in the buffer queue corresponding to each service priority, and dynamically adjust the first QPS threshold of each service priority, so that the downstream system can reasonably allocate resources for processing the flow requests, and ensure that the flow requests of each service priority can be reasonably executed, thereby realizing the maximization of the utilization benefit of the flow requests of the downstream system.
By the method, on one hand, the problem that the first gateway equipment controls the flow when receiving a large amount of flow requests in a certain period of time, and the downstream system is crashed due to the fact that the flow requests exceed the processing capacity of the downstream system too much is solved; on the other hand, the first QPS threshold of the service priority is dynamically adjusted according to the buffer condition of the traffic request in the corresponding buffer queue of each service priority, so that the downstream system can reasonably allocate the traffic request processing resources of each service priority according to the received traffic request of the service priority, thereby realizing the maximum utilization of the traffic request processing resources of the downstream system.
Next, a system architecture diagram of a flow control parameter adjustment method according to an embodiment of the present application will be described with reference to the accompanying drawings. Referring to fig. 2, fig. 2 is a system architecture diagram of a flow control parameter adjustment method according to an embodiment of the present application.
In fig. 2, an upstream system, a flow control system, and a downstream system are included. The upstream system is used for sending a flow request to the downstream system. A plurality of gateway devices deployed with gateway services are included in the flow control system, and an authentication layer, a flow control layer, and a routing layer may be included in the gateway services. A whitelist filtering module and a service tag authority module can be included in the authentication layer. The white list filtering module is used for detecting whether source IP addresses in the received flow requests are all in an IP address white list, and rejecting the flow requests under the condition that the IP addresses in the flow requests are not in the IP address white list. The service tag authority module is used for detecting whether a service tag in the received flow request exists in the service tag list, and rejecting the flow request when the service tag in the flow request does not exist in the service tag list.
The flow control layer can comprise a flow rate per second inquiry rate processing module and a flow buffer module. The flow rate per second query rate processing module is used for calculating the QPS of the gateway service and carrying out QPS detection according to the calculated QPS. The traffic buffer module is used for buffering the traffic requests in a traffic buffer queue. The routing layer is used for sending the flow request which passes the QPS check to a downstream system for processing. The issuing system is used for receiving and processing the flow request sent by the gateway service and sending the processing result of the flow request to the upstream system through the gateway service.
Fig. 2 describes a system architecture of a flow control parameter adjustment method according to an embodiment of the present application. The flow of a flow control parameter adjustment method according to an embodiment of the present application is described below with reference to the accompanying drawings.
Referring to fig. 3, fig. 3 is a flowchart of a flow control parameter adjustment method according to an embodiment of the present application, and in the embodiment of fig. 3, a flow control manner is a distributed control manner, that is: flow control is performed by a plurality of gateway devices deployed with gateway services, which belong to the same flow control system.
In fig. 3, an example will be described in which one gateway device (first gateway device) among the plurality of gateway devices performs flow control.
In addition, for different services that may be corresponding to the traffic request received by the gateway device, priorities are provided between the services, and for convenience of description, in this embodiment of the present application, the number of service priorities of the traffic request is taken as 3 (respectively, the first priority, the second priority, the third priority, and the first priority > the second priority > the third priority), and a specific flow of controlling the traffic by the first gateway device at a time is described as follows:
s301: the method comprises the steps that a first gateway device receives a flow request from an upstream system, wherein the flow request comprises a service tag, and the service tag is used for representing a service corresponding to the flow request.
Specifically, the first gateway device is a network device deployed with a gateway service, the upstream system is a network system that issues a flow request to the downstream system, and the upstream system may be an external network system.
The traffic request may include a traffic label, where the traffic label is used to characterize a traffic type of the traffic request, and the first gateway device may determine, according to the traffic label of the traffic request, a traffic type of the traffic request received by the first gateway device, so as to determine, according to the traffic type, a priority of a service corresponding to the traffic request.
In the embodiment of the present application, the priorities of the traffic request are three, and more priorities (for example, 5 priorities) may be determined according to the actual request situation of the traffic to which the traffic request belongs. For convenience of description and understanding, the embodiments of the present application will be described by taking three types of service priorities as examples.
In the embodiment of the application, the service priority of the flow request can comprise a first priority, a second priority and a third priority, and the first priority is higher than the second priority by higher than the third priority. The traffic request with the service priority being the first priority is the first traffic request, the traffic request with the service priority being the second priority is the second traffic request, and the traffic request with the service priority being the third priority is the third traffic request. In the embodiment of the present application, the flow request received by the first gateway device includes the first flow request, the second flow request, and the third flow request as an example.
In some embodiments, the traffic request may further include a source IP address (an IP address of a network device where the service that generated the traffic request is located), and a destination IP address (an IP address of a network device where a downstream system that processes the traffic request is located).
In some embodiments, the traffic request may further include room identification information, where the room identification information is used to characterize a room in which the gateway device that generates the traffic request is located.
S302: the first gateway device determines whether the QPS of the flow control system exceeds a first QPS limit.
Specifically, in the process of receiving the flow requests of various service priorities, the first gateway device may periodically calculate QPS, where the QPS is used to characterize the number of flow requests received by the first gateway device in a unit time.
For example, the first gateway device receives 1000 traffic requests within 1 second, and then the QPS is 1000. The first gateway device may also periodically calculate QPS during receipt of the traffic request. For example, the first gateway device may calculate QPS in 4 seconds as a period, assuming that the first gateway device receives 200 traffic requests within 4 seconds; then, within these 4 seconds, the QPS calculated by the gateway device is 50.
Alternatively, in some embodiments, the first gateway device may obtain the source IP address in each traffic request after receiving the traffic request and before calculating the QPS. The first gateway device may then determine whether the source IP address in the traffic request is in the whitelist of IP addresses. If not, the first gateway device judges that the flow request is illegal and refuses the flow request. If at the first gateway device calculates QPS. Wherein the flow request rejected by the first gateway device is not a flow request used by the gateway device to calculate the QPS.
In this way, the first gateway device can screen out a part of illegal flow requests (the flow requests with the source IP address not in the IP address white list) in advance, and can reduce a part of flow requests on the basis of guaranteeing information security, thereby reducing the burden of processing the flow requests by a downstream system.
After calculating the QPS, the first gateway device may broadcast a first request message to other gateway devices in the flow control system, the first information in the first request message being used to instruct the other gateway devices to send their calculated QPS to the first gateway device. After receiving the QPS from the other gateway devices, the first gateway device may sum the QPS calculated by the first gateway device and the QPS received by the first gateway device to obtain a first QPS sum value, where the first QPS sum value is the QPS of the flow control system. After calculating the first QPS sum value, the first gateway device may determine whether the first QPS sum value exceeds a first QPS limit value. The first QPS limit value is an upper QPS limit value in the flow control system, that is: the flow control system issues a maximum of the number of flow requests to the downstream system.
S303: and if the QPS of the flow control system exceeds the first QPS limit value, the first gateway equipment refuses the flow request received this time.
Specifically, if the first QPS sum is greater than the first QPS limit, it indicates that the number of flow requests received by the entire flow control system in a unit time exceeds the flow request processing capability of the downstream system, and the number of flow requests needs to be controlled to prevent the downstream system from collapsing due to processing a large number of flow requests in a short time. Therefore, in the case that the first QPS sum value is greater than the first QPS limit value, the first gateway device may reject the traffic request received this time.
S304: and if the QPS of the flow control system does not exceed the first QPS limit value, the first gateway equipment judges whether a first target priority exists in the service priority of the received flow request, and the QPS of the flow request corresponding to the first target priority exceeds a first QPS threshold value of the first target priority.
Specifically, the first QPS threshold of each service priority is the QPS upper limit of the traffic request corresponding to the service priority. Each traffic priority corresponds to a QPS threshold. In the embodiment of the application, three service priorities are respectively a first priority, a second priority and a third priority. Thus, each of these three priorities corresponds to a first QPS threshold.
Assuming that the first QPS threshold corresponding to the first priority is 100, the first QPS threshold corresponding to the second priority is 110, and the first QPS threshold corresponding to the third priority is 120, this means that the QPS upper limit value of the first flow request is 100, the QPS upper limit value of the second flow request is 110, and the QPS upper limit value of the third flow request is 120.
It can be understood that: the maximum number of first flow requests which can be issued by the first gateway device to the downstream system in unit time is 100, the maximum number of second flow requests which can be issued by the first gateway device to the downstream system in unit time is 110, and the maximum number of third flow requests which can be issued by the first gateway device to the downstream system in unit time is 120.
It is assumed that the first gateway device receives 110 number of first flow requests, 120 number of second flow requests, and 130 number of third flow requests per unit time. Then the QPS of the first, second, and third flow requests all exceed their corresponding first QPS thresholds. Thus, the first priority, the second priority, and the third priority are all first target priorities.
When the first gateway device calculates (does not calculate the first QPS threshold or does not buffer the first QPS threshold before) the first QPS threshold (the initial first QPS threshold) corresponding to each service priority for the first time, the first QPS threshold may be calculated by the following method:
The first gateway device may calculate a first QPS threshold corresponding to the first flow request according to a second QPS limit value thereof, where the second QPS limit value is a maximum value of the number of flow requests allowed to be issued by the first gateway device to the downstream system in a unit time. The first gateway device may dynamically calculate the second QPS limit value by equation (1), equation (1) as follows:
wherein, QPS 2 For the second QPS limit value, QPS 1 For the first QPS limit value, QPS' is the first QPS sum value, QPS m QPS calculated for the first gateway device. The first gateway device may update the second limit value once by calculating the QPS once.
The first gateway device may calculate, according to the second QPS limit value, a first QPS threshold of each traffic priority corresponding to the traffic request according to the traffic priority of the traffic request received by the first gateway device.
The first gateway device may calculate a first QPS threshold for the first traffic request according to equation (2), equation (2) as follows:
wherein, QPS 11 For a first QPS threshold corresponding to a first flow request, QPS 2 A second QPS limit value, x, for the first gateway device 1 High water level ratio, y, for first flow request 1 A low water level ratio for the first flow request. X is x 1 For characterizing the maximum ratio, y, of the number of first flow requests allowed to be issued by a gateway device to the second QPS limit of the gateway device per unit time 1 For characterizing a minimum ratio of a first number of flow requests that the gateway device is allowed to issue to downstream systems per unit time to a second QPS limit value for the gateway device.
After calculating the first QPS threshold corresponding to the first traffic request (first priority), the first gateway device may calculate the first QPS threshold corresponding to the second traffic request (second priority) according to formula (3), where formula (3) is as follows:
wherein, QPS 12 For a first QPS threshold, x, corresponding to a second traffic request 2 High water level ratio, y, for second flow request 2 A low water level ratio for the second flow request. X is x 2 For characterizing the maximum ratio of the number of second traffic requests allowed by the gateway device to the second QPS limit value of the gateway device per unit time, y 2 For characterizing a minimum ratio of the number of second traffic requests the gateway device is allowed to issue to the downstream system per unit time to a second QPS limit value of the gateway device.
After calculating the first QPS threshold corresponding to the second flow request, the first gateway device may calculate the first QPS threshold of the third flow request (the third priority) according to formula (4), where formula (4) is as follows:
Wherein, QPS 13 A first QPS threshold, x, for a third flow request 3 High water level ratio, y, for third flow request 3 A low water level ratio for the third flow request. X is x 3 For characterizing the maximum ratio of the number of third flow requests allowed by the gateway device to the second QPS limit value of the gateway device per unit time, y 3 For characterizing a minimum ratio of the number of third flow requests the gateway device is allowed to issue to the downstream system per unit time to the second QPS limit value of the gateway device.
In this way, the first gateway device may ensure that the first QPS threshold of the traffic request with high traffic priority is as high as possible, and the first QPS threshold of the traffic request with low traffic priority is as low as possible, and issue as many traffic requests with high traffic priority as possible to the downstream system without exceeding the second QPS limit value of the first gateway device, so as to ensure that as many high priority traffic (e.g., some core traffic) can be processed by the downstream system.
By the method, the initial first QPS threshold corresponding to each service priority can be calculated (the first QPS threshold is not calculated or buffered before), and the QPS threshold reference value can be provided when the first QPS threshold corresponding to the service priority is updated subsequently.
S305: if not, the first gateway device sends the received flow request to a downstream system for processing.
Specifically, if the first target priority does not exist in the service priorities of the traffic requests received by the first gateway device, it is indicated that the number of the traffic requests of each service priority in the traffic requests received by the first gateway device is moderate, so that the traffic request processing resources of the downstream system can be reasonably occupied. Thus, the first gateway device issues the received traffic request to the downstream system for processing.
S306: if yes, the first gateway device caches the flow requests exceeding the corresponding first QPS threshold in the target flow requests of the first target priority into a buffer queue corresponding to the first target priority, and sends the received other flow requests to a downstream system for processing.
Specifically, if the first gateway device determines that the first target priority exists, the first gateway device caches the traffic request exceeding the first QPS threshold portion of the service priority in the traffic request corresponding to the service priority into a buffer queue corresponding to the service priority, and sends the received other traffic requests to a downstream system for processing.
By way of example, assuming that the first QPS threshold corresponding to the first priority is 100, the first QPS threshold corresponding to the second priority is 110, and the first QPS threshold corresponding to the first priority is 120, this means that the QPS upper limit value of the first flow request is 100, the QPS upper limit value of the second flow request is 130, and the QPS upper limit value of the third flow request is 120. Suppose that the QPS for the first flow request is 110, the QPS for the second flow request is 100, and the QPS for the third flow request is 150. It follows that the QPS of the first flow request and the third flow request both exceed their corresponding first QPS thresholds, and that the QPS of the second flow request does not exceed its corresponding first QPS threshold. Therefore, the first flow request and the third flow request are first target flow requests, the difference between the QPS of the first flow request and its corresponding first QPS threshold is 10, and the difference between the QPS of the third flow request and its corresponding first QPS threshold is 30. Then, the first gateway device may buffer 10 first flow requests received in a unit time into the first buffer queue, buffer 30 third flow requests received in a unit time into the third buffer queue, and send 100 first flow requests, 100 second flow requests and 120 third flow requests received in a unit time to a downstream system for processing.
In some possible implementations, the first gateway device may reject the first target traffic request if the first target traffic request is a rejected traffic request.
S307: and the first gateway equipment determines whether a second target priority exists in the service priorities of the received flow requests, wherein the second target priority is the service priority of the first QPS threshold to be updated.
Specifically, the first gateway device may determine whether the second target priority exists in the service priorities of the received traffic requests when it is determined that the QPS of the traffic control system does not exceed the first QPS limit value. The second target priority is a traffic priority for which the first QPS threshold is to be updated.
The manner in which the first gateway device determines whether the second target priority exists in the service priorities of the received traffic requests may be:
the first gateway device accesses the buffer queues corresponding to the service priorities of the received traffic requests, and checks whether the traffic requests are cached in the buffer queue of each service priority. And if the buffer queue does not have the buffer flow request, determining the service priority corresponding to the buffer queue as a second target priority.
If the flow requests are cached in the buffer queue and the number of the flow requests detected in the buffer queue by the first gateway device is larger than the number of the flow requests detected in the buffer queue last time, the first gateway device determines that the service priority corresponding to the buffer queue is the second target priority.
For example, if the first traffic request is not cached in the first buffer queue, the first priority is the second target priority. If the second traffic request is buffered in the second buffer queue and the number of buffered second traffic requests is 70, the first gateway device detects that the number of second traffic requests in the second buffer queue is 60 last time, then the second priority is also the second target priority. If the third flow request is cached in the third buffer queue and the number of the cached third flow requests is 60, the first gateway device detects that the number of the third flow requests in the third buffer queue is 70 last time, and then the third priority is not the second target priority.
S308: if the second target priority exists, the first gateway device updates a first QPS threshold of the second target priority according to the buffer condition of the flow request in the buffer queue corresponding to the second target priority.
If there is a buffer condition of the traffic request in the buffer queue corresponding to the second target priority, updating the first QPS threshold of the second target priority, specifically the following two conditions are:
first case: and the buffer queue corresponding to the second target priority is not cached with the flow request.
If the flow requests are not cached in the buffer queue corresponding to the second target priority, the first QPS threshold of the second target priority is set too high, so that the first gateway equipment sends all the flow requests corresponding to the second target priority received by the first gateway equipment to a downstream system for processing. This may cause the downstream system to allocate a significant amount of processing resources for processing the traffic request corresponding to the second target priority from the first gateway device. While the resources of the downstream system for processing the traffic requests are limited, too much processing resources are allocated for the traffic requests of the second target priority, and the processing resources of the traffic requests of other traffic priorities are inevitably compressed. When the processing resources of traffic requests of other traffic priorities are over-compressed, the operation of other priority traffic may be severely affected. Therefore, under the condition that the flow requests are not buffered in the buffer queue corresponding to the second target priority, the first gateway device can moderately lower the first QPS threshold corresponding to the service priority, so that after receiving the flow requests of the second target priority from the upstream system, the first gateway device can temporarily buffer part of the flow requests in the buffer queue, and therefore, the downstream system can vacate part of processing resources to process the flow requests of other service priorities. On the premise of ensuring that the service with the second target priority can be normally executed, the service with other service priorities can be normally executed as far as possible.
The first gateway device may obtain the firstFirst ratio a of two target priorities 1 The first ratio value is used for representing the reduction amplitude of the second target priority corresponding to the first QPS threshold, and the first ratio value can be obtained through a historical value, experimental data or an empirical value, and the embodiment of the application is not limited. After calculating the first ratio, the first gateway device may calculate a second QPS threshold corresponding to the second target priority according to formula (5), where formula (5) is as follows:
SQP c =SQP 1i *(1-a 1 )(5)
wherein, SQP c A second QPS threshold, SQP, for the second target priority 1i A is a first QPS threshold corresponding to the second target priority 1 Is a first ratio of the second target priority.
In the process of calculating SQP c Thereafter, if QPS 2 *x i <SQP c <QPS 2 *y i The first gateway device determines the first QPS threshold updated by the second target priority as SQP c . If SQP c Greater than or equal to QPS 2 *x i The first gateway device determines that the updated first QPS threshold is QPS 2 *x i . If SQP c Less than or equal to QPS 2 *y i The first gateway device determines that the updated first QPS threshold is QPS 2 *y i . Wherein, QPS 2 A second QPS limit value, x, for the first gateway device i For the high water level ratio, y, of the flow request corresponding to the second target priority i And the low water level ratio of the flow request corresponding to the second target priority is obtained.
Second case: the flow requests are cached in the buffer queue of the second target priority, and the number of the flow requests detected in the buffer queue by the first gateway device at this time is larger than the number of the flow requests detected in the buffer queue at last time.
If the flow requests are cached in the buffer queue of the second target priority, and the number of the flow requests detected in the buffer queue by the first gateway device at this time is larger than the number of the flow requests detected in the buffer queue at last time. It is indicated that the traffic request of the second target priority received by the first gateway device does not match the first QPS threshold thereof, i.e. the number of traffic requests of the traffic priority received by the first gateway device is greater than the first QPS threshold, thereby causing an increase in the traffic requests buffered in the buffer queue corresponding to the second target priority. Considering that the flow requests of the second target priority received by the first gateway device at present are increased, the first gateway device can moderately raise the first QPS threshold corresponding to the second target priority, so that the first gateway device can properly issue more flow requests of the service priority to a downstream system along with the increase of the flow requests corresponding to the second target priority, thereby ensuring that the downstream system can allocate more processing resources to process the flow requests of the service priority, and ensuring that the service of the service priority can be normally executed.
The first gateway device may calculate a second ratio a of the second target priority 2 (value between 0 and 1), the second ratio value is used to represent the increasing amplitude of the second target priority corresponding to the first QPS threshold, and the first gateway device may calculate the second ratio by using the formula (6), where the formula (6) is as follows:
a 2 =(x i -y i )/n (6)
wherein n is a first parameter, which can be obtained through a historical value, an experimental value or an empirical value, and the embodiment of the application is not limited; a, a 2 Is a second ratio; x is x i For the high water level ratio, y, of the flow request corresponding to the second target priority i And the low water level ratio of the flow request corresponding to the second target priority is obtained.
After calculating the second ratio, the first gateway device may calculate a second QPS threshold corresponding to the second target priority according to formula (7), where formula (7) is as follows:
SQP c =SQP 1i +SQP 2 *a 2 (7)
wherein, SQP c A second QPS threshold, SQP, for the second target priority 1i For the first QPS threshold corresponding to the second target priority, SQP 2 A second QPS limit value for the first gateway device.
In the process of calculating SQP c Thereafter, if QPS 2 *x u <SQP c <QPS 2 *y u The first gateway device determines the first QPS threshold updated by the second target priority as SQP c . If SQP c Greater than or equal to QPS 2 *x u The first gateway device determines that the updated first QPS threshold is QPS 2 *x i . If SQP c Less than or equal to QPS 2 *y i The first gateway device determines that the updated first QPS threshold is QPS 2 *y i
It should be understood that S307 may be performed before S305/S306, after S305/S306, or concurrently with S305/S306, as the embodiment of the present application is not limited in this respect.
It should be understood that the order of steps in the embodiment of fig. 3 described above is merely exemplary in nature. The order of the steps in the embodiment of fig. 3 may be adjusted, the steps may be omitted, the order of the steps may be adjusted, and/or the steps omitted may be performed in different embodiments, which are also within the scope of the embodiments of the present application.
The foregoing describes in detail the methods of embodiments of the present application, and related apparatuses, devices, computer-readable storage media, and computer programs of embodiments of the present application are described below.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a flow control parameter adjusting device 40 according to an embodiment of the present application, where the flow control parameter adjusting device 40 includes a receiving unit 401, a judging unit 402, and an updating unit 403; the specific functions of each unit are as follows:
A receiving unit 401 for receiving a flow request from an upstream system;
a judging unit 402, configured to judge whether a target priority exists in service priorities corresponding to the received flow request, if the QPS of the flow control system does not exceed the first QPS limit value;
an updating unit 403, configured to update the first QPS threshold corresponding to the target priority according to the buffering condition of the traffic request in the buffer queue corresponding to the target priority.
In one possible implementation manner, determining whether a target priority exists in service priorities corresponding to received traffic requests specifically includes: judging whether a flow request is cached in a buffer queue corresponding to the service priority corresponding to the received flow request; if a buffer queue which does not buffer the flow request exists, the service priority corresponding to the buffer queue which does not buffer the flow is the target priority; if a buffer queue with flow requests is present and the number of the flow requests in the buffer queue with the flow requests is larger than the number of the flow requests detected last time, determining the service priority corresponding to the buffer queue as the target priority.
In one possible implementation manner, updating the first QPS threshold corresponding to the target priority according to the buffer condition of the traffic request in the buffer queue corresponding to the target priority includes: if the flow request is not cached in the buffer queue corresponding to the target priority, according to the SQP c =SQP 1i *(1-a 1 ) Calculating a second QPS threshold of the target priority; if the flow requests are cached in the buffer queue corresponding to the target priority and the number of the flow requests is more than the number of the flow requests detected in the buffer queue last time, according to the SQP c =SQP 1i +SQP 2 *a 2 Calculating a second QPS threshold for the marked priority; in QPS 2 *x i <SQP c <QPS 2 *y i In the case of SQP c Is the updated first QPS threshold; at SQP c Greater than or equal to QPS 2 *x i In the case of (2), QPS 2 *x i Is the updated first QPS threshold; at SQP c Less than or equal to QPS 2 *y i In the case of (2), QPS 2 *y i Is the updated first QPS threshold; wherein, SQP c A second QPS threshold, SQP, being target priority 1i A is the first QPS threshold, a, before target priority update 1 Is of a first ratio,a 2 For a second ratio, QPS 2 A second QPS limit value, x, for the first gateway device i High water level ratio, y, of flow request corresponding to target priority i The low water level ratio of the flow request corresponding to the target priority is obtained.
In one possible implementation, the flow control parameter adjustment device 40 further includes a computing unit, where:
and the calculating unit is used for calculating the original first QPS threshold value corresponding to each service priority.
In one possible manner, the calculating the original first QPS threshold corresponding to each service priority specifically includes: according to the formula Calculating an original first QPS threshold QPS with service priority being ith priority 1i The method comprises the steps of carrying out a first treatment on the surface of the In the case where i is smaller than N, i is updated according to i=i+1; in case k is smaller than N-1, k is updated according to k=k+1; execution according to the formula->Calculating an original first QPS threshold QPS with service priority being ith priority 1i Is carried out by the steps of (a); wherein i has an initial value of 1, k has an initial value of 0, QPS 10 Is 0, x i For the high water level ratio, y, of the flow request corresponding to the ith priority i For the low water level ratio of the flow request corresponding to the ith priority, the ith priority is higher than the level of the (i+1) th priority, and N is the number of service priorities.
In one possible implementation manner, the flow control parameter adjustment device 40 further includes an IP address determining unit and a first rejecting unit; wherein:
the IP address judging unit is used for judging whether the source IP address in the flow request is in an IP address white list or not;
and the first rejecting unit is used for rejecting the flow request.
In one possible implementation manner, the flow control parameter adjustment device 40 further includes a QPS judgment unit and a second rejection unit; wherein:
a QPS judging unit configured to judge whether the QPS of the flow control system exceeds a first QPS limit value;
and a second rejecting unit for rejecting the flow request from the upstream system.
In one possible implementation manner, the flow control parameter adjustment device 40 further includes a QPS calculation unit and a buffer unit; wherein:
the QPS calculating unit is used for calculating the QPS of each service priority in the service priorities corresponding to the received flow requests;
and the buffer unit is used for buffering the flow request exceeding the first QPS threshold part into a buffer queue corresponding to the service priority.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a flow control parameter adjusting apparatus 50 according to an embodiment of the present application, where the flow control parameter adjusting apparatus 50 may include a memory 501, a communication module 502 and a processor 503; wherein, the detailed description of each unit is as follows:
the memory 501 is used to store program codes.
The processor 503 is configured to call the program code stored in the memory to perform the following steps:
receiving, by the communication module 502, a traffic request from an upstream system, the received traffic request corresponding to one or more traffic priorities;
judging whether a target priority exists in the service priorities corresponding to the received flow requests under the condition that the QPS of the flow control system does not exceed a first QPS limit value; the first QPS threshold corresponding to the target priority is a first QPS threshold to be updated; if so, updating a first QPS threshold corresponding to the target priority according to the buffer condition of the flow request in the buffer queue corresponding to the target priority; the first QPS threshold corresponding to the target priority is a number upper limit value of the first gateway device for sending the target traffic request to the downstream system, and the service priority of the target traffic request is the target priority.
In one possible implementation manner, determining whether a target priority exists in service priorities corresponding to received traffic requests specifically includes: judging whether a flow request is cached in a buffer queue corresponding to the service priority corresponding to the received flow request; if a buffer queue which does not buffer the flow request exists, the service priority corresponding to the buffer queue which does not buffer the flow is the target priority; if a buffer queue with flow requests is present and the number of the flow requests in the buffer queue with the flow requests is larger than the number of the flow requests detected last time, determining the service priority corresponding to the buffer queue as the target priority.
In one possible implementation manner, updating the first QPS threshold corresponding to the target priority according to the buffer condition of the traffic request in the buffer queue corresponding to the target priority includes: if the flow request is not cached in the buffer queue corresponding to the target priority, according to the SQP c =SQP 1i *(1-a 1 ) Calculating a second QPS threshold of the target priority; if the flow requests are cached in the buffer queue corresponding to the target priority and the number of the flow requests is more than the number of the flow requests detected in the buffer queue last time, according to the SQP c =SQP 1i +SQP 2 *a 2 Calculating a second QPS threshold for the marked priority; in QPS 2 *x i <SQP c <QPS 2 *y i In the case of SQP c Is the updated first QPS threshold; at SQP c Greater than or equal to QPS 2 *x i In the case of (2), QPS 2 *x i Is the updated first QPS threshold; at SQP c Less than or equal to QPS 2 *y i In the case of (2), QPS 2 *y i Is the updated first QPS threshold; wherein, SQP c A second QPS threshold, SQP, being target priority 1i A is the first QPS threshold, a, before target priority update 1 A is a first ratio, a 2 For a second ratio, QPS 2 A second QPS limit value, x, for the first gateway device i High water level ratio, y, of flow request corresponding to target priority i The low water level ratio of the flow request corresponding to the target priority is obtained.
In one possible implementation, the receivingEach service priority corresponding to the traffic request corresponds to an original first QPS threshold, where the original first QPS threshold is a first QPS threshold calculated for the first time, and calculating the original first QPS threshold corresponding to each service priority specifically includes: according to the formulaCalculating an original first QPS threshold QPS with service priority being ith priority 1i The method comprises the steps of carrying out a first treatment on the surface of the In the case where i is smaller than N, i is updated according to i=i+1; in case k is smaller than N-1, k is updated according to k=k+1; execution according to the formula- >Calculating an original first QPS threshold QPS with service priority being ith priority 1i Is carried out by the steps of (a); wherein i has an initial value of 1, k has an initial value of 0, QPS 10 Is 0, x i For the high water level ratio, y, of the flow request corresponding to the ith priority i For the low water level ratio of the flow request corresponding to the ith priority, the ith priority is higher than the level of the (i+1) th priority, and N is the number of service priorities.
In one possible implementation manner, before determining whether the target priority exists in the service priorities corresponding to the received traffic requests, the method further includes: judging whether a source IP address in the flow request is in an IP address white list or not; if not, the flow request is refused.
In one possible implementation manner, before determining whether the target priority exists in the service priorities corresponding to the received traffic requests, the method further includes: judging whether the QPS of the flow control system exceeds a first QPS limit value or not, wherein the first QPS limit value is an upper limit value of a flow request sent to a downstream system by the flow control system; if so, rejecting the flow request from the upstream system.
In one possible implementation manner, before updating the first QPS threshold corresponding to the target priority according to the buffer condition of the traffic request in the buffer queue corresponding to the target priority, the method further includes: calculating the QPS of each service priority in the service priorities corresponding to the received flow requests; when the QPS with the service priority exceeds a first QPS threshold corresponding to the service priority, buffering the flow request exceeding the first QPS threshold into a buffer queue corresponding to the service priority.
Embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the method of flow control in the above embodiments and their various possible implementations.
Embodiments of the present application provide a computer program comprising instructions which, when executed by a computer, enable a flow control device to perform the flow performed by the flow control device in the above embodiments and their various possible implementations.
It should be noted that, the Memory in the foregoing embodiments may be a read-Only Memory (ROM) or other type of static storage device that may store static information and instructions, a random access Memory (random access Memory, RAM) or other type of dynamic storage device that may store information and instructions, or may be an electrically erasable programmable read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a compact disc (Compact Disc Read-Only Memory, CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memories may be stand alone and connected to the processor via a bus. The memory may be integrated with the processor.
The processor in the above embodiments may be a general purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above program.
For the foregoing method embodiments, for simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will appreciate that the present application is not limited by the order of acts described, as some steps may, in accordance with the present application, occur in other orders or concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed.
The elements described above as separate elements may or may not be physically separate, and elements shown as elements may or may not be physically located, or may be distributed over a plurality of network elements. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution, and the computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a gateway device, etc., and may be a processor in the computer device in particular) to execute all or part of the steps of the above-mentioned method according to the embodiments of the present application. Wherein the aforementioned storage medium may include: a U-disk, a removable hard disk, a magnetic disk, a compact disk, a read-only memory (ROM), a random access memory (random access memory, RAM), or the like, which can store program codes.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for adjusting a flow control parameter, the method being applied to a first gateway device in a flow control system, the method comprising:
receiving a flow request from an upstream system, wherein the flow request corresponds to one or more service priorities;
judging whether a target priority exists in the service priorities corresponding to the received flow requests under the condition that the QPS of the flow control system does not exceed a first QPS limit value; the first QPS threshold corresponding to the target priority is a first QPS threshold to be updated;
if so, updating a first QPS threshold corresponding to the target priority according to the buffer condition of the flow request in the buffer queue corresponding to the target priority;
The first QPS threshold corresponding to the target priority is a number upper limit value of the first gateway device for sending the target traffic request to the downstream system, and the service priority of the target traffic request is the target priority.
2. The method of claim 1, wherein the determining whether the target priority exists in the service priorities corresponding to the received traffic requests specifically comprises:
judging whether a flow request is cached in a buffer queue corresponding to the service priority corresponding to the received flow request;
if a buffer queue which does not buffer the flow request exists, the service priority corresponding to the buffer queue which does not buffer the flow is a target priority;
and if the buffer queue with the flow requests is present and the number of the flow requests in the buffer queue with the flow requests is larger than the number of the flow requests detected last time, determining the service priority corresponding to the buffer queue as the target priority.
3. The method according to any one of claims 1-2, wherein updating the first QPS threshold corresponding to the target priority according to the buffering status of the traffic requests in the buffer queue corresponding to the target priority comprises:
If the flow request is not cached in the buffer queue corresponding to the target priority, according to SQP c =SQP 1i *(1-a 1 ) Calculating a second QPS threshold for the target priority;
if the flow requests are cached in the buffer queue corresponding to the target priority and the number of the flow requests is more than the number of the flow requests detected in the buffer queue last time, according to SQP c =SQP 1i +SQP 2 *a 2 Calculating a second QPS threshold for the target priority;
in QPS 2 *x i <SQP c <QPS 2 *y i In the case of (1), the SQP c Is the updated first QPS threshold;
at the SQP c Greater than or equal to the QPS 2 *x i In the case of (3), the QPS 2 *x i Is the updated first QPS threshold;
at the SQP c Less than or equal toThe QPS is as follows 2 *y i In the case of (3), the QPS 2 *y i Is the updated first QPS threshold;
wherein the SQP c A second QPS threshold for the target priority, the SQP 1i For a first QPS threshold before the target priority update, the a 1 For a first ratio, the a 2 For a second ratio, the QPS 2 For a second QPS limit value of the first gateway apparatus, the x i For the high water level ratio of the flow request corresponding to the target priority, the y i And the low water level ratio of the flow request corresponding to the target priority is obtained.
4. The method of claim 3, wherein each service priority corresponding to the received traffic request corresponds to an original first QPS threshold, the original first QPS threshold being a first QPS threshold calculated for the first time, and calculating the original first QPS threshold for each service priority comprises:
According to the formulaCalculating an original first QPS threshold QPS with service priority being ith priority 1i
In case i is smaller than N, updating i according to i=i+1;
in case k is smaller than N-1, updating k according to k=k+1;
executing the formulaCalculating an original first QPS threshold QPS with service priority being ith priority 1i Is carried out by the steps of (a);
wherein the initial value of i is 1, the initial value of k is 0, QPS 10 0, the x is i For the high water level ratio of the flow request corresponding to the ith priority, the y i For the low water level ratio of the flow request corresponding to the ith priority, the ith priority is compared with the ithThe +1 priority is high, and the N is the number of service priorities.
5. The method of claim 1, wherein the determining whether the target priority exists in the traffic priorities corresponding to the received traffic requests further comprises:
judging whether a source IP address in the flow request is in an IP address white list or not;
and if not, rejecting the flow request.
6. The method of claim 1, wherein the determining whether the target priority exists in the traffic priorities corresponding to the received traffic requests further comprises:
Judging whether the QPS of the flow control system exceeds a first QPS limit value or not, wherein the first QPS limit value is an upper limit value of a flow request issued by the flow control system to a downstream system;
if so, rejecting the flow request from the upstream system.
7. The method of claim 1, wherein before updating the first QPS threshold corresponding to the target priority according to the buffering status of the traffic requests in the buffer queue corresponding to the target priority, further comprising:
calculating the QPS of each service priority in the service priorities corresponding to the received flow requests;
and when the QPS with the service priority exceeds a first QPS threshold corresponding to the service priority, buffering the flow request exceeding the first QPS threshold into a buffer queue corresponding to the service priority.
8. A flow control device comprising means for performing the flow control parameter adjustment method according to any one of claims 1-7.
9. A flow control device, comprising: a memory and a processor, wherein:
the memory is used for storing a computer program, and the computer program comprises program instructions;
The processor is configured to invoke the program instructions to cause the flow control device to perform the method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
CN202311100463.0A 2023-08-29 2023-08-29 Flow control parameter adjustment method, device, equipment and readable storage medium Pending CN117041163A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311100463.0A CN117041163A (en) 2023-08-29 2023-08-29 Flow control parameter adjustment method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311100463.0A CN117041163A (en) 2023-08-29 2023-08-29 Flow control parameter adjustment method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117041163A true CN117041163A (en) 2023-11-10

Family

ID=88631683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311100463.0A Pending CN117041163A (en) 2023-08-29 2023-08-29 Flow control parameter adjustment method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117041163A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478612A (en) * 2023-12-27 2024-01-30 成都新希望金融信息有限公司 Flow distribution method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478612A (en) * 2023-12-27 2024-01-30 成都新希望金融信息有限公司 Flow distribution method and device and electronic equipment
CN117478612B (en) * 2023-12-27 2024-03-15 成都新希望金融信息有限公司 Flow distribution method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US11159406B2 (en) Load balancing web service by rejecting connections
US20070118653A1 (en) System, method, and computer program product for throttling client traffic
US10432551B1 (en) Network request throttling
US20030200369A1 (en) System and method for dynamically tuning interrupt coalescing parameters
US9654483B1 (en) Network communication rate limiter
CN117041163A (en) Flow control parameter adjustment method, device, equipment and readable storage medium
EP3295348A1 (en) Method and device for defending against network attacks
US20210357264A1 (en) Assignment of Resources to Database Connection Processes Based on Application Information
JPWO2020263486A5 (en)
CN113595922B (en) Flow limiting method, device, server and storage medium
CN107426241B (en) Network security protection method and device
CN110858986A (en) Bandwidth adjusting method, device, communication equipment and computer readable storage medium
CN112445857A (en) Resource quota management method and device based on database
JP2009159024A (en) Communication system, communication regulation method, signal processing server, and program
JP3545931B2 (en) Call control scheduling method
CN107786371B (en) Data acceleration method and device and storage medium
CN113794650A (en) Concurrent request processing method, computer device and computer-readable storage medium
US11513856B2 (en) Method, devices and computer program products for resource usage
CN116382892B (en) Load balancing method and device based on multi-cloud fusion and cloud service
US10999398B1 (en) Scan protection with rate limiting
CN112260962A (en) Bandwidth control method and device
CN113315743B (en) Defense processing method, device, equipment and storage medium
CN117014386A (en) Flow control method, related device, equipment and readable storage medium
US20050223056A1 (en) Method and system for controlling dataflow to a central system from distributed systems
CN115037752B (en) Resource allocation method and device and electronic equipment

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