Service access frequency control method, device, computing device and storage medium
By determining whether the user's to be accessed frequency exceeds the threshold within the current time period and obtaining access frequency compensation from subsequent time periods, the problem of difficult to control DDOS attacks is solved, and effective restrictions and flexible control of the user's access frequency are achieved.
Patent Information
- Application Number
- CN202110838672.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-23
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-07-23
AI Technical Summary
The existing technology is difficult to effectively prevent and resolve distributed denial of service attacks (DDOS attacks), especially due to the security defects of the network protocol, DDOS attacks are difficult to control.
By obtaining the user's service access request, it is determined whether the waiting frequency of the current time period is exceeded the threshold. If it exceeds, a part of the access frequency threshold of the subsequent time period is obtained as a supplement to limit and compensate for the current time. Periodic access frequency, flexible high-frequency access control.
Effectively limit user access frequency, flexibly compensate users for insufficient available access frequency at a certain period of time, realize flexible control of high-frequency access, and enhance network security.
Smart Images

Figure CN113553528B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of Internet technology, and in particular to a service access frequency control method, device, computing equipment and storage medium. Background Art
[0002] With the development of Internet technology and Internet applications, various network attack methods have emerged one after another, such as fake orders, modem pool, group control, man-in-the-middle attack, Distributed Denial of Service attack (DDOS), etc. Network security issues have become more and more important.
[0003] Among them, DDOS attacks have become increasingly rampant with the rapid development of the Internet, from attacks with a few megabytes or tens of megabytes of traffic to attacks with tens of gigabytes or tens of terabytes of traffic. DDOS attacks are one of the most difficult network security issues to solve because they are easy to implement, difficult to prevent, and difficult to track, and have brought great harm to the network society. At the same time, due to the security defects of the network protocol itself, DDOS attacks have not been reasonably resolved. Summary of the invention
[0004] In view of the above problems, the embodiments of the present invention provide a service access frequency control method, apparatus, computing device and storage medium, which are used to solve the problem of DDOS attacks existing in the prior art.
[0005] According to one aspect of an embodiment of the present invention, a service access frequency control method is provided, the method comprising: obtaining a service access request of a user, the service access request including a frequency to be accessed by the user in a current time period; the service access includes multiple time periods, each of which is provided with the same access frequency threshold; determining whether the frequency to be accessed exceeds the access frequency threshold; when the frequency to be accessed exceeds the access frequency threshold, obtaining a portion of the access frequency from the access frequency threshold of a subsequent time period as a supplementary access frequency to compensate for the current time period, wherein the subsequent time period is a time period after the current time period in the multiple time periods. In an optional manner, the method further comprises: if a portion of the access frequency has been obtained from the subsequent time period as a supplementary access frequency to compensate for other time periods, then the access frequency threshold of each time period in the subsequent time period is subtracted from the access frequency threshold of each time period by the access frequency that has been compensated for other time periods, so as to update the access frequency threshold of each time period.
[0006] In an optional manner, the method of obtaining a portion of the access frequency from the access frequency threshold of a subsequent time period as a supplementary access frequency compensation to the current time period includes: starting from the time period after the current time period, obtaining a preset proportion of the access frequency from the access frequency threshold of each time period in turn, until the sum of the access frequency threshold of the current time period and all the obtained access frequencies is equal to the frequency to be accessed in the current time period, or the access frequency threshold of a time period in the subsequent time period is the first threshold, or the access frequency obtained from the access frequency threshold of a time period is the second threshold.
[0007] In an optional manner, starting from the (n+1)th time period, the preset ratio of each time period is q n , where n is an integer, n ≥ 1, 0 <q<1。
[0008] In an optional manner, after obtaining the user's service access request, the method further includes: adding the access time of the service access request to an access time queue corresponding to the user; obtaining the queue size of the access time queue including the access time of the current time period, and updating the user's access frequency in the current time period according to the queue size.
[0009] The obtaining of the user's service access request, wherein the service access request includes the user's waiting access frequency in the current time period, comprises: obtaining the user's service access request, adding the access time of the service access request to an access time queue corresponding to the user; obtaining the queue size of the access time queue including the access time of the current time period, wherein the queue size is the user's waiting access frequency in the current time period.
[0010] In an optional manner, determining whether the frequency to be accessed exceeds the access frequency threshold includes: determining whether the frequency to be accessed exceeds the access frequency threshold within a time period when the total traffic of service access is lower than a third threshold and the service concurrency is lower than a fourth threshold.
[0011] In an optional manner, after determining whether the frequency to be accessed exceeds the access frequency threshold, the method further includes: determining whether the frequency to be accessed exceeds the sum of its access frequency threshold and all access frequencies that can be obtained from the access frequency threshold of subsequent time periods; when the frequency to be accessed is greater than the sum of its access frequency threshold and all access frequencies that can be obtained from the access frequency threshold of subsequent time periods, intercepting the service access request.
[0012] According to another aspect of an embodiment of the present invention, there is provided a service access frequency control device, the device comprising: an acquisition module, used to acquire a service access request of a user, the service access request including the frequency to be accessed by the user in the current time period; the service access includes multiple time periods, each of the time periods is provided with the same access frequency threshold; a determination module, used to determine whether the frequency to be accessed exceeds the access frequency threshold; a compensation module, used to acquire a portion of the access frequency from the access frequency threshold of a subsequent time period when the frequency to be accessed exceeds the access frequency threshold, as a supplementary access frequency compensation to the current time period, wherein the subsequent time period is a time period after the current time period in the multiple time periods. According to another aspect of an embodiment of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface communicate with each other via the communication bus;
[0013] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the operation of the service access frequency control method as described above.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored in the storage medium. When the executable instruction is executed on a computing device, the computing device executes the operation of the service access frequency control method as described above.
[0015] The embodiment of the present invention obtains a portion of the access frequency from the access frequency threshold of the subsequent time period when the access frequency of the client exceeds the access frequency threshold in the current time period, and compensates the current time period as a supplementary access frequency. This can not only limit the user's access frequency, but also flexibly compensate for the shortage of the user's available access frequency in a certain period of time, thereby flexibly realizing high-frequency access control.
[0016] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0018] Figure 1 A schematic diagram showing the setting of high-frequency control with fixed time period and variable frequency in the prior art is shown;
[0019] Figure 2 A schematic diagram showing the setting of high frequency control with fixed period and fixed frequency in the prior art
[0020] Figure 3 A schematic diagram showing a flow chart of a service access frequency control method provided by an embodiment of the present invention;
[0021] Figure 4 A schematic diagram of a lending process of a service access frequency control method provided by an embodiment of the present invention is shown;
[0022] Figure 5 A schematic diagram of a loan simulation of a service access frequency control method provided by an embodiment of the present invention is shown;
[0023] Figure 6 A schematic flow chart of another service access frequency control method provided by an embodiment of the present invention is shown;
[0024] Figure 7 A schematic flow chart of another service access frequency control method provided by an embodiment of the present invention is shown;
[0025] Figure 8 A schematic diagram showing the structure of a service access frequency control device provided by an embodiment of the present invention is shown;
[0026] Fig. 9 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0028] Currently, DDOS attacks have not been properly addressed in the Internet. Through DDOS attacks, the server buffer can be forced to overflow and not accept new message requests; or IP spoofing can be used to make the server reset illegal user connections, resulting in normal users being unable to connect.
[0029] There are two main ways to solve DDOS attacks in existing technologies:
[0030] 1. High-frequency control with fixed time periods and variable frequencies: The system sets different access frequencies (hereinafter referred to as set frequencies in this paragraph) for different time periods, such as Figure 1The frequency is set to n from 00:00 to 02:00, m from 02:00 to 18:00, and k from 18:00 to 20:00. The number of visits in each time period is accumulated to determine the time period in which the current visit time is located, and whether the visit frequency in this time period exceeds the set frequency. If it exceeds, the current visit is considered abnormal and the current visit is intercepted.
[0031] The above method has a relatively large time span and is relatively complicated to configure. In extreme cases (such as the last second of the previous time period and the beginning second of the next time period), the access frequency increases suddenly, and the access volume of the previous time period and the next time period does not reach the set frequency, while the access volume of the previous time period and the beginning second of the next time period adds up to exceed the set frequency, or the access volume of the last second of the previous time period and the next time period adds up to exceed the set frequency. This situation cannot be effectively controlled.
[0032] 2. High-frequency control with fixed period and fixed frequency: The system sets a fixed access frequency (hereinafter referred to as set frequency) for a fixed time period, that is, the time period is fixed and the frequency is fixed, such as Figure 2 The length of each time period is t, and the set frequency is n. A fixed-length queue is initialized to store access time. When there is a new access, the access time is added to the end of the queue. The earlier the access time, the closer its access time is to the head of the queue. Compare the access time t of the current access in the queue c and all the access times before it, if t c and in t c If the time difference of a certain access time among all previous access times does not exceed t, and the number of accesses within the time difference exceeds the set frequency, the current access is judged to be abnormal and the current access is intercepted.
[0033] In the above method, if the number of accesses within the time difference exceeds the set frequency and the current access is blocked and restricted, no access can be made for a period of time, and the restriction policy cannot be relaxed in a certain time period, so the mechanism is not flexible enough.
[0034] Therefore, in view of the above problems, an embodiment of the present invention provides a service access frequency control method. Figure 3 A flow chart of a service access frequency control method provided by an embodiment of the present invention is shown. The method can be executed in a server or server cluster that provides service access to each user. The method comprises the following steps:
[0035] Step 110: Obtain a service access request of a user, wherein the service access request includes the frequency of access to be performed by the user in a current time period; the service access includes multiple time periods, and each time period is set with the same access frequency threshold.
[0036] In the Internet field, a user initiates a service access request to a server, and the server responds to the user's service access request and allows the user to access the service. The embodiment of the present invention allows the user to borrow the access frequency of the subsequent time period in advance during a specific time period, which can not only limit the user's access frequency, but also flexibly compensate for the lack of the user's available access frequency during a certain period of time.
[0037] The time period refers to a continuous time period. For example, if the time period is set to t, the duration of each time period is t. Multiple consecutive time periods are represented by the array t[n]. If t[0] represents the current time period, t[1] represents the next time period, and so on, t[n] represents the nth time period. Access frequency refers to the number of visits or the number of visits. The access frequency threshold refers to the maximum number of times a user is allowed to access a service in each time period.
[0038] The access frequency refers to the number of accesses initiated by the user. This step needs to obtain the number of accesses initiated by the user in the current time period to determine whether it exceeds the access frequency threshold of the current time period.
[0039] The server identifies the user by obtaining the unique identifier of each user. There are many ways to uniquely identify a user. For example, in an embodiment of the present invention, a device fingerprint (deviceID / ip) can be used as a key to identify the uniqueness of the user. Each user on the server has his or her own access time queue. When a user initiates a request for the first time, the time of the user's first access is added to the end of the user's access time queue. The earlier the access is in time, the closer its access time is to the head of the access time queue. When the user visits again, the access time queue corresponding to the user in the server cache is searched by key to obtain the frequency of the user's pending access in the current time period. Specifically, in some embodiments, after step 110, the method further includes:
[0040] Step 111: adding the access time of the service access request to the access time queue corresponding to the user;
[0041] Step 112: Obtain the queue size of the access time queue including the access time of the current time period, and update the access frequency of the user in the current time period according to the queue size.
[0042] In this step, the queue size can be set to the storage capacity of the queue or the number of access times, both of which are numerical values. The access frequency threshold is also a number and is a numerical value. Therefore, the frequency to be accessed by the user in the current time period can be updated according to the queue size, so that the frequency to be accessed can be compared with the access frequency threshold in the subsequent steps. For example, when the queue size is set to the storage capacity of the queue, a corresponding relationship between the queue size and the access frequency threshold is pre-set (for example, 1KB storage capacity can store an access time data, and the corresponding access time data corresponds to the value of the frequency to be accessed is 1, then the corresponding relationship is set to a ratio of 1:1), assuming that the queue size is 100KB, then the frequency to be accessed by the user in the current time period is updated to 100. For another example, when the queue size is set to the number of access times, a corresponding relationship between the queue size and the access frequency threshold is pre-set (for example, the value of the frequency to be accessed by an access time data is 1, then the corresponding relationship is set to a ratio of 1:1), assuming that the queue size is 100, then the frequency to be accessed by the user in the current time period is updated to 100.
[0043] Since each user has only one access time queue, in order to keep only the user's access time in the current time period in the access time queue, the access time data of "access time > current access time - access period" in the access time queue can be deleted by comparing the data in the access time queue, and the access time of the current business access request can be added to the access time queue.
[0044] Step 120: Determine whether the to-be-accessed frequency exceeds the access frequency threshold.
[0045] Step 120 needs to compare the access frequency to be accessed with the access frequency threshold. In step 112, the queue size of the access time queue including the access time of the current time period is obtained. Therefore, in some embodiments, step 120 specifically includes:
[0046] Step 121: Determine whether the queue size exceeds the access frequency threshold of the current time period;
[0047] Step 122: If the queue size exceeds the access frequency threshold of the current time period, determine that the access frequency exceeds the access frequency threshold.
[0048] If the queue size exceeds the access frequency threshold of the current time period, it means that the access frequency exceeds the access frequency threshold, the number of visits by the user has exceeded the access frequency threshold, and further subsequent operations need to be performed.
[0049] Step 130: When the to-be-accessed frequency exceeds the access frequency threshold, obtain a part of the access frequency from the access frequency thresholds of subsequent time periods as supplementary access frequency to compensate the current time period, where the subsequent time periods are the time periods after the current time period among the multiple time periods.
[0050] This step allows the user to borrow in advance the access frequency of subsequent time periods. First, since the total allowable access amount within a total time period remains unchanged, and the access frequency of a single time period can be lent to the time period before it. When the access frequency of a certain time period is partially lent to other time periods, the available access frequency of this time period will decrease. Therefore, it is necessary to update the available access frequency of each time period in real time, that is, its access frequency threshold. In some embodiments, if a part of the access frequency has been obtained from the subsequent time periods as supplementary access frequency to compensate other time periods, then subtract the access frequency that has been compensated to other time periods from the access frequency threshold of each time period in the subsequent time periods to update the access frequency threshold of each time period. That is, the access frequency threshold of each time period = the access frequency threshold set in Step 110 - the access frequency lent to other time periods.
[0051] In some embodiments, obtaining a part of the access frequency from the access frequency thresholds of subsequent time periods as supplementary access frequency to compensate the current time period in Step 130 includes:
[0052] Starting from the time period immediately following the current time period, sequentially obtain a preset proportion of the access frequency from the access frequency thresholds of each time period until the sum of the access frequency threshold of the current time period and the obtained access frequencies is equal to the to-be-accessed frequency of the current time period, or the access frequency threshold of a certain time period in the subsequent time periods is the first threshold, or the access frequency obtained from the access frequency threshold of a certain time period is the second threshold. Wherein, the first threshold can be 1 or other values, and the second threshold can also be 1 or other values.
[0053] In some embodiments, the borrowing of access frequency can be carried out in the way of a geometric sequence. Starting from the (n + 1)-th time period, the preset proportion of each time period is q n , where n is an integer, n ≥ 1, 0 < q < 1. The preset proportion can be flexibly configured according to the business, and can accurately control the high-frequency access times and master the borrowing times.
[0054] For example, set the time period as t, set the access frequency threshold as m within a unit time period (similar to the first term a1 of a geometric sequence), set the preset ratio of borrowing access frequency as q (also known as the borrowing ratio, similar to the common ratio of a geometric sequence, where 0 < q < 1), and the access frequency to be accessed as k.
[0055] Multiple consecutive time periods are represented by the array t[n]. If t[0] represents the current time period, t[1] represents the next time period, ……, t[n] represents the nth time period.
[0056] The number of accesses that t[0] can borrow for the t[1] time period is m * q 1 and the number of accesses borrowed for the t[2] time period is m * q 2 …… and the number of accesses borrowed for the t[n] time period is m * q n , and its borrowing termination conditions include:
[0057] (1) When k approaches infinity, the borrowing termination condition is m * q n ≥ 1, that is, when borrowing until the last time period, the borrowing is not completed, or the number of accesses in the last time period is 1, and it cannot lend to other time periods anymore;
[0058] (2) When k is relatively small, the borrowing termination condition is m + m * (q 1 + q 2 + … + q n ) ≥ k, that is, when borrowing until the last time period or a previous time period, the borrowing requirement can be met.
[0059] The total number of accesses that can be borrowed in the t[n] time period is m * (q 1 + q 2 + … + q n ). The borrowing process is as Figure 4 shown. Taking the first borrowing termination condition above as an example, the shaded part on the left in each time period represents the number of accesses held (that is, the access frequency threshold), and the right side represents the number of times lent out or borrowed in. In the first stage, the number of accesses within the unit time t is limited to m, and from top to bottom are consecutive time periods t. In the second stage, when the number of accesses k to be accessed is greater than m times within the unit time, borrowing is required from the next time period. In the third stage, when the number of borrowings in the next unit time still cannot meet the demand of the number of accesses k, the access frequency of the next time period is borrowed again, and so on recursively. The above operations continue until in the nth stage, borrowing until the last time period and m * q n ≥ 1, then the borrowing stops.
[0060] It can be seen that the larger the lending ratio q is, the more the lending time period n and the access frequency of the lending will be, but the lending itself cannot exceed the access frequency held in the time period. When the access frequency held in the nth time period is 1 or the amount of lending is 1, the lending will be stopped. Figure 5 The simulation is that when the access frequency y is set to 100, its borrowing ratio q is 1 / 2, 1 / 4 / , 1 / 8 / , 1 / 16, respectively, and the access frequency of borrowing to the time period x in the subsequent time period is sequentially calculated.
[0061] The following is an explanation of the recursive algorithm for borrowing and lending:
[0062] The borrowing behavior occurs when the current access volume reaches the set maximum access volume. First, a group of object classes Borrower arrays are defined. Its fields mainly include: maximum access volume (maxCount), current access volume (curCount), maximum loan amount (maxLendCount), current loan amount (curLendCount), remaining access volume (restCount), start time (startTime), and end time (endTime). Among them, Borrower[0] identifies the current access time period, and the fields maxLendCount and curLendCount indicate the maximum access volume that can be borrowed and the current borrowed access volume. For other Borrower[1…n] objects, their maxLendCount and curLendCount indicate the maximum access volume that can be borrowed and the current borrowed access volume.
[0063] For general business systems, the access cycle is usually set to seconds, the frequency setting is generally not too large, the depth of lending (i.e., lending objects) is not too deep, and the lending itself has an expected convergence effect (i.e., m*q n >=1), so the recursive algorithm can simply and clearly realize the sum of the borrowing and lending amounts in each time period.
[0064] Through recursion, the specific number of times that Borrower[0] can borrow in the future time period is obtained in the current cycle (i.e., Borrower[0]), where freCount represents the threshold and mulFoctor represents the borrowing ratio. When a user enters the borrowing mechanism, the system will first determine whether the user enters the borrowing mechanism for the first time. If so, the current user's borrowing mechanism flag isLend = true (default is false), and the user's subsequent requests for a period of time will directly enter the borrowing mechanism for judgment. When the number of visits to Borrower[0] is too large and the number of visits lent out in the Borrower[1] time period reaches the maximum borrowing amount limit, the system will continue to borrow visits from Borrower[2] until the borrowing amount of Borrower[n] is greater than 1. In the subsequent time period, the maximum number of visits to Borrower[1…n] = the remaining number of visits, until the borrowing cycle ends and the borrowing flag isLend = flase is changed.
[0065]
[0066] In some embodiments, when the access frequency exceeds the access frequency threshold, it is possible to further determine whether the user's security complies with the security rules, thereby determining whether the user is allowed to pre-borrow the access frequency of the subsequent time period, and only compensate the access frequency for users whose security complies with the security rules. This step can determine the user's security (that is, the user's normality, or the user's legitimacy) through a certain security rule chain. If the user's security complies with the security rules, the subsequent access frequency can be used in advance. If not, the subsequent access frequency cannot be used in advance. The security rule chain includes a blacklist library, anti-replay attack, etc.
[0067] In some embodiments, Figure 6 As shown, step 120 of determining whether the to-be-accessed frequency exceeds the access frequency threshold comprises:
[0068] Step 120a: When the total traffic of service access is lower than the third threshold and the service concurrency is lower than the fourth threshold, determine whether the access frequency exceeds the access frequency threshold.
[0069] In this step, for high traffic and high concurrency times, the user is not allowed to pre-borrow and use the subsequent access frequency. The user is only allowed to pre-borrow and use the subsequent access frequency during low traffic and low concurrency times. Therefore, in this step, when the total traffic of business access is lower than the third threshold and the business concurrency is lower than the fourth threshold, it is determined whether the frequency to be accessed exceeds the access frequency threshold, and then step 130 and subsequent steps are continued. The total traffic of business access is lower than the third threshold, indicating that this is a low traffic time; the business concurrency is lower than the fourth threshold, indicating that this is a low concurrency time. The third threshold and the fourth threshold can be set according to actual conditions.
[0070] In some embodiments, Figure 7 As shown, after step 120 determines whether the to-be-accessed frequency exceeds the access frequency threshold, the method further includes:
[0071] Step 120b: Determine whether the to-be-accessed frequency is greater than the sum of its access frequency threshold and all access frequencies that can be obtained from the access frequency threshold of subsequent time periods;
[0072] Step 120c: When the frequency to be accessed is greater than the sum of its access frequency threshold and all access frequencies that can be obtained from the access frequency threshold of subsequent time periods, intercept the service access request.
[0073] In this step, when the number of visits in the current time period reaches the sum of the maximum frequency + the maximum loan amount, subsequent requests in this time period will be directly blocked and lending will not be possible.
[0074] The embodiment of the present invention can limit the user's access frequency and flexibly compensate for the shortage of the user's available access frequency in a certain period of time by obtaining a part of the access frequency from the access frequency threshold of the subsequent time period when the user's access frequency in the current time period exceeds the access frequency threshold, and compensate the current time period as a supplementary access frequency. This can flexibly realize high-frequency access control.
[0075] Figure 8 A schematic diagram of the structure of a service access frequency control device provided by an embodiment of the present invention is shown.
[0076] like Figure 8 As shown, the device 300 includes:
[0077] The acquisition module 301 is used to acquire a service access request of a user, wherein the service access request includes the frequency of the user to be accessed in the current time period; the service access includes multiple time periods, and each time period is set with the same access frequency threshold; the determination module 302 is used to determine whether the frequency to be accessed exceeds the access frequency threshold;
[0078] The compensation module 303 is used to obtain a part of the access frequency from the access frequency threshold of the subsequent time period as a supplementary access frequency compensation to the current time period when the access frequency exceeds the access frequency threshold, wherein the subsequent time period is a time period after the current time period among the multiple time periods.
[0079] The functions or operation steps implemented by the above modules are substantially the same as those in the above method embodiments, and will not be described in detail here.
[0080] The embodiment of the present invention can limit the user's access frequency and flexibly compensate for the shortage of the user's available access frequency in a certain period of time by obtaining a part of the access frequency from the access frequency threshold of the subsequent time period when the user's access frequency in the current time period exceeds the access frequency threshold, and compensate the current time period as a supplementary access frequency. This can flexibly realize high-frequency access control.
[0081] Fig. 9 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention is shown, wherein the computing device may be a server or a server cluster, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
[0082] like Fig. 9 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0083] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements used by a user. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned embodiment of the service access frequency control method.
[0084] Specifically, the program 410 may include program code including computer executable instructions.
[0085] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0086] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0087] The embodiment of the present invention can limit the user's access frequency and flexibly compensate for the shortage of the user's available access frequency in a certain period of time by obtaining a part of the access frequency from the access frequency threshold of the subsequent time period when the user's access frequency in the current time period exceeds the access frequency threshold, and compensate the current time period as a supplementary access frequency. This can flexibly realize high-frequency access control.
[0088] An embodiment of the present invention provides a computer-readable storage medium, wherein the storage medium stores at least one executable instruction. When the executable instruction is executed on a computing device, the computing device executes the service access frequency control method in any of the above method embodiments.
[0089] An embodiment of the present invention provides a service access frequency control device, which is used to execute the above service access frequency control method.
[0090] An embodiment of the present invention provides a computer program, which can be called by a processor to enable a computing device to execute the service access frequency control method in any of the above method embodiments.
[0091] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed on a computer, the computer executes the service access frequency control method in any of the above method embodiments.
[0092] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description made to specific languages above is for disclosing the best mode of the present invention.
[0093] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0094] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than those expressly recited in each claim.
[0095] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0096] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A service access frequency control method, characterized in that: The method comprises: Acquire a service access request of a user, wherein the service access request includes a frequency of access to be performed by the user in a current time period; the service access includes multiple time periods, and each time period is set with the same access frequency threshold; Determining whether the to-be-accessed frequency exceeds the access frequency threshold; When the frequency to be accessed exceeds the access frequency threshold, a portion of the access frequency is obtained from the access frequency threshold of the subsequent time period as a supplementary access frequency compensation to the current time period, including: starting from the time period after the current time period, a preset proportion of the access frequency is obtained from the access frequency threshold of each time period in turn, until the sum of the access frequency threshold of the current time period and all the obtained access frequencies is equal to the frequency to be accessed in the current time period, or the access frequency threshold of a time period in the subsequent time period is the first threshold, or the access frequency obtained from the access frequency threshold of a time period is the second threshold; wherein the subsequent time period is a time period after the current time period among the multiple time periods; starting from the n+1th time period, the preset proportion of each time period is q n , where n is an integer, n ≥ 1, 0 <q<1。 2. The method according to claim 1, characterized in that The method further comprises: If a portion of the access frequency has been obtained from the subsequent time period to be used as a supplementary access frequency to compensate for other time periods, the access frequency threshold of each time period in the subsequent time period is subtracted from the access frequency that has been compensated for other time periods to update the access frequency threshold of each time period.
3. The method according to claim 1 or 2, characterized in that: After obtaining the service access request of the user, the method further includes: Adding the access time of the service access request to the access time queue corresponding to the user; The queue size of the access time queue including the access time of the current time period is obtained, and the access frequency of the user in the current time period is updated according to the queue size.
4. The method according to claim 1 or 2, characterized in that: The determining whether the to-be-accessed frequency exceeds the access frequency threshold comprises: When the total traffic of the service access is lower than the third threshold and the service concurrency is lower than the fourth threshold, it is determined whether the access frequency exceeds the access frequency threshold.
5. The method according to claim 1 or 2, characterized in that: After determining whether the to-be-accessed frequency exceeds the access frequency threshold, the method further includes: Determine whether the to-be-accessed frequency is greater than the sum of its access frequency threshold and all access frequencies that can be obtained from access frequency thresholds of subsequent time periods; When the frequency to be accessed is greater than the sum of its access frequency threshold and all access frequencies that can be obtained from the access frequency threshold of the subsequent time period, the service access request is intercepted.
6. A service access frequency control device, characterized in that: The device comprises: an acquisition module, used to acquire a service access request of a user, wherein the service access request includes a frequency of access to be performed by the user in a current time period; the service access includes multiple time periods, and each time period is provided with the same access frequency threshold; a determination module, used to determine whether the frequency of access to be performed exceeds the access frequency threshold; A compensation module, used for obtaining a part of the access frequency from the access frequency threshold of a subsequent time period when the frequency to be accessed exceeds the access frequency threshold, as a supplementary access frequency compensation to the current time period, including: starting from the time period after the current time period, sequentially obtaining a preset proportion of the access frequency from the access frequency threshold of each time period, until the sum of the access frequency threshold of the current time period and all the obtained access frequencies is equal to the frequency to be accessed in the current time period, or the access frequency threshold of a time period in the subsequent time period is the first threshold, or the access frequency obtained from the access frequency threshold of a time period is the second threshold; wherein the subsequent time period is a time period after the current time period among the multiple time periods; starting from the n+1th time period, the preset proportion of each time period is q n , where n is an integer, n ≥ 1, 0 <q<1。 7. A computing device, characterized in that include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the service access frequency control method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction. When the executable instruction is executed on a computing device, the computing device executes the operation of the service access frequency control method according to any one of claims 1 to 5.
