Application flow limiting method, device, equipment and program product
By dynamically adjusting the rate limiting rules and analyzing the neural network model, the problem of insufficient adaptability of rate limiting rules in existing technologies has been solved, enabling effective response to sudden traffic surges, improving system stability and throughput, and reducing the need for manual intervention.
Patent Information
- Application Number
- CN202511256306.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-11-11
AI Technical Summary
In existing technologies, manually generating rate limiting rules cannot effectively cope with sudden traffic surges and high concurrency traffic in complex scenarios, lacks adaptability, and leads to insufficient system stability and reliability.
By dynamically adjusting the rate limiting rules, the final rate limiting rules are generated based on container resource usage and user input information. The traffic protection component is then controlled to perform rate limiting, and a neural network model is used to analyze multi-dimensional data to optimize the rate limiting strategy.
It enables dynamic responses to sudden traffic surges and system load changes, improving system stability and reliability, enhancing overall throughput and user experience, and reducing the tediousness and inaccuracy of manual operations.
Smart Images

Figure CN120935112A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology or other related fields, and in particular to an application of a current limiting method, device, equipment and program product. Background Technology
[0002] Sentinel is an open-source high-availability traffic protection component for distributed service architectures. Its main functions include traffic control, circuit breaking and degradation, and system load protection. It is widely used in microservice architectures to ensure system stability and reliability.
[0003] Typically, rate limiting rules can be set manually through the Sentinel console, or they can be generated based on AI using user input.
[0004] However, the above methods for generating rate limiting rules lack adaptability to complex scenarios and cannot effectively handle large-scale resources and high-concurrency traffic. Summary of the Invention
[0005] This application provides a method, apparatus, device, and program product for applying flow limiting, which dynamically adjusts flow limiting rules to cope with sudden changes in traffic or system load.
[0006] Firstly, this application provides an application rate limiting method applied to a server, where multiple applications are configured and a traffic protection component is installed. The method includes:
[0007] For any target application, determine whether the resource usage of the first container corresponding to the target application is greater than a preset value;
[0008] When the rate exceeds the preset value, the rate limiting rules are updated based on the container resource usage of each application.
[0009] Based on the user's input information regarding the updated rate limiting rules, the final rate limiting rules are determined, and the traffic protection component controls the rate limiting of the target application according to the final rate limiting rules.
[0010] Secondly, this application provides an application rate limiting device applied to a server, on which multiple applications are configured, and a traffic protection component is also configured. The device includes:
[0011] The determination module, for any target application, is used to determine whether the resource usage of the first container corresponding to the target application is greater than a preset value;
[0012] The update module is used to determine and update the rate limiting rules based on the container resource usage of each application when the value exceeds the preset value.
[0013] The processing module is used to determine the final rate limiting rules based on the user's input information for updating the rate limiting rules, and control the traffic protection component to perform rate limiting control on the target application according to the final rate limiting rules.
[0014] Thirdly, this application provides an electronic device, including: at least one processor and a memory;
[0015] The memory stores the instructions that the computer executes;
[0016] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the method as described in any of the first aspects.
[0017] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method as described in any of the first aspects.
[0018] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the first aspects.
[0019] The application rate limiting method, apparatus, device, and program products provided in this application are applied to a server, on which multiple applications are configured, and a traffic protection component is configured. The method includes: for any target application, determining whether the resource usage of the first container corresponding to the target application is greater than a preset value; when it is greater than the preset value, determining an updated rate limiting rule based on the container resource usage of each application; determining a final rate limiting rule based on the user's input information for the updated rate limiting rule; and controlling the traffic protection component to perform rate limiting control on the target application according to the final rate limiting rule, thereby realizing dynamic adjustment of the rate limiting strategy to cope with sudden traffic or system load changes. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 A flowchart illustrating an application rate limiting method provided in an embodiment of the present invention;
[0022] Figure 2 A schematic diagram of an overall framework provided for an embodiment of the present invention;
[0023] Figure 3 A timing diagram of an application of a current limiting method provided in an embodiment of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of an application current limiting device provided in an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention.
[0026] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, necessary confidentiality measures have been taken, they do not violate public order and good morals, and corresponding operation interfaces are provided for users to choose to authorize or refuse.
[0029] It should be noted that the application current limiting method, device, equipment, storage medium and program product provided in this application can be used in the fintech field, or in any field other than fintech. This application does not limit the application field of the application current limiting method, device, equipment, storage medium and program product.
[0030] Currently, rate limiting is typically implemented using rules manually set by the user, with rate control based on these rules. However, manually generating rate limiting rules requires multiple modifications based on the actual scenario, which is ineffective in handling sudden surges in traffic.
[0031] The application rate limiting method provided in this application aims to solve the above-mentioned technical problems in the prior art.
[0032] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0033] Figure 1 This is a flowchart illustrating an application rate limiting method provided in an embodiment of the present invention. The method can be applied to a server hosting multiple applications and equipped with a traffic protection component. When the access volume of any application is too high, the traffic protection component can limit the rate of access for that application. The method includes steps S101 to S103:
[0034] Step S101: For any target application, determine whether the resource usage of the first container corresponding to the target application is greater than a preset value.
[0035] For a target application, it can be monitored, and when the target application meets the conditions for updating the rate limiting rules, the final rate limiting rules for the target application are generated.
[0036] Optionally, the health status of the target application can be continuously monitored to determine whether there is pressure on container resources, thereby determining whether it is necessary to initiate the process of adjusting the rate limiting rules.
[0037] Optionally, the first container resource usage of the target application can be obtained. The first container resource usage can be the CPU (Central Processing Unit) utilization or memory utilization of the target application under the current situation, or it can be a weighted fusion value of CPU utilization and memory utilization. When the CPU utilization is high, it means that the application is busy processing computing tasks; when the memory utilization is high, it means that the application is caching a large amount of data.
[0038] Optionally, if the resource usage of the first container exceeds a preset value, it indicates that the target application's container resource consumption is high, and the rate limiting rules need to be updated. If the resource usage of the first container is less than or equal to the preset value, it indicates that the target application's container resource consumption is low, and the rate limiting rules do not need to be updated.
[0039] Optionally, the preset value can be a numerical value set based on experience, and this application does not impose specific limitations.
[0040] Step S102: When the value exceeds the preset value, determine and update the rate limiting rules based on the container resource usage of each application.
[0041] When the target application's first container resource usage is high, it indicates that the target application's container resources are under pressure. In this case, the container resources of other applications can be obtained, and the rate limiting rules for the target application can be adjusted based on the container resource usage of other applications.
[0042] This is because a server contains multiple applications. For a specific target application, when other applications have low container resource usage, more container resources can be allocated to that application, allowing the rate limiting rule to be set for a larger number of accesses. Conversely, when other applications have high container resource usage, it indicates that the entire server's resources are nearing saturation. In this case, the rate limiting rule for that target application can be set for a smaller number of accesses, thus more strictly restricting access, protecting the stability of the target application and the entire server, and preventing cascading failures.
[0043] By monitoring the usage of resources in each container, the rate limiting rules for the target application can be dynamically adjusted. This allows for the full utilization of idle resources to improve overall throughput and user experience while protecting the stability of the target application and the entire server.
[0044] Step S103: Based on the user's input information regarding the updated rate limiting rules, determine the final rate limiting rules, and control the traffic protection component to perform rate limiting control on the target application according to the final rate limiting rules.
[0045] After finalizing the updated rate limiting rules, these rules can be presented to users, such as through a front-end interface. Users can then decide whether to use the updated rate limiting rules to obtain the final rate limiting rules.
[0046] By having users evaluate the updated rate limiting rules, the system determines whether to activate the updated rate limiting rule, thereby improving the reliability of the final rate limiting rule settings.
[0047] Optionally, for updating rate limiting rules, users can input different information, such as enable or deny commands. That is, after the updated rate limiting rule is generated, the user can confirm whether to use the updated rule or input a new one. This method improves the reliability of the final rate limiting rule while avoiding the cumbersome and inaccurate process of manually modifying the rule multiple times.
[0048] The application rate limiting method provided in this application is applied to a server with multiple applications and a traffic protection component. The method includes: for any target application, determining whether the resource usage of the first container corresponding to the target application exceeds a preset value; if it exceeds the preset value, determining an updated rate limiting rule based on the current request volume of the target application; determining a final rate limiting rule based on user input information regarding the updated rate limiting rule; and controlling the traffic protection component to perform rate limiting control on the target application according to the final rate limiting rule. By dynamically adjusting the rate limiting strategy, it can cope with sudden traffic spikes or system load changes, thereby improving application reliability.
[0049] Optionally, based on the container resource usage of each application, determine the updated rate limiting rules, including:
[0050] The current request volume of the target application, the container resource usage of each application on the server, and the current hardware information of the server are input into the rate limiting rule generation model to obtain the updated rate limiting rules. The current hardware information includes: the number of CPU cores, memory capacity, and CPU temperature information.
[0051] By generating a model based on rate limiting rules, various types of data are analyzed to obtain accurate updated rate limiting rules.
[0052] The current request volume of the target application is the number of concurrent requests it is currently handling. This current request volume allows for a better determination of when to update the rate limiting rules.
[0053] The container resource usage of each application on the server can reflect the overall resource status, determine whether there are idle resources, and thus determine whether to relax or tighten the rate limiting rules when updating them.
[0054] In addition, the system can obtain the server's current hardware information. The number of CPU cores and memory capacity represent the server's physical resource limits and directly affect the setting of rate limiting rules. CPU temperature information indicates the server's health level; when the CPU temperature is too high, it indicates poor server heat dissipation or continuous overload operation.
[0055] The rate limiting rule generation model is a trained neural network model that possesses a complex mapping relationship between input data and updated rate limiting rules. By leveraging the aforementioned multi-dimensional data and the rate limiting rule generation model, updated rate limiting rules can be accurately obtained.
[0056] By generating models based on multi-dimensional data and rate limiting rules, it is possible to more accurately determine and update rate limiting rules.
[0057] Optionally, the method also includes:
[0058] Training data is obtained from various applications on the server through the application programming interface (API), and the neural network model is trained based on the training data to obtain the rate limiting rule generation model.
[0059] The training data consists of multiple sets of data. Each set of data includes: the container resource usage of each application on the server at the time the training data is acquired, the current hardware information of the server, the rate limiting rules set by the user for any application, and the current request volume of the application.
[0060] When generating a rate limiting rule generation model, training data can be collected first, and the neural network model can be trained using the training data to obtain the rate limiting rule generation model.
[0061] Optionally, when collecting training data, multiple sets of data corresponding to each application can be obtained via API. For example, the obtained data may include the container resource usage of each application on the server, the server's current hardware information, the rate limiting rules set by the user for any application, and the current request volume of that application. Optionally, the user sets the rate limiting rules to be valid rate limiting rules. Optionally, the API can be implemented based on RESTful rules, providing mutual calls between various modules.
[0062] Optionally, this method can be applied in the financial field, such as in a banking scenario, where the server contains multiple applications and can automatically collect data from different applications, so that the data generated within the bank can be effectively utilized.
[0063] By collecting training data, a neural network model is trained based on the training data to obtain a rate limiting rule generation model.
[0064] Optionally, the method also includes:
[0065] When it is determined that the resource usage of the first container corresponding to the target application exceeds a preset value, an alarm message is generated; the alarm message is used to instruct the user to determine the input information for updating the rate limiting rules.
[0066] Accordingly, based on the user's input information regarding the updated rate limiting rules, the final rate limiting rules are determined, including:
[0067] When the input information is an enable command for updating the rate limiting rule, or when the input information is empty, the updated rate limiting rule will be determined as the final rate limiting rule.
[0068] When it is determined that the resource usage of the first container corresponding to the target application is greater than the preset value, on the one hand, an updated rate limiting rule can be generated, and on the other hand, an alarm message can be generated. After hearing the alarm message, the user can confirm the input information to determine whether to enable the updated rate limiting rule.
[0069] Optionally, if the user inputs a start command for the updated rate limiting rule, then the updated rate limiting rule can be determined as the final rate limiting rule. Alternatively, if no user input is received within a preset time after the alarm is issued, the updated rate limiting rule can also be determined as the final rate limiting rule.
[0070] For example, a user receives an alert, reviews the generated "updated rate limiting rule" (e.g., increasing user access from 20 to 30), and deems the rate limiting rule reasonable. The user then explicitly clicks the "Approve," "Agree," or "Enable" button, thus making the updated rate limiting rule the final rate limiting rule.
[0071] For example, after an alarm is issued, if the user does not respond within a specified time (e.g., 10 minutes) (i.e., neither an enable nor a deny command is issued), and the user's input is "empty," the updated rate limiting rule can be automatically determined as the final rate limiting rule and executed. Optionally, the user can be an operations and maintenance (O&M) personnel. This method allows for automatic problem handling even when O&M personnel are off-duty, negligent, or unable to respond promptly, preventing missed optimal adjustment opportunities due to lack of intervention.
[0072] Optionally, determining the final rate limiting rule based on the user's input information regarding the updated rate limiting rule also includes:
[0073] When the input information is a rate limiting rule entered by the user, the rate limiting rule entered by the user will be determined as the final rate limiting rule.
[0074] Furthermore, regarding updated rate limiting rules, if a user deems a rate limiting rule unreasonable, they can input a new rate limiting rule, which will then be set as the final rate limiting rule. The new rate limiting rule can be a previous rate limiting rule or a different one.
[0075] By allowing users to input rate limiting rules, it is possible to avoid directly applying rate limiting rules that are inappropriate when they are output.
[0076] Optionally, after the traffic protection component performs rate limiting on the target application according to the final rate limiting rules, the method further includes:
[0077] Collect valid rate limiting rules and update the rate limiting rule generation model based on the valid rate limiting rules.
[0078] Optionally, the rate limiting rule generation model can be updated to further improve its accuracy.
[0079] Optionally, after the rate limiting rule generation model is applied, updated rate limiting rules can be obtained. If the updated rate limiting rule is applied and is effective, the updated rate limiting rule can be marked as effective, and the rate limiting rule generation model can be updated based on each effective rate limiting rule.
[0080] Updating the rate limiting rule generation model refers to adjusting the internal parameters of the rate limiting rule generation model based on effective rate limiting rules, so that the rate limiting rule generation model can output more accurate rate limiting rules.
[0081] Optionally, when updating the rate limiting rule generation model, it is also possible to obtain the container resource usage of each application, the current hardware information of the server, and the current request volume of the application when the effective rate limiting rule is applied, so as to update the rate limiting rule generation model based on the above information.
[0082] The accuracy of the rate limiting rule generation model is further improved by updating the model.
[0083] Optionally, collect valid rate limiting rules, including:
[0084] Obtain the second container resource usage corresponding to the target application. When the difference between the first container resource usage and the second container resource usage is greater than a preset difference, the final rate limiting rule is determined to be a valid rate limiting rule. The second container resource usage is: the container resource usage of the target application after the target application has been rate-limited according to the final rate limiting rule and after a preset time.
[0085] The first container resource usage refers to the container resource usage of the target application before the final rate limiting rule is implemented. The second container resource usage refers to the container resource usage of the target application after the preset duration of the final rate limiting rule is implemented. For example, the first container resource usage is a CPU utilization rate as high as 90%, and after rate limiting, the second container resource usage is a CPU utilization rate that has dropped to 60%.
[0086] After obtaining the resource usage of the second container, the final rate limiting rule can be determined as an effective rate limiting rule based on the relationship between the difference between the resource usage of the first and second containers and a preset difference. This difference represents the improvement effect. When the difference is greater than the preset difference, the final rate limiting rule can be determined as an effective rate limiting rule; when the difference is less than or equal to the preset difference, the final rate limiting rule can be determined as an ineffective rate limiting rule.
[0087] The above method can accurately filter effective rate limiting rules, thereby enabling the rate limiting rule generation model to be updated based on these effective rules.
[0088] Figure 2This is a schematic diagram of an overall framework provided in an embodiment of the present invention. Figure 3 This is a timing diagram illustrating an application of a current limiting method provided in an embodiment of the present invention. For example... Figure 2 and Figure 3 As shown, the overall architecture includes: a front-end display interface, application access processing, and an API. The application rate limiting device in this application includes: a data collector, data collection, model processing, and output processing. A traffic protection component is set up on the server for rate limiting. The front-end display interface can show the generated updated rate limiting rules. The application access processing can connect with various applications and perform personalized processing for different applications, sending the container resource usage of each application to the data collector via the API. The data collector can reprocess the data obtained by the data collector, generate updated rate limiting rules through model processing, and finally output the updated rate limiting rules through output processing. Once the updated rate limiting rule is determined to be applied, the traffic protection component can limit the application's rate based on this updated rate limiting rule.
[0089] Figure 4 This is a schematic diagram of a current limiting device provided in an embodiment of the present invention. The device includes:
[0090] The determination module 401, for any target application, is used to determine whether the resource usage of the first container corresponding to the target application is greater than a preset value;
[0091] The update module 402 is used to determine and update the rate limiting rules based on the container resource usage of each application when the value exceeds the preset value.
[0092] The processing module 403 is used to determine the final rate limiting rule based on the user's input information for updating the rate limiting rule, and control the traffic protection component to perform rate limiting control on the target application according to the final rate limiting rule.
[0093] Optionally, when updating the rate limiting rules based on the container resource usage of each application, module 402 is specifically used for:
[0094] The current request volume of the target application, the container resource usage of each application on the server, and the current hardware information of the server are input into the rate limiting rule generation model to obtain the updated rate limiting rules. The current hardware information includes: the number of CPU cores, memory capacity, and CPU temperature information.
[0095] Optionally, the device may also include: a model training module for:
[0096] Training data is obtained from various applications on the server through the application programming interface (API), and the neural network model is trained based on the training data to obtain the rate limiting rule generation model.
[0097] The training data consists of multiple sets of data. Each set of data includes: the container resource usage of each application on the server at the time the training data is acquired, the current hardware information of the server, the rate limiting rules set by the user for any application, and the current request volume of the application.
[0098] Optionally, the device may also include: an alarm module for:
[0099] When it is determined that the resource usage of the first container corresponding to the target application exceeds a preset value, an alarm message is generated; the alarm message is used to instruct the user to determine the input information for updating the rate limiting rules.
[0100] Accordingly, when determining the final rate limiting rule based on the user's input information regarding the updated rate limiting rule, the processing module 403 specifically performs the following:
[0101] When the input information is an enable command for updating the rate limiting rule, or when the input information is empty, the updated rate limiting rule will be determined as the final rate limiting rule.
[0102] Optionally, when determining the final rate limiting rule based on the user's input information regarding the updated rate limiting rule, the processing module 403 is also used to:
[0103] When the input information is a rate limiting rule entered by the user, the rate limiting rule entered by the user will be determined as the final rate limiting rule.
[0104] Optionally, the device is also used in: a model update module, for:
[0105] After the traffic control protection component performs rate limiting on the target application according to the final rate limiting rules, it collects the effective rate limiting rules and updates the rate limiting rule generation model based on the effective rate limiting rules.
[0106] Optionally, the model update module, when collecting valid rate limiting rules, is specifically used for:
[0107] Obtain the second container resource usage corresponding to the target application. When the difference between the first container resource usage and the second container resource usage is greater than a preset difference, the final rate limiting rule is determined to be a valid rate limiting rule. The second container resource usage is: the container resource usage of the target application after the target application has been rate-limited according to the final rate limiting rule and after a preset time.
[0108] The current limiting device 40 provided in this embodiment of the invention can achieve the above-mentioned... Figure 1 The application rate limiting method shown is similar in principle and technical effect, and will not be described in detail here.
[0109] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Figure 5As shown, the electronic device provided in this embodiment includes at least one processor 501 and a memory 502. The processor 501 and the memory 502 are connected via a bus 503.
[0110] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to execute the method in the above method embodiment.
[0111] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0112] In the above Figure 5 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0113] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage.
[0114] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0115] This invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in the above embodiments.
[0116] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the above method embodiments.
[0117] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0118] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0119] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0120] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0121] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0122] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0123] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0124] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0125] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A current limiting method, characterized in that, Applied to a server, wherein multiple applications are configured on the server, and a traffic protection component is configured on the server, the method includes: For any target application, determine whether the resource usage of the first container corresponding to the target application is greater than a preset value; When the value exceeds the preset value, the rate limiting rules are updated based on the container resource usage of each application. Based on the user's input information regarding the updated rate limiting rules, the final rate limiting rules are determined, and the traffic protection component is controlled to perform rate limiting control on the target application according to the final rate limiting rules.
2. The method according to claim 1, characterized in that, Based on the container resource usage of each application, determine and update the rate limiting rules, including: The current request volume of the target application, the container resource usage of each application on the server, and the current hardware information of the server are input into the rate limiting rule generation model to obtain the updated rate limiting rule; the current hardware information includes: the number of CPU cores, memory capacity, and CPU temperature information.
3. The method according to claim 2, characterized in that, The method further includes: Training data is obtained from various applications on the server through the application programming interface (API), and the neural network model is trained based on the training data to obtain the rate limiting rule generation model. The training data consists of multiple sets of data, each set including: the container resource usage of each application on the server at the time the training data is acquired, the current hardware information of the server, the rate limiting rules set by the user for any application, and the current request volume of the application.
4. The method according to claim 1, characterized in that, The method further includes: When it is determined that the resource usage of the first container corresponding to the target application is greater than a preset value, an alarm message is generated; the alarm message is used to instruct the user to determine the input information for updating the rate limiting rule. Accordingly, based on the user's input information regarding the updated rate limiting rules, the final rate limiting rules are determined, including: When the input information is an enable instruction for updating the rate limiting rule, or when the input information is empty, the updated rate limiting rule is determined as the final rate limiting rule.
5. The method according to claim 4, characterized in that, Based on the user's input information regarding the updated rate limiting rules, the final rate limiting rules are determined, which also includes: When the input information is a rate limiting rule entered by the user, the rate limiting rule entered by the user is determined as the final rate limiting rule.
6. The method according to claim 2, characterized in that, After controlling the traffic protection component to perform rate limiting control on the target application according to the final rate limiting rule, the method further includes: Collect effective rate limiting rules, and update the rate limiting rule generation model based on the effective rate limiting rules.
7. The method according to claim 6, characterized in that, Collect valid rate limiting rules, including: Obtain the second container resource usage corresponding to the target application. When the difference between the first container resource usage and the second container resource usage is greater than a preset difference, the final rate limiting rule is determined to be the effective rate limiting rule. The second container resource usage is the container resource usage of the target application after the target application has been rate-limited according to the final rate limiting rule for a preset period of time.
8. A current limiting device, characterized in that, Applied to a server, the server is equipped with multiple applications and a traffic protection component; the device includes: The determination module, for any target application, is used to determine whether the resource usage of the first container corresponding to the target application is greater than a preset value; The update module is used to determine and update the rate limiting rules based on the container resource usage of each application when the rate exceeds the preset value. The processing module is used to determine the final rate limiting rule based on the user's input information for the updated rate limiting rule, and control the traffic protection component to perform rate limiting control on the target application according to the final rate limiting rule.
9. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.