CN111131058B - Access quantity control method and device - Google Patents

Access quantity control method and device Download PDF

Info

Publication number
CN111131058B
CN111131058B CN201911164965.3A CN201911164965A CN111131058B CN 111131058 B CN111131058 B CN 111131058B CN 201911164965 A CN201911164965 A CN 201911164965A CN 111131058 B CN111131058 B CN 111131058B
Authority
CN
China
Prior art keywords
access
current limiting
strategy
requests
request
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
CN201911164965.3A
Other languages
Chinese (zh)
Other versions
CN111131058A (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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201911164965.3A priority Critical patent/CN111131058B/en
Publication of CN111131058A publication Critical patent/CN111131058A/en
Application granted granted Critical
Publication of CN111131058B publication Critical patent/CN111131058B/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)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a device for controlling access quantity, and relates to the technical field of computers. One embodiment of the method comprises the following steps: receiving an access request; when the number of the received access requests is judged to meet the access amount control condition: determining part of the access requests as target requests, generating normal response data responding to the target requests and returning the normal response data; for access requests other than the target request, disconnecting the access request or placing the access request into a preset waiting queue; when the number of the received access requests is judged not to meet the access amount control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion. The embodiment can provide personalized access quantity control functions for the service terminals by setting access quantity control conditions for each service terminal.

Description

Access quantity control method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for controlling access amount.
Background
With the development of internet technology, service systems face an increasing access pressure, and it becomes more important how to ensure the stability and availability of service systems under the pressure of large-scale access. In the prior art, access amount control is generally performed based on a unified gateway arranged in front of a server (as shown in fig. 1), and such a control method is simple and coarse in granularity, and is difficult to provide a personalized flow control policy for a specific server. In addition, the unified gateway is used as a single point part of the whole system and bears the whole access amount pressure, and once the unified gateway fails, the unified gateway is easy to cause the unavailability of the whole system.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for controlling access amount, which can provide a personalized access amount control function for a server by setting an access amount control condition for each server.
To achieve the above object, according to one aspect of the present invention, there is provided an access amount control method.
The access quantity control method of the embodiment of the invention comprises the following steps: receiving an access request; when the number of the received access requests is judged to meet the preset access quantity control condition: determining part of the access requests as target requests, generating normal response data responding to each target request and returning the normal response data; for each access request except the target request, disconnecting the access request or placing the access request into a preset waiting queue; when the number of the received access requests is judged not to meet the access quantity control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion.
Optionally, the current limiting policy includes at least one performance current limiting policy; and, the access volume control policy is determined according to the steps of: collecting operation data of a current statistical period, and acquiring performance indexes of the current statistical period according to the operation data; and determining a performance current limiting strategy with the current statistical period performance index matched with the current statistical period as a primary selecting strategy, and determining the maximum current limiting proportion in the primary selecting strategy as an access control strategy.
Optionally, the current limiting policy further includes at least one availability current limiting policy; and, the method further comprises: prior to determining the access volume control policy: acquiring an availability index of a current statistical period according to the operation data; and determining an availability limiting strategy with limiting conditions matched with the availability index as the primary selection strategy.
Optionally, the current limiting policy further includes at least one timing current limiting policy, and the current limiting condition of each timing current limiting policy is a current limiting time interval; and, the method further comprises: and before determining the access quantity control strategy, determining a timing current limiting strategy of which the current time is included in the current time of the current time interval as the initial strategy.
Optionally, the determining whether to respond to the access request normally by using a pre-stored access amount control policy includes: converting a client identifier carried in the access request into a hash value between 0 and 1; when the hash value is not smaller than the current limiting proportion in the access quantity control strategy, normally responding to the access request; and when the hash value is smaller than the current limiting proportion in the access quantity control strategy, disconnecting the connection with the access request or placing the access request in the waiting queue.
Optionally, the number of received access requests includes: the number of access requests received in the current acquisition period or the number of access requests currently being processed; the access amount control condition includes: the number of the received access requests is greater than a preset threshold; the number of target requests is equal to the threshold; the operation data includes: the response result and the response time length of each access request; and, the performance index comprises at least one of: response time length percentage TP index, response time length maximum value and response time length average value.
To achieve the above object, according to another aspect of the present invention, there is provided an access amount control apparatus.
The access amount control device of the embodiment of the invention can comprise: a receiving unit, configured to receive an access request; a control unit for: when the number of the received access requests is judged to meet the preset access quantity control condition: determining part of the access requests as target requests, generating normal response data responding to each target request and returning the normal response data; for each access request except the target request, disconnecting the access request or placing the access request into a preset waiting queue; a current limiting unit for: when the number of the received access requests is judged not to meet the access quantity control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion.
To achieve the above object, according to still another aspect of the present invention, there is provided an electronic apparatus.
An electronic apparatus of the present invention includes: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the access quantity control method provided by the invention.
To achieve the above object, according to still another aspect of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of the present invention has stored thereon a computer program which, when executed by a processor, implements the access amount control method provided by the present invention.
According to the technical scheme of the invention, one embodiment of the invention has the following advantages or beneficial effects:
firstly, an access quantity control condition is set for each server in advance so as to determine a processing mode aiming at the access request, for example, when the number of the access requests is larger than a preset threshold, only partial access requests (the number of the access requests can be equal to the threshold) are normally responded, other requests are directly disconnected or put into a waiting queue, so that service resources can be quickly released when the large-scale access quantity is faced, and the availability of the system is ensured.
Secondly, setting a plurality of current limiting strategies for each service end, when the number of access requests is not greater than the threshold value, acquiring the operation data of the service end in real time so as to acquire operation indexes such as performance, availability and the like, and finally determining an access quantity control strategy for actually executing current limiting from the plurality of current limiting strategies by utilizing the operation indexes, thereby realizing intelligent sensing of the operation condition of the service end and automatic control of the access quantity when the access quantity is greater (when the access quantity is smaller than the large-scale access quantity), improving the sensitivity, availability and service resource utilization rate of the system, and realizing targeted current limiting measures facing different access quantity pressures. In addition, by setting the timing current limiting strategy, the corresponding current limiting strategy can be deployed in advance before the flow flood peak with the periodic characteristic comes, so that the corresponding current limiting strategy can be effectively responded.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a prior art unified gateway architecture diagram;
FIG. 2 is a schematic diagram of main steps of an access amount control method in an embodiment of the present invention;
FIG. 3 is a schematic diagram of an implementation architecture of an access amount control method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of determining an access volume control policy in an embodiment of the invention;
FIG. 5 is a schematic diagram of the components of an access amount control device in an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram to which embodiments in accordance with the present invention may be applied;
fig. 7 is a schematic diagram of an electronic device for implementing the access amount control method in the embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features in the embodiments may be combined with each other without collision.
Fig. 2 is a schematic diagram of main steps of an access amount control method in an embodiment of the present invention.
As shown in fig. 2, the method according to the embodiment of the present invention may specifically be performed according to the following steps:
step S201: an access request is received.
In the embodiment of the invention, the server receives an access request sent by the client, and the access request is used for calling the local service of the server. Typically, the access request carries a client identifier for uniquely identifying the client.
Step S202: when the number of the received access requests is judged to meet the preset access quantity control condition: determining part of the access requests as target requests, generating normal response data responding to each target request and returning the normal response data; for each access request other than the target request, disconnecting the access request or placing the access request in a preset waiting queue.
Before executing this step, access amount control conditions are configured in advance for the server to perform customized access request restriction, for example, the access amount control conditions may be configured to: "the number of received access requests is greater than the preset threshold", which means that when the number of received access requests is greater than the preset threshold in step S201, a restriction operation is performed on the access requests. The number of the received access requests may be the number of the access requests received in the current acquisition period (i.e., the acquisition period closest to the current time, the acquisition period may be set to 1 second or 2 seconds according to the actual environment), or may be the number of the access requests currently being processed.
In a specific application, the above-mentioned limiting operation performed on the access request may be: and performing disconnection or queuing (namely queuing the access requests, and disconnecting after the queuing time exceeds a preset threshold) processing on the rest of the access requests. In the embodiment of the invention, the part of the access request which is normally responded can be called as a target request, and in an actual application scene, the target request can be determined through the following steps. The received requests are first ordered from small to large (i.e., from early to late) in terms of request time, after which the previous access requests, the number of which is equal to the threshold in the access volume control condition, are determined to be target requests.
Through the arrangement, customized access quantity control conditions can be configured for each server to execute access quantity control, when the number of current access requests is larger than a threshold value, the access requests within the range of the threshold value can be normally responded, and other access requests are disconnected or put into a waiting queue, so that the availability of the system is ensured.
Fig. 3 is a schematic diagram of an implementation architecture of an access amount control method in an embodiment of the present invention.
As shown in fig. 3, the service unit may implement a complete set of service flows, which may include a plurality of service function points. It is understood that the service function point may be used as the service end described above. The access volume control terminal is integrated with the service function point and deployed together, and interacts with the access volume control logic engine for determining the effective state of the access volume control rule. Wherein the access amount control rule is composed of the above access amount control condition and an access amount limiting operation performed when the condition is satisfied. The access volume control logic engine is responsible for defining and storing the access volume control rules and issuing the access volume control rules through interaction with the access volume control terminal. It can be understood that the service logic integration of the access control terminal and the service function point can directly count the instantaneous access of the service function point and apply the access control rule defined in the access control logic engine to the service function point, thereby realizing the access control.
In general, the access volume control rules may include a service function point identification, an access pressure metric (number of access requests received per second or number of access requests currently being processed), a threshold, and an excessive limiting operation.
The following describes the interaction flow of each terminal by taking the scenario that the access amount control rule is "when the number of access requests received per second is greater than 100", the excessive portion is directly disconnected ". The business service unit receives the access requests from the client, and when the number of the access requests is not more than 100, all the requests can obtain normal return results; when the number of the access requests exceeds 100, an access quantity control rule is triggered, and the access quantity control terminal executes corresponding processing on all the excessive access requests according to the access quantity control rule, so that the whole system is ensured to be available. It can be appreciated that the calculation of the access amount for the service function point is dynamic, and as the service resource is released, once the number of access requests of the system is reduced below the threshold value 100, new access requests can be processed normally, and the access amount control rule is not triggered to cause the quick abnormal state to return.
Therefore, the invention provides an access quantity control method based on specific business services, which can realize a finer-granularity access quantity control function, more flexible access quantity control rule configuration, ensure the availability of a system and solve the overall unavailable risk caused by a single point of the system relative to the access quantity control capability provided by a unified gateway.
Step S203: when the number of the received access requests is judged not to meet the access amount control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion.
Step S202 is an access amount control step when the current access amount is greater than the threshold value. When the current access quantity is not greater than the threshold value, the excessive request is not required to be directly disconnected, at this time, the running condition of the server can be judged according to the running data of the server, so as to determine the access quantity control strategy, and finally, corresponding current limiting processing is executed according to the access quantity control strategy, and specific execution steps are described below.
1. A plurality of current limiting strategies are preset, and each current limiting strategy comprises a current limiting condition (namely, a triggering condition of current limiting processing) and a current limiting proportion (namely, an access request proportion which does not normally respond). Typically, the flow restriction ratio is a value between 0 and 1 (i.e., not less than 0 and not more than 1).
For example: a certain current limiting policy of a certain service end is: when TP90 is greater than 1000 milliseconds, the flow is automatically restricted by 20 percent. The TP90 is a indicator of percentage TP (Top Percentile) of response duration, and the physical meaning of the indicator is as follows: and ordering the response time lengths of the server in the statistical period from small to large, wherein the response time length is positioned at 90% of the response time. Similarly, TP50 refers to ordering the multiple response durations of the server from small to large in the statistical period, where the response duration is located at 50% of the response time. In the above flow limiting strategy, the flow limiting conditions are: TP90 is greater than 1000 milliseconds, the flow limit proportion is 20%, if the flow limit strategy is used as the access quantity control strategy of the server, the flow limit strategy can control the server to provide no call for 20% of access requests and provide call for 80% of access requests.
In the embodiment of the present invention, the current limiting policy of each server may include: performance throttling policies, availability throttling policies, and timing throttling policies. The current limiting condition of the performance current limiting strategy is a performance index of the server, for example: TP50, TP90, TP99, TP999, response time average, response time maximum, etc., the current limiting policy "TP90 is greater than 1000 ms, and the automatic current limiting of 20% of the traffic" in the above example is the performance current limiting policy.
The current limiting condition of the availability current limiting strategy is an availability index of the server, and in a specific application, the availability of the server in a certain statistical period is the quotient of the normal call total number (namely the successful call total number) and the call total number of the server in the statistical period. For example: the following current limiting strategy is the available rate current limiting strategy: when the service end availability is less than 50%, the flow is automatically limited by 40%.
The current limiting condition of the timing current limiting strategy is a current limiting time interval, namely a preset time interval for triggering the current limiting operation. For example: the following current limiting strategy is a timing interval: from 2017-10-2723:55:00-2017-10-28:05:00 time range, automatically restricting 80% of the flow, which indicates: and limiting the current of 80% of access requests in a time interval from 23:55 of 10.27.of 2017 to 05:0.0.2018, wherein the time interval is "2017-10-27:55:00-2017-10-2800:05:00".
2. And determining the current access quantity control strategy from the current limiting strategy.
Specifically, firstly, collecting operation data of a server in a current statistical period (namely, the statistical period closest to the current moment, the statistical period can be set to be 1 minute, one hour and the like), and acquiring performance indexes of the server in the current statistical period by the statistical operation data; and in the performance current limiting strategy of the server, determining a performance current limiting strategy with the current statistical period, wherein the performance current limiting strategy is matched with the performance index of the current statistical period, and taking the performance current limiting strategy as a primary selection strategy of the server.
Preferably, the operation data may include: the result of the response to each access request (i.e., whether it is a normal or an abnormal response) and the response time. By counting the running data of the current counting period, the performance index of the server in the current counting period can be obtained, and then the current limiting strategy with the current limiting condition matched with the performance index of the current counting period can be determined as the primary selecting strategy of the server.
Then, obtaining an availability index of the server side in the current statistical period according to the operation data; and determining an availability limiting strategy of which the limiting condition is matched with the availability index in the availability limiting strategy of the server, and taking the availability limiting strategy as a primary selection strategy of the server.
And then, in the timing current limiting strategy of the server, determining the timing current limiting strategy with the current moment (namely, the current moment is in the current limiting time interval) in the current limiting time interval, and taking the timing current limiting strategy as the initial selection strategy of the server.
And finally, determining the largest calling quantity current limiting proportion in the initially selected strategy as the access quantity control strategy of the server, and storing the access quantity control strategy. FIG. 4 is a schematic diagram of determining an access control policy according to an embodiment of the present invention, where the step of determining a preliminary policy from a performance throttling policy, an availability throttling policy, and a timing throttling policy to obtain the access control policy may be as shown in FIG. 4. It should be noted that, the present invention does not limit the execution sequence of the step of determining the primary selection policy from the performance current limiting policy, the step of determining the primary selection policy from the availability current limiting policy, and the step of determining the primary selection policy from the timing current limiting policy.
3. When the number of the received access requests is judged to be not in accordance with the access quantity control condition, judging whether the access requests are normally responded or not by utilizing the access quantity control strategy aiming at any access request. As a preferred solution, the client identifier carried in the access request may be first converted into a hash value between 0 and 1; when the hash value is not smaller than the current limiting proportion in the access quantity control strategy, normally responding to the access request; and when the hash value is smaller than the current limiting proportion in the access quantity control strategy, disconnecting the connection with the access request or placing the access request in a waiting queue. Through the arrangement, the current limiting operation conforming to the current limiting proportion can be realized.
It can be understood that if the performance index and the availability index of the current statistics period do not accord with each current limiting condition, the server side is indicated to be running normally at present, and if the current statistics period is not in the current limiting time interval in the timing current limiting strategy at this time, the server side can respond normally to each access request.
In the technical scheme of the embodiment of the invention, the access quantity control condition is set for each server in advance so as to determine the processing mode aiming at the access request, for example, when the number of the access requests is larger than a preset threshold, only partial access requests are normally responded, and other requests are directly disconnected or put into a waiting queue, so that service resources can be quickly released when large-scale access quantity is faced, and the availability of the system is ensured. In addition, by setting a plurality of current limiting strategies for each service end, when the number of access requests is not greater than the threshold value, operation data of business services are acquired in real time so as to acquire operation indexes such as performance, availability and the like, and finally, the operation indexes are utilized to determine an access quantity control strategy for actually executing current limiting from the plurality of current limiting strategies, so that intelligent perception of business service operation conditions and automatic control of access quantity when the access quantity is large are realized, the sensitivity, availability and service resource utilization rate of a system can be improved, and targeted current limiting measures facing different access quantity pressures are realized. In addition, by setting the timing current limiting strategy, the corresponding current limiting strategy can be deployed in advance before the flow flood peak with the periodic characteristic comes, so that the corresponding current limiting strategy can be effectively responded.
It should be noted that, for the convenience of description, the foregoing method embodiments are expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present invention is not limited by the described order of actions, and some steps may actually be performed in other order or simultaneously. Moreover, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts and modules referred to are not necessarily required to practice the invention.
In order to facilitate better implementation of the above-described aspects of embodiments of the present invention, the following provides related devices for implementing the above-described aspects.
Referring to fig. 5, an access amount control apparatus 500 provided in an embodiment of the present invention may include: a receiving unit 501, a control unit 502 and a current limiting unit 503.
Wherein the receiving unit 501 is configured to receive an access request; the control unit 502 may be configured to: when the number of the received access requests is judged to meet the preset access quantity control condition: determining part of the access requests as target requests, generating normal response data responding to each target request and returning the normal response data; for each access request except the target request, disconnecting the access request or placing the access request into a preset waiting queue; the current limiting unit 503 may be used to: when the number of the received access requests is judged not to meet the access quantity control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion.
Preferably, the current limiting strategy comprises at least one performance current limiting strategy; the current limiting unit 503 may further be configured to: collecting operation data of a current statistical period, and acquiring performance indexes of the current statistical period according to the operation data; and determining a performance current limiting strategy with the current statistical period performance index matched with the current statistical period as a primary selecting strategy, and determining the maximum current limiting proportion in the primary selecting strategy as an access control strategy.
In some embodiments, the throttling policy further comprises at least one availability throttling policy; the current limiting unit 503 may further be configured to: prior to determining the access volume control policy: acquiring an availability index of a current statistical period according to the operation data; and determining an availability limiting strategy with limiting conditions matched with the availability index as the primary selection strategy.
Preferably, the current limiting policy may further include at least one timing current limiting policy, and the current limiting condition of each timing current limiting policy is a current limiting time interval; the current limiting unit 503 may further be configured to: and before determining the access quantity control strategy, determining a timing current limiting strategy of which the current time is included in the current time of the current time interval as the initial strategy.
In an alternative implementation, the current limiting unit 503 may be further configured to: converting a client identifier carried in the access request into a hash value between 0 and 1; when the hash value is not smaller than the current limiting proportion in the access quantity control strategy, normally responding to the access request; and when the hash value is smaller than the current limiting proportion in the access quantity control strategy, disconnecting the connection with the access request or placing the access request in the waiting queue.
Furthermore, in the embodiment of the present invention, the number of received access requests includes: the number of access requests received in the current acquisition period or the number of access requests currently being processed; the access amount control condition includes: the number of the received access requests is greater than a preset threshold; the number of target requests is equal to the threshold; the operation data includes: the response result and the response time length of each access request; and, the performance index comprises at least one of: response time length percentage TP index, response time length maximum value and response time length average value.
In the technical scheme of the embodiment of the invention, the access quantity control condition is set for each server in advance so as to determine the processing mode aiming at the access request, for example, when the number of the access requests is larger than a preset threshold, only partial access requests are normally responded, and other requests are directly disconnected or put into a waiting queue, so that service resources can be quickly released when large-scale access quantity is faced, and the availability of the system is ensured. In addition, by setting a plurality of current limiting strategies for each service end, when the number of access requests is not greater than the threshold value, operation data of business services are acquired in real time so as to acquire operation indexes such as performance, availability and the like, and finally, the operation indexes are utilized to determine an access quantity control strategy for actually executing current limiting from the plurality of current limiting strategies, so that intelligent perception of business service operation conditions and automatic control of access quantity when the access quantity is large are realized, the sensitivity, availability and service resource utilization rate of a system can be improved, and targeted current limiting measures facing different access quantity pressures are realized. In addition, by setting the timing current limiting strategy, the corresponding current limiting strategy can be deployed in advance before the flow flood peak with the periodic characteristic comes, so that the corresponding current limiting strategy can be effectively responded.
Fig. 6 illustrates an exemplary system architecture 600 to which an access volume control method or access volume control device of an embodiment of the present invention may be applied.
As shown in fig. 6, a system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605 (this architecture is merely an example, and the components contained in a particular architecture may be tailored to the application specific case). The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various client applications, such as an access amount control application (by way of example only), may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background server (by way of example only) providing support for access volume control applications operated by users using the terminal devices 601, 602, 603. The background server may process the received access amount limitation request and feed back the processing result (e.g. the current access amount situation after the current access amount is limited—only by way of example) to the terminal devices 601, 602, 603.
It should be noted that, the access amount control method provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the access amount control device is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides electronic equipment. The electronic equipment of the embodiment of the invention comprises: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the access quantity control method provided by the invention.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an electronic device of an embodiment of the present invention. The electronic device shown in fig. 7 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the computer system 700 are also stored. The CPU701, ROM 702, and RAM703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 710 as necessary, so that a computer program read out therefrom is installed into the storage section 708 as necessary.
In particular, the processes described in the main step diagrams above may be implemented as computer software programs according to the disclosed embodiments of the invention. For example, embodiments of the present invention include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the main step diagrams. In the above-described embodiment, the computer program can be downloaded and installed from a network through the communication section 709 and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by the central processing unit 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, a computer readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor includes a receiving unit and a control unit. The names of these units do not constitute a limitation on the unit itself in some cases, for example, the receiving unit may also be described as "unit sending an access request to the control unit".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by the device, cause the device to perform steps comprising: receiving an access request; when the number of the received access requests is judged to meet the preset access quantity control condition: determining part of the access requests as target requests, generating normal response data responding to each target request and returning the normal response data; for each access request except the target request, disconnecting the access request or placing the access request into a preset waiting queue; when the number of the received access requests is judged not to meet the access quantity control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion.
In the technical scheme of the embodiment of the invention, the access quantity control condition is set for each server in advance so as to determine the processing mode aiming at the access request, for example, when the number of the access requests is larger than a preset threshold, only partial access requests are normally responded, and other requests are directly disconnected or put into a waiting queue, so that service resources can be quickly released when large-scale access quantity is faced, and the availability of the system is ensured. In addition, by setting a plurality of current limiting strategies for each service end, when the number of access requests is not greater than the threshold value, operation data of business services are acquired in real time so as to acquire operation indexes such as performance, availability and the like, and finally, the operation indexes are utilized to determine an access quantity control strategy for actually executing current limiting from the plurality of current limiting strategies, so that intelligent perception of business service operation conditions and automatic control of access quantity when the access quantity is large are realized, the sensitivity, availability and service resource utilization rate of a system can be improved, and targeted current limiting measures facing different access quantity pressures are realized. In addition, by setting the timing current limiting strategy, the corresponding current limiting strategy can be deployed in advance before the flow flood peak with the periodic characteristic comes, so that the corresponding current limiting strategy can be effectively responded.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. An access amount control method, comprising:
receiving an access request;
when the number of the received access requests is judged to meet the preset access quantity control condition: determining part of the access requests as target requests, generating normal response data responding to each target request and returning the normal response data; for each access request except the target request, disconnecting the access request or placing the access request into a preset waiting queue;
when the number of the received access requests is judged not to meet the access quantity control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion; the access amount control condition includes: the number of the received access requests is greater than a preset threshold; the number of target requests is equal to the threshold.
2. The method of claim 1, wherein the current limiting policy comprises at least one performance current limiting policy; and, the access volume control policy is determined according to the steps of:
collecting operation data of a current statistical period, and acquiring performance indexes of the current statistical period according to the operation data;
and determining a performance current limiting strategy with the current statistical period performance index matched with the current statistical period as a primary selecting strategy, and determining the maximum current limiting proportion in the primary selecting strategy as an access control strategy.
3. The method of claim 2, wherein the throttling policy further comprises at least one availability throttling policy; and, the method further comprises: prior to determining the access volume control policy:
acquiring an availability index of a current statistical period according to the operation data;
and determining an availability limiting strategy with limiting conditions matched with the availability index as the primary selection strategy.
4. The method of claim 2, wherein the throttling policy further comprises at least one timed throttling policy, the throttling conditions of each timed throttling policy limiting a streaming time interval; and, the method further comprises:
and before determining the access quantity control strategy, determining a timing current limiting strategy of which the current time is included in the current time of the current time interval as the initial strategy.
5. The method of claim 1, wherein the determining whether to normally respond to the access request using a pre-stored access volume control policy comprises:
converting a client identifier carried in the access request into a hash value between 0 and 1;
when the hash value is not smaller than the current limiting proportion in the access quantity control strategy, normally responding to the access request;
and when the hash value is smaller than the current limiting proportion in the access quantity control strategy, disconnecting the connection with the access request or placing the access request in the waiting queue.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the number of received access requests includes: the number of access requests received during the current acquisition period or the number of access requests currently being processed.
7. The method according to any one of claims 2 to 4, wherein,
the operation data includes: the response result and the response time length of each access request;
and, the performance index comprises at least one of: response time length percentage TP index, response time length maximum value and response time length average value.
8. An access amount control apparatus, comprising:
a receiving unit, configured to receive an access request;
a control unit for: when the number of the received access requests is judged to meet the preset access quantity control condition: determining part of the access requests as target requests, generating normal response data responding to each target request and returning the normal response data; for each access request except the target request, disconnecting the access request or placing the access request into a preset waiting queue;
a current limiting unit for: when the number of the received access requests is judged not to meet the access quantity control condition: judging whether to normally respond to any access request by utilizing a pre-stored access quantity control strategy; the access control strategy is determined from a plurality of preset current limiting strategies, and each current limiting strategy comprises a current limiting condition and a current limiting proportion; the access amount control condition includes: the number of the received access requests is greater than a preset threshold; the number of target requests is equal to the threshold.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
CN201911164965.3A 2019-11-25 2019-11-25 Access quantity control method and device Active CN111131058B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911164965.3A CN111131058B (en) 2019-11-25 2019-11-25 Access quantity control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911164965.3A CN111131058B (en) 2019-11-25 2019-11-25 Access quantity control method and device

Publications (2)

Publication Number Publication Date
CN111131058A CN111131058A (en) 2020-05-08
CN111131058B true CN111131058B (en) 2023-06-30

Family

ID=70496598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911164965.3A Active CN111131058B (en) 2019-11-25 2019-11-25 Access quantity control method and device

Country Status (1)

Country Link
CN (1) CN111131058B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113765969A (en) * 2020-09-28 2021-12-07 北京沃东天骏信息技术有限公司 Flow control method and device
CN112367266A (en) * 2020-10-29 2021-02-12 北京字节跳动网络技术有限公司 Current limiting method, current limiting device, electronic equipment and computer readable medium
CN112671897B (en) * 2020-12-22 2023-03-21 北京达佳互联信息技术有限公司 Access method, device, storage medium, equipment and product of distributed system
CN112804160B (en) * 2021-01-26 2023-06-06 北京嘀嘀无限科技发展有限公司 Application program-based current limiting method, device, equipment, medium and product
CN112764937B (en) * 2021-01-29 2022-04-15 中国平安人寿保险股份有限公司 Access control method and device, computer equipment and storage medium
CN113329011B (en) * 2021-05-27 2022-07-08 北京天空卫士网络安全技术有限公司 Security access control method and device
CN114553936B (en) * 2022-02-18 2024-01-30 北京达佳互联信息技术有限公司 Connection method, device, electronic apparatus, and computer-readable storage medium
CN114745329B (en) * 2022-03-30 2024-03-22 青岛海尔科技有限公司 Flow control method and device, storage medium and electronic device
CN115361339B (en) * 2022-08-15 2024-03-01 中国工商银行股份有限公司 Flow control method, device, electronic equipment and storage medium
CN115051952A (en) * 2022-08-16 2022-09-13 阿里巴巴(中国)有限公司 Current limiting processing method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9386019B1 (en) * 2013-03-14 2016-07-05 Ca, Inc. System and method for controlled access to network devices
CN110071952B (en) * 2018-01-24 2023-08-08 北京京东尚科信息技术有限公司 Service call quantity control method and device

Also Published As

Publication number Publication date
CN111131058A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111131058B (en) Access quantity control method and device
CN109246229B (en) Method and device for distributing resource acquisition request
CN109684358B (en) Data query method and device
CN110276182B (en) API distributed current limiting realization method
CN107341050B (en) Service processing method and device based on dynamic thread pool
CN110858843B (en) Service request processing method and device and computer readable storage medium
CN109936613B (en) Disaster recovery method and device applied to server
CN109495542B (en) Load distribution method based on performance monitoring and terminal equipment
CN112839067B (en) Data synchronization method and device
CN107995286B (en) Automatic service starting and stopping method based on dubbo platform, server and storage medium
CN113381944A (en) System current limiting method, apparatus, electronic device, medium, and program product
CN108650667A (en) Terminal scheduling method and apparatus
CN110071952B (en) Service call quantity control method and device
CN109587068B (en) Flow switching method, device, equipment and computer readable storage medium
CN109800085B (en) Resource configuration detection method and device, storage medium and electronic equipment
CN112448987A (en) Fusing degradation triggering method and system and storage medium
CN113765966A (en) Load balancing method and device
CN114745276B (en) Switch bandwidth adjusting method and device, electronic equipment and computer readable medium
CN115525411A (en) Method, device, electronic equipment and computer readable medium for processing service request
CN113535020B (en) Method, apparatus, device, medium and product for generating application icons
CN115766484A (en) Service degradation method, device, equipment, computer readable medium and program product
CN114374657A (en) Data processing method and device
US9479579B2 (en) Grouping processing method and system
CN112788075A (en) Business service monitoring method and device
CN113778730B (en) Service degradation method and device for distributed system

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