Traffic limiting method and device, computer device and storage medium

By generating and synchronizing rate limiting information for the target node and associated nodes when the front-end processor detects a traffic access request, the problem of insufficient system high availability in traditional traffic limiting technology is solved, and more stable system operation is achieved.

CN115967678BActive Publication Date: 2026-02-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211704539.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-02-10
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

Traditional traffic limiting technologies cannot effectively protect system high availability when traffic surges or drops, leading to system downtime or service unavailability.

Method used

When the front-end processor detects a traffic access request, it identifies the target node and target interface, generates and synchronizes rate limiting information to the caches of the target node and associated nodes, and ensures that all interfaces are configured with rate limiting information so as to restrict traffic access requests that meet the threshold conditions.

Benefits of technology

This effectively avoids system downtime or service unavailability caused by interfaces without configured rate limiting information, thus improving the system's high availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115967678B_ABST
    Figure CN115967678B_ABST
Patent Text Reader

Abstract

The application relates to a traffic limiting method and device, computer equipment, a storage medium and a computer program product, and belongs to the technical field of cloud computing. The method comprises the following steps: in the case that a traffic access request is detected, a target node and a target interface corresponding to the traffic access request are confirmed; in the case that no traffic limiting information of the target interface exists in a traffic limiting information cache of the target node, traffic limiting information of the target interface is generated, and the traffic limiting information of the target interface is added to the traffic limiting information cache of the target node; the traffic limiting information of the target interface is used for the target interface to perform traffic limiting processing on a traffic access request meeting a threshold condition; and the traffic limiting information of the target interface is synchronized to a traffic limiting information cache of an associated node of the target node; the associated node is each node including the target interface in a node cluster corresponding to the target node except the target node. By adopting the method, the high availability of a system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a traffic limiting method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the popularization of the Internet, the ever-increasing traffic has placed higher demands on the high availability of systems that provide services, leading to the development of traffic limiting technology.

[0003] In traditional technologies, traffic limiting technology mainly involves configuring rate limiting policies on service interfaces that are expected to have their traffic limited. When traffic surges or exceeds a threshold, the traffic is limited according to the rate limiting policy, thereby reducing the pressure on the system.

[0004] However, in practice, sudden increases and decreases in traffic are often unpredictable. When a large number of traffic access requests access service interfaces that are not configured with rate limiting policies, the pressure on the system receiving the traffic access requests will increase sharply, leading to system crashes or service unavailability, resulting in low system availability. Summary of the Invention

[0005] Therefore, it is necessary to provide a traffic limiting method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the high availability of the system in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a traffic limiting method applied to a preprocessor. The method includes:

[0007] Upon detecting a traffic access request, identify the target node and target interface corresponding to the traffic access request;

[0008] If the rate limiting information for the target interface is not found in the rate limiting information cache of the target node, rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node. The rate limiting information for the target interface is used to limit the traffic of traffic access requests that meet the threshold conditions.

[0009] The rate limiting information of the target interface is synchronized to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node other than the target node, including each node of the target interface.

[0010] In one embodiment, upon detecting a traffic access request, identifying the target node and target interface corresponding to the traffic access request includes:

[0011] Upon detecting a traffic access request, identify the request type of the traffic access request and the interface parameter information corresponding to the traffic access request;

[0012] Based on the request type, confirm the node cluster corresponding to the traffic access request;

[0013] From the node cluster, identify the node that includes an interface that matches the interface parameter information, and designate it as the target node. Then, designate the interface in the target node that matches the interface parameter information as the target interface.

[0014] In one embodiment, the step of generating the rate limiting information for the target interface when the rate limiting information cache of the target node does not contain rate limiting information for the target interface includes:

[0015] If there is no rate limiting information corresponding to the interface parameter information of the target interface in the rate limiting information cache of the target node, the historical access information of the target interface is obtained.

[0016] Based on the historical access information of the target interface, predict the target concurrency threshold and the target throughput threshold of the target interface;

[0017] Rate limiting information for the target interface is generated based on the target concurrency threshold and the target throughput threshold of the target interface.

[0018] In one embodiment, before predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface, the method further includes:

[0019] Obtain historical access information for each interface across multiple node clusters;

[0020] Based on the historical access information of each interface under the multiple node clusters, construct the concurrency threshold prediction model and throughput threshold prediction model for the multiple node clusters.

[0021] The step of predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface includes:

[0022] From the concurrency threshold prediction models and throughput threshold prediction models of the multiple node clusters, the target concurrency threshold prediction model and target throughput threshold prediction model of the node cluster corresponding to the target node are identified.

[0023] The historical access information of the target interface is input into the target concurrency threshold prediction model and the target throughput threshold prediction model respectively to predict the threshold, thereby obtaining the target concurrency threshold and the target throughput threshold of the target interface.

[0024] In one embodiment, synchronizing the rate limiting information of the target interface to the rate limiting information cache of the associated node of the target node includes:

[0025] The rate limiting information of the target interface is sent to the configuration center. The configuration center is used to identify the interface parameter information of the target interface from the rate limiting information of the target interface, and based on the interface parameter information, to identify the associated node of the target node from the node cluster corresponding to the target node, and to send the rate limiting information of the target interface to the associated node, so that the associated node adds the received rate limiting information of the target interface to the rate limiting information cache of the node.

[0026] Secondly, this application also provides another traffic limiting method applied to nodes. The method includes:

[0027] When the node is an associated node of the target node, the rate limiting information of the target interface synchronized by the front-end processor is obtained; the associated node is one of the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface; the rate limiting information of the target interface is used for the target interface to perform traffic limiting processing on traffic access requests that meet the threshold conditions; the front-end processor is used to, when a traffic access request is detected, confirm the target node and target interface corresponding to the traffic access request; if the rate limiting information of the target interface does not exist in the rate limiting information cache of the target node, generate the rate limiting information of the target interface and add the rate limiting information of the target interface to the rate limiting information cache of the target node;

[0028] The rate limiting information is added to the rate limiting information cache of the node.

[0029] In one embodiment, when the node is an associated node of the target node, before obtaining the rate limiting information of the target interface synchronized by the preprocessor, the method further includes:

[0030] When it is detected that the configuration center has received the rate limiting information of the target interface sent by the front-end processor, the node parameter information of the target node is obtained from the rate limiting information receiving record of the configuration center, and the interface parameter information of the target interface is identified from the rate limiting information of the target interface cached by the configuration center.

[0031] If, based on the node parameter information of the target node, it is confirmed that the node and the target node belong to the same node cluster, then query each interface of the node;

[0032] If there is an interface among the interfaces of the node that matches the interface parameter information of the target interface, the node is identified as an associated node of the target node;

[0033] When the node is an associated node of the target node, obtaining the rate limiting information of the target interface synchronized by the preprocessor includes:

[0034] When the node is an associated node of the target node, the rate limiting information of the target interface generated by the front-end processor is obtained from the cache of the configuration center.

[0035] Thirdly, this application also provides a flow limiting device. The device includes:

[0036] The node interface confirmation module is used to confirm the target node and target interface corresponding to the traffic access request when a traffic access request is detected.

[0037] The rate limiting information generation module is used to generate rate limiting information for the target interface when the rate limiting information cache of the target node does not contain rate limiting information for the target interface, and to add the rate limiting information for the target interface to the rate limiting information cache of the target node; the rate limiting information for the target interface is used for the target interface to perform traffic limiting processing on traffic access requests that meet the threshold conditions;

[0038] The rate limiting information synchronization module is used to synchronize the rate limiting information of the target interface to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface.

[0039] Fourthly, this application also provides another flow limiting device. The device includes:

[0040] The rate limiting information acquisition module is used to acquire rate limiting information of the target interface synchronized by the front-end processor when the node is an associated node of the target node; the associated node is the node in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface; the rate limiting information of the target interface is used for the target interface to perform traffic limiting processing on traffic access requests that meet the threshold conditions; the front-end processor is used to confirm the target node and target interface corresponding to the traffic access request when a traffic access request is detected, and if the rate limiting information of the target interface does not exist in the rate limiting information cache of the target node, generate the rate limiting information of the target interface and add the rate limiting information of the target interface to the rate limiting information cache of the target node;

[0041] The rate limiting information adding module is used to add the rate limiting information to the rate limiting information cache of the node.

[0042] Fifthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0043] Upon detecting a traffic access request, identify the target node and target interface corresponding to the traffic access request;

[0044] If the rate limiting information for the target interface is not found in the rate limiting information cache of the target node, rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node. The rate limiting information for the target interface is used to limit the traffic of traffic access requests that meet the threshold conditions.

[0045] The rate limiting information of the target interface is synchronized to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node other than the target node, including each node of the target interface.

[0046] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0047] Upon detecting a traffic access request, identify the target node and target interface corresponding to the traffic access request;

[0048] If the rate limiting information for the target interface is not found in the rate limiting information cache of the target node, rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node. The rate limiting information for the target interface is used to limit the traffic of traffic access requests that meet the threshold conditions.

[0049] The rate limiting information of the target interface is synchronized to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node other than the target node, including each node of the target interface.

[0050] Seventhly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0051] Upon detecting a traffic access request, identify the target node and target interface corresponding to the traffic access request;

[0052] If the rate limiting information for the target interface is not found in the rate limiting information cache of the target node, rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node. The rate limiting information for the target interface is used to limit the traffic of traffic access requests that meet the threshold conditions.

[0053] The rate limiting information of the target interface is synchronized to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node other than the target node, including each node of the target interface.

[0054] The aforementioned traffic limiting method, apparatus, computer equipment, storage medium, and computer program product first, upon detecting a traffic access request, identify the target node and target interface corresponding to the traffic access request; then, if the traffic limiting information cache of the target node does not contain traffic limiting information for the target interface, generate traffic limiting information for the target interface and add it to the traffic limiting information cache of the target node; finally, synchronize the traffic limiting information for the target interface to the traffic limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node itself, including all nodes of the target interface. In this way, when the front-end processor detects a traffic access request, it first generates corresponding traffic limiting information for the target interface that has not yet been configured with traffic limiting information, and then synchronizes the generated traffic limiting information to the traffic limiting information cache of each node containing the target interface, ensuring that each interface in the system receiving the traffic access request is configured with the corresponding traffic limiting information. The traffic limiting method based on the above process can avoid system crashes or service unavailability caused by a large number of traffic requests accessing an interface without configured rate limiting information when the sudden increase or decrease in access traffic to the interface cannot be clearly understood, thereby improving the high availability of the system. Attached Figure Description

[0055] Figure 1 This is a diagram illustrating the application environment of the traffic limiting method in one embodiment;

[0056] Figure 2 This is a flowchart illustrating a traffic limiting method in one embodiment;

[0057] Figure 3 This is a flowchart illustrating the flow limiting method in another embodiment;

[0058] Figure 4 This is a flowchart illustrating the steps of obtaining rate limiting information of the target interface synchronized by the front-end processor in one embodiment.

[0059] Figure 5 This is a flowchart illustrating the flow limiting method in yet another embodiment;

[0060] Figure 6 This is a structural block diagram of the flow limiting device in one embodiment;

[0061] Figure 7 This is a structural block diagram of the flow limiting device in another embodiment;

[0062] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0064] The traffic limiting method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown includes a front-end processor 102, a configuration center 104, a node 106, and an interface 108. The front-end processor 102, the configuration center 104, the node 106, and the interface 108 communicate with each other via a network. The preprocessor 102 intercepts traffic access requests before they enter interface 108, determines whether the target interface corresponding to the traffic access request is configured with rate limiting information, and generates corresponding rate limiting information for interfaces without rate limiting information. The configuration center 104 caches the rate limiting information of each interface in the system that provides services to the outside world, and manages the node cluster configuration, node parameter information, and interface parameter information within the system. Node 106 has a rate limiting information cache, which is used to cache the rate limiting information of each interface in node 106. Interface 108 provides corresponding services to the sender of the traffic access request based on the traffic access request and the rate limiting information. It should be noted that a node can correspond to multiple interfaces, and an interface can also correspond to multiple nodes at the same time. For example, node 1 has interfaces A, B, C, and D, while interface A can exist in node 1, node 2, and node 3 at the same time. It should also be noted that the system contains multiple node clusters, each providing the same or similar type of service. For example, node cluster 1 provides microservice invocation services, node cluster 2 provides HTTP (Hypertext Transfer Protocol) invocation services, and node cluster 3 provides database access services. Each node cluster contains one or more nodes; for example, node cluster 1 contains node 1, node 2, and node 3. The front-end processor 102 and configuration center 104 can be implemented using independent servers or terminals, or using a cluster of multiple servers or terminals.

[0065] Specifically, when the front-end processor 102 detects a traffic access request, it identifies the target node 106 (e.g., node 1) and the target interface 108 (e.g., interface A) corresponding to the traffic access request. Then, if the rate limiting information for the target interface 108 is not found in the rate limiting information cache of the target node 106, the front-end processor 102 generates the rate limiting information for the target interface 108 and adds it to the rate limiting information cache of the target node 106. Finally, the rate limiting information for the target interface 108 is synchronized to the rate limiting information cache of the associated nodes of the target node 106. The associated nodes are the nodes in the node cluster corresponding to the target node 106 other than the target node 106, including all nodes of the target interface 108.

[0066] In one exemplary embodiment, such as Figure 2 As shown, a traffic limiting method is provided, which can be applied to... Figure 1 Taking the pre-processor in the image as an example, the following steps are included:

[0067] Step S202: If a traffic access request is detected, confirm the target node and target interface corresponding to the traffic access request.

[0068] Among them, the target interface corresponding to the traffic access request is the interface to be accessed by the traffic access request, which is usually determined by the request content of the traffic access request; the target node corresponding to the traffic access request is the node corresponding to the interface to be accessed by the traffic access request, which is usually determined by the load balancing strategy inside the system. The load balancing strategy inside the system includes round-robin, random, retry, hash, etc.

[0069] It should be noted that "system" refers to a system that provides services to the outside world, such as backend services for web pages or applications that provide microservices.

[0070] Specifically, when the front-end processor detects a traffic access request entering the system, it first intercepts the traffic access request and obtains the service that the traffic access request needs by parsing the traffic access request. Then, based on the service that the traffic access request needs to obtain, it identifies the node cluster that can provide services to the sender of the traffic access request. Next, based on the node cluster and the load balancing strategy inside the system, it identifies the target node corresponding to the traffic access request in the node cluster, and identifies the interface in the target node that can provide services to the sender of the traffic access request as the target interface.

[0071] For example, see reference. Figure 1Suppose the traffic access request is to retrieve the user list of a certain microservice record, and the node cluster in the system that can provide this service to the outside world is node cluster 1. According to the load balancing strategy of the system, it is decided that node 1, which includes interface A, will provide the service to the outside world. Then node 1 is the target node, and interface A in node 1 is the target interface.

[0072] Step S204: If the rate limiting information for the target interface is not found in the rate limiting information cache of the target node, the rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node.

[0073] The target node's rate limiting information cache is used to record the rate limiting information of each interface included in the target node; the rate limiting information is the rate limiting rule of the interface, and the rate limiting information is used by the interface to perform traffic limiting processing on traffic access requests that meet the threshold conditions; the threshold conditions are the traffic limit conditions that each interface can handle; the traffic limiting processing is the discard processing, that is, if the traffic of the traffic access request exceeds the threshold conditions, the interface will reject the call of the traffic access request.

[0074] Specifically, after confirming the target node and target interface corresponding to the traffic access request, the front-end processor needs to query the rate limiting information cache of the target node to see if there is rate limiting information corresponding to the target interface. If the rate limiting information of the target interface cannot be found in the rate limiting information cache of the target node, the front-end processor generates the rate limiting information of the target interface, thereby configuring the rate limiting information for the target interface, and adds the rate limiting information of the target interface to the rate limiting information cache of the target node. Then, the front-end processor sends the traffic access request to the target interface in the target node. If the rate limiting information of the target interface can be found in the rate limiting information cache of the target node, then the front-end processor sends the traffic access request to the target interface in the target node. After receiving the traffic access request, the target interface processes the traffic access request based on the rate limiting information corresponding to the target interface in the rate limiting information cache of the target node.

[0075] For example, see reference. Figure 1The front-end processor queries the rate limiting information cache of node 1. If the rate limiting information for interface A is not found in the cache, the front-end processor generates the rate limiting information for interface A and adds it to the rate limiting information cache of node 1. The front-end processor then sends the traffic access request to interface A of node 1. If the rate limiting information for interface A is found in the cache, the front-end processor sends the traffic access request to interface A. Upon receiving the traffic access request, interface A processes it according to the corresponding rate limiting information in the rate limiting information cache of node 1. For example, assuming the traffic access request does not exceed the threshold condition, interface A allows the traffic access request and provides normal external services based on the request. If the traffic access request exceeds the threshold condition, interface A rejects the traffic access request and does not provide external services.

[0076] Step S206: Synchronize the rate limiting information of the target interface to the rate limiting information cache of the associated node of the target node.

[0077] Among them, the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node, including all nodes of the target interface. For example, for interface A of node 1, nodes 2 and 3 are associated nodes of node 1; for interface C of node 1, node 2 is an associated node of node 1, while node 3 is a non-associated node of node 1 since it does not include interface C.

[0078] Specifically, the front-end processor synchronizes the rate limiting information of the target interface to the node cluster corresponding to the target node, and to the rate limiting information cache of each node except the target node.

[0079] refer to Figure 1 In node cluster 1, there are nodes 1, 2, and 3. Taking interface A of node 1 as the target interface as an example, the preprocessor generates the rate limiting information for interface A, adds the rate limiting information for interface A to the rate limiting information cache of node 1, and then synchronizes the rate limiting information for interface A to the rate limiting information caches of nodes 2 and 3, configuring rate limiting information for interface A in nodes 2 and 3. Taking interface D of node 3 as another example, the preprocessor generates the rate limiting information for interface D, adds the rate limiting information for interface D to the rate limiting information cache of node 3, and then synchronizes the rate limiting information for interface D to the rate limiting information cache of node 1, configuring rate limiting information for interface D in node 1.

[0080] In the traffic limiting method described above, the front-end processor first identifies the target node and target interface corresponding to the traffic access request upon detection. Then, if the target interface's rate limiting information is not found in the target node's rate limiting information cache, rate limiting information for the target interface is generated and added to the target node's rate limiting information cache. Finally, the rate limiting information for the target interface is synchronized to the rate limiting information caches of the associated nodes of the target node. The associated nodes are all nodes in the node cluster corresponding to the target node, excluding the target node itself, including all nodes of the target interface. In this way, when the front-end processor detects a traffic access request, it first generates corresponding rate limiting information for the target interface that has not yet been configured with rate limiting information, and then synchronizes the generated rate limiting information to the rate limiting information caches of all nodes containing that target interface. This ensures that all interfaces in the system receiving traffic access requests are configured with corresponding rate limiting information. Based on this process, the traffic limiting method avoids system downtime or service unavailability caused by a large number of traffic access requests accessing an interface without rate limiting information when the sudden increase or decrease in interface access traffic is unclear, thereby improving system high availability.

[0081] In an exemplary embodiment, step S202 above, when a traffic access request is detected, confirms the target node and target interface corresponding to the traffic access request, specifically including the following: when a traffic access request is detected, identifies the request type of the traffic access request and the interface parameter information corresponding to the traffic access request; based on the request type, confirms the node cluster corresponding to the traffic access request; from the node cluster, identifies the node that includes the interface matching the interface parameter information as the target node, and designates the interface in the target node that matches the interface parameter information as the target interface.

[0082] Among them, the request type of the traffic access request refers to the type of service to be obtained by the traffic access request, such as microservice call service, HTTP call service, database access service, etc.; the interface parameter information refers to the identifier of the interface, such as interface A, interface B or interface C, etc.

[0083] Specifically, when the front-end processor detects a traffic access request, it intercepts the traffic access request and parses it to identify the request type and interface parameter information of the interface to be accessed. Then, based on the request type, it identifies the node cluster corresponding to the traffic access request among multiple node clusters in the system. Next, according to the load balancing strategy, it identifies the node that includes the interface matching the interface parameter information from the corresponding node cluster as the target node corresponding to the traffic access request, and confirms the interface matching the interface parameter information in the target node as the target interface corresponding to the traffic access request.

[0084] For example, the front-end processor identifies the request type and interface parameter information of the interface to be accessed from the traffic access request, as shown in the reference. Figure 1 If the type of traffic access request is to call a microservice and the interface parameter information of the interface to be accessed is interface A, then the front-end processor first identifies node cluster 1 from the multiple node clusters of the system based on the request type "call microservice". Based on the interface parameter information "interface A" and the system's load balancing strategy, it identifies node 1 in node cluster 1 as the target node and interface A in node 1 as the target interface.

[0085] In this embodiment, the front-end processor uses the information carried by the traffic access request to determine the node cluster, target node, and target interface for the traffic access request. It can then determine whether the target node has rate limiting information cached for the target interface. If not, it generates rate limiting information for the target interface, so that the target interface can perform corresponding rate limiting processing on the traffic access request based on the rate limiting information.

[0086] In an exemplary embodiment, step S204 above, when the rate limiting information cache of the target node does not contain rate limiting information for the target interface, generates rate limiting information for the target interface. Specifically, this includes the following: when the rate limiting information cache of the target node does not contain rate limiting information corresponding to the interface parameter information of the target interface, obtaining the historical access information of the target interface; predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface; and generating rate limiting information for the target interface based on the target concurrency threshold and target throughput threshold of the target interface.

[0087] The historical access information records all traffic access requests received by the target interface, the traffic size of each traffic access request, and the processing status of each traffic access request, such as normal processing or abnormal processing. Abnormal processing refers to the processing status where the interface is unable to provide services due to overload. Concurrency is the number of requests that the interface receiving traffic access requests can process simultaneously, and throughput is the number of requests that the interface receiving traffic access requests can process per unit of time.

[0088] Specifically, after determining the target node and target interface, the front-end processor needs to query the rate limiting information cache of the target node to see if there is rate limiting information corresponding to the target interface. If there is, the traffic access request is processed through the target interface. If not, the historical access information of the target interface is obtained, and the target concurrency threshold and target throughput threshold of the target interface are predicted based on the historical access information. Then, the rate limiting information corresponding to the target interface is generated based on the target concurrency threshold and target throughput threshold.

[0089] For example, see reference. Figure 1 If the front-end processor cannot find the rate limiting information cache for interface A in the rate limiting information cache of node 1, then it predicts the target concurrency threshold and target throughput threshold for interface A based on the historical access information of interface A, thereby generating rate limiting information for interface A.

[0090] In this embodiment, the front-end processor obtains the target concurrency threshold and target throughput threshold of the target interface through the historical access information of the target interface. It can generate corresponding rate limiting information for interfaces that have not yet been configured with rate limiting information, thereby avoiding system crashes or service unavailability caused by the received traffic access requests exceeding the interface's load capacity when the access traffic changes are not clearly known.

[0091] In an exemplary embodiment, before predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface as described above, the following steps are further included: obtaining the historical access information of each interface under multiple node clusters; and constructing a concurrency threshold prediction model and a throughput threshold prediction model for multiple node clusters based on the historical access information of each interface under multiple node clusters.

[0092] The above steps, based on the historical access information of the target interface, predict the target concurrency threshold and target throughput threshold of the target interface. Specifically, this includes the following: identifying the target concurrency threshold prediction model and target throughput threshold prediction model of the node cluster corresponding to the target node from the concurrency threshold prediction models and throughput threshold prediction models of multiple node clusters; inputting the historical access information of the target interface into the target concurrency threshold prediction model and the target throughput threshold prediction model respectively to perform threshold prediction, thereby obtaining the target concurrency threshold and target throughput threshold of the target interface.

[0093] Among them, the concurrency threshold prediction model and the throughput threshold prediction model are prediction models obtained by performing multiple deep learning operations on the historical access information of each interface, that is, the concurrency and throughput that the interface can handle when it is overloaded and crashes.

[0094] Specifically, the front-end processor first constructs a corresponding concurrency threshold prediction model and throughput threshold prediction model for each node cluster based on the concurrency and throughput capabilities of each interface under multiple node clusters. Then, based on the node cluster corresponding to the traffic access request, the front-end processor identifies the target concurrency threshold prediction model and target throughput threshold prediction model for the node cluster corresponding to the target node from multiple concurrency threshold prediction models and throughput threshold prediction models. Taking the historical access information of the target interface as input, the target concurrency threshold and target throughput threshold of the target interface are predicted by the target concurrency threshold prediction model and the target throughput threshold prediction model, respectively.

[0095] In this embodiment, the front-end processor constructs predictive models for the concurrency thresholds and throughput of each interface based on historical access information from each interface in the node cluster. Then, based on the historical access information of the target interface, it obtains the target concurrency and throughput of the target interface through the target concurrency threshold prediction model and the target throughput threshold prediction model. In other words, the front-end processor can accurately predict the traffic limits that a specific target interface can handle using the historical access information and corresponding prediction models of the target interface, providing a threshold basis for generating rate limiting information for the target interface, thereby improving the high availability of the system.

[0096] In an exemplary embodiment, step S206, which synchronizes the rate limiting information of the target interface to the rate limiting information cache of the associated node of the target node, specifically includes the following: sending the rate limiting information of the target interface to the configuration center.

[0097] The configuration center is used to identify the interface parameter information of the target interface from the rate limiting information of the target interface. Based on the interface parameter information, it identifies the associated node of the target node from the node cluster corresponding to the target node, and sends the rate limiting information of the target interface to the associated node, so that the associated node adds the received rate limiting information of the target interface to the rate limiting information cache of the node.

[0098] Specifically, the front-end processor sends the rate limiting information of the target interface to the configuration center. The configuration center identifies the node parameter information of the target node and the interface parameter information of the target interface from the received rate limiting information. Based on the node parameter information, it determines the node cluster. Then, based on the interface parameter information, it identifies each node in the node cluster that contains an interface corresponding to the interface parameter information, excluding the target node, as the associated node of the target node. The rate limiting information of the target interface is then sent to each associated node. After receiving the rate limiting information sent by the configuration center, each associated node adds the received rate limiting information to the node's rate limiting information cache.

[0099] For example, see reference. Figure 1If the target node is node 1 and the target interface is interface A, then the configuration center confirms the associated nodes as nodes 2 and 3, and sends the received rate limiting information for interface A to nodes 2 and 3. Nodes 2 and 3 then add the received rate limiting information to their respective rate limiting information caches. For example, if the target node is node 2 and the target interface is interface C, then the configuration center confirms the associated node as node 1, and sends the received rate limiting information for interface C to node 1. Node 1 then adds the received rate limiting information to its rate limiting information cache.

[0100] In this embodiment, the front-end processor sends the rate limiting information to the configuration center, which then confirms the associated nodes of the target node. This synchronizes the rate limiting information of the target interface to the rate limiting information cache of the associated nodes of the target node. By generating rate limiting information for a target interface, the system can configure rate limiting information for each corresponding interface, thus avoiding the possibility of the interface crashing due to a sudden increase in traffic due to the lack of rate limiting information configuration. This further improves the high availability of the system.

[0101] In one exemplary embodiment, such as Figure 3 As shown, a traffic limiting method is also provided, which can be applied to... Figure 1 Taking a node in the example, the explanation includes the following steps:

[0102] S302, when the node is an associated node of the target node, obtain the rate limiting information of the target interface synchronized by the front-end processor.

[0103] S304 adds the rate limiting information to the node's rate limiting information cache.

[0104] Among them, the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface; the rate limiting information of the target interface is used for the target interface to perform rate limiting processing on traffic access requests that meet the threshold conditions. The preprocessor is used to confirm the target node and target interface corresponding to the traffic access request when a traffic access request is detected. If the rate limiting information of the target interface does not exist in the rate limiting information cache of the target node, the preprocessor generates the rate limiting information of the target interface and adds the rate limiting information of the target interface to the rate limiting information cache of the target node.

[0105] Specifically, when a node determines that it is an associated node of the target node, it obtains the rate limiting information of the target interface synchronized by the front-end processor and adds the rate limiting information of the target interface to the rate limiting information cache of the node.

[0106] For example, see reference. Figure 1In the example of node 2, assuming the target node is node 1 and the target interface is interface A, based on the above information, node 2 can determine that it belongs to the associated node of node 1. Therefore, it obtains the rate limiting information of interface A synchronized by the front-end processor and adds it to the rate limiting information cache. Assuming the target node is node 1 and the target interface is interface D, based on the above information, node 2 can determine that it does not belong to the associated node of node 1. Therefore, it does not need to obtain the rate limiting information of interface D synchronized by the front-end processor.

[0107] It should be noted that the specific limitations of the above-mentioned traffic restriction method can be found in steps S202 to S206, and will not be repeated here.

[0108] In this embodiment, when a node is an associated node of a target node, it obtains the rate limiting information of the target interface synchronized by the front-end processor and adds it to the rate limiting information cache of the node. This achieves the purpose of configuring rate limiting information for each interface corresponding to the target interface while the front-end processor generates rate limiting information for a specific target interface. This avoids the possibility of the interface crashing due to a sudden increase in traffic because of the lack of configured rate limiting information, and further improves the high availability of the system.

[0109] In one exemplary embodiment, such as Figure 4 As shown, the steps in the above-described traffic limiting method applied to nodes, specifically including obtaining the rate limiting information of the target interface synchronized by the front-end processor, further include the following steps:

[0110] Step 402: When it is detected that the configuration center has received the rate limiting information of the target interface sent by the front-end processor, the node parameter information of the target node is obtained from the rate limiting information receiving record of the configuration center, and the interface parameter information of the target interface is identified from the rate limiting information of the target interface cached in the configuration center.

[0111] Step 404: If the node and the target node belong to the same node cluster based on the node parameter information of the target node, query each interface of the node.

[0112] Step 406: If there is an interface among the nodes that matches the interface parameter information of the target interface, then the node is confirmed as an associated node of the target node.

[0113] Step 408: If the node is an associated node of the target node, retrieve the rate limiting information of the target interface generated by the preprocessor from the cache of the configuration center.

[0114] Among them, the node parameter information is the identifier of the node, such as node1, node2 or node3, etc.

[0115] Specifically, the node monitors the changes in rate limiting information in the configuration center in real time. When the configuration center receives rate limiting information for the target interface sent by the front-end processor, the node obtains the node parameter information of the target node to which the target interface belongs from the rate limiting information reception record of the configuration center, and identifies the interface parameter information of the target interface from the rate limiting information of the target interface cached in the configuration center. Then, based on the node parameter information, the node confirms whether the node and the target node belong to the same node cluster. If they belong to the same node cluster, the node queries each interface of the node to confirm whether there is an interface that matches the interface parameter information of the target interface. If there is, the node confirms the node as an associated node of the target node, and obtains the rate limiting information of the target interface generated by the front-end processor from the cache of the configuration center.

[0116] For example, see reference. Figure 1 If node 2 in the cluster has node 1 as the target node and interface A as the target interface, then node 2 can confirm that it belongs to the same node cluster as node 1 and has an interface matching interface A within its cluster. Therefore, node 2 confirms itself as an associated node of the target node and retrieves the rate limiting information for interface A from the configuration center's cache. For example, if the target node is node 1 and the target interface is interface D, although node 2 belongs to the same node cluster as node 1, node 2 does not have an interface matching interface D, so it does not need to retrieve the rate limiting information for interface D from the configuration center. If the target node is in node cluster 2 or node cluster 3, then after determining that it does not belong to the same node cluster as node 1, no operation is performed.

[0117] In this embodiment, the node uses the node parameter information of the target node and the interface parameter information of the target interface to sequentially determine whether the node belongs to the same node cluster as the target node, and whether there is an interface in the node that matches the interface parameter information of the target interface. This confirms whether the node is an associated node of the target node. If the node is an associated node of the target node, it obtains the rate limiting information of the target interface from the configuration center. This ensures that while the front-end processor generates rate limiting information for the target interface, each associated node containing the target interface can also obtain the corresponding rate limiting information. This avoids the possibility of the interface crashing due to a sudden increase in traffic because of the lack of configured rate limiting information, and further improves the high availability of the system.

[0118] In one exemplary embodiment, such as Figure 5 As shown, another method for traffic limiting is provided, which can be applied to... Figure 1 Taking the pre-processor in the image as an example, the following steps are included:

[0119] Step S501: When a traffic access request is detected, identify the request type of the traffic access request and the interface parameter information corresponding to the traffic access request.

[0120] Step S502: Based on the request type, confirm the node cluster corresponding to the traffic access request; from the node cluster, identify the nodes that include interfaces that match the interface parameter information as target nodes, and use the interfaces in the target nodes that match the interface parameter information as target interfaces.

[0121] Step S503: If there is no rate limiting information corresponding to the interface parameter information of the target interface in the rate limiting information cache of the target node, obtain the historical access information of the target interface.

[0122] Step S504: Input the historical access information of the target interface into the target concurrency threshold prediction model and the target throughput threshold prediction model of the node cluster corresponding to the target node to perform threshold prediction, and obtain the target concurrency threshold and the target throughput threshold of the target interface.

[0123] Step S505: Generate rate limiting information for the target interface based on the target concurrency threshold and target throughput threshold, and add the rate limiting information of the target interface to the rate limiting information cache of the target node.

[0124] Step S506: Synchronize the rate limiting information of the target interface to the rate limiting information cache of the associated node of the target node.

[0125] Among them, the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node, including all nodes of the target interface.

[0126] It should be noted that the construction process of the concurrency threshold prediction model and the throughput threshold prediction model is as follows: obtain the historical access information of each interface under multiple node clusters; based on the historical access information of each interface under multiple node clusters, construct the concurrency threshold prediction model and the throughput threshold prediction model for multiple node clusters.

[0127] It should also be noted that the process of confirming the target concurrency threshold prediction model and the target throughput threshold prediction model of the node cluster corresponding to the target node is as follows: From the concurrency threshold prediction models and throughput threshold prediction models of multiple node clusters, the target concurrency threshold prediction model and the target throughput threshold prediction model of the node cluster corresponding to the target node are confirmed.

[0128] In this embodiment, the front-end processor uses the information carried in the traffic access request to determine the node cluster, target node, and target interface, thereby enabling corresponding processing of the traffic access request. Simultaneously, using the historical access information of the target interface, it obtains the target concurrency threshold and target throughput threshold for the target interface, and generates corresponding rate limiting information for interfaces that have not yet been configured with rate limiting. By generating corresponding rate limiting information for interfaces that have not yet been configured with rate limiting, and synchronizing the generated rate limiting information to the rate limiting information cache of each node containing that interface, it ensures that each interface in the system receiving the traffic access request can be configured with corresponding rate limiting information. This achieves the goal of configuring rate limiting information for each corresponding interface by generating rate limiting information for a target interface. Based on the above process, the traffic limiting method can avoid system downtime or service unavailability caused by a large number of traffic access requests accessing an interface without rate limiting information when the sudden increase or decrease in interface access traffic is unclear, thereby improving the high availability of the system.

[0129] To more clearly illustrate the traffic limiting method provided in the embodiments of this application, the following specific embodiment will be used to describe the traffic limiting method in detail. In an exemplary embodiment, this application also provides an automated traffic limiting method based on traffic discovery, specifically including the following steps:

[0130] Step 1: The pre-processor intercepts requests based on traffic discovery, obtains relevant request data such as the interface address and interface parameter information, and queries the rate limiting rule cache of the node corresponding to the interface to determine whether it needs to enter the rate limiting process. If no rate limiting rule corresponding to the interface is found in the rate limiting rule cache, it means that the interface accessed by this request has not yet been configured with rate limiting rules, and it is necessary to jump to steps 2 and 3; if a rate limiting rule corresponding to the interface can be found in the rate limiting rule cache, it means that the interface accessed by this request has been configured with rate limiting rules, and it is necessary to jump to step 4.

[0131] Step 2: If the interface has not yet been configured with rate limiting rules, the preprocessor generates rate limiting rules for the interface based on predefined default rate limiting thresholds, such as concurrency thresholds and throughput thresholds. These rules are then loaded into the rate limiting rule cache of the node corresponding to the interface, and simultaneously pushed to the configuration center. Requests will then bypass the rate limiting logic and directly access the interface. This ensures that subsequent requests to the interface will be subject to rate limiting control, preventing interface or service unavailability due to sudden traffic surges.

[0132] Step 3: All nodes in the node cluster of the node to which the interface belongs listen to the configuration center at startup. When a node pushes rate limiting rules and interface information to the configuration center in Step 2, other nodes in the cluster can receive the rate limiting rules pushed by that node in a timely manner by listening to the configuration center. If the node listening to the configuration center also has the corresponding interface, the rate limiting rules will be loaded into the node's rate limiting rule cache.

[0133] Step 4: If the rate limiting rules and interface information already exist in the memory rate limiting rule cache set, it means that the interface has implemented traffic control, and the request can normally enter the rate limiting rule process for processing. The rate limiting process will determine whether to allow the request or discard it, ultimately achieving the rate limiting effect and ensuring the availability of the service system.

[0134] In this embodiment, the front-end processor automatically configures rate limiting rules for all nodes in the cluster by discovering traffic and broadcasting it to other nodes. This achieves automated generation and automatic activation of rate limiting rules, resolving the issue of downtime caused by sudden surges in access traffic to interfaces that are not explicitly required to be rate-limited. During this process, there is no need to worry about or analyze which interfaces require rate limiting configuration. Furthermore, the front-end processor sends the rate limiting rules to the configuration center, and the nodes retrieve the rate limiting rules from the configuration center asynchronously, reducing system overhead. In addition, this embodiment employs a configuration center listener-push approach. Alternatively, after generating rate limiting rules, they can be stored in a database or distributed cache, with other nodes in the cluster periodically accessing the database or distributed cache to retrieve updated rate limiting rules.

[0135] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0136] Based on the same inventive concept, this application also provides a flow limiting device for implementing the flow limiting method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more flow limiting device embodiments provided below can be found in the limitations of the flow limiting method described above, and will not be repeated here.

[0137] In one exemplary embodiment, such as Figure 6 As shown, a flow limiting device is provided, applied to a front-end processor, including: a node interface confirmation module 602, a flow limiting information generation module 604, and a flow limiting information synchronization module 606, wherein:

[0138] The node interface confirmation module 602 is used to confirm the target node and target interface corresponding to the traffic access request when a traffic access request is detected.

[0139] The rate limiting information generation module 604 is used to generate rate limiting information for the target interface when the rate limiting information cache of the target node does not contain rate limiting information for the target interface, and add the rate limiting information for the target interface to the rate limiting information cache of the target node; the rate limiting information for the target interface is used to limit the traffic access requests that meet the threshold conditions.

[0140] The rate limiting information synchronization module 606 is used to synchronize the rate limiting information of the target interface to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface.

[0141] In an exemplary embodiment, the node interface confirmation module 602 is further configured to, upon detecting a traffic access request, identify the request type of the traffic access request and the interface parameter information corresponding to the traffic access request; confirm the node cluster corresponding to the traffic access request based on the request type; identify, from the node cluster, a node that includes an interface matching the interface parameter information as a target node, and designate the interface in the target node that matches the interface parameter information as a target interface.

[0142] In an exemplary embodiment, the rate limiting information generation module 604 is further configured to: obtain historical access information of the target interface when there is no rate limiting information corresponding to the interface parameter information of the target interface in the rate limiting information cache of the target node; predict the target concurrency threshold and the target throughput threshold of the target interface based on the historical access information of the target interface; and generate rate limiting information of the target interface based on the target concurrency threshold and the target throughput threshold of the target interface.

[0143] In an exemplary embodiment, the traffic limiting device further includes a prediction model building module, which is used to obtain historical access information of each interface under multiple node clusters; and to build a concurrency threshold prediction model and a throughput threshold prediction model for multiple node clusters based on the historical access information of each interface under multiple node clusters.

[0144] The rate limiting information generation module 604 is also used to identify the target concurrency threshold prediction model and target throughput threshold prediction model of the node cluster corresponding to the target node from the concurrency threshold prediction model and throughput threshold prediction model of multiple node clusters; input the historical access information of the target interface into the target concurrency threshold prediction model and target throughput threshold prediction model respectively to perform threshold prediction, and obtain the target concurrency threshold and target throughput threshold of the target interface.

[0145] In an exemplary embodiment, the rate limiting information synchronization module 606 is further configured to send the rate limiting information of the target interface to the configuration center; the configuration center is configured to identify the interface parameter information of the target interface from the rate limiting information of the target interface, and based on the interface parameter information, identify the associated node of the target node from the node cluster corresponding to the target node, and send the rate limiting information of the target interface to the associated node, so that the associated node adds the received rate limiting information of the target interface to the rate limiting information cache of the node.

[0146] In one exemplary embodiment, such as Figure 7 As shown, another flow limiting device is also provided, which is applied to the node, including: a flow limiting information acquisition module 702 and a flow limiting information addition module 704.

[0147] The rate limiting information acquisition module 702 is used to acquire rate limiting information of the target interface synchronized by the front-end processor when the node is an associated node of the target node; the associated node is the node in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface;

[0148] The rate limiting information of the target interface is used for the target interface to perform rate limiting processing on traffic access request 5 that meets the threshold conditions. The front-end processor is used to identify the target node and target interface corresponding to the traffic access request when a traffic access request is detected. If the rate limiting information of the target interface does not exist in the rate limiting information cache of the target node, the processor generates the rate limiting information of the target interface and adds the rate limiting information of the target interface to the rate limiting information cache of the target node.

[0149] The 0-rate limiting information addition module 704 is used to add rate limiting information to the rate limiting information cache of the node.

[0150] In an exemplary embodiment, the traffic limiting device applied to the node further includes an associated node confirmation module, which, when the configuration center receives traffic limiting information of the target interface sent by the front-end processor, obtains the node parameter information of the target node from the traffic limiting information receiving record of the configuration center, and identifies the interface parameter information of the target interface from the traffic limiting information of the target interface cached by the configuration center; 5, when it is confirmed that the node and the target node belong to the same node cluster based on the node parameter information of the target node, queries each interface of the node; and if there is an interface among the various interfaces of the node that matches the interface parameter information of the target interface, confirms the node as an associated node of the target node.

[0151] The rate limiting information acquisition module 702 is also used to acquire the rate limiting information of the target interface generated by the preprocessor from the cache of the configuration center when the node is an associated node of the target node.

[0152] 0. Each module in the aforementioned flow limiting device can be entirely or partially controlled through software, hardware, or a combination thereof.

[0153] Implementation. The above modules can be embedded in the processor of a computer device in hardware form or independent of it, or they can be stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0154] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. This computer device includes a processor, memory, input / output...

[0155] Output interfaces (Input / Output, or I / O for short) and communication interfaces. These include the processor, memory, and input / output interfaces.

[0156] The output interface is connected via the system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of this computer device provides computing and control capabilities. The memory of this computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database of this computer device stores data such as rate limiting information and historical access information for each interface. The input / output interface of this computer device is used for exchanging information between the processor and external devices. The communication interface of this computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a rate limiting method.

[0157] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0158] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0159] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.

[0160] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0162] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0163] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0164] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A flow limiting method, characterized in that, Applied to a pre-processor, the method includes: Upon detecting a traffic access request, identify the target node and target interface corresponding to the traffic access request; If the rate limiting information for the target interface is not found in the rate limiting information cache of the target node, rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node. The rate limiting information for the target interface is used to limit the traffic of traffic access requests that meet the threshold conditions. The rate limiting information of the target interface is synchronized to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface; If the rate limiting information for the target interface is not found in the rate limiting information cache of the target node, generating the rate limiting information for the target interface includes: If no rate limiting information corresponding to the interface parameter information of the target interface exists in the rate limiting information cache of the target node, the historical access information of the target interface is obtained. This historical access information records each traffic access request received by the target interface, the traffic size of each traffic access request, and the processing status of each traffic access request. Based on the historical access information of the target interface, the target concurrency threshold and target throughput threshold of the target interface are predicted. Based on the target concurrency threshold and target throughput threshold of the target interface, rate limiting information for the target interface is generated. Before predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface, the method further includes: Obtain historical access information for each interface under multiple node clusters; based on the historical access information for each interface under the multiple node clusters, construct a concurrency threshold prediction model and a throughput threshold prediction model for the multiple node clusters. The step of predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface includes: identifying the target concurrency threshold prediction model and target throughput threshold prediction model of the node cluster corresponding to the target node from the concurrency threshold prediction model and throughput threshold prediction model of the multiple node clusters; inputting the historical access information of the target interface into the target concurrency threshold prediction model and the target throughput threshold prediction model respectively to perform threshold prediction, thereby obtaining the target concurrency threshold and target throughput threshold of the target interface.

2. The method according to claim 1, characterized in that, Upon detecting a traffic access request, confirming the target node and target interface corresponding to the traffic access request includes: Upon detecting a traffic access request, identify the request type of the traffic access request and the interface parameter information corresponding to the traffic access request; Based on the request type, confirm the node cluster corresponding to the traffic access request; From the node cluster, identify the node that includes an interface that matches the interface parameter information, and designate it as the target node. Then, designate the interface in the target node that matches the interface parameter information as the target interface.

3. The method according to claim 1, characterized in that, The step of synchronizing the rate limiting information of the target interface to the rate limiting information cache of the associated node of the target node includes: The rate limiting information of the target interface is sent to the configuration center. The configuration center is used to identify the interface parameter information of the target interface from the rate limiting information of the target interface, and based on the interface parameter information, to identify the associated node of the target node from the node cluster corresponding to the target node, and to send the rate limiting information of the target interface to the associated node, so that the associated node adds the received rate limiting information of the target interface to the rate limiting information cache of the node.

4. A flow limiting method, characterized in that, Applied to nodes, the method includes: When the node is an associated node of the target node, the rate limiting information of the target interface synchronized by the preprocessor is obtained; the associated node is one of the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface; the rate limiting information of the target interface is used for the target interface to perform traffic limiting processing on traffic access requests that meet the threshold conditions; the preprocessor is used to, upon detecting a traffic access request, confirm the target node and target interface corresponding to the traffic access request, and, upon querying the rate limiting information cache of the target node, find that the rate limiting information of the target interface does not exist. In the absence of information, the rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node. The rate limiting information for the target interface is also synchronized to the rate limiting information cache of the associated nodes of the target node. The rate limiting information for the target interface is generated by the front-end processor based on the historical access information of the target interface, predicting the target concurrency threshold and target throughput threshold of the target interface, and generating the information according to these thresholds. The historical access information of the target interface is stored in the rate limiting information cache of the target node and does not exist therein. The information is obtained under the condition of rate limiting information corresponding to the interface parameter information of the target interface; the historical access information records the traffic access requests received by the target interface, the traffic size of each traffic access request, and the processing status of each traffic access request; before predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface, the method further includes: the preprocessor obtains the historical access information of each interface under multiple node clusters; based on the historical access information of each interface under multiple node clusters, constructs the concurrency threshold prediction model and throughput threshold prediction model of the multiple node clusters; the step of predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface includes: the preprocessor identifies the target concurrency threshold prediction model and target throughput threshold prediction model of the node cluster corresponding to the target node from the concurrency threshold prediction model and throughput threshold prediction model of the multiple node clusters; the historical access information of the target interface is input into the target concurrency threshold prediction model and the target throughput threshold prediction model respectively to perform threshold prediction, thereby obtaining the target concurrency threshold and target throughput threshold of the target interface.

5. The method according to claim 4, characterized in that, In the case where the node is an associated node of the target node, before obtaining the rate limiting information of the target interface synchronized by the preprocessor, the following steps are also included: When it is detected that the configuration center has received the rate limiting information of the target interface sent by the front-end processor, the node parameter information of the target node is obtained from the rate limiting information receiving record of the configuration center, and the interface parameter information of the target interface is identified from the rate limiting information of the target interface cached by the configuration center. If, based on the node parameter information of the target node, it is confirmed that the node and the target node belong to the same node cluster, then query each interface of the node; If there is an interface among the interfaces of the node that matches the interface parameter information of the target interface, the node is identified as an associated node of the target node; When the node is an associated node of the target node, obtaining the rate limiting information of the target interface synchronized by the preprocessor includes: When the node is an associated node of the target node, the rate limiting information of the target interface generated by the front-end processor is obtained from the cache of the configuration center.

6. A flow limiting device, characterized in that, Applied to a pre-processor, the device includes: The node interface confirmation module is used to confirm the target node and target interface corresponding to the traffic access request when a traffic access request is detected. The rate limiting information generation module is used to generate rate limiting information for the target interface when the rate limiting information cache of the target node does not contain rate limiting information for the target interface, and to add the rate limiting information for the target interface to the rate limiting information cache of the target node; the rate limiting information for the target interface is used for the target interface to perform traffic limiting processing on traffic access requests that meet the threshold conditions; The rate limiting information synchronization module is used to synchronize the rate limiting information of the target interface to the rate limiting information cache of the associated nodes of the target node; the associated nodes are the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface; The rate limiting information generation module is also used for If no rate limiting information corresponding to the interface parameter information of the target interface exists in the rate limiting information cache of the target node, the historical access information of the target interface is obtained. This historical access information records each traffic access request received by the target interface, the traffic size of each traffic access request, and the processing status of each traffic access request. Based on the historical access information of the target interface, the target concurrency threshold and target throughput threshold of the target interface are predicted. Based on the target concurrency threshold and target throughput threshold of the target interface, rate limiting information for the target interface is generated. The traffic limiting device also includes a prediction model building module, which is used to obtain historical access information of each interface under multiple node clusters; and to build a concurrency threshold prediction model and a throughput threshold prediction model for the multiple node clusters based on the historical access information of each interface under the multiple node clusters. The rate limiting information generation module is further configured to identify the target concurrency threshold prediction model and target throughput threshold prediction model of the node cluster corresponding to the target node from the concurrency threshold prediction model and throughput threshold prediction model of the multiple node clusters; input the historical access information of the target interface into the target concurrency threshold prediction model and the target throughput threshold prediction model respectively to perform threshold prediction, and obtain the target concurrency threshold and target throughput threshold of the target interface.

7. A flow limiting device, characterized in that, Applied to a node, the device includes: The rate limiting information acquisition module is used to acquire rate limiting information of the target interface synchronized by the front-end processor when the node is an associated node of the target node; the associated node is one of the nodes in the node cluster corresponding to the target node, excluding the target node, including each node of the target interface; the rate limiting information of the target interface is used for the target interface to perform traffic limiting processing on traffic access requests that meet the threshold conditions; the front-end processor is used to, upon detecting a traffic access request, confirm the target node and target interface corresponding to the traffic access request, and, upon querying the rate limiting information cache of the target node, find that the target interface does not exist in the target interface's rate limiting information cache. In the case of rate limiting information for the target interface, rate limiting information for the target interface is generated and added to the rate limiting information cache of the target node. The rate limiting information for the target interface is also synchronized to the rate limiting information cache of the associated nodes of the target node. The rate limiting information for the target interface is generated by the preprocessor based on the historical access information of the target interface, predicting the target concurrency threshold and target throughput threshold of the target interface, and generating the information according to these thresholds. The historical access information of the target interface is stored in the rate limiting information cache of the target node. The historical access information is obtained when there is no rate limiting information corresponding to the interface parameter information of the target interface. The historical access information records the traffic access requests received by the target interface, the traffic size of each traffic access request, and the processing status of each traffic access request. Before predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface, the method further includes: the preprocessor obtaining the historical access information of each interface under multiple node clusters; constructing a concurrency threshold prediction model and a throughput threshold prediction model for the multiple node clusters based on the historical access information of each interface under the multiple node clusters; the step of predicting the target concurrency threshold and target throughput threshold of the target interface based on the historical access information of the target interface includes: the preprocessor identifying the target concurrency threshold prediction model and target throughput threshold prediction model of the node cluster corresponding to the target node from the concurrency threshold prediction model and throughput threshold prediction model of the multiple node clusters; inputting the historical access information of the target interface into the target concurrency threshold prediction model and the target throughput threshold prediction model respectively to perform threshold prediction, thereby obtaining the target concurrency threshold and target throughput threshold of the target interface.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Monitoring system, monitoring method and monitoring center

    CN109981484A

  • Redis-based API flow limiting method and device, computer equipment and storage medium

    CN113726676A

  • Flow limiting method, device and equipment of distributed system, medium and product

    CN115421922A