CN114640700A - Calling frequency control method and device - Google Patents

Calling frequency control method and device Download PDF

Info

Publication number
CN114640700A
CN114640700A CN202011370411.1A CN202011370411A CN114640700A CN 114640700 A CN114640700 A CN 114640700A CN 202011370411 A CN202011370411 A CN 202011370411A CN 114640700 A CN114640700 A CN 114640700A
Authority
CN
China
Prior art keywords
time period
frequency threshold
current
calling
current frequency
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.)
Granted
Application number
CN202011370411.1A
Other languages
Chinese (zh)
Other versions
CN114640700B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011370411.1A priority Critical patent/CN114640700B/en
Publication of CN114640700A publication Critical patent/CN114640700A/en
Application granted granted Critical
Publication of CN114640700B publication Critical patent/CN114640700B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application relates to the technical field of communication, in particular to a calling frequency control method and a calling frequency control device, which are used for determining a current frequency threshold value of a calling party for an accessed target interface in a target time period; in the target time period, when a service calling request sent by the calling party through the target interface is received, obtaining the current frequency balance in the target time period according to the current frequency threshold and the called times of the calling party through the target interface in the target time period; if the current frequency balance is determined to be exhausted, current resource use information is obtained; and adjusting the current frequency threshold according to the current resource use information, so that the utilization rate of system resources can be improved, and the accuracy and effectiveness of calling frequency control are improved, so that the normal calling of a calling party is ensured as much as possible on the premise of ensuring the stability of a system platform.

Description

Calling frequency control method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for controlling a call frequency.
Background
In the related art, usually, a caller needs to access to a system through an interface of the system and provide services by using resources of the system, however, the system resources are limited, the system resources are often exhausted due to excessive access of the caller, and the caller also often cannot obtain corresponding services due to insufficient system resources, thereby affecting the business processing of the caller.
Disclosure of Invention
The embodiment of the application provides a calling frequency control method and device, so that the accuracy and effectiveness of calling frequency control are improved, the utilization rate of system resources is improved, and the normal calling of a calling party is ensured as much as possible on the premise of ensuring the stability of a system platform.
The embodiment of the application provides the following specific technical scheme:
one embodiment of the present application provides a method for controlling a call frequency, including:
determining a current frequency threshold of an access target interface of a calling party in a target time period;
in the target time period, when a service calling request sent by the calling party through the target interface is received, obtaining the current frequency balance in the target time period according to the current frequency threshold and the called times of the calling party through the target interface in the target time period;
if the current frequency balance is determined to be exhausted, current resource use information is obtained;
and adjusting the current frequency threshold according to the current resource use information.
Another embodiment of the present application provides a call frequency control apparatus, including:
the first determining module is used for determining a current frequency threshold value of an access target interface of a calling party in a target time period;
a second determining module, configured to, when receiving a service invocation request sent by the caller through the target interface in the target time period, obtain a current frequency balance in the target time period according to the current frequency threshold and the number of times that the caller has been invoked through the target interface in the target time period;
the acquisition module is used for acquiring current resource use information if the current frequency balance is determined to be exhausted;
and the adjusting module is used for adjusting the current frequency threshold according to the current resource use information.
Another embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement any of the steps of the above-mentioned call frequency control method.
Another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements any of the steps of the above-mentioned method for invoking a frequency control.
In the embodiment of the application, the current frequency threshold of the calling party for the accessed target interface in the target time period is determined; in the target time period, when a service calling request sent by the calling party through the target interface is received, obtaining the current frequency balance in the target time period according to the current frequency threshold and the called times of the calling party through the target interface in the target time period; if the current frequency balance is determined to be exhausted, current resource use information is obtained, and the current frequency threshold is adjusted according to the current resource use information, so that the current frequency threshold in each target time period can be determined for a target interface of a calling party, a fixed value is not uniformly and statically allocated for the calling party, and the frequency threshold of the target interface of the calling party can be dynamically allocated for the calling party by combining the current resource use information of the system when a service calling request is received, so that system resources can be fully utilized, the effectiveness and the accuracy of frequency threshold allocation are improved, and the normal calling of the calling party can be ensured as much as possible on the premise of ensuring the stability of a system platform.
Drawings
FIG. 1 is a schematic diagram of an application architecture of a call frequency control method according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for controlling call frequency in an embodiment of the present application;
FIG. 3 is a schematic diagram of an overall schematic structure of a call frequency control method in an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a call frequency control apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device in 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 drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For the purpose of facilitating an understanding of the embodiments of the present application, a brief introduction will be made below to some concepts proposed in the embodiments of the present application:
frequency control: the short term frequency control refers to a policy for controlling the number of calls of one or more interfaces in a unit time, so as to ensure that Interface services of an Application Program Interface (API) are not impacted by a large number of requests, and ensure the overall stability of a platform.
Frequency quota: the frequency quota is referred to as a frequency threshold in the embodiment of the application.
System capacity: the total number of requests that the current platform system can support will decrease the value of the system capacity each time a caller requests.
The calling party: which means any user that uses the API to perform the service feature, for example, a terminal or a server.
History call log: the service of each caller calls a record of request information, such as the time point of the request, the requester, Uniform Resource Locator (URL), header, and responder.
Query Per Second rate (Query Per Second, QPS): the number of requests that can be processed by the server in one second is shown, for example, in the embodiment of the present application, QPS is used as a unit to measure the interface call frequency.
In the related art, a fixed value is usually statically allocated to a calling frequency control manner, including a frequency quota for a single caller and a frequency quota of an entire system platform, for example, a fixed frequency quota Q is allocated when a caller calls an interface for the first time, in a following P period, if the number of times that the caller accesses an API is greater than Q, a service call request of the caller is rejected, and after the P period, the frequency quota is reset to Q.
Therefore, to solve the above-mentioned problems, embodiments of the present application provide a call frequency control method based on dynamic frequency threshold allocation, and specifically, determine a current frequency threshold of a caller for an accessed target interface in a target time period, obtain a current frequency balance in the target time period according to the current frequency threshold and an adjusted number of times of the caller passing through the target interface in the target time period when a service call request sent by the caller through the target interface is received in the target time period, and further adjust the current frequency threshold according to current resource usage information if it is determined that the current frequency balance is exhausted, so that the current frequency threshold of the caller in a certain target time period can be determined, and the frequency threshold of the target interface of the caller is dynamically allocated in combination with current resource usage information of the system, the method and the device realize control on the calling frequency, can fully utilize system resources, ensure normal calling of a calling party as much as possible on the premise of permission of a system platform, and improve the accuracy and the effectiveness of calling frequency control.
Fig. 1 is a schematic diagram of an application architecture of a call frequency control method according to an embodiment of the present application, including a caller 100, a verification server 200, and a service server 300.
The caller 100 is a user who calls an interface of the platform system to complete a corresponding service, and may be a third party server, and may also be a terminal device, and this embodiment is not limited in this application, and the caller 100 may communicate with the service server 300 and the verification server 200 through external interfaces, for example, the caller 100 may access the platform through an interface provided by the platform system, and then the caller 100 sends a service call request to the verification server 200 through the accessed interface, and when the verification server 200 performs verification to allow the service call request, the service call request is forwarded to the service server 300, so that the service server 300 may perform service processing on the service call request, and the service server 300 may also send a service processing result of the service call request to the caller 100.
The verification server 200 and the service server 300 are both background servers providing services, the service server 300 is mainly used for performing service processing on the service call request, the verification server 200 is mainly used for verifying the service call request of the caller 100, judging whether the call frequency of the caller 100 sending the service call request through the target interface exceeds the current frequency threshold value, and the frequency threshold of the caller 100 may be dynamically calculated and assigned in the embodiment of the present application, the dynamic computation function for the frequency threshold may be implemented by being integrated into the verification server 200, or may be implemented as a separate quota computation server, in contrast, in the embodiment of the present application, there is no limitation, and of course, the verification server 200 and the service server 300 are also divided according to functions, and may also be implemented by being integrated on one server, and the embodiment of the present application is not limited.
The verification server 200 and the service server 300 may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, Network services, cloud communication, middleware services, domain name services, security services, Content Delivery Networks (CDNs), big data, artificial intelligence platforms, and the like.
The caller 100 and the verification server 200, the caller 100 and the service server 300, and the verification server 200 and the service server 300 may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein, for example, in fig. 1, the caller 100, the verification server 200, and the service server 300 are connected through the internet to realize communication therebetween.
Optionally, the internet described above uses standard communication techniques, protocols, or a combination of both. The internet is typically the internet, but can be any Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), any combination of mobile, wireline or wireless networks, private or virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including Hypertext Mark-up Language (HTML), Extensible Markup Language (XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec). In other embodiments, custom and/or dedicated data communication techniques may also be used in place of, or in addition to, the data communication techniques described above.
It should be noted that, the call frequency control method in the embodiment of the present application is mainly executed by the verification server 200, and here, it is described by taking a verification server 200 integrating a call frequency verification function and a frequency threshold calculation function as an example, for each caller 100, the verification server 200 determines, by analyzing historical call information, a current frequency threshold of each caller 100 for an accessed target interface in each target time period, and dynamically allocates the current frequency threshold of each target time period to the caller 100, and further checks whether a current frequency balance is exhausted when a service call request is received in the target time period, and if it is determined that the current frequency balance is exhausted, the current frequency threshold of the caller 100 may be adjusted according to current resource usage information, so as to ensure normal call of the caller 100 as much as possible.
It is worth to be noted that the application architecture diagram in the embodiment of the present application is to more clearly illustrate the technical solution in the embodiment of the present application, and does not limit the technical solution provided in the embodiment of the present application, nor limit the service scenario, and may be applied to various service scenarios that need frequency control protection, and for other application architectures and service scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar problems, and in each embodiment of the present application, the application architecture applied to fig. 1 is taken as an example to schematically illustrate the application architecture.
Based on the foregoing embodiment, referring to fig. 2, a flowchart of a method for controlling call frequency in the embodiment of the present application is shown, where the method includes:
step 200: and determining the current frequency threshold of the calling party for the accessed target interface in the target time period.
In the embodiment of the present application, each caller may allocate a fixed frequency threshold when accessing the API, for example, the system capacity is 1000qps, where an initial value of the system capacity is usually an empirical value, the system capacity may also be modified when the system capacity is increased and becomes effective, and a caller may allocate 10qps for the caller to use when accessing, that is, the initial frequency threshold of the caller.
It should be noted that, when different callers access the same interface, the frequency threshold assigned by each caller may not be the same, and when the same caller accesses different interfaces, the frequency thresholds assigned by each interface may also be different, that is, the assignment of the frequency thresholds is for one caller and one interface.
In order to improve accuracy and effectiveness of the calling frequency control in the embodiment of the present application, based on the initial frequency threshold, the current frequency threshold of each time period is dynamically allocated, and the specific execution of step 200 includes:
and S1, acquiring historical calling information of the calling party in a preset historical time.
The preset historical duration may be a period of time before the current computing time, for example, a historical call log of the past 7 days.
Moreover, the preset historical duration is greater than the duration of the divided time periods, and the preset historical duration may include a plurality of time periods, for example, the preset historical duration is in days, and the time period is in minutes, which is not limited in the embodiment of the present application.
And S2, respectively counting the times of sending the service calling requests in each time period with preset historical duration according to the historical calling information.
For example, historical call information of the last 7 days is obtained, the unit of each time period is minute, statistics is performed in a manner of 1 point per minute, and total 7 × 24 × 60 points of service call request data of each caller can be recorded, where the service call request data of each point at least includes the number of times of sending the service call request, that is, the number of times of sending the service call request corresponding to each minute of each day in the last 7 days is obtained.
And S3, respectively determining the weighted average of the counted times of each corresponding same time period in the preset historical time length.
For example, taking a calling party as an example, if historical call information of the past 7 days is obtained, there should be 7 statistical times for sending the service call request in the daily 00:01 time period, and the 7 times may be added and averaged, and then multiplied by 120%, so as to obtain a weighted average value of the time period.
And S4, taking the maximum value of the initial frequency threshold of the target time period and the weighted average value of the same time period in the corresponding preset historical duration as the current frequency threshold of the target time period.
The target time period is one of the time periods, for example, the weighted average of the times corresponding to the target time period is 50qps, the initial frequency threshold is 10qps, the maximum value of the two, that is, 50qps is taken as the current frequency threshold of the target time period, so that the current frequency threshold of the single interface per minute on the single day of the calling party can be calculated and obtained.
In this way, in the embodiment of the present application, for each caller, by analyzing historical call information such as historical call trends and peaks, the current frequency threshold corresponding to each current time period can be predicted.
Further, dynamic modification may be performed according to the predicted current frequency threshold of each time period, for example, a time point at which the frequency threshold may be insufficient may be predicted, and the allocated frequency threshold may be modified before the arrival.
For example, by analyzing and predicting that a caller 9 am may have a call requirement of 50qps, then the call may be made at 8: 55, the caller's frequency threshold is modified from 10qps to 50 qps.
Therefore, when the modification is carried out at a certain moment before the target time period comes, a certain error can be allowed, the accuracy of frequency threshold value distribution is improved, and the normal calling of a calling party is ensured as much as possible.
Step 210: and in the target time period, when a service calling request sent by a calling party through a target interface is received, obtaining the current frequency balance in the target time period according to the current frequency threshold and the called times of the calling party through the target interface in the target time period.
For example, if the current frequency threshold is 10qps, the number of times that the target interface has been invoked in the target time period is 3, and the current frequency balance is (10-3) qps.
Step 220: and if the current frequency balance is determined to be exhausted, acquiring the current resource use information.
The current resource usage information at least includes usage ratio values of each index representing the current resource, such as usage ratio values of a CPU, a memory, a network card, and the like, and of course, other indexes representing the current resource may also be used, which is not limited in the embodiment of the present application.
Further, if it is determined that the current frequency balance is not exhausted, that is, there is a margin, the service call request is allowed, the service logic is normally executed, and the frequency deduction may be performed after the service call request is completed. Therefore, the current frequency balance is calculated in real time according to each service calling request, and the efficiency can be improved.
Step 230: and adjusting the current frequency threshold according to the current resource use information.
When step 230 is executed, the method specifically includes:
1) and determining the remaining capacity of the system according to the current resource use information.
Specifically, the method comprises the following steps: carrying out weighted average on the use proportion value of each index according to the corresponding weight of each index, and taking the weighted average value of each index as the used capacity of the system; and determining the remaining capacity of the system according to the used capacity of the system.
For example, if the CPU usage ratio is 40%, the corresponding weight is 0.6, the memory usage ratio is 30%, the corresponding weight is 0.3, the network card usage ratio is 10%, and the corresponding weight is 0.1, the used capacity of the system may be represented as: 0.4 × 0.6+0.3 × 0.3+0.1 × 0.1 ═ 0.34 (34%), and the remaining system capacity was determined to be 66%.
The used capacity of the system is positively correlated with the current resource use information, and the used capacity of the system is reduced along with the reduction of the use proportion value of the CPU, the memory and the network card, so that the purpose of automatically adjusting the capacity of the platform system can be realized.
In addition, the used capacity or the remaining capacity of the system may be manually reported by a relevant person in real time, or an interface may be provided by the service server for the verification server to directly read, which is not limited in the embodiment of the present application.
2) And if the residual capacity of the system is determined to exceed the preset threshold, increasing the current frequency threshold by a preset proportion.
The preset threshold may be set according to actual conditions and requirements, for example, set to 20%, and this embodiment of the present application is not limited.
For example, if the remaining system capacity is 66% > 20%, the current frequency threshold of the calling party for the target interface may be adjusted up by 20%, at this time, since the current frequency threshold is increased, the current frequency balance is correspondingly increased, and the current frequency balance is not 0, the service of the calling party may be continuously supported.
Further, when a service invocation request is sent in the target time period in the following, if it is determined that the current frequency threshold is exhausted again, the above steps 220 to 230 may be repeatedly executed until the remaining capacity of the system does not exceed the preset threshold.
Further, if the remaining system capacity does not exceed the preset threshold, the service invocation request is rejected, and at this time, the service invocation request of the caller fails, which indicates that the system capacity is not enough and corresponding service logic cannot be executed.
In the embodiment of the application, a current frequency threshold value of an access target interface of a calling party in a target time period is determined, and then when a service calling request sent by the calling party through the target interface is received in the target time period, a current frequency balance in the target time period is obtained according to the current frequency threshold value and the called times of the calling party through the target interface in the target time period; if the balance of the current frequency is determined to be exhausted, the current resource use information is obtained, and the current frequency threshold value is adjusted according to the current resource use information, so that the current required frequency threshold value can be predicted by analyzing the historical calling information such as the calling rule, the trend and the like of the calling party, and the current resource use information of the system can be combined, so that the frequency threshold value of the target interface is dynamically allocated by the calling party, the system resources can be fully utilized, the effectiveness and the accuracy of frequency threshold value allocation are improved, the normal calling of the calling party can be guaranteed as far as possible on the premise of ensuring the permission of a platform, and the influence on the online production of the calling party is reduced.
Based on the foregoing embodiment, a specific application scenario is described below, taking the example that three callers access through the same target interface a respectively, and for better clarity, a dynamic computation function for a frequency threshold is integrated in an independent quota computation server to be implemented, so that the entire system architecture may include a service server, a frequency check server, and a quota computation server, where the service server is represented in a cluster form, and specifically refer to fig. 3, which is an overall schematic structural diagram of a call frequency control method in the embodiment of the present application.
Based on the foregoing embodiment, it can be seen that two aspects are mainly implemented in the embodiment of the present application, on one hand, performing frequency verification when receiving a service invocation request, and adjusting a current frequency threshold according to a system residual capacity, where the adjustment when receiving the service invocation request is mainly a real-time adjustment stage, and on the other hand, predetermining a current frequency threshold in a target time period, where analysis and prediction need to be performed in advance, and the adjustment stage is mainly an asynchronous adjustment stage, specifically:
in a first aspect: and (5) adjusting in real time.
1) As shown in fig. 3, for example, caller a, caller B, and caller C are all accessed through target interface a, and a fixed frequency threshold is assigned when accessing target interface a, caller a is 10qps, caller B is 50qps, and caller C is 100 qps.
2) Taking the caller a as an example, if the caller a sends a service invocation request, the verification server performs frequency verification when receiving the service invocation request.
If the current frequency balance is determined not to be exhausted, the service calling request is forwarded to the service server to normally execute the service logic, frequency deduction is performed after completion, namely deduction is continuously performed by taking the current frequency threshold as an initial value, one service calling request is subtracted by 1, for example, the current frequency threshold is 10 times per second, namely maximum 10 calling times are allowed in one second, and deduction is performed by taking 10 as the initial value every second.
If the current frequency balance is determined to be exhausted, dynamic allocation is performed again in combination with the system capacity, for example, the number of times of service call requests within a certain second exceeds 10, that is, the current frequency balance is 0, the system residual capacity is determined, for example, as shown in fig. 3, the service server may report current resource usage such as load, hardware usage and the like to the quota calculation server, and the verification server may also report information such as a verification result and processing delay of the service call requests to the quota calculation server, so that the quota calculation server may determine the system residual capacity in combination with the information, and then the quota calculation server sends the system residual capacity to the verification server, the verification server may further determine according to the system residual capacity, and if it is determined that the system residual capacity exceeds a preset threshold, a preset proportion is increased to the current frequency threshold, and if the residual capacity of the system is determined not to exceed the preset threshold value, rejecting the service call request.
In a second aspect: and (4) asynchronous adjusting phase.
As shown in fig. 3, the quota calculation server may obtain a history call log, that is, history call information, according to the history call information, analyze and count the calls for each caller, and predict a frequency threshold of a target time period of the current day, for example, a frequency threshold allocated when the caller a initially accesses is 10qps, and predict a call frequency required in a certain target time period to be 50qps through the history call information, the frequency threshold of the caller a may be modified from 10qps to 50qps before the target time period arrives, and the quota calculation server sends a current frequency threshold 50qps determined for the target time period to the verification server, so that the verification server performs frequency verification based on the current frequency threshold 50 qps.
Therefore, in the embodiment of the application, the dynamic frequency threshold value is distributed through the historical calling information and the current system residual capacity, the whole safety and stability of the platform can be ensured, the online production interruption caused by the fact that the calling party touches the interface frequency threshold value is effectively avoided, and the normal service calling of the calling party is ensured as much as possible.
In addition, it should be noted that the call frequency control method in the embodiment of the present application may be applied to various scenarios that need frequency control protection, including scenarios that need different frequency control policies for multiple callers, and scenarios that may exist under the scenarios and involve some dynamic quota allocation requirements, thereby achieving dynamic frequency quota allocation.
Based on the same inventive concept, the embodiment of the present application further provides a call frequency control device, where the call frequency control device may be, for example, the verification server in the foregoing embodiment, and the call frequency control device may be a hardware structure, a software module, or a hardware structure plus a software module. Based on the foregoing embodiments, referring to fig. 4, an example of a frequency calling control device in this application specifically includes:
a first determining module 40, configured to determine a current frequency threshold of the caller for an accessed target interface in a target time period;
a second determining module 41, configured to, when receiving a service invocation request sent by the caller through the target interface in the target time period, obtain a current frequency balance in the target time period according to the current frequency threshold and the number of times that the caller has been invoked through the target interface in the target time period;
an obtaining module 42, configured to obtain current resource usage information if it is determined that the current frequency balance is exhausted;
and an adjusting module 43, configured to adjust the current frequency threshold according to the current resource usage information.
Optionally, when determining that the current frequency threshold of the caller for the accessed target interface is in the target time period, the first determining module 40 is specifically configured to:
acquiring historical calling information of the calling party in a preset historical time;
respectively counting the times of sending service calling requests in each time period of the preset historical duration according to the historical calling information;
respectively determining the weighted average of the times counted in each corresponding same time period in the preset historical time;
and taking the maximum value of the initial frequency threshold value of the target time period and the corresponding weighted average value of the same time period in the preset historical time period as the current frequency threshold value of the target time period.
Optionally, the modifying module 44 is further configured to:
before the target time period comes, adjusting the frequency threshold of the caller for the target interface to the current frequency threshold.
Optionally, when the current frequency threshold is adjusted according to the current resource usage information, the adjusting module 43 is specifically configured to:
determining the residual capacity of the system according to the current resource use information;
and if the system residual capacity is determined to exceed the preset threshold, the current frequency threshold is increased by a preset proportion.
Optionally, the current resource usage information at least includes usage ratio values of indexes characterizing the current resource, and when determining the remaining system capacity according to the current resource usage information, the adjusting module 43 is specifically configured to:
carrying out weighted average on the use proportion value of each index according to the corresponding weight of each index, and taking the weighted average value of each index as the used capacity of the system;
determining a system remaining capacity based on the system used capacity.
Optionally, the processing module 45 is further configured to:
and if the residual capacity of the system does not exceed a preset threshold value, rejecting the service calling request.
Based on the above embodiments, fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
An electronic device, which may be a server in the foregoing embodiments, may include a processor 510 (CPU), a memory 520, an input device 530, an output device 540, and the like.
Memory 520 may include Read Only Memory (ROM) and Random Access Memory (RAM), and provides processor 510 with program instructions and data stored in memory 520. In the embodiment of the present application, the memory 520 may be used to store any program for calling the frequency control method in the embodiment of the present application.
The processor 510 is configured to execute any of the calling frequency control methods according to the embodiments of the present application by calling the program instructions stored in the memory 520 according to the obtained program instructions, and the processor 510 is configured to execute the calling frequency control methods.
Based on the foregoing embodiments, in the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the call frequency control method in any of the above method embodiments.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which 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 network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.

Claims (10)

1. A calling frequency control method is characterized by comprising the following steps:
determining a current frequency threshold of an access target interface of a calling party in a target time period;
in the target time period, when a service calling request sent by the calling party through the target interface is received, obtaining the current frequency balance in the target time period according to the current frequency threshold and the called times of the calling party through the target interface in the target time period;
if the current frequency balance is determined to be exhausted, current resource use information is obtained;
and adjusting the current frequency threshold according to the current resource use information.
2. The method of claim 1, wherein determining a current frequency threshold of the caller for the accessed target interface in the target time period comprises:
acquiring historical calling information of the calling party in a preset historical time;
respectively counting the times of sending service calling requests in each time period of the preset historical duration according to the historical calling information;
respectively determining the weighted average of the counted times of each corresponding same time period in the preset historical time;
and taking the maximum value of the initial frequency threshold value of the target time period and the corresponding weighted average value of the same time period in the preset historical time period as the current frequency threshold value of the target time period.
3. The method of claim 1 or 2, further comprising:
before the target time period comes, adjusting the frequency threshold of the caller for the target interface to the current frequency threshold.
4. The method of claim 1, wherein adjusting the current frequency threshold according to the current resource usage information comprises:
determining the remaining capacity of the system according to the current resource use information;
and if the system residual capacity is determined to exceed the preset threshold, the current frequency threshold is increased by a preset proportion.
5. The method according to claim 4, wherein the current resource usage information at least includes usage ratio values of indexes characterizing current resources, and then determining the remaining system capacity according to the current resource usage information specifically includes:
carrying out weighted average on the use proportion value of each index according to the corresponding weight of each index, and taking the weighted average value of each index as the used capacity of the system;
determining a system remaining capacity based on the system used capacity.
6. The method of claim 4, further comprising:
and if the residual capacity of the system does not exceed a preset threshold value, rejecting the service calling request.
7. A call frequency control apparatus, comprising:
the first determining module is used for determining the current frequency threshold of the calling party for the accessed target interface in the target time period;
a second determining module, configured to, when receiving a service invocation request sent by the caller through the target interface in the target time period, obtain a current frequency balance in the target time period according to the current frequency threshold and the number of times that the caller has been invoked through the target interface in the target time period;
the acquisition module is used for acquiring current resource use information if the current frequency balance is determined to be exhausted;
and the adjusting module is used for adjusting the current frequency threshold according to the current resource use information.
8. The apparatus of claim 7, wherein when determining that the caller is at a current frequency threshold of the target time period for the accessed target interface, the first determining module is specifically configured to:
acquiring historical calling information of the calling party in a preset historical time;
respectively counting the times of sending service calling requests in each time period of the preset historical duration according to the historical calling information;
respectively determining the weighted average of the counted times of each corresponding same time period in the preset historical time;
and taking the maximum value of the initial frequency threshold value of the target time period and the corresponding weighted average value of the same time period in the preset historical time period as the current frequency threshold value of the target time period.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of claims 1-6 are implemented when the program is executed by the processor.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program when executed by a processor implements the steps of the method of any one of claims 1 to 6.
CN202011370411.1A 2020-11-30 2020-11-30 Calling frequency control method and device Active CN114640700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011370411.1A CN114640700B (en) 2020-11-30 2020-11-30 Calling frequency control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011370411.1A CN114640700B (en) 2020-11-30 2020-11-30 Calling frequency control method and device

Publications (2)

Publication Number Publication Date
CN114640700A true CN114640700A (en) 2022-06-17
CN114640700B CN114640700B (en) 2023-04-07

Family

ID=81944442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011370411.1A Active CN114640700B (en) 2020-11-30 2020-11-30 Calling frequency control method and device

Country Status (1)

Country Link
CN (1) CN114640700B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080363A (en) * 2022-08-23 2022-09-20 中国中金财富证券有限公司 System capacity evaluation method and device based on service log
CN117478600A (en) * 2023-12-28 2024-01-30 彩讯科技股份有限公司 Flow control method and system for serving high concurrency multi-center business center

Citations (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110246745A1 (en) * 2010-04-02 2011-10-06 Hitachi, Ltd. Management system and computer system management method
CN103425526A (en) * 2012-05-18 2013-12-04 腾讯科技(深圳)有限公司 Control method and device for interface calls
CN105471649A (en) * 2015-12-03 2016-04-06 深圳市金立通信设备有限公司 Virtual network performance monitoring system and method, and related equipment
CN105656855A (en) * 2014-11-14 2016-06-08 阿里巴巴集团控股有限公司 Resource access control method and device
CN106130972A (en) * 2016-06-22 2016-11-16 腾讯科技(深圳)有限公司 Resource access control method and device
CN106550010A (en) * 2016-09-21 2017-03-29 南京途牛科技有限公司 A kind of real-time control distributed system calls external system to service the method and system of the frequency
US20170228257A1 (en) * 2014-07-31 2017-08-10 Hewlett Packard Enterprise Development Lp Dynamic adjustment of thresholds
CN107704765A (en) * 2017-08-28 2018-02-16 深圳市诚壹科技有限公司 A kind of interface access method, server and computer-readable recording medium
CN108334440A (en) * 2017-01-19 2018-07-27 阿里巴巴集团控股有限公司 A kind of processing method and processing device, client obtaining application performance test result
CN109067807A (en) * 2018-10-16 2018-12-21 杭州安恒信息技术股份有限公司 Safety protecting method, device and electronic equipment based on WEB application firewall overload
CN109194539A (en) * 2018-08-13 2019-01-11 中国平安人寿保险股份有限公司 Data management-control method, device, computer equipment and storage medium
CN109246229A (en) * 2018-09-28 2019-01-18 网宿科技股份有限公司 A kind of method and apparatus of distribution resource acquisition request
CN109756528A (en) * 2017-11-01 2019-05-14 广州腾讯科技有限公司 Control method for frequency and device, equipment, storage medium, server
CN109766182A (en) * 2018-12-18 2019-05-17 平安科技(深圳)有限公司 The scalable appearance method, apparatus of system resource dynamic, computer equipment and storage medium
CN109903175A (en) * 2019-03-26 2019-06-18 众安在线财产保险股份有限公司 A kind of Insurance core system monitor supervision platform
CN110138688A (en) * 2019-04-15 2019-08-16 深圳壹账通智能科技有限公司 Dynamic adjusts method, apparatus, equipment and the readable storage medium storing program for executing of business interface
CN110535777A (en) * 2019-08-12 2019-12-03 新华三大数据技术有限公司 Access request control method, device, electronic equipment and readable storage medium storing program for executing
CN110865881A (en) * 2018-08-27 2020-03-06 中移(苏州)软件技术有限公司 Resource scheduling method and device
US20200104392A1 (en) * 2018-10-02 2020-04-02 Servicenow, Inc. Dynamic threshold adjustment based on performance trend data
CN111262795A (en) * 2020-01-08 2020-06-09 京东数字科技控股有限公司 Service interface-based current limiting method and device, electronic equipment and storage medium
CN111866101A (en) * 2020-07-08 2020-10-30 深圳市欢太科技有限公司 Access request processing method and device, storage medium and electronic equipment
CN111985726A (en) * 2020-08-31 2020-11-24 重庆紫光华山智安科技有限公司 Resource quantity prediction method and device, electronic equipment and storage medium

Patent Citations (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110246745A1 (en) * 2010-04-02 2011-10-06 Hitachi, Ltd. Management system and computer system management method
CN103425526A (en) * 2012-05-18 2013-12-04 腾讯科技(深圳)有限公司 Control method and device for interface calls
US20170228257A1 (en) * 2014-07-31 2017-08-10 Hewlett Packard Enterprise Development Lp Dynamic adjustment of thresholds
CN105656855A (en) * 2014-11-14 2016-06-08 阿里巴巴集团控股有限公司 Resource access control method and device
CN105471649A (en) * 2015-12-03 2016-04-06 深圳市金立通信设备有限公司 Virtual network performance monitoring system and method, and related equipment
CN106130972A (en) * 2016-06-22 2016-11-16 腾讯科技(深圳)有限公司 Resource access control method and device
CN106550010A (en) * 2016-09-21 2017-03-29 南京途牛科技有限公司 A kind of real-time control distributed system calls external system to service the method and system of the frequency
CN108334440A (en) * 2017-01-19 2018-07-27 阿里巴巴集团控股有限公司 A kind of processing method and processing device, client obtaining application performance test result
CN107704765A (en) * 2017-08-28 2018-02-16 深圳市诚壹科技有限公司 A kind of interface access method, server and computer-readable recording medium
CN109756528A (en) * 2017-11-01 2019-05-14 广州腾讯科技有限公司 Control method for frequency and device, equipment, storage medium, server
CN109194539A (en) * 2018-08-13 2019-01-11 中国平安人寿保险股份有限公司 Data management-control method, device, computer equipment and storage medium
CN110865881A (en) * 2018-08-27 2020-03-06 中移(苏州)软件技术有限公司 Resource scheduling method and device
CN109246229A (en) * 2018-09-28 2019-01-18 网宿科技股份有限公司 A kind of method and apparatus of distribution resource acquisition request
US20200104392A1 (en) * 2018-10-02 2020-04-02 Servicenow, Inc. Dynamic threshold adjustment based on performance trend data
CN109067807A (en) * 2018-10-16 2018-12-21 杭州安恒信息技术股份有限公司 Safety protecting method, device and electronic equipment based on WEB application firewall overload
CN109766182A (en) * 2018-12-18 2019-05-17 平安科技(深圳)有限公司 The scalable appearance method, apparatus of system resource dynamic, computer equipment and storage medium
CN109903175A (en) * 2019-03-26 2019-06-18 众安在线财产保险股份有限公司 A kind of Insurance core system monitor supervision platform
CN110138688A (en) * 2019-04-15 2019-08-16 深圳壹账通智能科技有限公司 Dynamic adjusts method, apparatus, equipment and the readable storage medium storing program for executing of business interface
CN110535777A (en) * 2019-08-12 2019-12-03 新华三大数据技术有限公司 Access request control method, device, electronic equipment and readable storage medium storing program for executing
CN111262795A (en) * 2020-01-08 2020-06-09 京东数字科技控股有限公司 Service interface-based current limiting method and device, electronic equipment and storage medium
CN111866101A (en) * 2020-07-08 2020-10-30 深圳市欢太科技有限公司 Access request processing method and device, storage medium and electronic equipment
CN111985726A (en) * 2020-08-31 2020-11-24 重庆紫光华山智安科技有限公司 Resource quantity prediction method and device, electronic equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080363A (en) * 2022-08-23 2022-09-20 中国中金财富证券有限公司 System capacity evaluation method and device based on service log
CN115080363B (en) * 2022-08-23 2022-11-15 中国中金财富证券有限公司 System capacity evaluation method and device based on service log
CN117478600A (en) * 2023-12-28 2024-01-30 彩讯科技股份有限公司 Flow control method and system for serving high concurrency multi-center business center
CN117478600B (en) * 2023-12-28 2024-03-08 彩讯科技股份有限公司 Flow control method and system for serving high concurrency multi-center business center

Also Published As

Publication number Publication date
CN114640700B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN110276182B (en) API distributed current limiting realization method
US9015227B2 (en) Distributed data processing system
US20200287794A1 (en) Intelligent autoscale of services
CN111478857B (en) Interface current limiting control method and device and electronic equipment
US8667056B1 (en) Dynamic traffic management
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
CN114640700B (en) Calling frequency control method and device
US7548969B2 (en) Computer system polling with adjustable intervals based on rules and server states
CN107592345B (en) Transaction current limiting device, method and transaction system
CN112367268B (en) Current limiting method and device for micro-service
CN111600967A (en) Access pressure-based load balancing system among block chain nodes
US20230088768A1 (en) System and Method for Statistically Distributed Rate Limiting of Application Programming Interface Traffic
CN107682316B (en) Method for generating dynamic password sending strategy and method for sending dynamic password
CN113905091B (en) Method and device for processing access request
US11127404B2 (en) Capping the rate of incoming transactions in inbound stateful conversations established in a distributed computing environment
CN116232804A (en) API gateway based on micro-service architecture
US11477322B1 (en) System and method for prioritizing tenants for a service for a request router in a cloud-based software as a service (SaaS) platform contact-center
CN112492635B (en) Determination method and device for scheduling priority
CN114598656B (en) Load balancing method and system applied to delivery service platform
CN115037693B (en) Distributed current limiting method and distributed current limiting device based on token bucket
US11108656B1 (en) Techniques for allocating and managing telecommunication resources
CN117221235A (en) API flow allocation method, device, equipment and storage medium in financial business system
CN117294578B (en) Communication method, system, computer equipment and storage medium
CN117614910A (en) Interface service current limiting method and device, electronic equipment and medium
CN116915705A (en) Enhanced service flow control system and control method

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