Method for automatically and intelligently adjusting current limiting strategy
Through automatic and intelligent adjustment of the current limiting strategy, dynamic calculation and policy adjustment, the problem of traditional current limiting strategy insufficient adaptability to real-time traffic changes is solved, and the stability and flexibility of the system in high concurrency scenarios is realized, reducing the burden of operation and maintenance. Ensure system availability.
Patent Information
- Application Number
- CN202411332792.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-20
AI Technical Summary
Traditional current limiting strategies are based on static configuration, lack the ability to adapt to real-time traffic changes, and are unable to flexibly respond to different traffic patterns and business needs, resulting in service response delays or system crashes in high concurrency scenarios.
Provide a method to automatically and intelligently adjust the current limiting strategy, adjust the current limiting threshold through current limiting strategy configuration and dynamic calculation, and support complex current limiting strategies across systems and transactions, and dynamically adjust them according to the server resource utilization rate and time period to ensure that The availability of the system in different scenarios.
It realizes automatic adjustment of the current limit threshold in different scenarios, maximizes the processing of requested traffic, reduces the burden on operation and maintenance personnel, improves the stability and flexibility of the system, is compatible with static configuration, and realizes autonomy in application current limit.
Smart Images

Figure CN119172321A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent current limiting adjustment, and in particular to a method for realizing automatic intelligent current limiting adjustment strategy. Background Art
[0002] With the rapid development of Internet technology, network services are facing increasing user visits and data traffic. Especially in high-concurrency scenarios, such as promotional activities, live broadcasts of popular events, etc., network services may encounter sudden traffic surges, which may cause service response delays, system crashes, or even service unavailability, seriously affecting user experience and business continuity.
[0003] In order to ensure the stability and reliability of services, current limiting strategies are widely used in distributed systems and microservice architectures. Current limiting strategies prevent system overload by controlling the number of requests per unit time. However, traditional current limiting strategies are often based on static configurations and lack the ability to adapt to real-time traffic changes, and cannot flexibly respond to different traffic patterns and business needs.
[0004] Existing technical solutions:
[0005] 2.1 Static Configuration Strategy
[0006] In the current system architecture, static configuration strategy is a common flow control method. This method mainly relies on some mature algorithms, such as token bucket algorithm and sliding window counter algorithm. The core idea of these algorithms is to control the flow based on the set static flow threshold.
[0007] On the application side, the SDK (software development kit) for current limiting and circuit breaking is usually integrated. Through this SDK, the relevant configuration thresholds can be obtained. Then, the application side will calculate the current request volume in real time and compare it with these thresholds. If the current request volume exceeds the threshold, then the downgrade process will be triggered.
[0008] There are many ways to handle this downgrade, such as directly rejecting new requests, putting new requests in a queue for processing, or forwarding requests to other servers for processing. The specific processing method needs to be determined according to actual business needs and system architecture.
[0009] The static configuration strategy can effectively control traffic by setting static traffic thresholds and combining algorithms such as the token bucket algorithm and the sliding window counter algorithm, as well as real-time calculation and comparison on the application side, to prevent the system from crashing due to excessive traffic, thereby improving the system's availability and stability.
[0010] 2.2 Manually Adjust Strategy
[0011] The manual adjustment strategy is a strategy based on static configuration. It is mainly used to deal with the challenges of the system during traffic peaks. Under this strategy, the operation and maintenance managers need to manually adjust the thresholds of different application interfaces according to actual usage. The purpose of this is to balance user requests and ensure that the system can run smoothly and efficiently.
[0012] Operation and maintenance personnel need to monitor the system traffic to understand the current usage. This includes analyzing key indicators such as the request volume and response time of each application interface. Through this data, operation and maintenance personnel can determine which interfaces may have bottlenecks and need to adjust the thresholds.
[0013] The operation and maintenance personnel manually adjust the thresholds of different application interfaces. If the request volume of a certain interface is too high, resulting in a longer response time, the operation and maintenance personnel can appropriately increase the threshold of the interface to improve its processing capacity. If the request volume of a certain interface is low, the threshold can be appropriately lowered to save resources. Summary of the invention
[0014] In view of the above problems, the present invention is proposed to provide a method for realizing automatic intelligent adjustment of current limiting strategy, which overcomes the above problems or at least partially solves the above problems.
[0015] According to one aspect of the present invention, a method for realizing automatic intelligent adjustment of current limiting strategy is provided, and the current limiting strategy method comprises:
[0016] Based on current limiting strategy configuration;
[0017] Perform dynamic current limiting calculation and policy adjustment according to the configuration logic.
[0018] Optionally, the current limiting strategy configuration specifically includes:
[0019] System operation and maintenance personnel need to configure corresponding current limiting strategies based on the current limiting requirements of the system, and static configuration is supported;
[0020] Expanded support for complex flow control strategies based on cross-system and cross-transaction;
[0021] The system supports complex logic current limiting expressions based on systems and transactions, and also supports applications to adjust based on server resource usage thresholds.
[0022] Optionally, the dynamic current limiting calculation and policy adjustment according to the configuration logic specifically includes:
[0023] According to the configuration parameters and policies, the application service integrates the corresponding SDK service, obtains the corresponding parameters, parses the parameter thresholds of the relevant flow limiting and the flow limiting logic relationship between the application and transaction, creates a flow limiter, and calculates and adjusts the flow limiting threshold parameters in real time for the requests received by the application.
[0024] Optionally, the extension supports complex flow limiting strategies based on cross-system and cross-transaction, specifically including: supporting flow limiting strategies for multiple time periods, and supporting flow limiting strategies for hot users or users of different role levels.
[0025] Optionally, the dynamic current limiting calculation and policy adjustment according to the configuration logic specifically includes:
[0026] When the application-integrated SDK is started, it obtains the corresponding current limiting strategy from the current limiting control core service;
[0027] The factory class loads the current limiting strategy and creates a variety of current limiting control classes.
[0028] Optionally, the multiple current limiting control classes specifically include: static current limiting policy class, time-based current limiting policy class, server resource current limiting policy class, multi-application dependency current limiting policy class, key parameter current limiting policy class and interface dependency current limiting policy class.
[0029] Optionally, the static current limiting strategy class includes: a transaction interface as a primary key, a corresponding current limiting threshold, and a counter that integrates a current limiting statistical algorithm.
[0030] The present invention provides a method for realizing automatic intelligent adjustment of current limiting strategy, and the current limiting strategy method includes: based on current limiting strategy configuration; dynamic current limiting calculation and strategy adjustment according to configuration logic. Dynamically based on flexible configuration in multiple scenarios and self-monitoring of system current limiting strategy, the current limiting threshold is automatically adjusted according to different scenarios to ensure the maximum processing of request traffic under the premise of system availability; compatible with the subsequent static configuration, the dynamic configuration strategy in multiple scenarios is expanded, the autonomy of application current limiting is realized, and the work of operation and maintenance personnel in handling sudden high traffic is liberated.
[0031] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0033] Figure 1 A flow chart of the current limiting strategy configuration provided by an embodiment of the present invention;
[0034] Figure 2 A flow chart of dynamic adjustment of current limiting calculation provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0036] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0037] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0038] The present invention provides a method for realizing automatic intelligent adjustment of current limiting strategy, comprising:
[0039] The first step is based on the current limiting strategy configuration, and the second step is to dynamically calculate the current limiting and adjust the strategy according to the configuration logic.
[0040] The first step is to load the configuration parameters. At this stage, system operation and maintenance personnel can configure the corresponding flow limiting strategy based on the flow limiting requirements of the system. Static configuration is also supported here, and extended support is provided for complex flow limiting strategies based on cross-system and cross-transaction, flow limiting strategies for different time periods, and flow limiting strategies for hot users or users of different role levels. The system supports complex logic flow limiting expressions based on systems and transactions, and also supports applications to adjust according to server resource usage thresholds.
[0041] The second step is to integrate the corresponding SDK service with the application service according to the configuration parameters and policies, obtain the corresponding parameters, parse the parameter thresholds of the relevant flow limiting and the flow limiting logic relationship between the application and transaction, create a flow limiter, and calculate and adjust the flow limiting threshold parameters in real time for the requests received by the application.
[0042] Through the implementation of these two steps, the system can adjust the dynamic current limiting parameters based on simple configuration threshold current limiting, complex dependency logic, and server resource utilization, and can process user requests to the maximum extent possible while ensuring the availability of the system.
[0043] like Figure 1 As shown, the current limiting strategy configuration:
[0044] System operators need to configure corresponding flow limiting strategies according to the actual needs of the system, especially the flow limiting needs. In addition to supporting static configuration, the system also supports complex flow limiting strategies based on cross-system and cross-transaction, flow limiting strategies for different time periods, and flow limiting strategies for hot users or users of different role levels. Operators can formulate more complex and sophisticated flow limiting strategies based on the actual conditions of multiple systems or transactions. This strategy can better adapt to complex business scenarios and ensure the stable operation of the system.
[0045] The system also supports complex logic flow limiting expressions based on systems and transactions. This expression allows operation and maintenance personnel to write more complex flow limiting rules based on the specific logic of the system and transactions. Such rules can control traffic more accurately and ensure the efficient operation of the system.
[0046] The system also supports applications to adjust according to server resource usage thresholds. When server resource usage reaches a certain threshold, the application automatically adjusts the current limiting strategy to ensure stable operation of the system.
[0047] The system also supports the configuration of flow limiting parameters based on time periods, and supports flow limiting strategies based on key fields and role information of requests. After using this strategy, flow limiting strategies based on time changes and flow limiting strategies that prioritize some users and transactions can be implemented.
[0048] like Figure 2 As shown, the current limiting calculation is dynamically adjusted:
[0049] At this stage, when the application integrated SDK is started, it obtains the corresponding current limiting strategy from the current limiting control core service. The factory class loads the current limiting strategy to create different current limiting control classes, including static current limiting strategy class, time-based current limiting strategy class, server resource current limiting strategy class, multi-application relationship dependency current limiting strategy class, key parameter current limiting strategy class, and its interface dependency current limiting strategy class.
[0050] The static current limiting strategy class is relatively simple, including the transaction interface as the primary key, the corresponding current limiting threshold, and a counter that integrates the current limiting statistical algorithm.
[0051] The server resource current limiting strategy class, in addition to the relevant parameter methods of the static current limiting strategy, also includes the key values corresponding to the server resource parameters. For example, if the CPU usage rate is 90%, it means that after the CPU usage rate of the monitored application reaches the threshold, the other current limiting thresholds of this application will be gradually reduced to ensure that the server usage rate is maintained below 90%.
[0052] The multi-application relationship depends on the current limiting strategy class, which is used to handle scenarios where different applications process a type of business requests at the same time. For example, when system B triggers a current limiting alarm, it means that system B cannot handle too many requests. The upstream system A can use a lower current limiting threshold and perform current limiting in advance. The implementation of this type requires the system to report the status after triggering the current limiting and notify the dependent system to adjust the threshold.
[0053] Interface dependency current limiting strategy class is similar to application dependency. The interface is limited to the interface dependency in the same application. When the downstream interface is triggered by current limiting, the upstream system is notified to adjust the current limiting strategy. The difference is that there is no need to report the event that triggers current limiting in the same application.
[0054] The key parameter flow limiting strategy class is a method of parsing the key fields in the request message and limiting the flow according to the configured flow limiting parameters. It gives priority to ensuring that there are sufficient resources to process the services with special requests and limits the flow of requests from other non-core users, roles, etc.
[0055] Beneficial effects:
[0056] 1. Dynamic self-monitoring based on flexible configuration and system flow limiting strategies in various scenarios, so as to automatically adjust the flow limiting threshold according to different scenarios and ensure the maximum processing of request traffic under the premise of system availability.
[0057] 2. Good compatibility and scalability. It is compatible with future static configurations, expands dynamic configuration strategies in multiple scenarios, and achieves a certain degree of autonomy in application flow limiting, which greatly liberates the work of operation and maintenance personnel when dealing with sudden high traffic.
[0058] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for realizing automatic intelligent adjustment of current limiting strategy, characterized in that: The current limiting strategy method includes: Based on current limiting strategy configuration; Perform dynamic current limiting calculation and policy adjustment according to the configuration logic.
2. According to claim 1, a method for realizing automatic intelligent adjustment of current limiting strategy is characterized in that: The configuration based on the current limiting strategy specifically includes: System operation and maintenance personnel need to configure corresponding current limiting strategies based on the current limiting requirements of the system, and static configuration is supported; Expanded support for complex flow control strategies based on cross-system and cross-transaction; The system supports complex logic current limiting expressions based on systems and transactions, and also supports applications to adjust based on server resource usage thresholds.
3. According to claim 1, a method for realizing automatic intelligent adjustment of current limiting strategy is characterized in that: The dynamic current limiting calculation and policy adjustment according to the configuration logic specifically includes: According to the configuration parameters and policies, the application service integrates the corresponding SDK service, obtains the corresponding parameters, parses the parameter thresholds of the relevant flow limiting and the flow limiting logic relationship between the application and transaction, creates a flow limiter, and calculates and adjusts the flow limiting threshold parameters in real time for the requests received by the application.
4. A method for realizing automatic intelligent adjustment of current limiting strategy according to claim 2, characterized in that: The extension supports complex flow limiting strategies based on cross-system and cross-transaction, specifically including: supporting flow limiting strategies for multiple time periods, and supporting flow limiting strategies for hot users or users of different role levels.
5. A method for realizing automatic intelligent adjustment of current limiting strategy according to claim 1, characterized in that: The dynamic current limiting calculation and policy adjustment according to the configuration logic specifically includes: When the application-integrated SDK is started, it obtains the corresponding current limiting strategy from the current limiting control core service; The factory class loads the current limiting strategy and creates a variety of current limiting control classes.
6. A method for realizing automatic intelligent adjustment of current limiting strategy according to claim 5, characterized in that: The multiple current limiting control classes specifically include: static current limiting strategy class, time-based current limiting strategy class, server resource current limiting strategy class, multi-application dependency current limiting strategy class, key parameter current limiting strategy class and interface dependency current limiting strategy class.
7. A method for realizing automatic intelligent adjustment of current limiting strategy according to claim 6, characterized in that: The static current limiting strategy class includes: the transaction interface as the primary key, the corresponding current limiting threshold and a counter integrating the current limiting statistical algorithm.
Citation Information
Cited By
Multi-dimensional current limiting method, system and terminal applied to stadium management system
CN121000666A
