System, apparatus, device, medium, and program product for flow limiting

By dynamically adjusting the rate limiting parameters and combining service processing performance data and outbound call response data, the stability problem of distributed systems under high concurrency was solved, and dynamic limitation of inbound and outbound traffic was achieved, protecting the stability of the system and related systems.

CN116582490BActive Publication Date: 2026-06-05CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-05-31
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies cannot effectively protect the stability of distributed systems under high concurrency. Rate limiting strategies cannot be dynamically adjusted, cannot adapt to the hardware differences of different servers, and cannot consider rate limiting from the global perspective of the distributed system, resulting in a high risk of system crash.

Method used

By acquiring service processing performance data and outbound call response data of the target system, the rate limiting parameters are dynamically adjusted to match the system's processing capacity, thereby achieving dynamic limitation of inbound and outbound traffic. Further adjustments are then made based on system performance data.

Benefits of technology

It achieves stability protection for distributed systems, avoids avalanche effects, ensures stable operation of the system under high concurrency, and protects the performance of related systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116582490B_ABST
    Figure CN116582490B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of distribution, in particular to a system flow limiting method, device, equipment, medium and program product, the method comprises the following steps: obtaining service processing performance data of a target system, the service processing performance data is used for representing the processing capacity of the target system to service requests, the service processing performance data comprises one or more of request response time and request success rate; obtaining a first flow limiting parameter of the target system, the first flow limiting parameter is used for limiting the flow entering the target system; adjusting the first flow limiting parameter based on the service processing performance data, so that the adjusted first flow limiting parameter is matched with the processing capacity of the target system to service requests. The system flow limiting method can realize dynamic limitation of the visiting flow and the out-visiting flow of the target system, and can effectively guarantee the stability of the target system and protect the related systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed technology, and in particular to a system current limiting method, apparatus, device, medium, and program product. Background Technology

[0002] In internet application scenarios, application servers may receive unexpected access requests, such as sudden surges in traffic caused by viral marketing campaigns. However, every system has a service limit. When the traffic exceeds the system's service capacity, the system may freeze or crash. How to protect the system from being overwhelmed by high-concurrency access, or even cause a cascading failure that leads to related system failures, has become a research topic.

[0003] To ensure system stability and availability, rate limiting strategies can be employed to restrict incoming traffic under high concurrency or instantaneous high concurrency conditions. Several rate limiting strategies are available, such as the token bucket algorithm. However, the rate limiting parameters in this algorithm cannot be adjusted once determined. If the rate limiting parameter restricts traffic too much, the distributed system cannot handle it; if the parameter restricts traffic too little, the performance of the servers in the distributed system will not be fully utilized. Furthermore, since the hardware conditions of each server differ, applying a single token bucket rate limiting parameter to different servers is clearly inappropriate.

[0004] Furthermore, related technologies have proposed a rate-limiting strategy that dynamically adjusts rate-limiting parameters by periodically acquiring the usage of the server's Central Processing Unit (CPU) and memory. However, this strategy only observes CPU and memory usage to identify system performance bottlenecks, which is ineffective for application servers with non-CPU-intensive computing or non-blocking input / output (NIO) processing modes, especially with the increasing prevalence of containerized deployments, where this performance monitoring metric is too simplistic. Additionally, this strategy focuses on the performance of a single server and fails to consider rate-limiting from a global distributed system perspective. From the perspective of the entire distributed system, the performance of a single server does not reflect the overall load, resulting in poor rate-limiting effectiveness for the distributed system. Moreover, this strategy cannot address situations where the performance of a single server is normal, but the performance of downstream related systems in the distributed environment experiences problems. Summary of the Invention

[0005] To address the aforementioned problems in the prior art, the present invention aims to provide a system flow limiting method, apparatus, device, medium, and program product that can dynamically limit the inbound and outbound traffic of a target system, effectively ensuring the stability of the target system while also protecting related systems.

[0006] To address the above problems, this invention provides a system current limiting method, comprising:

[0007] Obtain service processing performance data of the target system. The service processing performance data is used to characterize the target system's ability to process service requests. The service processing performance data includes one or more of the following: request response time and request success rate.

[0008] Obtain a first rate limiting parameter for the target system, wherein the first rate limiting parameter is used to limit the traffic entering the target system;

[0009] The first rate limiting parameter is adjusted based on the service processing performance data so that the adjusted first rate limiting parameter matches the target system's ability to process service requests.

[0010] Furthermore, adjusting the first rate limiting parameter based on the service processing performance data includes:

[0011] Obtain first benchmark data corresponding to the service processing performance data, wherein the first benchmark data is determined based on the historical service processing performance data of the target system within a first time period;

[0012] Calculate the first rate of change of the service processing performance data relative to the first benchmark data;

[0013] The adjustment strategy for the first current limiting parameter is determined based on the first rate of change;

[0014] The first current limiting parameter is adjusted based on the adjustment strategy of the first current limiting parameter to obtain the adjusted first current limiting parameter.

[0015] Furthermore, the adjustment strategy for determining the first current limiting parameter based on the first rate of change includes:

[0016] Determine the threshold range in which the first rate of change falls;

[0017] The adjustment threshold of the first current limiting parameter is determined based on the threshold range in which the first rate of change falls.

[0018] Another aspect of the present invention provides a system current limiting method, comprising:

[0019] Obtain outbound call response data of the target system. The outbound call response data is used to characterize the processing capability of the associated system of the target system to service requests. The outbound call response data includes one or more of the following: outbound call response time and outbound call success rate.

[0020] Obtain the second rate limiting parameter of the target system, which is used to limit the outbound traffic of the target system to the associated system;

[0021] The second rate limiting parameter is adjusted based on the outbound call response data so that the adjusted second rate limiting parameter matches the processing capacity of the associated system for service requests.

[0022] Furthermore, adjusting the second flow limiting parameter based on the outbound call response data includes:

[0023] Obtain the second reference data corresponding to the outbound call response data, the second reference data being determined based on the historical outbound call response data of the target system within a second time period;

[0024] Calculate the second rate of change of the outbound call response data relative to the second baseline data;

[0025] The adjustment strategy for the second current limiting parameter is determined based on the second rate of change;

[0026] The second current limiting parameter is adjusted based on the adjustment strategy of the second current limiting parameter to obtain the adjusted second current limiting parameter.

[0027] Furthermore, the method also includes:

[0028] Acquire system performance data of the target system, wherein the system performance data is used to characterize the resource usage of the target system, and the system performance data includes one or more of CPU utilization, memory utilization, and system load;

[0029] The second flow limiting parameter is adjusted based on the system performance data so that the adjusted second flow limiting parameter matches the resource usage of the target system.

[0030] Furthermore, adjusting the second current limiting parameter based on the system performance data includes:

[0031] Determine the threshold range in which the system performance data falls;

[0032] The adjustment strategy for the second current limiting parameter is determined based on the threshold range in which the system performance data falls;

[0033] The second current limiting parameter is adjusted based on the adjustment strategy of the second current limiting parameter to obtain the adjusted second current limiting parameter.

[0034] Another aspect of the present invention provides a system current limiting device, comprising:

[0035] The first data acquisition module is used to acquire service processing performance data of the target system. The service processing performance data is used to characterize the target system's ability to process service requests. The service processing performance data includes one or more of the following: request response time and request success rate.

[0036] The first parameter acquisition module is used to acquire the first flow limiting parameter of the target system, and the first flow limiting parameter is used to limit the traffic entering the target system.

[0037] The first adjustment module is used to adjust the first rate limiting parameter based on the service processing performance data, so that the adjusted first rate limiting parameter matches the target system's ability to process service requests.

[0038] Another aspect of the present invention provides a system current limiting device, comprising:

[0039] The second data acquisition module is used to acquire outbound call response data of the target system. The outbound call response data is used to characterize the processing capability of the associated system of the target system to service requests. The outbound call response data includes one or more of the outbound call response time and outbound call success rate.

[0040] The second parameter acquisition module is used to acquire the second rate limiting parameter of the target system, which is used to limit the outbound traffic of the target system to the associated system.

[0041] The second adjustment module is used to adjust the second rate limiting parameter based on the outbound call response data, so that the adjusted second rate limiting parameter matches the processing capacity of the associated system for service requests.

[0042] In another aspect, the present invention provides an electronic device including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the system current limiting method as described above.

[0043] In another aspect, the present invention provides a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the system rate limiting method as described above.

[0044] In another aspect, the present invention provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the steps of the system current limiting method described above.

[0045] Due to the above technical solution, the present invention has the following beneficial effects:

[0046] According to the system rate limiting method of the present invention, a first rate limiting parameter for limiting traffic entering the target system is adjusted based on the service processing performance data of the target system, so that the adjusted first rate limiting parameter matches the processing capacity of the target system for service requests. This method considers the rate limiting strategy from a system-wide perspective, realizes dynamic limitation of the inbound traffic to the target system, so that when rate limiting occurs, the rate limiting parameter of the inbound traffic is no longer a fixed setting, but is related to the processing capacity of the target system, thereby effectively ensuring the stability of the target system.

[0047] According to the system flow limiting method of the present invention, a second flow limiting parameter for limiting the outbound traffic of the target system to associated systems is adjusted based on the outbound call response data and / or system performance data of the target system. This adjustment ensures that the second flow limiting parameter matches the processing capacity of the associated system for service requests and / or the resource usage of the target system. By dynamically adjusting the flow limiting parameter of the target system's outbound traffic based on more comprehensive core flow limiting indicators, the method achieves dynamic limitation of the target system's outbound traffic, thus protecting both the target system and associated systems.

[0048] Furthermore, the system rate limiting method according to the embodiments of the present invention can more comprehensively protect its own system and prevent the avalanche effect by detecting and limiting rate in both inbound and outbound traffic directions, and can better protect related systems compared with traditional inbound rate limiting. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the present invention, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0050] Figure 1 This is a schematic diagram of the implementation environment provided in one embodiment of the present invention;

[0051] Figure 2 This is a flowchart of a system current limiting method provided in an embodiment of the present invention;

[0052] Figure 3 This is a flowchart of a system current limiting method provided in another embodiment of the present invention;

[0053] Figure 4 This is a flowchart of a system current limiting method provided in another embodiment of the present invention;

[0054] Figure 5 This is a flowchart of a system current limiting method provided in another embodiment of the present invention;

[0055] Figure 6 This is a flowchart of a system current limiting method provided in another embodiment of the present invention;

[0056] Figure 7 This is a schematic diagram of the structure of a system current limiting device provided in one embodiment of the present invention;

[0057] Figure 8 This is a schematic diagram of the structure of a system current limiting device provided in another embodiment of the present invention;

[0058] Figure 9 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0059] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0060] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0061] To make the objectives, technical solutions, and advantages disclosed in the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. The acquisition, storage, use, and processing of data in the technical solutions of the embodiments of the present invention all comply with the relevant provisions of national laws and regulations.

[0062] It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the present invention and are not intended to limit the embodiments of the present invention. First, the embodiments of the present invention explain the following concepts:

[0063] System rate limiting: System rate limiting is a proactive defense mechanism to protect the system. It limits the traffic access to the system by degrading services, ensuring that the system can provide stable services in high-concurrency scenarios.

[0064] System load (LoadAverage): In Linux systems, system load is a measure of CPU workload. It is mainly affected by three parts: CPU usage, memory usage, and input / output (IO). It is the average number of threads in the system run queue within a specific time range.

[0065] Token: Used to control access to resources. The system must obtain a token before it can successfully accept a request. Requests that cannot obtain a token cannot be responded to in a timely manner and will enter the rate limiting post-processing process.

[0066] Outbound call: Requesting services outside the scope of this system is defined as an outbound call, such as requesting services from a third-party system.

[0067] Reference manual attached Figure 1 It illustrates a schematic diagram of the implementation environment of a system current limiting method provided in an embodiment of the present invention, such as... Figure 1 As shown, the implementation environment may include at least an Application Programming Interface (API) gateway 110, at least one application service 120, and a rate limiting policy center 130. The rate limiting policy center 130, the API gateway 110, and the at least one application service 120 may be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any restrictions on this.

[0068] The API gateway 110 can be used to control inbound traffic. It generates inbound tokens for microservices and specific request paths within microservices by receiving rate-limiting policies issued by the rate-limiting policy center 130. Specifically, the API gateway 110 may include a first metric collector 111, a request interceptor 112, a first rate-limiting processor 113, and an inbound token generator 114. Service requests enter the request interceptor 112 to obtain a token before being routed to a microservice. If an access token is successfully obtained, the request continues to be routed downwards. If a token is not successfully obtained, the request can enter the first rate-limiting processor 113 for queuing or direct rejection. The first metric collector 111 can periodically collect service processing performance data of the system, including but not limited to one or more of request response time and request success rate, and centrally send the collected service processing performance data to the rate-limiting policy center 130.

[0069] The application service 120, acting as the application logic provider, can accept service requests forwarded from the API gateway 110. The API gateway 110 provides protection for the inbound traffic of the application service 120 itself, while the application service 120 provides protection for outbound traffic to associated systems. Specifically, the application service 120 may include a second indicator collector 121, an outbound call interceptor 122, a second rate limiting processor 123, and an outbound token generator 124. Before being sent to the associated system, outbound call requests enter the outbound call interceptor 122 to obtain a token. If an access token is successfully obtained, the request continues to be sent; if a token is not successfully obtained, the request can enter the second rate limiting processor 123 for queuing or direct rejection.

[0070] Unlike the API gateway, the application service 120 may not be able to obtain performance metrics such as CPU utilization, memory utilization, and system load of the associated system. Therefore, it can collect metrics from dimensions such as outbound call response time and outbound call success rate to characterize the processing capability of the associated system for service requests. That is, the second metric collector 121 can periodically collect outbound call response data of the system, including but not limited to one or more of outbound call response time and outbound call success rate, and centrally send the collected outbound call response data to the rate limiting policy center 130.

[0071] The rate limiting strategy center 130 serves as a centralized rate limiting strategy center, used to complete tasks such as indicator data collection, rate limiting parameter calculation, and rate limiting parameter distribution. The rate limiting strategy center 130 may include an indicator collector 131, a rate limiting parameter calculator 132, and a parameter distributor 133. The indicator collector 131 can receive service processing performance data sent by the first indicator collector 111 and outbound call response data sent by the second indicator collector 121. The rate limiting parameter calculator 132 can calculate, based on the service processing performance data and the outbound call response data, against the current benchmark indicator value to determine whether to adjust the rate limiting parameters. If rate limiting parameters need to be adjusted, the method provided in this embodiment can be used to adjust the rate limiting parameters, and the adjusted rate limiting parameters can be sent to the API gateway 110 and / or the application service 120 through the parameter distributor 133. The inbound token generator 114 and / or the outbound token generator 124 can adjust information such as the number of tokens issued or the token issuance rate based on the received corresponding rate limiting parameters.

[0072] In one possible embodiment, the second indicator collector 121 can also periodically collect system performance data, including but not limited to one or more of CPU utilization, memory utilization, and system load, and centrally send the collected system performance data to the rate limiting policy center 130. The indicator collector 131 can also receive the system performance data sent by the second indicator collector 121, and the rate limiting parameter calculator 132 can determine whether to adjust the rate limiting parameters based on the system performance data. If it is necessary to adjust the rate limiting parameters, the method provided in this embodiment of the invention can be used to adjust the rate limiting parameters, and the adjusted rate limiting parameters can be sent to the application service 120 through the parameter distributor 133.

[0073] It should be noted that, Figure 1 This is merely an example. Those skilled in the art will understand that, although... Figure 1 Only one application service 120 is shown in the figure, but this does not constitute a limitation on the embodiments of the present invention. It may include more or fewer application services 120 than shown in the figure.

[0074] The following is a detailed description of the inbound traffic limiting method provided in the embodiments of the present invention.

[0075] Reference manual attached Figure 2 This illustrates the flow chart of a system current limiting method provided by an embodiment of the present invention, which can be applied to... Figure 1 In the rate limiting strategy center, specific examples include... Figure 2 As shown, the method may include the following steps:

[0076] S210: Obtain service processing performance data of the target system. The service processing performance data is used to characterize the target system's ability to process service requests. The service processing performance data includes one or more of the following: request response time and request success rate.

[0077] In this embodiment of the invention, the target system can be a single-server system or a distributed system. The target system can be a non-CPU-intensive computing system or a system with NIO processing mode. This embodiment of the invention does not impose specific limitations on this.

[0078] In this embodiment of the invention, the service processing performance data may include, but is not limited to, data that characterizes the target system's ability to process service requests for services within the system's scope, such as request response time and request success rate. The request success rate may be the request success rate over a period of time. The period of time can be preset according to actual needs, for example, it may be set to 1 hour, 30 minutes, etc., and this embodiment of the invention does not impose specific limitations on it. Specifically, a shorter request response time and a higher request success rate indicate that the target system has a better ability to process service requests, while a longer request response time and a lower request success rate indicate that the target system has a worse ability to process service requests.

[0079] Optionally, refer to the accompanying reference manual. Figure 3 The API gateway can periodically collect service processing performance data of the target system and send the collected data to the rate limiting policy center. For example, at the end of a period, the API gateway can obtain the number of successfully requested services and the total number of all service requests within that period, and calculate the success rate by dividing the result by the number of successfully requested services by the total number of all service requests, then send this result to the rate limiting policy center.

[0080] S220: Obtain the first flow limiting parameter of the target system, the first flow limiting parameter being used to limit the flow entering the target system.

[0081] In this embodiment of the invention, the first rate limiting parameter can be stored in the rate limiting policy center. After obtaining the service processing performance data, the first rate limiting parameter of the target system can be directly read. The first rate limiting parameter may include, but is not limited to, parameters such as the number of access tokens issued and the access token issuance rate.

[0082] In one possible embodiment, the first rate limiting parameter can also be sent to the rate limiting policy center by the API gateway. For example, the API gateway can send the target system's current first rate limiting parameter to the rate limiting policy center along with the service processing performance data.

[0083] S230: Adjust the first rate limiting parameter based on the service processing performance data so that the adjusted first rate limiting parameter matches the target system's ability to process service requests.

[0084] In this embodiment of the invention, based on the service processing performance data, it can be determined whether the first rate limiting parameter of the target system matches the target system's ability to process service requests. If they match, no adjustment is made; if they do not match, the first rate limiting parameter is adjusted so that it matches the target system's ability to process service requests. For example, if the target system has a good ability to process service requests, but the first rate limiting parameter is small, then they do not match, and the first rate limiting parameter can be increased; if the target system has a poor ability to process service requests, but the first rate limiting parameter is large, then they also do not match, and the first rate limiting parameter can be decreased.

[0085] In one possible embodiment, adjusting the first rate limiting parameter based on the service processing performance data may include: obtaining first baseline data corresponding to the service processing performance data, wherein the first baseline data is determined based on historical service processing performance data of the target system within a first time period; calculating a first rate of change of the service processing performance data relative to the first baseline data; determining an adjustment strategy for the first rate limiting parameter based on the first rate of change; and adjusting the first rate limiting parameter based on the adjustment strategy to obtain the adjusted first rate limiting parameter.

[0086] Specifically, historical service processing performance data of the target system within a first time period can be obtained, and the average value of the historical service processing performance data can be calculated as the first benchmark data. The first time period can be preset according to actual needs, for example, it can be set to 1 week, 1 day, or even 1 week's working days or rest days, etc. This embodiment of the invention does not impose specific limitations in this regard. The calculation process of the first rate of change can refer to existing technologies, and will not be elaborated further in this embodiment of the invention.

[0087] It is understood that the embodiments of the present invention comprehensively limit inbound traffic based on multiple dimensions of indicators such as service processing performance indicators such as request response time and request success rate, as well as historical patterns. This enables the adjusted first rate limiting parameter to better match the operating status of the target system, thereby fully leveraging the service capabilities of the system.

[0088] Specifically, an adjustment threshold can be determined based on the first rate of change and the type of service processing performance data, and the first rate limiting parameter can be adjusted based on the adjustment threshold. It is understood that when the types of service processing performance data are different, the same adjustment threshold can be obtained based on the same first rate of change, or different adjustment thresholds can be obtained.

[0089] In one possible embodiment, the strategy for determining the adjustment of the first current limiting parameter based on the first rate of change may include: determining the threshold range in which the first rate of change falls; and determining the adjustment threshold of the first current limiting parameter based on the threshold range in which the first rate of change falls.

[0090] Specifically, for different types of service processing performance data, a pre-defined correspondence between the threshold range of the first rate of change and the adjustment threshold can be established. After determining the threshold range of the first rate of change, an adjustment threshold corresponding to the threshold range can be determined based on the correspondence between the types of service processing performance data, serving as the adjustment threshold for the first rate limiting parameter. Subsequently, the first rate limiting parameter can be adjusted based on the adjustment threshold.

[0091] For example, when the service processing performance data is request response time, if the growth rate of the request response time relative to the baseline request response time (as an instance of the first baseline data) does not exceed 20%, the first rate limiting parameter is not adjusted; if the growth rate of the request response time relative to the baseline request response time exceeds 20% but does not exceed 50%, the first rate limiting parameter value is reduced by 10% (i.e., the adjustment threshold is -10%); if the growth rate of the request response time relative to the baseline request response time exceeds 50% but does not exceed 100%, the first rate limiting parameter value is reduced by 20%; if the growth rate of the request response time relative to the baseline request response time exceeds 100% but does not exceed 150%, the first rate limiting parameter value is reduced by 50%; and if the growth rate of the request response time relative to the baseline request response time exceeds 150%, the first rate limiting parameter value is reduced by 80%. Correspondingly, when the request response time recovers, the first rate limiting parameter value can also be increased in reverse according to the rules.

[0092] For example, when the service processing performance data is the request success rate, if the rate of decrease in the request success rate relative to the baseline request success rate (another instance of the first rate of change) within a period does not exceed 20%, the first rate limiting parameter value is reduced by 40% (i.e., the adjustment threshold is -40%); if the rate of decrease in the request success rate relative to the baseline request success rate within a period exceeds 20% but does not exceed 50%, the first rate limiting parameter value is reduced by 80%; if the rate of decrease in the request success rate relative to the baseline request success rate within a period exceeds 50% but does not exceed 80%, the first rate limiting parameter value is reduced by 90%; and if the rate of decrease in the request success rate relative to the baseline request success rate within a period exceeds 80%, the first rate limiting parameter value is reduced by 100%. Correspondingly, when the request success rate recovers, the first rate limiting parameter value can also be increased in reverse according to the rules.

[0093] Specifically, after determining the adjustment threshold of the first current limiting parameter, the adjusted first current limiting parameter can be calculated based on the first current limiting parameter and the adjustment threshold.

[0094] In one possible embodiment, referencing the appendix to the specification... Figure 3 The step S230 may further include sending the adjusted first rate limiting parameter to the API gateway.

[0095] It is understood that the embodiments of the present invention protect access by limiting system inbound traffic based on API gateways, which can consider the rate limiting strategy from the perspective of the whole system and avoid the situation where the performance indicators of a single server are normal but the overall system performance indicators are abnormal.

[0096] In one possible embodiment, a first maximum current limiting parameter value and a first minimum current limiting parameter value can be preset. When the calculated adjusted first current limiting parameter is greater than or equal to the first minimum current limiting parameter value and less than or equal to the first maximum current limiting parameter value, the calculated adjusted first current limiting parameter can be used as the final first current limiting parameter. When the calculated adjusted first current limiting parameter is less than the first minimum current limiting parameter value, the first minimum current limiting parameter value can be used as the final first current limiting parameter. When the calculated adjusted first current limiting parameter is greater than the first maximum current limiting parameter value, the first maximum current limiting parameter value can be used as the final first current limiting parameter. The first maximum current limiting parameter value and the first minimum current limiting parameter value can be preset according to system performance, and this embodiment of the invention does not impose specific limitations on this.

[0097] Accordingly, step S230 may be followed by a step of sending the final first rate limiting parameter to the API gateway.

[0098] It is understood that by pre-setting the maximum and minimum current limiting parameters, the embodiments of the present invention can ensure that the first current limiting parameter is always within a reasonable range, thereby further ensuring the stability of the target system.

[0099] In one possible embodiment, the target system may include multiple request paths. Therefore, the service processing performance data may include the request response time and / or request success rate corresponding to multiple request paths, and the first rate limiting parameter may also include first rate limiting parameters corresponding to multiple request paths. For the first rate limiting parameter corresponding to each request path, separate methods can be used. Figure 2 The rate limiting method provided in the illustrated embodiment has been adjusted.

[0100] It should be noted that when the service processing performance data includes multiple types of data, it can be used... Figure 2 The rate limiting method provided in the illustrated embodiment adjusts the first rate limiting parameter sequentially to obtain the adjusted first rate limiting parameter. For example, when the service processing performance data includes request response time and request success rate, the first rate limiting parameter can be adjusted firstly based on the request response time, and then the first rate limiting parameter adjusted based on the request success rate can be adjusted again to obtain the adjusted first rate limiting parameter.

[0101] It should be noted that the system rate limiting method provided in this embodiment of the invention can be performed independently or based on parameter adjustments made according to the system performance data of the target system. This embodiment of the invention does not impose any limitations on this. It is understood that for non-CPU-intensive systems and systems using NIO processing mode, the rate limiting effect of the system rate limiting method provided in this embodiment of the invention is significantly better than that of existing rate limiting methods based on parameter adjustments made according to system performance data.

[0102] In summary, the system rate limiting method according to the embodiments of the present invention adjusts the first rate limiting parameter for limiting traffic entering the target system based on the service processing performance data of the target system, so that the adjusted first rate limiting parameter matches the processing capacity of the target system for service requests. This method considers the rate limiting strategy from a system-wide perspective, realizes dynamic limitation of inbound traffic to the target system, and ensures that when rate limiting occurs, the rate limiting parameter of inbound traffic is no longer a fixed setting, but is related to the processing capacity of the target system, thereby effectively ensuring the stability of the target system.

[0103] To mitigate the impact of performance issues in downstream related systems on the target system in a distributed environment, and to protect the related systems as well, this invention also provides a rate limiting method for restricting outbound traffic. The rate limiting method for outbound traffic provided by this invention is described in detail below.

[0104] Reference manual attached Figure 4 This illustrates the flow chart of a system current limiting method provided by another embodiment of the present invention, which can be applied to... Figure 1 In the rate limiting strategy center, specific examples include... Figure 4 As shown, the method may include the following steps:

[0105] S410: Obtain outbound call response data of the target system. The outbound call response data is used to characterize the processing capability of the associated system of the target system for service requests. The outbound call response data includes one or more of the outbound call response time and outbound call success rate.

[0106] In this embodiment of the invention, since performance indicators such as CPU utilization, memory utilization, and system load of the associated system may not be readily available, the outbound call response time and outbound call success rate of the target system can be used to characterize the associated system's ability to process service requests. That is, the outbound call response data may include, but is not limited to, data that characterizes the associated system's ability to process service requests, such as outbound call response time and outbound call success rate. The outbound call success rate can also be the request success rate within a period. The period can be preset according to actual needs, for example, it can be set to 1 hour, 30 minutes, etc., and this embodiment of the invention does not impose specific limitations on this. Specifically, a shorter outbound call response time and a higher outbound call success rate indicate a better ability of the associated system to process service requests, while a longer outbound call response time and a lower outbound call success rate indicate a worse ability of the associated system to process service requests.

[0107] Optionally, refer to the accompanying reference manual. Figure 5 The application service can periodically collect outbound call response data from the target system and send the collected outbound call response data to the rate limiting policy center. For example, at the end of a cycle, the application service can obtain the number of successful outbound service requests and the total number of outbound calls during that cycle, and calculate the outbound call success rate by dividing the result by the number of successful outbound service requests by the total number of outbound calls, then send this result to the rate limiting policy center.

[0108] S420: Obtain the second flow limiting parameter of the target system, which is used to limit the outbound traffic of the target system to the associated system.

[0109] In this embodiment of the invention, the second rate limiting parameter can be stored in the rate limiting strategy center. Upon obtaining the outbound call response data, the second rate limiting parameter of the target system can be directly read. The second rate limiting parameter may include, but is not limited to, parameters such as the number of outbound tokens issued and the outbound token issuance rate.

[0110] In one possible embodiment, the second rate limiting parameter can also be sent to the rate limiting policy center by the application service. For example, the application service can send the target system's current second rate limiting parameter to the rate limiting policy center at the same time as sending the outbound call response data.

[0111] S430: Adjust the second rate limiting parameter based on the outbound call response data so that the adjusted second rate limiting parameter matches the processing capacity of the associated system for service requests.

[0112] In this embodiment of the invention, based on the outbound call response data, it can be determined whether the second rate limiting parameter of the target system matches the processing capacity of the associated system for service requests. If they match, no adjustment is made; if they do not match, the second rate limiting parameter is adjusted so that it matches the processing capacity of the associated system for service requests. For example, if the associated system has a good processing capacity for service requests, but the second rate limiting parameter is small, then they do not match, and the second rate limiting parameter can be increased; if the associated system has a poor processing capacity for service requests, but the second rate limiting parameter is large, then they also do not match, and the second rate limiting parameter can be decreased.

[0113] In one possible embodiment, adjusting the second flow limiting parameter based on the outbound call response data may include: obtaining second baseline data corresponding to the outbound call response data, the second baseline data being determined based on historical outbound call response data of the target system within a second time period; calculating a second rate of change of the outbound call response data relative to the second baseline data; determining an adjustment strategy for the second flow limiting parameter based on the second rate of change; and adjusting the second flow limiting parameter based on the adjustment strategy to obtain the adjusted second flow limiting parameter.

[0114] Specifically, historical outbound call response data of the target system within a second time period can be obtained, and the average value of the historical outbound call response data can be calculated as the second benchmark data. The second time period can also be preset according to actual needs, such as being set to 1 week, 1 day, or even 1 week's workdays and rest days; this embodiment of the invention does not impose specific limitations in this regard. The calculation process of the second rate of change can refer to existing technologies, and will not be elaborated upon here.

[0115] It is understood that, from the perspective of the operation status of the associated system, the embodiments of the present invention comprehensively implement outbound traffic limiting based on multiple dimensions of indicators such as outbound call response time, outbound call success rate, and historical patterns of the target system. This enables the adjusted second traffic limiting parameter to better match the operation status of the associated system, thereby protecting the associated system and reducing the risk of avalanche of the associated system.

[0116] Specifically, an adjustment threshold can be determined based on the second rate of change and the type of outbound call response data, and the second flow limiting parameter can be adjusted based on the adjustment threshold. It is understood that when the types of outbound call response data are different, the same adjustment threshold can be obtained based on the same second rate of change, or different adjustment thresholds can be obtained.

[0117] Specifically, for different types of outbound call response data, a pre-defined correspondence between the threshold range of the second rate of change and the adjustment threshold can be established. After determining the threshold range of the second rate of change, an adjustment threshold corresponding to the threshold range can be determined based on the correspondence between the types of outbound call response data, serving as the adjustment threshold for the second flow limiting parameter. Subsequently, the second flow limiting parameter can be adjusted based on the adjustment threshold.

[0118] For example, when the outbound call response data is the outbound call response time, if the growth rate of the outbound call response time relative to the baseline outbound call response time (as an example of the second baseline data) does not exceed 20%, the second rate limiting parameter is not adjusted; if the growth rate of the outbound call response time relative to the baseline outbound call response time exceeds 20% but does not exceed 50%, the value of the second rate limiting parameter is reduced by 10% (i.e., the adjustment threshold is -10%); if the growth rate of the outbound call response time relative to the baseline outbound call response time exceeds 50% but does not exceed 100%, the value of the second rate limiting parameter is reduced by 20%; if the growth rate of the outbound call response time relative to the baseline outbound call response time exceeds 100% but does not exceed 150%, the value of the second rate limiting parameter is reduced by 50%; and if the growth rate of the outbound call response time relative to the baseline outbound call response time exceeds 150%, the value of the second rate limiting parameter is reduced by 80%. Correspondingly, when the outbound call response time recovers, the value of the second rate limiting parameter can also be increased in reverse according to the rules.

[0119] Specifically, after determining the adjustment threshold of the second current limiting parameter, the adjusted second current limiting parameter can be calculated based on the second current limiting parameter and the adjustment threshold.

[0120] In one possible embodiment, referencing the appendix to the specification... Figure 5 The step S430 may further include sending the adjusted second rate limiting parameter to the application service.

[0121] In one possible embodiment, a second maximum current limiting parameter value and a second minimum current limiting parameter value can be preset. When the calculated adjusted second current limiting parameter is greater than or equal to the second minimum current limiting parameter value and less than or equal to the second maximum current limiting parameter value, the calculated adjusted second current limiting parameter can be used as the final second current limiting parameter. When the calculated adjusted second current limiting parameter is less than the second minimum current limiting parameter value, the second minimum current limiting parameter value can be used as the final second current limiting parameter. When the calculated adjusted second current limiting parameter is greater than the second maximum current limiting parameter value, the second maximum current limiting parameter value can be used as the final second current limiting parameter. The second maximum current limiting parameter value and the second minimum current limiting parameter value can be preset according to system performance, and this embodiment of the invention does not impose specific limitations on this.

[0122] Accordingly, step S430 may be followed by a step of sending the final second rate limiting parameter to the application service.

[0123] It is understood that by pre-setting the maximum and minimum current limiting parameters, the embodiments of the present invention can ensure that the second current limiting parameter is always within a reasonable range, thereby further ensuring the stability of the target system.

[0124] In one possible embodiment, the target system may include multiple request paths; therefore, the outbound call response data may include the outbound call response time and / or outbound call success rate corresponding to multiple request paths, and the second rate limiting parameter may also include second rate limiting parameters corresponding to multiple request paths. For the second rate limiting parameter corresponding to each request path, separate methods can be used. Figure 4 The rate limiting method provided in the illustrated embodiment has been adjusted.

[0125] It should be noted that when the outbound call response data includes multiple types of data, it can be used... Figure 4 The rate limiting method provided in the illustrated embodiment adjusts the second rate limiting parameter sequentially to obtain the adjusted second rate limiting parameter. For example, when the outbound call response data includes outbound call response time and outbound call success rate, the second rate limiting parameter can be adjusted first based on the outbound call response time, and then the adjusted second rate limiting parameter based on the outbound call success rate can be adjusted again to obtain the adjusted second rate limiting parameter.

[0126] It is understood that the embodiments of the present invention dynamically limit outbound traffic by dynamically diagnosing the operation of external related systems. When traffic limiting occurs, the traffic limiting parameters for outbound traffic are no longer fixed, but are related to the performance of the related systems. This can protect the target system while also protecting the related systems, effectively addressing the situation where the performance indicators of the system itself are normal in a distributed environment, but the performance of the downstream related systems is problematic.

[0127] In one possible embodiment, referencing the appendix to the specification... Figure 6 Furthermore, the second current limiting parameter can be adjusted based on the performance data of the target system. Specifically, such as... Figure 6 As shown, the method may include the following steps:

[0128] S610: Obtain system performance data of the target system. The system performance data is used to characterize the resource usage of the target system. The system performance data includes one or more of CPU utilization, memory utilization, and system load.

[0129] In this embodiment of the invention, the system performance data may include, but is not limited to, data that can characterize the resource usage of the target system, such as CPU utilization, memory utilization, and system load. Specifically, higher CPU utilization, higher memory utilization, or higher system load indicates higher resource occupancy, meaning fewer available resources in the target system; conversely, lower CPU utilization, lower memory utilization, or lower system load indicates lower resource occupancy, meaning more available resources in the target system.

[0130] In this embodiment of the invention, multiple servers are deployed in the distributed system. The hardware of each server may be the same or different, and this embodiment of the invention does not limit this. Each server in the distributed system starts a process to monitor the CPU utilization, memory utilization, and system load of the hardware.

[0131] Optionally, refer to the accompanying reference manual. Figure 5 (like Figure 5 (As shown in the dashed section), the application service can periodically collect system performance data of the target system and send the collected system performance data to the rate limiting policy center.

[0132] S620: Obtain the second flow limiting parameter of the target system, the second flow limiting parameter being used to limit the outbound traffic of the target system to the associated system.

[0133] It should be noted that the specific details of step S620 can be found by referring to... Figure 4 The specific details of the system current limiting method provided in the illustrated embodiment will not be repeated here.

[0134] S630: Adjust the second current limiting parameter based on the system performance data so that the adjusted second current limiting parameter matches the resource usage of the target system.

[0135] In this embodiment of the invention, based on the system performance data, it can be determined whether the second rate limiting parameter of the target system matches the resource usage of the target system. If they match, no adjustment is made; if they do not match, the second rate limiting parameter is adjusted so that it matches the resource usage of the target system. For example, if the resource utilization rate of the target system is low and the second rate limiting parameter is small, they do not match, and the second rate limiting parameter can be increased; if the resource utilization rate of the target system is high and the second rate limiting parameter is large, they also do not match, and the second rate limiting parameter can be decreased.

[0136] It is understood that, by starting from its own operating status, the embodiments of the present invention dynamically limit outbound traffic based on performance indicators such as CPU utilization, memory utilization, and system load of the target system, thereby ensuring that the adjusted second flow limiting parameter conforms to the operating status of the target system and further improves the stability of the target system.

[0137] In one possible embodiment, adjusting the second current limiting parameter based on the system performance data may include: determining the threshold range in which the system performance data falls; determining an adjustment strategy for the second current limiting parameter based on the threshold range in which the system performance data falls; and adjusting the second current limiting parameter based on the adjustment strategy to obtain the adjusted second current limiting parameter.

[0138] Specifically, an adjustment threshold can be determined based on the threshold range of the system performance data and the type of the system performance data, and the second current limiting parameter can be adjusted based on the adjustment threshold.

[0139] For example, for different types of system performance data, a correspondence between the threshold range of the system performance data and the adjustment threshold can be preset. After determining the threshold range of the system performance data, an adjustment threshold corresponding to the threshold range can be determined according to the correspondence between the types of system performance data, and used as the adjustment threshold of the second current limiting parameter. Subsequently, the second current limiting parameter can be adjusted according to the adjustment threshold.

[0140] For example, when the system performance data is CPU utilization, if the CPU utilization exceeds 80% but does not exceed 90%, the second current limiting parameter value can be reduced by 20% (i.e., the threshold is adjusted to -20%); if the CPU utilization exceeds 90%, the second current limiting parameter value can be reduced by 50%. Correspondingly, if the CPU utilization does not exceed 20%, the second current limiting parameter value can be increased by 50%; if the CPU utilization exceeds 20% but does not exceed 40%, the second current limiting parameter value can be increased by 20%.

[0141] In one possible embodiment, the target system may include multiple application services. Therefore, the system performance data may include CPU utilization, memory utilization, and / or system load corresponding to multiple application services. The second rate limiting parameter may also include second rate limiting parameters corresponding to multiple application services. For the second rate limiting parameter corresponding to each application service, separate methods can be used. Figure 6 The rate limiting method provided in the illustrated embodiment has been adjusted.

[0142] It should be noted that when the system performance data includes multiple types of data, it can be used... Figure 6 The rate limiting method provided in the illustrated embodiment adjusts the second rate limiting parameter sequentially to obtain the adjusted second rate limiting parameter. For example, when the system performance data includes CPU utilization and system load, the second rate limiting parameter can be adjusted first based on CPU utilization, and then adjusted again based on the system load to obtain the adjusted second rate limiting parameter.

[0143] It should be noted that other specific details in the embodiments of the present invention can be found by referring to [the relevant documentation]. Figure 4 The specific details of the system current limiting method provided in the illustrated embodiment will not be repeated here.

[0144] It is understood that the embodiments of the present invention dynamically limit outbound traffic by dynamically diagnosing the operating status of the target system. This means that when traffic limiting occurs, the traffic limiting parameters for outbound traffic are no longer fixed, but are related to the performance of the target system, thereby effectively ensuring the stability of the target system.

[0145] In summary, the system flow limiting method according to embodiments of the present invention adjusts the second flow limiting parameter for limiting the outbound traffic of the target system to associated systems based on the outbound call response data and / or system performance data of the target system. This makes the adjusted second flow limiting parameter match the processing capacity of the associated system for service requests and / or the resource usage of the target system. By dynamically adjusting the flow limiting parameter of the target system's outbound traffic based on more comprehensive core flow limiting indicators, this method achieves dynamic limitation of the target system's outbound traffic, and can protect the target system while also protecting associated systems.

[0146] It should be noted that, Figure 2 The system current limiting method provided in the illustrated embodiment, Figure 4 The system current limiting method and the embodiment shown provide Figure 6 The system current limiting method provided in the illustrated embodiment can be performed individually, in pairs in parallel, or in all three in parallel. This embodiment of the invention does not impose any restrictions on this.

[0147] Reference manual attached Figure 7 This illustrates the structure of a system current limiting device 700 provided in one embodiment of the present invention. For example... Figure 7 As shown, the device 700 may include:

[0148] The first data acquisition module 710 is used to acquire service processing performance data of the target system. The service processing performance data is used to characterize the target system's ability to process service requests. The service processing performance data includes one or more of the following: request response time and request success rate.

[0149] The first parameter acquisition module 720 is used to acquire the first flow limiting parameter of the target system, wherein the first flow limiting parameter is used to limit the flow entering the target system.

[0150] The first adjustment module 730 is used to adjust the first rate limiting parameter based on the service processing performance data, so that the adjusted first rate limiting parameter matches the target system's ability to process service requests.

[0151] Reference manual attached Figure 8 This illustrates the structure of a system current limiting device 800 provided in another embodiment of the present invention. For example... Figure 8 As shown, the device 800 may include:

[0152] The second data acquisition module 810 is used to acquire outbound call response data of the target system. The outbound call response data is used to characterize the processing capability of the associated system of the target system to service requests. The outbound call response data includes one or more of outbound call response time and outbound call success rate.

[0153] The second parameter acquisition module 820 is used to acquire the second flow limiting parameter of the target system, which is used to limit the outbound traffic of the target system to the associated system.

[0154] The second adjustment module 830 is used to adjust the second rate limiting parameter based on the outbound call response data, so that the adjusted second rate limiting parameter matches the processing capacity of the associated system for service requests.

[0155] In one possible embodiment, the device 800 may further include:

[0156] The third data acquisition module is used to acquire system performance data of the target system. The system performance data is used to characterize the resource usage of the target system. The system performance data includes one or more of CPU utilization and system load.

[0157] The second adjustment module 830 is further configured to adjust the second current limiting parameter based on the system performance data, so that the adjusted second current limiting parameter matches the resource usage of the target system.

[0158] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus provided in the above embodiments and the corresponding method embodiments belong to the same concept, and the specific implementation process can be found in the corresponding method embodiments, which will not be repeated here.

[0159] One embodiment of the present invention also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the system current limiting method provided in the above method embodiments.

[0160] Memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for the functions, etc.; the data storage area can store data created based on the use of the device, etc. Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory can also include a memory controller to provide the processor with access to the memory.

[0161] Refer to the attached reference manual Figure 9 The diagram shown is a block diagram of an electronic device 900 according to an embodiment of the present invention. The electronic device 900 may include one or more processors 902, system control logic 908 connected to at least one of the processors 902, system memory 904 connected to the system control logic 908, non-volatile memory (NVM) 906 connected to the system control logic 908, and network interface 910 connected to the system control logic 908.

[0162] Processor 902 may include one or more single-core or multi-core processors. Processor 902 may include any combination of general-purpose processors and special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In embodiments herein, processor 902 may be configured to perform operations according to... Figures 2 to 6 One or more embodiments of the various embodiments shown.

[0163] In some embodiments, system control logic 908 may include any suitable interface controller to provide any suitable interface to at least one of the processors 902 and / or any suitable device or component communicating with system control logic 908.

[0164] In some embodiments, system control logic 908 may include one or more memory controllers to provide an interface to system memory 904. System memory 904 may be used to load and store data and / or instructions. In some embodiments, memory 904 of device 900 may include any suitable volatile memory, such as suitable dynamic random access memory (DRAM).

[0165] NVM / Memory 906 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM / Memory 906 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of HDD (Hard Disk Drive), CD (Compact Disc) drive, and DVD (Digital Versatile Disc) drive.

[0166] NVM / Storage 906 may include a portion of storage resources mounted on the device 900, or it may be accessible by the device but is not necessarily part of the device. For example, NVM / Storage 906 may be accessed over a network via network interface 910.

[0167] Specifically, system memory 904 and NVM / memory 906 may each include a temporary copy and a permanent copy of instruction 920. Instruction 920 may include, when executed by at least one of processors 902, causing device 900 to perform, as Figures 2 to 6 The instructions for the system current limiting method are shown. In some embodiments, the instructions 920, hardware, firmware and / or their software components may additionally / alternatively be located in the system control logic 908, network interface 910 and / or processor 902.

[0168] Network interface 910 may include a transceiver for providing a radio interface to device 900, thereby enabling communication with any other suitable device (such as a front-end module, antenna, etc.) via one or more networks. In some embodiments, network interface 910 may be integrated into other components of device 900. For example, network interface 910 may be integrated into at least one of the following: a communication module of processor 902, system memory 904, NVM / memory 906, and a firmware device (not shown) with instructions, which, when at least one of processor 902 executes the instructions, enable device 900 to implement... Figures 2 to 6 One or more embodiments of the various embodiments shown.

[0169] The network interface 910 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 910 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.

[0170] In one embodiment, at least one of the processors 902 may be packaged together with the logic of one or more controllers for system control logic 908 to form a system-in-package (SiP). In another embodiment, at least one of the processors 902 may be integrated on the same die with the logic of one or more controllers for system control logic 908 to form a system-on-a-chip (SoC).

[0171] Device 900 may further include an input / output (I / O) device 912. The I / O device 912 may include a user interface enabling a user to interact with device 900; the peripheral component interface is designed to allow peripheral components to also interact with device 900. In some embodiments, device 900 may also include sensors for determining at least one of environmental conditions and location information related to device 900.

[0172] In some embodiments, the user interface may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., a light-emitting diode flash), and a keyboard.

[0173] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.

[0174] In some embodiments, the sensor may include, but is not limited to, a gyroscope sensor, an accelerometer, a proximity sensor, an ambient light sensor, and a positioning unit. The positioning unit may also be part of or interact with the network interface 910 to communicate with components of the positioning network (e.g., Global Positioning System (GPS) satellites).

[0175] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 900. In other embodiments of the present invention, the electronic device 900 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0176] An embodiment of the present invention also provides a computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a system current limiting method, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the system current limiting method provided in the above-described method embodiment.

[0177] Optionally, in embodiments of the present invention, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0178] One embodiment of the present invention also provides a computer program product comprising a computer program / instructions that, when the computer program product is run on an electronic device, are loaded and executed by a processor to implement the steps of the system current limiting method provided in the various alternative embodiments described above.

[0179] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0180] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0181] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0182] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A system current limiting method, characterized in that, The method is executed by the rate limiting policy center and includes: Obtain service processing performance data of the target system from the API gateway. The service processing performance data is used to characterize the target system's ability to process service requests. The service processing performance data includes one or more of the following: request response time and request success rate. Obtain a first rate limiting parameter for the target system, wherein the first rate limiting parameter is used to limit the traffic entering the target system; Adjusting the first rate limiting parameter based on the service processing performance data includes: Obtain first benchmark data corresponding to the service processing performance data, wherein the first benchmark data is determined based on the historical service processing performance data of the target system within a first time period; Calculate the first rate of change of the service processing performance data relative to the first benchmark data; Determine the threshold range in which the first rate of change falls; Based on the correspondence between the threshold range of the first rate of change and the adjustment threshold, the adjustment threshold of the first current limiting parameter is determined according to the determined threshold range of the first rate of change. The first current limiting parameter is adjusted based on the adjustment threshold to obtain the adjusted first current limiting parameter; The adjusted first rate limiting parameter is sent to the API gateway so that the API gateway limits the traffic entering the target system based on the adjusted first rate limiting parameter, so that the adjusted first rate limiting parameter matches the target system's ability to process service requests.

2. A system current limiting method, characterized in that, The method is executed by the rate limiting policy center and includes: The outbound call response data of the target system is obtained from the application service. The outbound call response data is used to characterize the processing capability of the associated system of the target system to the service request. The outbound call response data includes one or more of the outbound call response time and outbound call success rate. Obtain the second rate limiting parameter of the target system, which is used to limit the outbound traffic of the target system to the associated system; Adjusting the second flow limiting parameter based on the outbound call response data includes: Obtain the second reference data corresponding to the outbound call response data, the second reference data being determined based on the historical outbound call response data of the target system within a second time period; Calculate the second rate of change of the outbound call response data relative to the second baseline data; Determine the threshold range in which the second rate of change falls; Based on the correspondence between the pre-set threshold range of the second rate of change and the adjustment threshold, the adjustment threshold of the second current limiting parameter is determined according to the determined threshold range of the second rate of change. The second current limiting parameter is adjusted based on the adjustment threshold to obtain the adjusted second current limiting parameter; The adjusted second rate limiting parameter is sent to the application service so that the application service can limit the traffic of the target system to the associated system based on the adjusted second rate limiting parameter, so that the adjusted second rate limiting parameter matches the processing capacity of the associated system for service requests and the resource usage of the target system.

3. A system current limiting device, characterized in that, The device includes: The first data acquisition module is used to acquire service processing performance data of the target system from the API gateway. The service processing performance data is used to characterize the target system's ability to process service requests. The service processing performance data includes one or more of the following: request response time and request success rate. The first parameter acquisition module is used to acquire the first flow limiting parameter of the target system, and the first flow limiting parameter is used to limit the traffic entering the target system. The first adjustment module is used for Adjusting the first rate limiting parameter based on the service processing performance data includes: obtaining first baseline data corresponding to the service processing performance data, wherein the first baseline data is determined based on historical service processing performance data of the target system within a first time period; calculating a first rate of change of the service processing performance data relative to the first baseline data; determining a threshold range in which the first rate of change falls; determining an adjustment threshold for the first rate limiting parameter based on a pre-set correspondence between the threshold range in which the first rate of change falls and an adjustment threshold; and adjusting the first rate limiting parameter based on the adjustment threshold to obtain the adjusted first rate limiting parameter. The adjusted first rate limiting parameter is sent to the API gateway so that the API gateway limits the traffic entering the target system based on the adjusted first rate limiting parameter, so that the adjusted first rate limiting parameter matches the target system's ability to process service requests.

4. A system current limiting device, characterized in that, The device includes: The second data acquisition module is used to acquire outbound call response data of the target system from the application service. The outbound call response data is used to characterize the processing capability of the associated system of the target system to service requests. The outbound call response data includes one or more of the outbound call response time and outbound call success rate. The second parameter acquisition module is used to acquire the second rate limiting parameter of the target system, which is used to limit the outbound traffic of the target system to the associated system. The second adjustment module is used to adjust the second flow limiting parameter based on the outbound call response data, including: Obtain the second reference data corresponding to the outbound call response data, the second reference data being determined based on the historical outbound call response data of the target system within a second time period; Calculate the second rate of change of the outbound call response data relative to the second baseline data; Determine the threshold range in which the second rate of change falls; Based on the correspondence between the pre-set threshold range of the second rate of change and the adjustment threshold, the adjustment threshold of the second current limiting parameter is determined according to the determined threshold range of the second rate of change. The second current limiting parameter is adjusted based on the adjustment threshold to obtain the adjusted second current limiting parameter; The adjusted second rate limiting parameter is sent to the application service so that the application service can limit the traffic of the target system to the associated system based on the adjusted second rate limiting parameter, so that the adjusted second rate limiting parameter matches the processing capacity of the associated system for service requests and the resource usage of the target system.

5. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the system current limiting method as described in claim 1 or 2.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the system current limiting method as described in claim 1 or 2.

7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the system current limiting method as described in claim 1 or 2.