A method, device, electronic device and storage medium for requesting speed limit

By obtaining and analyzing the associated information of network requests, filtering and applying the speed limit configuration, the problem of poor user-level concurrent request speed limit in the prior art is solved, and the efficiency and stability of network requests are improved.

CN116016353BActive Publication Date: 2025-02-25BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211559669.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2025-02-25
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

Existing request speed limiting methods are difficult to limit globally on demand for user-level concurrent requests, resulting in the efficiency and stability of network requests being affected.

Method used

By obtaining the request association information of the current network request, determine the user-level concurrent request association data and request speed limit configuration data, filter the target user-level concurrent request association data, and then determine the current based on the target user-level concurrent request association data and request speed limit configuration data. The requested speed limit value for network requests.

Benefits of technology

The global on-demand speed limit for user-level concurrent requests matching the current network request is realized, improving the efficiency and stability of network requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016353B_ABST
    Figure CN116016353B_ABST
Patent Text Reader

Abstract

The present disclosure provides a request rate limiting method, device, electronic device and storage medium, which relates to the field of Internet technology, and specifically to cloud computing, traffic control, system maintenance and other technologies, wherein the method comprises: obtaining request association information of the current network request; determining user-level concurrent request association data and request rate limiting configuration data of the current network request according to the request association information; wherein the user-level concurrent request association data includes concurrent request association data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request; filtering target user-level concurrent request association data from the user-level concurrent request association data according to the request rate limiting configuration data; determining the request rate limiting value of the current network request according to the target user-level concurrent request association data and the request rate limiting configuration data. The embodiments of the present disclosure can improve the efficiency and stability of network requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and specifically to cloud computing, traffic control, system maintenance and other technologies. Background Art

[0002] At present, when users operate the client of some applications, they may initiate a network request through the client to request the server to provide the corresponding service. For example, a user can initiate multiple network requests through the client of a network disk application to request to download or upload the corresponding data. For this type of application, the server usually sets a corresponding speed limit policy to limit the speed of user requests. The purpose of speed limiting is to protect the system or use it for system maintenance by limiting the speed of requests, and to refuse service when the limit rate is reached. It is widely used in various technical fields such as cloud computing. Summary of the invention

[0003] The embodiments of the present disclosure provide a request rate limiting method, device, electronic device and storage medium, which can improve the efficiency and stability of network requests.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for requesting a rate limit, including:

[0005] Get the request-related information of the current network request;

[0006] Determine the user-level concurrent request association data and request rate limit configuration data of the current network request according to the request association information; wherein the user-level concurrent request association data includes concurrent request association data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request;

[0007] Filter target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data;

[0008] The request rate limit value of the current network request is determined according to the target user-level concurrent request association data and the request rate limit configuration data.

[0009] In a second aspect, an embodiment of the present disclosure provides a device for requesting a speed limit, including:

[0010] A request-related information acquisition module is used to obtain the request-related information of the current network request;

[0011] An associated configuration data determination module, configured to determine user-level concurrent request associated data and request rate limit configuration data of the current network request according to the request associated information; wherein the user-level concurrent request associated data includes concurrent request associated data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request;

[0012] a target user-level concurrent request associated data screening module, used for screening target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data;

[0013] The request rate limit value determination module is used to determine the request rate limit value of the current network request according to the target user-level concurrent request association data and the request rate limit configuration data.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the request speed limit method provided by the embodiment of the first aspect.

[0018] In a fourth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method for requesting speed limit provided in the embodiment of the first aspect.

[0019] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements the request rate limit method provided in the embodiment of the first aspect.

[0020] The disclosed embodiment obtains request association information of the current network request initiated by the requesting user, so as to determine the request rate limit configuration data of the current network request and the user-level concurrent request association data of all associated clients of the requesting user according to the request association information, thereby filtering the target user-level concurrent request association data from the user-level concurrent request association data according to the request rate limit configuration data, and then determining the request rate limit value of the current network request according to the filtered target user-level concurrent request association data and the request rate limit configuration data, so as to achieve global on-demand rate limit for the user-level concurrent requests matching the current network request, thereby solving the problem that the existing request rate limit method is difficult to perform global on-demand rate limit for the user-level concurrent requests, thereby improving the efficiency and stability of the network request.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0023] Figure 1 is a flow chart of a method for requesting speed limit provided by an embodiment of the present disclosure;

[0024] Figure 2 is a flow chart of a method for requesting speed limit provided by an embodiment of the present disclosure;

[0025] Figure 3 is a flow chart of a method for requesting speed limit provided by an embodiment of the present disclosure;

[0026] Figure 4 It is a schematic diagram of the effect of processing each request according to the real-time concurrency provided by an embodiment of the present disclosure;

[0027] Figure 5 This is a schematic diagram of the effect of limiting the processing of each request within different request rate limit periods provided by an embodiment of the present disclosure;

[0028] Figure 6 is a structural diagram of a speed limit request device provided by an embodiment of the present disclosure;

[0029] Figure 7 It is a structural diagram of an electronic device used to implement the method for requesting speed limit in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0031] For various applications, the purpose of rate limiting is mainly to protect the system by limiting the speed of concurrent access or requests, or limiting the speed of requests within a time window, and denying service when the rate limit is reached. Take online disk applications as an example. Online disk applications are accessed by tens of millions of users every day, and the user download bandwidth demand is huge, even exceeding the physical upper limit of the network link that the online disk server can provide. At present, some black industries often use illegal technical means to help malicious users find ways to bypass the user rights and interests setting restrictions of online disk products, break through the online disk speed limit conditions for malicious users, and then seek illegal economic benefits. To address such problems, online disks usually need to configure a strategy to limit the download speed for such users within a certain period of time (such as 1 week) after discovering that the user is using cheating software.

[0032] At present, the conventional request rate limiting policies provided by applications that need to rate limit requests to the user side mainly include the following types:

[0033] (1) Single connection speed limit: Each user request is stateless. Single connection speed limit sets a separate speed limit for each network request, and requests do not affect each other.

[0034] (2) Single-client speed limit method: A running client is speed-limited as a whole. If the user opens multiple concurrent requests in the client, the speed of each concurrent request can be evenly distributed according to the speed limit threshold.

[0035] (3) Centralized speed limit control on the server: The centralized flow control service is implemented on the server. The speed limit value of the network request is directly updated according to the total speed limit threshold and the current total speed and other conditions. If the network request exceeds the total threshold, the request may be directly rejected.

[0036] The main disadvantages of the conventional technical solution for requesting speed limiting are:

[0037] (1) The single-connection speed limit method cannot cope with various types of concurrency issues, including server interface-level concurrency and user-level concurrency. For the client of the application, most cheating behaviors usually increase the total request speed by enabling high concurrency. In other words, the single-connection speed limit method cannot effectively solve the problem of request concurrency.

[0038] (2) The single-client speed limit method cannot solve the problem of concurrent requests from multiple clients, because many application products allow users to log in through multiple different clients at the same time.

[0039] (3) The server-side centralized speed limit control method cannot solve the speed balance problem in multiple concurrent request scenarios, nor can it configure personalized speed limit strategies for user-level concurrent requests.

[0040] In one example, Figure 1 is a flow chart of a request rate limiting method provided by an embodiment of the present disclosure. This embodiment is applicable to the case of realizing global on-demand rate limiting for concurrent user-level requests. The method can be executed by a request rate limiting device, which can be implemented by software and / or hardware and can generally be integrated in an electronic device. The electronic device can be a server device. Accordingly, Figure 1 As shown, the method includes the following operations:

[0041] S110: Obtain request association information of the current network request.

[0042] Among them, the current network request can be any type of network request received by the server at the current moment, initiated by any type of current request client of the requesting user through the application, for example, it can be a download request for network resources or an upload request for local resources, etc. The disclosed embodiment does not limit the request type of the current network request. The request associated information can be any information associated with the current network request, for example, it can include but is not limited to the user ID (Identity document) corresponding to the request, the type of client that initiated the current network request, and the request speed of the current network request, etc.

[0043] In the disclosed embodiment, whenever a user initiates a network request through a client and the network request reaches the corresponding server, the server can use the network request received at the current moment as the current network request and execute the corresponding request rate limit policy for the received current network request.

[0044] S120. Determine user-level concurrent request association data and request rate limit configuration data of the current network request according to the request association information; wherein the user-level concurrent request association data includes concurrent request association data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request.

[0045] Among them, all associated clients of the requesting user can be understood as all client types that the requesting user interacts with the server at the current moment. It is understandable that the requesting user may initiate multiple concurrent requests at the same time through the current requesting client, so all associated clients include the current requesting client itself. Concurrent request associated data can be data associated with user-level concurrent requests, and the user-level concurrent request is a concurrent network request initiated by the same requesting user of the current network request, which may not include the current network request. User-level concurrent request associated data is also the relevant data of all user-level concurrent requests initiated by the requesting user through all associated clients at the current moment.

[0046] Specifically, the server can obtain the request association information of the current network request, and determine the user-level concurrent request association data matched by the current network request based on the obtained request association information. Exemplarily, the server can determine the various client types used by the requesting user at the current moment, such as PC (Personal Computer, personal computer) terminal, web (World Wide Web, global wide area network) terminal, Android terminal or iOS (mobile operating system developed by Apple) terminal, etc., based on the request association information of the current network request. Further, the server can use the network request received at the current moment and initiated by the requesting user through all associated clients as the user-level concurrent request of the current network request, and obtain the association information of each user-level concurrent request, such as the number of concurrent requests and the speed of each concurrent request, so as to determine the user-level concurrent request association data of the current network request based on the obtained association information of each user-level concurrent request.

[0047] At the same time, the server also needs to determine the request rate limit configuration data that matches the current network request based on the request association information. Exemplarily, the server can match the request rate limit configuration data of the current network request from the stored request rate limit configuration data of each user based on the ID identifier and / or client type of the requesting user of the current network request.

[0048] Optionally, the request speed limit configuration data may include, but is not limited to, various configuration data that can be used to determine the speed limit value, such as a threshold value of request concurrency and / or a threshold value of request total speed limit. At the same time, the request speed limit configuration data may also include a preset speed balancing mechanism to perform speed balancing processing on each concurrent request of the requesting user through the preset speed balancing mechanism. The request speed limit configuration data may include configuring a personalized speed limit strategy for concurrent requests at the user level.

[0049] Correspondingly, the server can execute the corresponding request rate limit policy for the current network request according to the obtained user-level concurrent request association data and request rate limit configuration data.

[0050] S130: Filter target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data.

[0051] The target user-level concurrent request associated data may be the target user-level concurrent request related data, and may also be understood as the concurrent request related data initiated by the requesting user through the target associated client, where the target associated client is the client type specified by the request speed limit configuration data, and may include the current requesting client itself. The target user-level concurrent request may be some or all of the concurrent requests initiated by the requesting user that are referenced when determining the speed limit value for the current network request.

[0052] It is understandable that the specific speed limit policy content included in the request speed limit configuration data can specify which user-level concurrent requests of the requesting user are used to speed limit the current network request. Exemplarily, for requesting user 1, the speed limit policy set by the server is that all concurrent requests initiated by the client type of the Android end of requesting user 1 are regarded as target user-level concurrent requests, so it is necessary to refer to the concurrent requests initiated by the client type of the Android end of requesting user 1 to speed limit the current network request of requesting user 1.

[0053] Therefore, after the server determines the user-level concurrent request association data and the request rate limit configuration data of the current network request, it is necessary to parse the user-level concurrent request association data and the request rate limit configuration data to determine the target associated client of the requesting user according to the parsing result of the request rate limit configuration data, and filter the target user-level concurrent request association data from the user-level concurrent request association data according to the identifier of the target associated client of the requesting user and the parsing result of the user-level concurrent request association data.

[0054] S140: Determine a request rate limit value of the current network request according to the target user-level concurrent request association data and the request rate limit configuration data.

[0055] Correspondingly, after filtering and obtaining the target user-level concurrent request associated data, the request rate limit value of the current network request can be determined according to the target user-level concurrent request associated data and the request rate limit configuration data, so that the request rate limit value of the current network request can meet the requirements of global rate limit optimization.

[0056] 0 In addition, the server can also make global on-demand adjustments to the speed limit value of the target user-level concurrent requests matching the current network request based on the target user-level concurrent request association data and the request speed limit configuration data, such as performing speed balancing processing on each concurrent request of the requesting user through a preset speed balancing mechanism, thereby further optimizing the global on-demand speed limit method.

[0057] For example, the server can obtain the request speed and request quantity of the target 5 user-level concurrent requests initiated by the requesting user through the target associated client, and determine the threshold of the total request speed and the threshold of the request concurrency configured for the requesting user according to the request speed limit configuration data, so as to configure the request speed limit value of the current network request according to the threshold of the total request speed and the request speed of each target user-level concurrent request, or according to the threshold of the request concurrency and the target user.

[0058] The number of concurrent user-level requests determines whether the current network request needs to be cached, etc. 0 Optional, when the current request is configured based on the total request speed and the request speed of each target user-level concurrent request

[0059] When requesting a speed limit value for a network request, you can also use the speed balancing mechanism preset in the request configuration data.

[0060] It can be seen that the above-mentioned request speed limiting method can solve the request concurrency problem of single client and multiple clients by screening the target user-level concurrent requests for speed limiting the user's current network request through the speed limit policy set by the user, and determine the request speed limit value of the current network request according to the associated data of the target user-level concurrent requests and the preset request speed limit configuration data, so as to realize global on-demand speed limiting for the user-level concurrent requests matching the current network request, so that the request speed limit value of the current network request reaches the global optimal state, and ensures that the server can efficiently and stably process the current network request, thereby improving the efficiency and stability of the network request.

[0061] The disclosed embodiment obtains the request association information of the current network request initiated by the requesting user, so as to determine the request rate limit configuration data of the current network request and the user-level concurrent request association data of all associated clients of the requesting user according to the request association information, thereby filtering the target user-level concurrent request association data from the user-level concurrent request association data according to the request rate limit configuration data, and then determining the request rate limit value of the current network request according to the filtered target user-level concurrent request association data and the request rate limit configuration data, so as to realize global on-demand rate limit for the user-level concurrent requests matching the current network request, solve the problem that the existing request rate limit method is difficult to perform global on-demand rate limit for the user-level concurrent requests, thereby improving the efficiency and stability of the network request.

[0062] In one example, Figure 2 It is a flow chart of a request rate limiting method provided by an embodiment of the present disclosure. Based on the technical solutions of the above-mentioned embodiments, the embodiment of the present disclosure has been optimized and improved, and provides a variety of specific optional implementation methods for determining the user-level concurrent request association data and request rate limiting configuration data of the current network request according to the request association information, and filtering the target user-level concurrent request association data.

[0063] like Figure 2 A method for requesting rate limiting is shown, comprising:

[0064] S210: Obtain request association information of the current network request.

[0065] The request-related information may include a request subject.

[0066] The request subject may be relevant information of the requesting user.

[0067] S220: Determine, according to the request subject in the request association information, the associated user-level concurrent request that matches the current network request.

[0068] Among them, the associated user-level concurrent request is the concurrent request initiated by the requesting user at the same time, which is being processed by the server at the current moment when the current network request is received. The concurrent request can be initiated by other clients or by the same client that initiates the current network request. The embodiments of the present disclosure do not limit this. In other words, the associated user-level concurrent request can be all the associated user-level concurrent requests of the requesting user at the current moment. Similarly, the associated user-level concurrent request can be a concurrent upload request or download request of the requesting user.

[0069] Specifically, the server can determine the request subject of the current network request based on the request association information of the current network request. Further, the server can determine the associated user-level concurrent requests that match the current network request based on the request subject. For example, the server can determine the concurrent requests currently initiated by the requesting user to the server through all clients based on the request subject, and use them as the associated user-level concurrent requests.

[0070] In an optional embodiment of the present disclosure, the request subject may include a requesting user identifier and a requesting client identifier; determining the associated user-level concurrent request that matches the current network request based on the request subject in the request association information may include: determining the associated user concurrent request end of the current network request based on the requesting user identifier; using the associated request of the associated user concurrent request end at the current moment as the associated user-level concurrent request; wherein the requesting client identifier is used to determine the target speed limit subject type based on the request speed limit configuration data.

[0071] Among them, the requesting user identifier can be any identifier type that can uniquely identify the requesting user, such as the account registered by the requesting user. The requesting client identifier can uniquely identify the type of client that initiates the request. The associated user concurrent request end can be the client that initiates all associated user-level concurrent requests of the current network request that the server is processing at the current moment, and can include the client itself that initiates the current network request, as well as other clients that request the user to initiate concurrent requests. It is understandable that the associated user concurrent request ends of different users may be different. The associated request of the associated user concurrent request end at the current moment can be the network request just initiated by the associated user concurrent request end at the current moment, or it can be the network request of the associated user concurrent request end that the server is processing at the current moment. The target speed limit subject type can be the target associated client type, and the target associated client can be the client that initiates the target user-level concurrent request.

[0072] In the disclosed embodiment, the server can specifically determine the associated user concurrent request end of the current network request according to the requesting user identifier. It can be understood that the user identifier corresponding to the associated user concurrent request end is the same as the requesting user identifier. Further, the server can determine the associated request of the associated user concurrent request end at the current moment as an associated user-level concurrent request.

[0073] The above technical solution can quickly match the associated user-level concurrent requests of the current network request through the request user identifier and the request client identifier, thereby achieving extremely fast matching of user-level concurrent requests.

[0074] S230: Determine the user-level concurrent request association data according to the request association information of the associated user-level concurrent requests.

[0075] Specifically, the server may obtain any associated request-related information such as the request speed and the request quantity associated with the user-level concurrent request, and determine it as the user-level concurrent request-related data.

[0076] S240: Match preset request configuration data according to the request subject in the request association information to obtain request rate limit configuration data of the current network request.

[0077] The preset request configuration data is the request configuration data that the server matches for all users.

[0078] Optionally, the server can determine the request user identifier that matches the request user based on the request subject in the request association information, so as to match the request speed limit configuration data configured for the request user from the preset request configuration data based on the request user identifier that matches the request user. If different clients of the request user set different request speed limit configuration data, the server can also determine the request user identifier and request client identifier that match the request user based on the request subject in the request association information, so as to match the request speed limit configuration data configured for the current request client of the request user from the preset request configuration data based on the request user identifier and request client identifier that match the request user. Among them, the current request client is the client that the request user initiates the current network request.

[0079] The above technical solution improves the efficiency of obtaining user-level concurrent request association data and request speed limit configuration data by determining user-level concurrent request association data according to the request subject and current request speed of request association information, and determining request speed limit configuration data according to the request subject.

[0080] S250: Determine a target speed limit subject type according to the requested speed limit configuration data.

[0081] It can be understood that the target rate limit subject type may include a target client type specified from all associated clients, and the specified target client type may include the current requesting client itself.

[0082] S260: Filter target user-level concurrent request associated data from the user-level concurrent request associated data according to the target rate limit subject type.

[0083] Exemplarily, the server can determine the client identifier of the target client based on the target speed limit subject type, and match the user-level concurrent request association data based on the client identifier of the target client, so as to use the request association data of the target user-level concurrent request initiated by the target client in the user-level concurrent request association data as the target user-level concurrent request association data.

[0084] S270: Determine a request rate limit value of the current network request according to the target user-level concurrent request association data and the request rate limit configuration data.

[0085] The above technical solution can realize personalized global on-demand speed limiting processing for the current network request by using the target user-level concurrent request association data, by filtering the target user-level concurrent request association data according to the target speed limiting subject type.

[0086] In one example, Figure 3 It is a flow chart of a request rate limiting method provided by an embodiment of the present disclosure. Based on the technical solutions of the above-mentioned embodiments, the embodiment of the present disclosure has been optimized and improved, and a plurality of specific optional implementation methods for determining the request rate limit value of the current network request according to the target user-level concurrent request association data and the request rate limit configuration data are provided.

[0087] like Figure 3 A method for requesting rate limiting is shown, comprising:

[0088] S310: Obtain request association information of the current network request.

[0089] S320: Determine user-level concurrent request association data and request rate limit configuration data of the current network request according to the request association information.

[0090] The user-level concurrent request associated data includes concurrent request associated data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request.

[0091] S330: Filter target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data.

[0092] S340: Determine a request concurrency threshold and a request total speed threshold of the current network request according to the request speed limit configuration data.

[0093] The request concurrency threshold may be a set upper limit of the request concurrency. The so-called request concurrency is the number of all requests at the current moment. The request total speed threshold may be a set upper limit of the request total speed. The so-called request total speed is the sum of all request speeds at the current moment.

[0094] S350: Determine the real-time request concurrency and the total real-time request speed at the current moment according to the target user-level concurrent request association data and the request association information of the current network request.

[0095] The real-time request concurrency may be the sum of the number of requests of each network request at the current moment, and the real-time request total speed may be the sum of the request speeds of each network request at the current moment.

[0096] Specifically, the server can count the number of requests of each target user-level concurrent request according to the target user-level concurrent request association data, and count the real-time request concurrency at the current moment according to the number of requests of each target user-level concurrent request and the current network request. At the same time, the server can count the request speed of each target user-level concurrent request according to the target user-level concurrent request association data, and count the total real-time request speed at the current moment according to the request speed of each target user-level concurrent request and the request speed of the current network request.

[0097] S360: Determine a request rate limit value of the current network request according to the first size relationship and / or the second size relationship.

[0098] The first size relationship is the size relationship between the real-time request concurrency and the request concurrency threshold, and the second size relationship is the size relationship between the real-time request total speed and the request total speed threshold.

[0099] Correspondingly, the request speed limit value of the current network request is determined based on the first size relationship and / or the second size relationship. The basic speed limit principle followed can be to make the speed limit value of the current network request meet the requirements of request concurrency, and to maximize the total request speed of the current network request and each target user-level concurrent request to be close to the total request speed limit threshold.

[0100] The above technical solution determines the real-time request concurrency and the total speed of real-time requests at the current moment, and determines the request speed limit value of the current network request according to the size relationship between the real-time request concurrency and the request concurrency threshold, and the size relationship between the real-time request total speed and the request total speed threshold. It can simultaneously meet the requirements of concurrency and total request speed limit, and improve the rationality of request speed limit.

[0101] In an optional embodiment of the present disclosure, determining the request rate limit value of the current network request based on the first size relationship and / or the second size relationship may include: when it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, determining the request rate limit value of the current network request based on the second size relationship; when it is determined that the real-time request concurrency is greater than the request concurrency threshold, determining the request rate limit value of the current network request based on a preset rate limit policy, and processing the current network request according to the preset processing policy.

[0102] The preset speed limit strategy may be a speed limit strategy executed on the current network request when the concurrency exceeds the limit. The preset processing strategy may be a request processing method executed on the current network request when the concurrency exceeds the limit.

[0103] Specifically, if the server determines that the real-time request concurrency is less than or equal to the request concurrency threshold, it indicates that the real-time request concurrency of the requesting user at the current moment has not exceeded the limit. At this time, the request speed limit value of the current network request can be determined based on the size relationship between the total speed of real-time requests and the total speed threshold of requests. Correspondingly, if the server determines that the real-time request concurrency is greater than the request concurrency threshold, it indicates that the real-time request concurrency of the requesting user at the current moment has exceeded the limit. At this time, the speed limit strategy can be preset to determine the request speed limit value of the current network request, and the current network request can be processed according to the preset processing strategy to effectively solve the problem of exceeding the real-time request concurrency limit.

[0104] In an optional embodiment of the present disclosure, determining the request speed limit value of the current network request based on the second size relationship may include: when it is determined that the real-time request total speed is less than or equal to the request total speed threshold, determining the request speed limit value of the current network request based on the single connection speed limit value; when it is determined that the real-time request total speed is greater than the request total speed threshold, determining the request speed limit value of the current network request based on a gradient descent strategy.

[0105] The single connection speed limit value may be a maximum speed limit value set for each network request. The gradient descent strategy may be a strategy for determining the request speed limit value of a network request step by step according to a certain level gradient.

[0106] In the disclosed embodiment, when the server determines that the real-time request concurrency is less than or equal to the request concurrency threshold, and the total speed of the real-time requests is less than or equal to the total speed threshold, it indicates that the current bandwidth resources are sufficient, and there is no need to adjust the speed limit value of the current network request. The request speed limit value of the current network request can be directly determined based on the single connection speed limit value. For example, when the single connection speed limit value is 2Mbps, the request speed limit value of the current network request can be determined to be 2Mbps. When the server determines that the real-time request concurrency is less than or equal to the request concurrency threshold, but the total speed of the real-time requests is greater than the total speed threshold, a gradient descent strategy can be used to determine the request speed limit value of the current network request based on the ranking of the current network request in each overspeeding request.

[0107] The above technical solution adopts different speed limit strategies for the two situations of exceeding the total speed of real-time requests and not exceeding the total speed when the real-time request concurrency is not exceeded, which can maximize the efficiency of user requests and the security of the server.

[0108] In an optional embodiment of the present disclosure, determining the request rate limit value of the current network request according to the gradient descent strategy may include: determining the request over-limit ranking value and the gradient descent base of the current network request; determining the gradient descent multiple of the current network request according to the request over-limit ranking value and the gradient descent base; determining the request rate limit value of the current network request according to the single connection rate limit value of the current network request and the gradient descent multiple.

[0109] The request over-limit ranking value may be the ranking of the current network request among the over-speed network requests. The gradient descent base may be the base set for the network request for lowering the speed limit. The gradient descent multiple may be a multiple value calculated from the request over-limit ranking value and the gradient descent base.

[0110] In a specific example, assuming that the total request speed threshold is 4 (only numerical examples will be used to illustrate the speed later, and the speed unit will be omitted), before the current network request arrives at the server, there are already 4 concurrent target user-level concurrent requests, which are target user-level concurrent request 1, target user-level concurrent request 2, target user-level concurrent request 3 and target user-level concurrent request 4 in the order in which the requests arrive at the server. Among the above target user-level concurrent requests, the sum of the request speeds of target user-level concurrent request 1 and target user-level concurrent request 2 has reached 4, then target user-level concurrent request 3 and target user-level concurrent request 4 become overspeed target user-level concurrent requests. After the current network request arrives at the server at the current moment, the above 4 target user-level concurrent requests are still in the execution state, then target user-level concurrent request 3 is the first overspeed network request, target user-level concurrent request 4 is the second overspeed network request, and the current network request is the third overspeed network request. Correspondingly, the request over-limit ranking value of target user-level concurrent request 3 is 1, the request over-limit ranking value of target user-level concurrent request 4 is 2, and the request over-limit ranking value of the current network request is 3. If the gradient descent base is set to 1 / 2, the gradient descent multiple of target user-level concurrent request 3 is (1 / 2) 1 That is, 1 / 2. The gradient descent multiple for the target user-level concurrent request 4 is (1 / 2) 2 That is 1 / 4, the gradient descent multiple requested by the current network is (1 / 2) 3 That is, 1 / 8. Correspondingly, if the single connection speed limit value of each network request is 2, the request speed limit value of the target user-level concurrent request 3 is 2*1 / 2, that is, 1, the request speed limit value of the target user-level concurrent request 4 is 2*1 / 4, that is, 1 / 2, and the request speed limit value of the current network request is 2*1 / 84, that is, 1 / 4.

[0111] It can be seen that in the above example, the gradient descent strategy is 1 / 2 of the single connection speed limit. n Executed, where n represents the request over-limit ranking value of the network request. That is, the first over-speed request is divided by 2 based on the single connection speed limit value, the second over-speed request is divided by 4 based on the single connection speed limit value, the third over-speed request is divided by 8 based on the single connection speed limit value, and so on.

[0112] That is, when the current total speed exceeds the limit but the concurrency does not exceed the limit, the gradient descent strategy can be used to limit the speed of concurrent requests of the requesting user to ensure that subsequent requests can be executed. The advantage of this setting is that instead of directly rejecting requests directly, it can ensure that multiple concurrent requests of the user can be executed in a single-user multi-concurrency scenario, and at the same time ensure that the total speed of each concurrent request will not be too high.

[0113] In an optional embodiment of the present disclosure, after determining the request speed limit value of the current network request according to the single connection speed limit value of the current network request and the gradient descent multiple, it may also include: determining the total concurrent request speed of the target associated user-level concurrent requests at the current moment according to the target user-level concurrent request associated data; calculating the speed limit threshold difference according to the concurrent request total speed and the request total speed threshold; and when it is determined that the request speed limit value of the current network request is less than the speed limit threshold difference, updating the request speed limit value of the current network request according to the speed limit threshold difference.

[0114] The total concurrent request speed may be the sum of the speeds of the user-level concurrent requests associated with each target. The speed limit threshold difference is the difference between the total request speed threshold and the total concurrent request speed.

[0115] In the disclosed embodiment, after the request speed limit value of the current network request is determined by the gradient descent strategy, in order to avoid excessive speed limit, it is necessary to detect the rationality of the request speed limit value of the current network request determined by the gradient descent strategy. Specifically, the server can determine the total concurrent request speed of each target-associated user-level concurrent request at the current moment according to the associated data of each target user-level concurrent request, and at the same time calculate the speed limit threshold difference using the value of the total request speed threshold minus the total concurrent request speed to determine the maximum speed limit value of the current network request allowed by the server at the current moment. Further, the server can compare the request speed limit value of the current network request determined by the gradient descent strategy with the calculated speed limit threshold difference. If the server determines that the request speed limit value of the current network request is less than the speed limit threshold difference, the request speed limit value of the current network request is updated according to the speed limit threshold difference, that is, the speed limit threshold difference is used as the request speed limit value of the current network request, and the speed limit value determined by the gradient descent strategy is not used as the request speed limit value of the current network request. Correspondingly, if the server determines that the request speed limit value of the current network request is greater than or equal to the speed limit threshold difference, the speed limit value determined by the gradient descent strategy can be directly used as the request speed limit value of the current network request.

[0116] The above technical solution detects the rationality of the request speed limit value of the current network request determined by the gradient descent strategy, and selects the speed limit threshold difference or the request speed limit value of the current network request determined by the gradient descent strategy according to the detection result as the request speed limit value of the current network request. This can maximize the efficiency of the current network request and avoid causing greater pressure on the bandwidth resources of the server.

[0117] In an optional embodiment of the present disclosure, the request limit method may further include: when determining that the request speed limit cycle is updated and the network requests within the current request speed limit cycle meet the request smoothing processing conditions, calculating the request average speed according to the real-time request concurrency and the request total speed threshold; determining the gradient descent request speed limit value of each network request within the current request speed limit cycle based on the current request speed limit value of each network request and the gradient descent strategy; comparing the gradient descent request speed limit value of the network request with the request average speed, and determining the larger value between the gradient descent request speed limit value and the request average speed as the request speed limit value of the network request; wherein the request smoothing processing conditions include: the real-time request concurrency is greater than or equal to the request concurrency threshold, and the real-time request total speed is greater than or equal to the request total speed threshold.

[0118] Among them, the request speed limit period can be a period for updating the request speed limit value, for example, it can be 5 seconds or 10 seconds, etc., which can be set according to actual business needs. The embodiment of the present disclosure does not limit the time period value of the request speed limit period. The request smoothing condition is the condition under which each network request needs to be smoothed. The average request speed can be the average of the speeds of each network request in the current request speed limit period. The gradient descent request speed limit value is the request speed limit value of each network request calculated using the gradient descent strategy.

[0119] It is understandable that due to the huge online traffic on the server side, which may reach millions of QPS (Queries-per-second), it will bring a huge burden to the overall system if the speed of each network request must be judged and adjusted all the time. Therefore, a request speed limit period can be set for the user's network request. During the request speed limit period, the request speed limit value of each network request remains unchanged. When the request speed limit period is updated, the request speed limit value of each network request can be updated synchronously.

[0120] Specifically, after the server configures the corresponding request speed limit value for each network request of the requesting user, the request speed limit value needs to be kept fixed in the current request speed limit period. When the request speed limit period is updated, the server can continue to determine whether each network request in the current request speed limit period meets the request smoothing processing conditions, that is, determine whether the real-time request concurrency of each network request in the current request speed limit period is greater than or equal to the request concurrency threshold, and whether the total real-time request speed is greater than or equal to the total request speed threshold. If it is determined that each network request within the current request speed limit period meets the request smoothing processing conditions, that is, it is determined that the real-time request concurrency of each network request within the current request speed limit period is greater than or equal to the request concurrency threshold, and the real-time request total speed is greater than or equal to the request total speed threshold, then the server can calculate the average request speed according to the real-time request concurrency and the request total speed threshold, and determine the gradient descent request speed limit value of each network request according to the current request speed limit value of each network request within the current request speed limit period and the gradient descent strategy, further compare the gradient descent request speed limit value of the network request with the request average speed, and determine the larger value between the gradient descent request speed limit value and the request average speed as the request speed limit value of the network request, so as to avoid the low request speed limit value affecting the user experience.

[0121] The above technical solution, by setting the request speed limit period to adjust the speed of each request in a timely manner, can achieve the speed balancing problem in the scenario of multiple concurrent requests, ensure that there will be no requests with always slow speeds, prevent some network requests from starving, and improve the rationality of request speed limits and the efficiency of request processing.

[0122] In an optional embodiment of the present disclosure, determining the request rate limit value of the current network request according to a preset rate limit policy may include: obtaining user association data of the requesting user; and determining the request rate limit value of the current network request according to the user association data.

[0123] The user-related data may be user-related data collected by the server, such as the total historical concurrency of the user and / or the user's special identification, etc. Optionally, the user's special identification may indicate whether the user's historical downloading behavior is reasonable, and classify unreasonable downloading behaviors of different degrees.

[0124] Correspondingly, if the server determines that the real-time request concurrency is greater than the request concurrency threshold, the request speed limit value of the current network request can be determined according to the preset speed limit policy, and the current network request can be processed according to the preset processing policy. Specifically, when determining the request speed limit value of the current network request according to the preset speed limit policy, the user-related data of the requesting user can be obtained to determine the request speed limit value of the current network request based on the obtained user-related data. The advantage of this setting is that it can refer to the relevant information of the requesting user to perform speed limit processing on the current network request with excessive request concurrency, thereby realizing a personalized speed limit processing strategy to meet the speed limit processing requirements of different types of users.

[0125] In an optional embodiment of the present disclosure, determining the request speed limit value of the current network request according to the user association data may include: determining the user speed limit level of the requesting user according to the user association data; when it is determined that the user speed limit level is the target user speed limit level, setting the request speed limit value of the current network request to the target request speed limit value, and refusing to respond to the current network request; or, when it is determined that the user speed limit level is a non-target user speed limit level, setting the request speed limit value of the current network request to the target request speed limit value, and adding the current network request to a request cache queue.

[0126] Among them, the user speed limit level can be a level of a certain speed limit strength or different speed limit methods set for the user. Optionally, the user speed limit level can be determined based on the user's historical access data. The target user speed limit level can be a level type that can reflect the user's bad access behavior. The target request speed limit value can be a request speed limit value set by the user of the target user speed limit level. The request cache queue can be used to cache the user's network requests.

[0127] In the disclosed embodiment, if the server determines that the real-time request concurrency is greater than the request concurrency threshold, it may determine the user speed limit level of the requesting user based on the user association data of the requesting user. Furthermore, the server may match the user speed limit level of the requesting user with the preset request configuration data. If the user speed limit level is determined to be the target user speed limit level based on the matching result, it indicates that the requesting user is largely an abnormal user, for example, a user who uses third-party software to break the conventional request speed limit configuration and initiates a large number of concurrent requests at the same time. At this point, the server may set the request speed limit value of the current network request initiated by such requesting user to the target request speed limit value, for example, it may be set to 0, and refuse to respond to the current network request.

[0128] It is understandable that, since the server is centrally controlled, the number of connections on the client side and the number of connections on the server side may be different. For example, if a single process on the server is blocked, the client thinks it has failed and retries to initiate the request. At this time, the client thinks that there is only one request connection being processed, while the server may think that there are two request connections for the client to be processed in a short period of time. If the server determines that the request connection initiated by the user immediately rejects the next request when the concurrency reaches the upper limit, it will cause the server to misjudge. Therefore, if the server determines that the user speed limit level is a non-target user speed limit level based on the matching result, it indicates that the requesting user is a normal user to a large extent. At this time, the request speed limit value of the current network request can be set to the target request speed limit value, for example, it can be set to 0, and the current network request is added to the request cache queue, and a buffer time is configured for the current network request to determine whether the current network request can be responded to normally at the next moment, instead of directly rejecting the current network request of the requesting user, thereby improving the rationality of network request processing while protecting system security, thereby improving user experience.

[0129] In an optional embodiment of the present disclosure, after adding the current network request to the request cache queue, it may also include: retrieving the current network request from the request cache queue after a set time interval; when it is determined that the real-time request concurrency is greater than the request concurrency threshold, setting the request rate limit value of the current network request to the target request rate limit value, and refusing to respond to the current network request; when it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, determining the request rate limit value of the current network request according to the second size relationship.

[0130] The time interval may be set according to actual needs, such as 1 second or 2 seconds, etc. The embodiment of the present disclosure does not limit the specific time period of the time interval.

[0131] After the current network request is added to the request cache queue, the server can re-acquire the cached current network request from the request cache queue after a set time interval, for example, when the next request processing time is reached. At this time, the server can continue to determine whether the real-time request concurrency is greater than the request concurrency threshold at the current moment of re-acquiring the current network request. If it is determined that the real-time request concurrency is greater than the request concurrency threshold at the current moment of re-acquiring the current network request, it indicates that the request concurrency is still exceeded after the set time interval. The server can set the request speed limit value of the current network request to the target request speed limit value, for example, to 0, and refuse to respond to the current network request. Correspondingly, if the server determines that the real-time request concurrency is less than or equal to the request concurrency threshold, it indicates that the request concurrency is no longer exceeded after the set time interval. The server can determine the request speed limit value of the current network request based on the second size relationship, that is, when it is determined that the real-time request total speed is less than or equal to the request total speed threshold, the request speed limit value of the current network request is determined according to the single connection speed limit value; when it is determined that the real-time request total speed is greater than the request total speed threshold, the request speed limit value of the current network request is determined according to the gradient descent strategy.

[0132] The above technical solution determines the request speed limit value of the current network request according to the size relationship between the real-time request concurrency and the request concurrency threshold, and the size relationship between the real-time request total speed and the request total speed threshold. It can define multiple speed limit levels and realize global on-demand speed limit. At the same time, different speed limit strategies can be set for different scenarios. When the number of concurrent network requests of a single user reaches a certain threshold, subsequent requests are not directly rejected to prevent misjudgment of the server in some scenarios. It also has the ability to smoothly control the speed of multiple concurrent download requests to prevent some requests from starving.

[0133] In one example, a network disk application initiates a download request as a specific example of an application scenario. The request speed limit method provided by the embodiment of the present disclosure can implement graded speed limit for unreasonable behaviors of different levels of users.

[0134] In the specific implementation of request speed limit, two concepts can be defined, namely request subject and speed limit policy. Among them, the request subject can represent the classification of the request, that is, to determine which user initiated the request. The speed limit policy can be a specific speed limit plan.

[0135] Specifically, the request body may include two parts: UID (User Identification) and client type. UID may be the account ID of the network disk user, and client type may refer to the type of client from which the download request comes. Optionally, the value range of client type may include but is not limited to [All, NA, PC, Web, Other], which may be dynamically expanded according to demand. "All" means that speed limit is applied to requests initiated by all clients of the UID; "NA" means that speed limit is applied to requests from iOS and Android terminals of the UID; "PC" means that speed limit is applied to requests from personal computers (such as clients of Windows, MAC, Unix, etc.) of the UID; "Web" means that speed limit is applied to requests from browsers of the UID; "Other" means other unknown clients, such as applications from third-party developers. For users of different levels, the value range of client types that need speed limit can be set separately. For example, user 1 can be set to "All", which means that speed limit is applied to requests initiated by all clients of the UID; user 1 can be set to "web", which means that speed limit is applied to requests from browsers of the UID.

[0136] The speed limit strategy may include but is not limited to five types of speed limits: single connection speed limit value (Single Speed, SS for short), total speed limit threshold (TotalSpeed, TS for short), maximum concurrency limit (MaxConcurrency, MC for short), total speed overlimit handling strategy (OverspeedStrategy, OS for short), and speed limit release time (Deadline, DL for short). The above values ​​can be dynamically set according to the speed limit level. Among them, the speed limit release time is also the release time of the speed limit strategy set by the user. For example, after user 1 is determined to adopt speed limit strategies such as maximum concurrency limit and total speed overlimit handling strategy, the validity period of the above speed limit strategy can be determined by the speed limit release time.

[0137] Accordingly, the specific processing flow of requesting rate limit includes the following operations:

[0138] When a current network request arrives at the server, the server can first determine the subject type that needs to be speed-limited according to the request speed limit configuration data that matches the current network request. For example, for request 1 initiated by user 1, according to the request speed limit configuration data of request 1, it is determined that the request from the browser of user 1 needs to be speed-limited, then the subject corresponding to request 1 is web. That is, the concurrent requests initiated by user 1 through the web client need to be taken as the target user-level concurrent requests. After determining the subject, query the number of requests currently being processed by the subject, that is, count the real-time request concurrency (hereinafter referred to as real-time concurrency).

[0139] Figure 4 FIG. 1 is a schematic diagram of the effect of processing each request according to the real-time concurrency provided by the embodiment of the present disclosure. In a specific example, Figure 4 As shown, if the server determines that the real-time concurrency has not reached the upper limit (MC), it will continue to determine the speed limit value of the current network request based on the total speed of real-time requests (hereinafter referred to as the total speed); otherwise, determine the overspeed processing strategy (OS). If the overspeed processing strategy is direct rejection, the request is directly rejected. It should be noted that the server will not directly reject the request by default, and this function will only be enabled for users of certain levels. If the overspeed processing strategy is not a direct rejection, the current network request will be inserted into the waiting queue and taken out in the next time window to determine whether the real-time concurrency has dropped below MC. If it is determined that the real-time concurrency has dropped below MC when the current network request is taken out in the next time window, the request will be executed; otherwise, the request will be rejected again to avoid misjudgment of the request by the server in some scenarios.

[0140] Accordingly, when judging the speed limit value of the current network request based on the total speed, smooth speed control can be used as the basic speed limit principle. Specifically, when the current total speed exceeds the limit, but the concurrency does not exceed the limit, the server can use the gradient descent strategy to determine the speed limit value of the current network request to ensure that subsequent requests can be executed instead of directly rejecting them. At the same time, it is necessary to be able to adjust the speed of each request in a timely manner to ensure that there are no requests that are always very slow.

[0141] It should be noted that the gradient descent strategy can be set at 1 / 2 of the single connection speed limit. n Execution. That is, the speed of the first speeding request is divided by 2, the second by 4, the third by 8, and so on. The advantage of this setting is that in a single-user multi-concurrency scenario, multiple requests can be executed at the same time, and the total speed is not too high. The gradient descent strategy is executed when each request arrives at the server. However, when the speed value calculated by the gradient descent strategy plus the current total speed is smaller than TS, the speed limit value of the request needs to be set to the difference between TS and the current total speed.

[0142] In the disclosed embodiment, it is necessary to set a request speed limit cycle, and the request speed limit cycle is based on a certain time period (such as 5 seconds, 10 seconds, etc.). In a cycle, a fixed speed limit value is set for each request, and when the cycle alternates, the speed limit value of each request is updated again. The speed update strategy when the cycle alternates can be specifically: first calculate the average speed of each request in the current cycle; secondly, calculate the gradient descent speed limit value s of each request according to the gradient descent strategy. If it is determined that s is less than or equal to the average speed, the request speed is set to the average speed, otherwise it is set to s.

[0143] Figure 5 is a schematic diagram of the effect of limiting the processing of each request within different request rate limit periods provided by the embodiment of the present disclosure. In a specific example, Figure 5 As shown in the figure, assume that the single connection speed limit SS is set to 1, TS is set to 2, and MC is set to 5. In cycle 1, requests 1 and 2 arrive at the server first in order. At this time, the total speed and concurrency have not reached the limit. The speed limit values ​​of requests 1 and 2 can be determined according to the single connection speed limit SS. When requests 3, 4, and 5 arrive in order, the total speed limit reaches the upper limit, but the concurrency does not reach the upper limit. The gradient descent strategy can be implemented for requests 3, 4, and 5, and the speed limits are implemented at 1 / 2, 1 / 4, and 1 / 8 of the single connection speed limit, respectively.

[0144] In cycle 2, readjust the speed of each request to prevent some requests from being too slow. First, calculate the average speed according to the real-time concurrency and TS, that is, 2 / 5=0.4. Then, compare the current speed of each request with the speed limit value after one gradient descent according to the gradient descent strategy, and take the larger value. In this example, the average speed is 0.4, but the current speed of request 1 and request 2 is 1, and after one gradient descent, it is 0.5, so the larger value of 0.5 is taken. When request 6 arrives, the current real-time concurrency has reached MC, and request 6 is temporarily added to the cache queue and waits. Wait until the next moment, after request 3 is processed and the number of request connections is released, request 6 is restarted. When request 6 is restarted, the total speed of the existing requests is 1.8, which will exceed TS 2 after adding the new request 6. The speed limit value of speed limit 2 minus the current total speed 1.8 is 0.2, and the speed limit value calculated by gradient descent is 0.5, so the larger value 0.5 is taken as the speed limit value of request 6. When request 7 arrives, the real-time concurrency and total speed are both lower than the threshold, and the request is executed at a single connection speed limit of 1.

[0145] In cycle 3, the remaining three requests are still being executed, and the speed of each request is readjusted to TS / 3 = 0.67. When request 8 arrives, the real-time concurrency and total speed are both below the threshold, and it is executed with a single connection speed limit of 1. When requests 9 and 10 arrive, the real-time total speed exceeds the limit, so the speed limits of requests 9 and 10 are set to 0.5 and 0.25 respectively according to the gradient descent.

[0146] In cycle 4, the remaining 4 requests are still being executed, and the speed of each request is readjusted to TS / 4=0.5.

[0147] In cycle 5, the remaining 2 requests are still being executed, and the speed of each request is readjusted to 1.

[0148] On the basis of the above scheme, when a request reaches the server, the priority influencing factor can also be considered to determine the speed limit value for the request. For example, for requests sent by users of different membership levels, the user UID in the request can be identified to match the speed limit policies of different user levels. Among them, the speed limit policies of different user levels are the same, and the settings of various thresholds in the speed limit policy, such as concurrency and total speed limit threshold, can be set differently.

[0149] At the same time, when determining the request speed limit value according to the gradient descent strategy, other weight factors can be considered at the same time. The weight factor can be determined based on the historical request data of the client that initiates the request. In addition to considering unreasonable download behavior, the weight factor can also consider other factors. For example, when a certain type of user initiates a request at a long interval, even if it may exceed the concurrency threshold, if it does not exceed the higher concurrency threshold set for the second time, such as the first concurrency threshold is 5 and the second concurrency threshold is 10, then the gradient descent strategy can be used to limit the speed of the user's request. A single connection speed limit strategy can be used or the speed limit can be set directly to provide such users with a good user experience, which is conducive to recovering lost user resources.

[0150] Compared with the existing speed limit strategy, the above technical solution realizes a true global speed limit function, which can make network requests efficient and stable. Through a special concurrency control strategy, misjudged rejection of requests can be avoided as much as possible. At the same time, it has the ability of graded speed limit, and can define multiple speed limit levels. At the same time, different speed limit strategies can be set for different scenarios. When the number of concurrent download requests of a single user reaches a certain threshold, subsequent requests are not directly rejected to prevent misjudgment of the server in some scenarios. Multiple concurrent download requests have the ability to dynamically adjust the speed smoothly, which can prevent some requests from starving.

[0151] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information (such as user-related data, etc.) are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0152] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present disclosure.

[0153] In one example, Figure 6 1 is a structural diagram of a request rate limiting device provided by an embodiment of the present disclosure. The embodiment of the present disclosure can be applied to achieve global on-demand rate limiting for user-level concurrent requests. The device is implemented by software and / or hardware and is specifically configured in an electronic device. The electronic device can be a server device.

[0154] like Figure 6The request rate limiting device 600 shown in the figure comprises: a request associated information acquisition module 610, an associated configuration data determination module 620, a target user level concurrent request associated data screening module 630 and a request rate limit value determination module 640.

[0155] The request associated information acquisition module 610 is used to acquire the request associated information of the current network request;

[0156] The associated configuration data determination module 620 is used to determine the user-level concurrent request associated data and the request rate limit configuration data of the current network request according to the request associated information; wherein the user-level concurrent request associated data includes the concurrent request associated data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request;

[0157] A target user-level concurrent request associated data screening module 630 is used to screen target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data;

[0158] The request rate limit value determination module 640 is used to determine the request rate limit value of the current network request according to the target user-level concurrent request association data and the request rate limit configuration data.

[0159] The disclosed embodiment obtains request association information of the current network request initiated by the requesting user, so as to determine the request rate limit configuration data of the current network request and the user-level concurrent request association data of all associated clients of the requesting user according to the request association information, thereby filtering the target user-level concurrent request association data from the user-level concurrent request association data according to the request rate limit configuration data, and then determining the request rate limit value of the current network request according to the filtered target user-level concurrent request association data and the request rate limit configuration data, so as to achieve global on-demand rate limit for the user-level concurrent requests matching the current network request, thereby solving the problem that the existing request rate limit method is difficult to perform global on-demand rate limit for the user-level concurrent requests, thereby improving the efficiency and stability of the network request.

[0160] Optionally, the request association information includes a request body; the associated configuration data determination module 620 is specifically used to: determine the associated user-level concurrent request matching the current network request according to the request body in the request association information; determine the user-level concurrent request association data according to the request association information of the associated user-level concurrent request; match the preset request configuration data according to the request body in the request association information to obtain the request rate limit configuration data of the current network request.

[0161] Optionally, the request body includes a requesting user identifier and a requesting client identifier; the associated configuration data determination module 620 is specifically used to: determine the associated user concurrent requesting end of the current network request according to the requesting user identifier; use the associated request of the associated user concurrent requesting end at the current moment as the associated user-level concurrent request; wherein the requesting client identifier is used to determine the target speed limit subject type according to the request speed limit configuration data.

[0162] Optionally, the target user-level concurrent request associated data screening module 630 is specifically used to: determine the target speed limit subject type according to the request speed limit configuration data; and screen the target user-level concurrent request associated data from the user-level concurrent request associated data according to the target speed limit subject type.

[0163] Optionally, the request speed limit value determination module 640 is specifically used to: determine the request concurrency threshold and the request total speed threshold of the current network request according to the request speed limit configuration data; determine the real-time request concurrency and the real-time request total speed at the current moment according to the target user-level concurrent request association data and the request association information of the current network request; determine the request speed limit value of the current network request according to the first size relationship and / or the second size relationship; wherein the first size relationship is the size relationship between the real-time request concurrency and the request concurrency threshold, and the second size relationship is the size relationship between the real-time request total speed and the request total speed threshold.

[0164] Optionally, the request speed limit value determination module 640 is specifically used to: when it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, determine the request speed limit value of the current network request according to the second size relationship; when it is determined that the real-time request concurrency is greater than the request concurrency threshold, determine the request speed limit value of the current network request according to a preset speed limit strategy, and process the current network request according to the preset processing strategy.

[0165] Optionally, the request speed limit value determination module 640 is specifically used to: when it is determined that the real-time request total speed is less than or equal to the request total speed threshold, determine the request speed limit value of the current network request according to the single connection speed limit value; when it is determined that the real-time request total speed is greater than the request total speed threshold, determine the request speed limit value of the current network request according to the gradient descent strategy.

[0166] Optionally, the request speed limit value determination module 640 is specifically used to: determine the request over-limit ranking value and the gradient descent base of the current network request; determine the gradient descent multiple of the current network request based on the request over-limit ranking value and the gradient descent base; determine the request speed limit value of the current network request based on the single connection speed limit value of the current network request and the gradient descent multiple.

[0167] Optionally, the request speed limit value determination module 640 is also used to: determine the total concurrent request speed of the target-associated user-level concurrent requests at the current moment based on the target user-level concurrent request associated data; calculate the speed limit threshold difference based on the total concurrent request speed and the request total speed threshold; and when it is determined that the request speed limit value of the current network request is less than the speed limit threshold difference, update the request speed limit value of the current network request based on the speed limit threshold difference.

[0168] Optionally, the request speed limit value determination module 640 is also used to: when it is determined that the request speed limit cycle is updated and the network requests within the current request speed limit cycle meet the request smoothing processing conditions, calculate the request average speed according to the real-time request concurrency and the request total speed threshold; determine the gradient descent request speed limit value of each network request according to the current request speed limit value of each network request within the current request speed limit cycle and the gradient descent strategy; compare the gradient descent request speed limit value of the network request with the request average speed, and determine the larger value between the gradient descent request speed limit value and the request average speed as the request speed limit value of the network request; wherein the request smoothing processing conditions include: the real-time request concurrency is greater than or equal to the request concurrency threshold, and the real-time request total speed is greater than or equal to the request total speed threshold.

[0169] Optionally, the request rate limit value determination module 640 is specifically used to: obtain user association data of the requesting user; and determine the request rate limit value of the current network request according to the user association data.

[0170] Optionally, the request speed limit value determination module 640 is specifically used to: determine the user speed limit level of the requesting user based on the user association data; when it is determined that the user speed limit level is the target user speed limit level, set the request speed limit value of the current network request to the target request speed limit value, and refuse to respond to the current network request; or, when it is determined that the user speed limit level is a non-target user speed limit level, set the request speed limit value of the current network request to the target request speed limit value, and add the current network request to the request cache queue.

[0171] Optionally, the request rate limit value determination module 640 is also used to: re-acquire the current network request from the request cache queue after a set time interval; when it is determined that the real-time request concurrency is greater than the request concurrency threshold, set the request rate limit value of the current network request to the target request rate limit value, and refuse to respond to the current network request; when it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, determine the request rate limit value of the current network request according to the second size relationship.

[0172] The above-mentioned speed limit requesting device can execute the speed limit requesting method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the speed limit requesting method provided by any embodiment of the present disclosure.

[0173] Since the speed limit request device described above is a device that can execute the speed limit request method in the embodiment of the present disclosure, based on the speed limit request method described in the embodiment of the present disclosure, a person skilled in the art can understand the specific implementation of the speed limit request device of the present embodiment and its various variations, so how the speed limit request device implements the speed limit request method in the embodiment of the present disclosure will not be described in detail here. As long as a person skilled in the art implements the device used by the speed limit request method in the embodiment of the present disclosure, it belongs to the scope of protection of the present disclosure.

[0174] In one example, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0175] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0176] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0177] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0178] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the request speed limit method. For example, in some embodiments, the request speed limit method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or the communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the request speed limit method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the request speed limit method in any other appropriate manner (e.g., by means of firmware).

[0179] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0180] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0181] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0182] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0183] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0184] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server can also be a server of a distributed system, or a server combined with a blockchain.

[0185] The disclosed embodiment obtains request association information of the current network request initiated by the requesting user, so as to determine the request rate limit configuration data of the current network request and the user-level concurrent request association data of all associated clients of the requesting user according to the request association information, thereby filtering the target user-level concurrent request association data from the user-level concurrent request association data according to the request rate limit configuration data, and then determining the request rate limit value of the current network request according to the filtered target user-level concurrent request association data and the request rate limit configuration data, so as to achieve global on-demand rate limit for the user-level concurrent requests matching the current network request, thereby solving the problem that the existing request rate limit method is difficult to perform global on-demand rate limit for the user-level concurrent requests, thereby improving the efficiency and stability of the network request.

[0186] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0187] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for requesting a rate limit, comprising: Get the request-related information of the current network request; Determine the user-level concurrent request association data and request rate limit configuration data of the current network request according to the request association information; wherein the user-level concurrent request association data includes concurrent request association data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request; Filter target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data; The request rate limit value of the current network request is determined according to the target user-level concurrent request association data and the request rate limit configuration data.

2. The method according to claim 1, wherein: The request association information includes a request body; the determining of user-level concurrent request association data and request rate limit configuration data of the current network request according to the request association information includes: Determine, according to the request subject in the request association information, the associated user-level concurrent request matched by the current network request; Determining the user-level concurrent request association data according to the request association information of the associated user-level concurrent request; The preset request configuration data is matched according to the request subject in the request association information to obtain the request rate limit configuration data of the current network request.

3. The method according to claim 2, wherein: The request body includes a requesting user identifier and a requesting client identifier; The determining, according to the request subject in the request association information, the associated user-level concurrent request matched by the current network request includes: Determine the associated user concurrent requesting end of the current network request according to the requesting user identifier; Taking the association request of the associated user concurrent request terminal at the current moment as the associated user-level concurrent request; The requesting client identifier is used to determine the target speed limit subject type according to the requested speed limit configuration data.

4. The method according to claim 1, wherein: The step of filtering target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data includes: Determine the target speed limit subject type according to the requested speed limit configuration data; Target user-level concurrent request associated data is filtered from the user-level concurrent request associated data according to the target rate limit subject type.

5. The method according to claim 1, wherein: The determining the request rate limit value of the current network request according to the target user-level concurrent request association data and the request rate limit configuration data includes: Determine a request concurrency threshold and a request total speed threshold of the current network request according to the request speed limit configuration data; Determine the real-time request concurrency and the total real-time request speed at the current moment according to the target user-level concurrent request association data and the request association information of the current network request; The request rate limit value of the current network request is determined according to the first size relationship and / or the second size relationship; wherein the first size relationship is the size relationship between the real-time request concurrency and the request concurrency threshold, and the second size relationship is the size relationship between the real-time request total speed and the request total speed threshold.

6. The method according to claim 5, wherein: The determining the request rate limit value of the current network request according to the first size relationship and / or the second size relationship includes: In a case where it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, determining a request rate limit value of the current network request according to the second size relationship; When it is determined that the real-time request concurrency is greater than the request concurrency threshold, a request rate limit value of the current network request is determined according to a preset rate limit strategy, and the current network request is processed according to the preset processing strategy.

7. The method according to claim 6, wherein: The determining the request rate limit value of the current network request according to the second size relationship includes: In a case where it is determined that the total speed of real-time requests is less than or equal to the total request speed threshold, determining the request speed limit value of the current network request according to the single connection speed limit value; When it is determined that the total speed of the real-time requests is greater than the total request speed threshold, the request speed limit value of the current network request is determined according to a gradient descent strategy.

8. The method according to claim 7, wherein: The determining the request rate limit value of the current network request according to the gradient descent strategy includes: Determine a request over-limit ranking value and a gradient descent base for the current network request; Determine the gradient descent multiple of the current network request according to the request overlimit ranking value and the gradient descent base; The request rate limit value of the current network request is determined according to the single connection rate limit value of the current network request and the gradient descent multiple.

9. The method according to claim 8, further comprising: Determine the total concurrent request speed of the target associated user-level concurrent requests at the current moment according to the target user-level concurrent request associated data; Calculate a speed limit threshold difference according to the total concurrent request speed and the total request speed threshold; When it is determined that the request speed limit value of the current network request is less than the speed limit threshold difference, the request speed limit value of the current network request is updated according to the speed limit threshold difference.

10. The method according to any one of claims 5 to 9, further comprising: When it is determined that the request speed limit period is updated and the network requests within the current request speed limit period meet the request smoothing processing conditions, the average request speed is calculated according to the real-time request concurrency and the total request speed threshold; Determine a gradient descent request speed limit value for each network request according to the current request speed limit value of each network request within the current request speed limit period and the gradient descent strategy; Compare the gradient descent request speed limit value of the network request with the request average speed, and determine the larger value between the gradient descent request speed limit value and the request average speed as the request speed limit value of the network request; The request smoothing processing condition includes: the real-time request concurrency is greater than or equal to the request concurrency threshold, and the total speed of the real-time requests is greater than or equal to the total speed threshold.

11. The method according to claim 6, wherein: The determining the request rate limit value of the current network request according to the preset rate limit strategy includes: Obtaining user association data of the requesting user; A request rate limit value of the current network request is determined according to the user association data.

12. The method according to claim 11, wherein: The determining the request rate limit value of the current network request according to the user association data includes: Determine the user speed limit level of the requesting user according to the user association data; In the case where it is determined that the user speed limit level is the target user speed limit level, setting the request speed limit value of the current network request to the target request speed limit value, and refusing to respond to the current network request; or In the case where it is determined that the user speed limit level is a non-target user speed limit level, the request speed limit value of the current network request is set to the target request speed limit value, and the current network request is added to a request cache queue.

13. The method according to claim 12, further comprising: After a set time interval, reacquire the current network request from the request cache queue; When it is determined that the real-time request concurrency is greater than the request concurrency threshold, setting the request rate limit value of the current network request to the target request rate limit value, and refusing to respond to the current network request; When it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, a request rate limit value of the current network request is determined according to the second size relationship.

14. A speed limit request device, comprising: A request-related information acquisition module is used to obtain the request-related information of the current network request; An associated configuration data determination module, configured to determine user-level concurrent request associated data and request rate limit configuration data of the current network request according to the request associated information; wherein the user-level concurrent request associated data includes concurrent request associated data of all associated clients of the requesting user; the requesting user is the user who initiates the current network request; a target user-level concurrent request associated data screening module, used for screening target user-level concurrent request associated data from the user-level concurrent request associated data according to the request rate limit configuration data; The request rate limit value determination module is used to determine the request rate limit value of the current network request according to the target user-level concurrent request association data and the request rate limit configuration data.

15. The device according to claim 14, wherein: The request association information includes a request body; the association configuration data determination module is specifically used to: Determine, according to the request subject in the request association information, the associated user-level concurrent request matched by the current network request; Determining the user-level concurrent request association data according to the request association information of the associated user-level concurrent request; The preset request configuration data is matched according to the request subject in the request association information to obtain the request rate limit configuration data of the current network request.

16. The device according to claim 15, wherein: The request body includes a requesting user identifier and a requesting client identifier; the associated configuration data determination module is specifically used to: Determine the associated user concurrent requesting end of the current network request according to the requesting user identifier; Taking the association request of the associated user concurrent request terminal at the current moment as the associated user-level concurrent request; The requesting client identifier is used to determine the target speed limit subject type according to the requested speed limit configuration data.

17. The device according to claim 14, wherein: The target user-level concurrent request associated data screening module is specifically used for: Determine the target speed limit subject type according to the requested speed limit configuration data; Target user-level concurrent request associated data is filtered from the user-level concurrent request associated data according to the target rate limit subject type.

18. The device according to claim 14, wherein: The requested speed limit value determination module is specifically used for: Determine a request concurrency threshold and a request total speed threshold of the current network request according to the request speed limit configuration data; Determine the real-time request concurrency and the total real-time request speed at the current moment according to the target user-level concurrent request association data and the request association information of the current network request; The request rate limit value of the current network request is determined according to the first size relationship and / or the second size relationship; wherein the first size relationship is the size relationship between the real-time request concurrency and the request concurrency threshold, and the second size relationship is the size relationship between the real-time request total speed and the request total speed threshold.

19. The device according to claim 18, wherein: The requested speed limit value determination module is specifically used for: In a case where it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, determining a request rate limit value of the current network request according to the second size relationship; When it is determined that the real-time request concurrency is greater than the request concurrency threshold, a request rate limit value of the current network request is determined according to a preset rate limit strategy, and the current network request is processed according to the preset processing strategy.

20. The device according to claim 19, wherein The requested speed limit value determination module is specifically used for: In a case where it is determined that the total speed of real-time requests is less than or equal to the total request speed threshold, determining the request speed limit value of the current network request according to the single connection speed limit value; When it is determined that the total speed of the real-time requests is greater than the total request speed threshold, the request speed limit value of the current network request is determined according to a gradient descent strategy.

21. The device according to claim 20, wherein: The requested speed limit value determination module is specifically used for: Determine a request over-limit ranking value and a gradient descent base for the current network request; Determine the gradient descent multiple of the current network request according to the request overlimit ranking value and the gradient descent base; The request rate limit value of the current network request is determined according to the single connection rate limit value of the current network request and the gradient descent multiple.

22. The device according to claim 21, wherein the requested speed limit value determination module is further configured to: Determine the total concurrent request speed of the target associated user-level concurrent requests at the current moment according to the target user-level concurrent request associated data; Calculate a speed limit threshold difference according to the total concurrent request speed and the total request speed threshold; When it is determined that the request speed limit value of the current network request is less than the speed limit threshold difference, the request speed limit value of the current network request is updated according to the speed limit threshold difference.

23. The device according to any one of claims 18 to 22, wherein the request speed limit value determination module is further configured to: When it is determined that the request speed limit period is updated and the network requests within the current request speed limit period meet the request smoothing processing conditions, the average request speed is calculated according to the real-time request concurrency and the total request speed threshold; Determine a gradient descent request speed limit value for each network request according to the current request speed limit value of each network request within the current request speed limit period and the gradient descent strategy; Compare the gradient descent request speed limit value of the network request with the request average speed, and determine the larger value between the gradient descent request speed limit value and the request average speed as the request speed limit value of the network request; The request smoothing processing condition includes: the real-time request concurrency is greater than or equal to the request concurrency threshold, and the total speed of the real-time requests is greater than or equal to the total speed threshold.

24. The device according to claim 19, wherein The requested speed limit value determination module is specifically used for: Obtaining user association data of the requesting user; A request rate limit value of the current network request is determined according to the user association data.

25. The device according to claim 24, wherein: The requested speed limit value determination module is specifically used for: Determine the user speed limit level of the requesting user according to the user association data; In the case of determining that the user speed limit level is the target user speed limit level, setting the request speed limit value of the current network request to the target request speed limit value, and refusing to respond to the current network request; or In the case where it is determined that the user speed limit level is a non-target user speed limit level, the request speed limit value of the current network request is set to the target request speed limit value, and the current network request is added to a request cache queue.

26. The device according to claim 25, wherein The requested speed limit value determination module is also used for: After a set time interval, reacquire the current network request from the request cache queue; When it is determined that the real-time request concurrency is greater than the request concurrency threshold, setting the request rate limit value of the current network request to the target request rate limit value, and refusing to respond to the current network request; When it is determined that the real-time request concurrency is less than or equal to the request concurrency threshold, a request rate limit value of the current network request is determined according to the second size relationship.

27. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the request rate limit method according to any one of claims 1 to 13.

28. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method for requesting speed limit according to any one of claims 1 to 13.

29. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the request rate limiting method described in any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Speed-limiting processing method and device for data traffic

    CN114070791A

  • Virtual machine flow rate limiting method and device, electronic equipment and storage medium

    CN114465956A