Distributed current limiting method, device, equipment, storage medium and program product

By automatically calculating the rate limiting coefficient and concurrency based on the unit processing time of the data access interface in the distributed system, the problem of low accuracy of manual adjustment is solved, the system resource utilization and user experience are improved, and maintenance costs are reduced.

CN116471232BActive Publication Date: 2026-07-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-03-15
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing technologies, manual intervention to adjust the concurrent data access interface has low accuracy, leading to waste of system resources or system paralysis. It relies on the experience and ability of maintenance personnel, which is costly and has a strong lag.

Method used

By obtaining the unit processing time of data access interface requests, the rate limiting coefficient is determined, and the concurrency is automatically calculated based on the rate limiting coefficient and the unit processing time to perform rate limiting control, reduce manual intervention, and improve the accuracy of concurrency.

Benefits of technology

It enables automatic adjustment of concurrency in distributed systems, improving system resource utilization, reducing maintenance costs, and ensuring system stability and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116471232B_ABST
    Figure CN116471232B_ABST
Patent Text Reader

Abstract

The distributed flow limiting method, device, equipment, storage medium and program product provided by the application can be used in the financial field or other related fields. The method comprises the following steps: acquiring a unit processing time length of a data access interface processing request, determining a flow limiting coefficient according to the unit processing time length, determining a concurrency of accessing the data access interface according to the flow limiting coefficient and the unit processing time length, and then limiting the access amount of accessing the data access interface according to the concurrency, thereby improving the accuracy of setting the concurrency and saving the cost without manual participation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a distributed rate limiting method, apparatus, device, storage medium, and program product. Background Technology

[0002] In distributed systems on the Internet, due to the massive data traffic, excessive access can easily lead to system paralysis. To ensure system security and real-time performance, rate limiting is usually used to protect servers or application backends. This involves limiting or rejecting traffic from callers to ensure the system's own load capacity.

[0003] In related technologies, when system data access interface resources are sufficient, the number of concurrent calls to the system data access interface is typically increased manually to improve system processing speed. Conversely, when data access interface resources are scarce, the number of concurrent calls is reduced manually to prevent excessive access volume from causing system crashes. However, this method relies on the experience and skills of the maintenance personnel, and subjective factors can easily lead to inaccurate concurrency settings. Here, the data access interface refers to the interface provided by the system for downstream requests. Summary of the Invention

[0004] This application provides a distributed rate limiting method, apparatus, device, storage medium, and program product to solve the problem of low accuracy in manually adjusting the concurrency of data access interfaces in related technologies.

[0005] Firstly, this application provides a distributed rate limiting method, including:

[0006] Get the unit processing time for data access interface requests;

[0007] The current limiting coefficient is determined based on the unit processing time.

[0008] The number of concurrent accesses to the data access interface is determined based on the rate limiting coefficient and the unit processing time.

[0009] Based on the concurrency level, the access volume to the data access interface is rate-limited.

[0010] In one possible implementation, determining the concurrency of accessing the data access interface based on the rate limiting coefficient and the unit processing time includes:

[0011] Obtain system performance parameters;

[0012] The number of concurrent connections is determined based on the system performance parameters, the current limiting coefficient, and the unit processing time.

[0013] In one possible implementation, determining the concurrency based on the system performance parameters, the current limiting coefficient, and the unit processing time includes:

[0014] The concurrency level is determined according to the following formula:

[0015]

[0016] Where a is the unit processing time, b is the system performance parameter, x is the number of concurrent users, and y is the rate limiting coefficient.

[0017] In one possible implementation, determining the current limiting coefficient based on the processing duration includes:

[0018] If the unit processing time is less than the first threshold, then the rate limiting coefficient is determined to be N, where N is an integer greater than 1;

[0019] If the unit processing time is greater than or equal to the first threshold and less than the second threshold, then the rate limiting coefficient is determined to be W, where W is an integer greater than or equal to 1.

[0020] If the unit processing time is greater than or equal to the second threshold and less than the third threshold, then the current limiting coefficient is determined to be Z, where N is less than W, W is less than Z, and Z is an integer greater than 1.

[0021] In one possible implementation, the method further includes:

[0022] Obtain the maximum number of accesses supported by the data access interface;

[0023] Based on the concurrency level and the maximum number of accesses, determine whether there is a processing error in the data access interface;

[0024] If the data access interface experiences a processing anomaly, an early warning message is sent, which instructs maintenance personnel to perform system maintenance.

[0025] In one possible implementation, the step of rate limiting the number of accesses to the data access interface based on the concurrency level includes:

[0026] Control the data access interface to receive the first request corresponding to the number of concurrent requests according to the access time of multiple requests;

[0027] The second request, other than the first request, is stored in a cache, and the second request in the cache is processed after the resources of the data access interface are restored to normal.

[0028] Secondly, this application provides a distributed current limiting device, comprising:

[0029] The acquisition module is used to obtain the unit processing time for data access interface requests;

[0030] The first determining module is used to determine the current limiting coefficient based on the unit processing time;

[0031] The second determining module is used to determine the number of concurrent accesses to the data access interface based on the rate limiting coefficient and the unit processing time;

[0032] The control module is used to limit the number of accesses to the data access interface based on the number of concurrent connections.

[0033] In one possible implementation, the second determining module is specifically used for:

[0034] Obtain system performance parameters;

[0035] The number of concurrent connections is determined based on the system performance parameters, the current limiting coefficient, and the unit processing time.

[0036] In one possible implementation, the second determining module is specifically used for:

[0037] The concurrency level is determined according to the following formula:

[0038]

[0039] Where a is the unit processing time, b is the system performance parameter, x is the number of concurrent users, and y is the rate limiting coefficient.

[0040] In one possible implementation, the first determining module is specifically used for:

[0041] If the unit processing time is less than the first threshold, then the rate limiting coefficient is determined to be N, where N is an integer greater than or equal to 1;

[0042] If the unit processing time is greater than or equal to the first threshold and less than the second threshold, then the rate limiting coefficient is determined to be W, where W is an integer greater than 1.

[0043] If the unit processing time is greater than or equal to the second threshold and less than the third threshold, then the current limiting coefficient is determined to be Z, where N is less than W, W is less than Z, and Z is an integer greater than 1.

[0044] In one possible implementation, the device further includes an early warning module.

[0045] The early warning module is specifically used for:

[0046] Obtain the maximum number of accesses supported by the data access interface;

[0047] Based on the concurrency level and the maximum number of accesses, determine whether there is a processing error in the data access interface;

[0048] If the data access interface experiences a processing anomaly, an early warning message is sent, which instructs maintenance personnel to perform system maintenance.

[0049] In one possible implementation, the control module is specifically used for:

[0050] Control the data access interface to receive the first request corresponding to the number of concurrent requests according to the access time of multiple requests;

[0051] The second request, other than the first request, is stored in a cache, and the second request in the cache is processed after the resources of the data access interface are restored to normal.

[0052] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0053] The memory stores computer-executed instructions;

[0054] The processor executes computer execution instructions stored in the memory to implement the signal processing method as described in the first aspect.

[0055] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a computer, are used to implement the distributed rate limiting method as described in the first aspect.

[0056] Fifthly, this application provides a computer program product, including a computer program, which, when executed by a computer, is used to implement the distributed rate limiting method described in the first aspect.

[0057] This application provides a distributed rate limiting method, apparatus, device, storage medium, and program product that can obtain the unit processing time of data access interface requests, determine the rate limiting coefficient based on the unit processing time, and then determine the concurrency of accessing the data access interface based on the rate limiting coefficient and the unit processing time. Then, the access volume of the data access interface can be rate limited according to the concurrency, which improves the accuracy of the concurrency and does not require manual intervention, thus saving costs. Attached Figure Description

[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0059] Figure 1 This is a schematic diagram illustrating one application scenario to which this application applies;

[0060] Figure 2 A flowchart illustrating a distributed rate limiting method provided in Embodiment 1 of this application;

[0061] Figure 3 This is a flowchart illustrating another distributed rate limiting method provided in Embodiment 2 of this application;

[0062] Figure 4 This is a schematic diagram of a distributed current limiting device provided in Embodiment 3 of this application;

[0063] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application.

[0064] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0065] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0066] To more clearly explain this application, the following is a brief introduction to the terms used in the embodiments of this application:

[0067] Rate limiting: Protects the system by limiting the rate of concurrent access or requests, or the rate of requests within a time window. Once the rate limit is reached, the system can refuse service, queue up, or degrade its performance.

[0068] Distributed rate limiting: Because distributed systems have huge data traffic, while the program system's ability to process requests is limited, it will crash once the number of requests exceeds its processing limit. In order to ensure the security and real-time performance of the system, rate limiting is usually used to protect the server or application backend. That is, by limiting or rejecting the traffic of the caller, the system can ensure its own load.

[0069] In traditional rate limiting methods, when system data access interface resources are sufficient, manual intervention is typically used to increase the number of concurrent calls to the system data access interface (also known as concurrency) to improve system processing speed. When data access interface resources are scarce, manual intervention is used to reduce the number of concurrent calls to prevent excessive access from causing system crashes. This approach results in high costs associated with manual intervention.

[0070] Moreover, the above methods are lagging, as it takes time to obtain the number of data access interface resources. When the resource number is fed back to the maintenance personnel, the setting of the concurrency number depends on the maintenance personnel themselves having certain experience and ability, which can easily lead to inaccurate concurrency numbers due to subjective reasons, resulting in wasted system resources or system paralysis.

[0071] In a distributed internet system, when the number of API requests (i.e., access volume) suddenly increases tenfold, the API becomes almost unusable, triggering a chain reaction that leads to the collapse of the entire system. Using a real-life traffic light intersection as an example, within the API's concurrency capacity, a "green light" operation can be activated; when the API's response slows down and request processing time increases, a "yellow light" operation is activated to reduce the number of accesses; when the API's request processing time exceeds a certain threshold, reaching its maximum concurrency capacity, a "red light" operation is activated, rejecting subsequent incoming traffic.

[0072] Therefore, this application provides a distributed rate limiting method. The rate limiting coefficient can be determined by the unit processing time of requests handled by the data access interface. Based on the rate limiting coefficient and the unit processing time, the concurrency of accessing the data access interface can be determined. This allows for rate limiting of the interface based on the rate limiting coefficient, reducing manual intervention in the operation of the distributed system, improving the accuracy of concurrency counts, fully utilizing system resources, saving costs, and improving user experience. Simultaneously, it can reduce the frequency of access traffic control by maintenance personnel, ensuring system environment stability.

[0073] In this embodiment of the application, the rate limiting coefficient can be understood as the coefficient corresponding to the "traffic lights" in real life. By intelligently setting the rate limiting coefficients corresponding to "red light", "yellow light" and "green light", each light corresponds to a different number of concurrent connections, so as to indicate that the data access interface is turned on with "red light", "yellow light" or "green light".

[0074] In this specific embodiment, the data access interface, in relation to the distributed system, is the downstream interface, which refers to the interface provided by the system for downstream requests.

[0075] To facilitate understanding, the following will be combined with... Figure 1 The examples illustrate the application scenarios to which the embodiments of this application are applicable.

[0076] Figure 1 Please refer to the diagram illustrating one application scenario to which this application applies. Figure 1 This includes: terminal device 101, terminal device 102, terminal device 103, and distributed server 104. Terminal devices 101, 102, and 103 initiate access or requests to distributed server 104 through a data access interface, causing distributed server 104 to respond.

[0077] Distributed server 104 can capture the unit processing time of requests processed by the data access interface, and then determine the rate limiting coefficient of the data access interface based on the unit processing time, so that the number of concurrent accesses that the data access interface can handle can be determined based on the rate limiting coefficient.

[0078] It is understood that there can be multiple terminal devices, which are not shown in the figure. Terminal device 101, terminal device 102, and terminal device 103 can be mobile phones, tablets, desktop computers, etc.

[0079] The technical solutions of this application and how they solve the aforementioned technical problems are described in detail below with specific embodiments. These specific embodiments may exist independently or in combination with each other. Identical or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0080] Figure 2 This is a flowchart illustrating a distributed rate limiting method provided in Embodiment 1 of this application. This method can be executed by a distributed server (hereinafter referred to as the server) or by a model update device installed in the server. This device can be a chip, a chip module, or an integrated development environment (IDE), etc. The following uses a server as an example. Figure 2 The method includes the following steps:

[0081] S201. Obtain the unit processing time for data access interface requests.

[0082] The server can obtain the unit processing time for data access interface requests. The unit processing time is the time required to process a request. For example, this time is the time interval between when a user initiates a request through a terminal device and when the corresponding response is received.

[0083] Because the number of concurrent accesses received by the data access interface is unstable, for example, the number of accesses in the morning is lower than the number of accesses at noon, in order for the server to make full use of the data access interface resources during the corresponding time period, the server can accurately determine the number of concurrent accesses to the data access interface. The server can obtain the unit processing time of the data access interface to process requests at a preset time point.

[0084] For example, the preset time points mentioned above could be 12 noon, 7 pm, 10 pm, etc., or other time points. Alternatively, the server could obtain the unit processing time for each preset duration to determine the concurrency of a single data access interface for each preset duration.

[0085] S202. Determine the flow restriction coefficient based on the unit processing time.

[0086] After obtaining the unit processing time, the server can determine the rate limiting coefficient based on the unit processing time. In other words, the server can determine the resources of the data access interface at this time based on the size of the unit processing time, so as to determine the amount of data access the data access interface can handle.

[0087] For example, a longer processing time per unit indicates that the resources of the data access interface are relatively scarce, resulting in low efficiency in processing requests and a longer processing time. Conversely, a shorter processing time per unit indicates that the resources of the data access interface are sufficient, resulting in high efficiency in processing requests and a shorter processing time.

[0088] S203. Determine the number of concurrent accesses to the data access interface based on the rate limiting coefficient and the unit processing time.

[0089] Once the server determines the rate limiting factor, it can determine the number of concurrent accesses to the data access interface based on the rate limiting factor and the unit processing time.

[0090] For example, when a server determines the concurrency based on the rate limiting factor and the unit processing time, it can also consider system performance. Determining the concurrency based on system performance, the rate limiting factor, and the unit processing time can improve applicability and avoid the situation where different systems have different performance, resulting in the concurrency not being applicable to the distributed system when the method of determining the concurrency is consistent.

[0091] S204. Based on the number of concurrent users, limit the access volume of the data access interface.

[0092] Once the concurrency level is determined, the server can rate-limit the number of accesses to the data access interface. For example, when the concurrency level is 200, the server can control the number of accesses received by the data access interface to be 200, thereby implementing rate limiting and protecting the system.

[0093] In this embodiment, the server can determine the rate limiting coefficient based on the unit processing time of requests processed by the data access interface. Based on the rate limiting coefficient and the unit processing time, the concurrent access to the data access interface can be determined. This allows for rate limiting of the interface based on the rate limiting coefficient, reducing manual intervention in the operation of the distributed system, improving the accuracy of concurrency counts, fully utilizing system resources, saving costs, and improving user experience. Simultaneously, it can reduce the frequency of access traffic control by maintenance personnel, ensuring system environment stability.

[0094] The following describes another distributed rate limiting method provided in this application through Embodiment 2.

[0095] Figure 3 This is a flowchart illustrating another distributed rate limiting method provided in Embodiment 2 of this application. This method can be executed by a distributed server (hereinafter referred to as the server) or by a model update device installed in the server. This device can be a chip, a chip module, an IDE, etc. The following uses a server as an example. Figure 3 The method includes the following steps:

[0096] S301. Obtain the unit processing time for data access interface requests.

[0097] S302. Determine the current limiting coefficient based on the unit processing time.

[0098] After obtaining the unit processing time, the server can determine the rate limiting factor based on the unit processing time. Specifically, the rate limiting factor can be determined in the following ways:

[0099] If the unit processing time is less than the first threshold, then the rate limiting coefficient is determined to be N, where N is an integer greater than or equal to 1.

[0100] If the unit processing time is greater than or equal to the first threshold and less than the second threshold, then the rate limiting coefficient is determined to be W, where W is an integer greater than 1.

[0101] If the unit processing time is greater than or equal to the second threshold and less than the third threshold, then the rate limiting coefficient is determined to be Z, where N is less than W, W is less than Z, and Z is an integer greater than 1.

[0102] It is understandable that the first threshold is less than the second threshold, and the second threshold is less than the third threshold.

[0103] For example, the first threshold can be 0.2 seconds and the current limiting coefficient N can be set to 1; the second threshold can be 1 second and the current limiting coefficient W can be set to 10; the third threshold can be 8 seconds and the current limiting coefficient Z can be set to 100.

[0104] The above are just examples. X, W, Z, the first threshold, the second threshold, and the third threshold can be set to other values, and this application does not impose any restrictions on them.

[0105] S303, Obtain system performance parameters.

[0106] After determining the rate limiting coefficient, the server can consider system performance when determining the concurrency, so as to accurately calculate the concurrency. This can improve applicability and avoid the situation where different systems have different performance, and the concurrency is not applicable to distributed systems when the method of determining the concurrency is consistent.

[0107] For example, system performance parameters can be expressed using the number of CPU cores, network speed, or other parameters.

[0108] S304. Determine the number of concurrent connections based on system performance parameters, current limiting coefficient, and unit processing time.

[0109] After determining the system performance parameters and the rate limiting factor, the server can determine the concurrency using formula (1):

[0110]

[0111] Where a is the unit processing time, b is the system performance parameter, x is the number of concurrent users, and y is the rate limiting coefficient.

[0112] S305. Based on the number of concurrent users, limit the access volume of the data access interface.

[0113] In one possible implementation, the server can, after determining the concurrency level, rate-limit the access volume to the data access interface based on the concurrency level. Specifically, the server can rate-limit the access volume to the data access interface in the following ways:

[0114] It can control the data access interface and receive the first request corresponding to the number of concurrent requests according to the access time of multiple requests. In other words, it can process the "first" request, and then store the second request other than the first request in the cache. After the resources of the data access interface are restored to normal, the second request in the cache is processed. That is, the second request is processed first, and then other "later" requests are processed.

[0115] In this approach, the server can use a queue to store the second request in a cache, or store it in a database task table to wait for the data access interface resources to recover before processing it.

[0116] In another possible implementation, the server can determine that when the unit processing time exceeds a third threshold, it indicates that the data access interface's request processing capacity is poor, leading to the excessive unit processing time. The server can then initiate an alert by sending an alert message, which instructs maintenance personnel to perform system maintenance. Specifically, the server can send the alert message to the terminal device held by the maintenance personnel, or it can output the alert message in other forms such as voice.

[0117] In another possible implementation, after determining the concurrency level, the server can obtain the maximum number of accesses supported by the data access interface. Based on the concurrency level and the maximum number of accesses, it can determine whether there is a processing error in the data access interface. Specifically, if the concurrency level is greater than the maximum number of accesses, it can be determined that there is a processing error in the data access interface. If there is a processing error in the data access interface, the server can send an early warning message. This early warning message is used to instruct maintenance personnel to perform system maintenance. Specifically, the server can send the early warning message to the terminal device held by the maintenance personnel, or it can output the early warning message in other forms such as voice.

[0118] In this embodiment, the server can determine the rate limiting coefficient based on the unit processing time of requests through the data access interface. Then, it obtains system performance parameters and, based on these parameters, the rate limiting coefficient, and the unit processing time, determines the concurrency of accessing the data access interface. This allows for rate limiting of the interface based on the rate limiting coefficient, reducing manual intervention in the distributed system's operation, improving the accuracy of concurrency counts, fully utilizing system resources, saving costs, and enhancing user experience. Simultaneously, it reduces the frequency of traffic control by maintenance personnel, ensuring system stability. Furthermore, considering system performance improves applicability and avoids situations where different systems have different performance characteristics, leading to unsuitable concurrency counts for distributed systems when the concurrency determination method is consistent.

[0119] Figure 4 This is a schematic diagram of a distributed current limiting device provided in Embodiment 3 of this application. (Reference) Figure 4 The device 40 includes: an acquisition module 401, a first determination module 402, a second determination module 403, and a control module 404.

[0120] The acquisition module 401 is used to acquire the unit processing time of the data access interface processing request.

[0121] The first determining module 402 is used to determine the flow limiting coefficient based on the unit processing time.

[0122] The second determining module 403 is used to determine the number of concurrent accesses to the data access interface based on the rate limiting coefficient and the unit processing time.

[0123] The control module 404 is used to limit the access volume of the data access interface based on the number of concurrent users.

[0124] In one possible implementation, the second determining module 403 is specifically used for:

[0125] Obtain system performance parameters.

[0126] The number of concurrent connections is determined based on system performance parameters, rate limiting coefficient, and unit processing time.

[0127] In one possible implementation, the second determining module 403 is specifically used for:

[0128] The concurrency level is determined using the following formula:

[0129]

[0130] Where a is the unit processing time, b is the system performance parameter, x is the number of concurrent users, and y is the rate limiting coefficient.

[0131] In one possible implementation, the first determining module 402 is specifically used for:

[0132] If the unit processing time is less than the first threshold, then the rate limiting coefficient is determined to be N, where N is an integer greater than or equal to 1.

[0133] If the unit processing time is greater than or equal to the first threshold and less than the second threshold, then the rate limiting coefficient is determined to be W, where W is an integer greater than 1.

[0134] If the unit processing time is greater than or equal to the second threshold and less than the third threshold, then the rate limiting coefficient is determined to be Z, where N is less than W, W is less than Z, and Z is an integer greater than 1.

[0135] In one possible implementation, the device further includes an early warning module.

[0136] The early warning module is specifically used for:

[0137] Get the maximum number of accesses supported by the data access interface.

[0138] Based on the number of concurrent requests and the maximum number of accesses, determine whether there are any processing anomalies in the data access interface.

[0139] If there is a processing error in the data access interface, an alert message will be sent to instruct maintenance personnel to perform system maintenance.

[0140] In one possible implementation, the control module 404 is specifically used for:

[0141] Control the data access interface and receive the first request corresponding to the number of concurrent requests based on the access time of multiple requests.

[0142] Store the second request (other than the first request) in the cache among multiple requests, and process the second request in the cache after the resources of the data access interface are restored to normal.

[0143] The apparatus in this embodiment can be used to execute the technical solutions of the above method embodiments. The specific implementation methods and technical effects are similar, and will not be described again here.

[0144] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application, as shown below. Figure 5 As shown, the electronic device 50 may include at least one processor 501 and a memory 502.

[0145] Memory 502 is used to store programs. Specifically, the program may include program code, which includes computer-executable instructions.

[0146] The memory 502 may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.

[0147] The processor 501 is used to execute computer execution instructions stored in the memory 502 to implement the method described in the foregoing method embodiments. The processor 501 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0148] Optionally, the electronic device 50 may also include a communication interface 503. In specific implementations, if the communication interface 503, memory 502, and processor 501 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

[0149] Optionally, in a specific implementation, if the communication interface 503, memory 502, and processor 501 are integrated on a single chip, then the communication interface 503, memory 502, and processor 501 can communicate through an internal interface.

[0150] Electronic devices 50 can be chips, chip modules, IDEs, distributed servers, etc.

[0151] The electronic device in this embodiment can be used to execute the technical solutions of the above method embodiments. The specific implementation methods and technical effects are similar, and will not be repeated here.

[0152] Embodiment 5 of this application provides a computer-readable storage medium, which may include various media capable of storing computer-executable instructions, such as USB flash drives, portable hard drives, read-only memory (ROM), RAM, disks, or optical discs. Specifically, the computer-readable storage medium stores computer-executable instructions, which, when executed by a computer, cause the technical solution shown in the above method embodiment to be executed. The specific implementation and technical effects are similar and will not be repeated here.

[0153] Embodiment 6 of this application provides a computer program product, including a computer program. When the computer program is executed by a computer, the technical solution shown in the above method embodiment is executed. The specific implementation method and technical effect are similar, and will not be repeated here.

[0154] It should be noted that the distributed current limiting method, apparatus, device, storage medium, and program product provided by this invention can be used in the financial field. It can also be used in any field other than finance. The application areas of the distributed current limiting method, apparatus, device, storage medium, and program product of this invention are not limited.

[0155] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0156] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

[0157] In this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects have an "or" relationship.

[0158] "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, a and b, a and c, b and c, or a, b, and c, where each of a, b, and c can be an element itself or a set containing one or more elements.

[0159] In this application, "at least one" means one or more. "More than one" means two or more. The descriptions of "first," "second," etc., appearing in the embodiments of this application are only for illustration and to distinguish the described objects, and have no order, nor do they indicate a special limitation on the number of devices in the embodiments of this application, and cannot constitute any limitation on the embodiments of this application. For example, "first threshold" and "second threshold" are only used to distinguish different thresholds, and do not indicate that the size, priority, or importance of these two thresholds are different.

[0160] In this application, terms such as "exemplary," "in some embodiments," and "in other embodiments" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the term "exemplary" is used to present the concept in a specific manner.

[0161] In this application, the terms "of," "corresponding (relevant)," "corresponding," and "related" may sometimes be used interchangeably. It should be noted that, unless a distinction is emphasized, their intended meanings are consistent. Similarly, in the embodiments of this application, "communication" and "transmission" may sometimes be used interchangeably. It should be noted that, unless a distinction is emphasized, their intended meanings are consistent. For example, transmission can include sending and / or receiving, and can be a noun or a verb.

[0162] In this application, "equal to" can be used with "less than" or "greater than", but not simultaneously with both. When "equal to" is used with "less than", it applies to the technical solution adopted by "less than". When "equal to" is used with "greater than", it applies to the technical solution adopted by "greater than".

Claims

1. A distributed rate limiting method, characterized in that, include: Get the unit processing time for data access interface requests; If the unit processing time is less than the first threshold, then the rate limiting coefficient is determined to be N, where N is an integer greater than or equal to 1; If the unit processing time is greater than or equal to the first threshold and less than the second threshold, then the rate limiting coefficient is determined to be W, where W is an integer greater than 1. If the unit processing time is greater than or equal to the second threshold and less than the third threshold, then the current limiting coefficient is determined to be Z, where N is less than W, W is less than Z, and Z is an integer greater than 1. Obtain system performance parameters; The number of concurrent connections is determined based on the system performance parameters, the current limiting coefficient, and the unit processing time. Determining the concurrency based on the system performance parameters, the rate limiting coefficient, and the unit processing time includes: The concurrency level is determined according to the following formula: Where a is the unit processing time, b is the system performance parameter, x is the number of concurrent users, and y is the rate limiting coefficient; Based on the concurrency level, the access volume to the data access interface is rate-limited.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the maximum number of accesses supported by the data access interface; Based on the concurrency level and the maximum number of accesses, determine whether there is a processing error in the data access interface; If the data access interface experiences a processing anomaly, an early warning message is sent, which instructs maintenance personnel to perform system maintenance.

3. The method according to claim 1, characterized in that, The step of limiting the number of accesses to the data access interface based on the concurrency level includes: Control the data access interface to receive the first request corresponding to the number of concurrent requests according to the access time of multiple requests; The second request, other than the first request, is stored in a cache, and the second request in the cache is processed after the resources of the data access interface are restored to normal.

4. A distributed current limiting device, characterized in that, include: The acquisition module is used to obtain the unit processing time for data access interface requests; A first determining module is configured to: if the unit processing time is less than a first threshold, determine the rate limiting coefficient as N, where N is an integer greater than or equal to 1; if the unit processing time is greater than or equal to the first threshold and less than a second threshold, determine the rate limiting coefficient as W, where W is an integer greater than 1; if the unit processing time is greater than or equal to the second threshold and less than a third threshold, determine the rate limiting coefficient as Z, where N is less than W, W is less than Z, and Z is an integer greater than 1. The second determining module is used to obtain system performance parameters; and determine the number of concurrent processes based on the system performance parameters, the current limiting coefficient, and the unit processing time. Determining the concurrency level based on the system performance parameters, the current limiting coefficient, and the unit processing time includes: determining the concurrency level according to the following formula: Where a is the unit processing time, b is the system performance parameter, x is the number of concurrent users, and y is the rate limiting coefficient; The control module is used to limit the number of accesses to the data access interface based on the number of concurrent connections.

5. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the distributed rate limiting method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the distributed rate limiting method as described in any one of claims 1-3.

7. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the distributed rate limiting method according to any one of claims 1-3.