Dynamic current limiting method, device, equipment, medium and product
By predicting traffic and load based on historical data, generating current limit rules and dynamic adjustments, the problem of static adjustment of current limit configuration in service grid technology is solved, and the flexibility and stability of the system are improved.
Patent Information
- Application Number
- CN202510734900.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-07-25
AI Technical Summary
Most of the current limiting configurations in existing service grid technologies are based on static rules, and it is difficult to dynamically adjust according to real-time system status and business needs, resulting in the inability to effectively respond to burst traffic or changes in business needs, affecting system stability.
Traffic prediction and system load prediction are carried out based on historical service operation data, current limit rules are generated, and current limit thresholds are dynamically adjusted through the service grid layer, and dynamic current limiting is carried out in combination with real-time service operation data.
Dynamic current limiting is achieved according to real-time system status and business needs, improving the flexibility and stability of the system, and avoiding performance degradation and crashes.
Smart Images

Figure CN120378362A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a dynamic flow limiting method, device, equipment, medium and product. Background Art
[0002] Under the background of the widespread application of the microservices architecture, as an important infrastructure layer, service mesh technology has gradually become a key component for managing communication between microservices.
[0003] Most of the flow limiting configurations in the existing service mesh technology are based on static rules, and these static flow limiting rules are difficult to dynamically adjust according to the real-time system state and business requirements. When the system faces sudden traffic or changes in business requirements, the static flow limiting configuration may not be able to effectively respond, resulting in a decline in service performance or even system crashes. Therefore, how to improve the flexibility of flow limiting is very important for improving system stability. Summary of the Invention
[0004] The present invention provides a dynamic flow limiting method, device, equipment, medium and product to solve the problem that static flow limiting rules cannot meet the system business requirements.
[0005] According to one aspect of the present invention, there is provided a dynamic flow limiting method, including:
[0006] Based on historical service operation data, perform traffic prediction and system load prediction to obtain a predicted traffic value, a predicted load score, and a dependency weight of the service in the system; the historical service operation data includes historical traffic data, system resource data, and business metric data;
[0007] Generate a flow limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and synchronize the flow limiting rule to the service mesh layer;
[0008] Limit the current running service based on the current service operation data and the flow limiting rule collected by the service mesh layer during the service operation.
[0009] According to another aspect of the present invention, there is provided a dynamic flow limiting device, including:
[0010] A traffic prediction module, configured to perform traffic prediction and system load prediction based on historical service operation data to obtain a predicted traffic value, a predicted load score, and a dependency weight of the service in the system; the historical service operation data includes historical traffic data, system resource data, and business metric data;
[0011] A flow limiting rule generation module, configured to generate a flow limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and synchronize the flow limiting rule to the service mesh layer;
[0012] A dynamic current limiting module is used to limit the current running service based on the current service running data collected during the service operation in the service mesh layer and the current limiting rules.
[0013] According to another aspect of the present invention, there is provided an electronic device, which includes:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the dynamic current limiting method according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for enabling a processor to implement the dynamic current limiting method according to any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, there is provided a computer program product including a computer program, and the computer program implements the dynamic current limiting method according to any embodiment of the present disclosure when executed by a processor.
[0019] The technical solution of the embodiment of the present invention is based on historical service running data to perform traffic prediction and system load prediction, obtain a predicted traffic value, a predicted load score, and the dependency weight of the service in the system, and then generate a current limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and synchronize the current limiting rule to the service mesh layer. Based on the current service running data and the current limiting rule collected by the service mesh layer during the service operation, the current running service is limited, so as to realize dynamic current limiting based on the predicted traffic and load status and meet the current limiting requirements of the system service in different states.
[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0022] Figure 1a It is a flowchart of a dynamic current limiting method provided in Embodiment 1 of the present invention;
[0023] Figure 1b It is a schematic structural diagram of a service mesh system provided in Embodiment 1 of the present invention;
[0024] Figure 2 It is a flowchart of a dynamic current limiting method provided in Embodiment 2 of the present invention;
[0025] Figure 3 It is a schematic structural diagram of a dynamic current limiting device provided in Embodiment 3 of the present invention;
[0026] Figure 4 It is a schematic structural diagram of an electronic device for implementing the dynamic current limiting method of the embodiments of the present invention. Detailed implementation manners
[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings 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 under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0029] Embodiment 1
[0030] Figure 1a This is a flowchart of a dynamic current limiting method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of dynamically configuring current limiting based on predicted traffic and load. This method can be executed by a dynamic current limiting device, which can be implemented in the form of hardware and / or software. The dynamic current limiting device can be configured in various general computing devices, and the computing device can be a server, and a service mesh system is running in the computing device.
[0031] The structure of the service mesh system is as Figure 1b shown, including a dynamic configuration center, a control plane, a data analysis module, and a service mesh layer. Among them, the service mesh layer serves as the communication infrastructure in the microservice cluster. The service mesh layer is responsible for request forwarding, load balancing, authentication and authorization between services. Each service instance communicates through the proxy of the service mesh layer, and the proxy executes the corresponding traffic management policies according to the instructions of the control plane. The control plane serves as the control center of the system. The control plane is responsible for receiving the configuration instructions from the dynamic configuration center, converting these instructions into configuration information that the service mesh layer can understand, and then sending them to the service mesh layer for execution. At the same time, the control plane is also responsible for monitoring the status of the service mesh layer to ensure the normal operation of the system. The dynamic configuration center serves as the storage and management center of the configuration information. The dynamic configuration center is responsible for storing the configuration information of all services, including flow limiting rules, routing rules, authentication information, etc. When the configuration information changes, the dynamic configuration center will update it in real time and notify the control plane of the change. The data analysis module serves as a support system for intelligent decision-making. The data analysis module deeply analyzes the system status and business requirements by collecting service operation status and traffic data and applying machine learning or prediction algorithms. Based on the analysis results, the data analysis module provides intelligent decision-making suggestions for the dynamic configuration center to optimize the flow limiting strategy and configuration information.
[0032] As Figure 1a shown, the dynamic flow limiting method includes:
[0033] S110. Based on the historical service operation data, perform traffic prediction and system load prediction to obtain a predicted traffic value, a predicted load score, and the dependency weight of the service in the system; the historical service operation data includes historical traffic data, system resource data, and business metric data.
[0034] The historical service operation data is used to describe the service operation status and traffic status of the service during historical operation. The historical service data is obtained by the data analysis module through the monitoring system and the log collection tool, including historical traffic data, system resource data, and business metric data. Among them, the historical traffic data includes the request volume and response time, etc.; the system resource data includes the usage rate of the central processing unit (CPU for short), the memory occupancy rate, the thread pool status, and the network latency, etc.; the business metric data includes business activity identifiers and time period characteristics, etc.
[0035] In the embodiment of the present invention, the historical service operation data can be collected according to the first execution period. Based on the historical service operation data, traffic prediction and system load prediction are performed to obtain a predicted traffic value, a predicted load score, and the dependency weight of the service in the system.
[0036] Specifically, according to the first execution cycle, historical service operation data is collected and the collected data is preprocessed, including performing data cleaning operations, removing outliers and filling in missing values, etc. After data cleaning, denoising processing is performed to obtain smoothed data, and then the data is formatted for subsequent analysis.
[0037] Furthermore, the data analysis module inputs the historical service operation data into the traffic prediction model to obtain the predicted traffic value, predicted load score, and dependency weight of the service in the system of the traffic prediction model data. Among them, the predicted load score is the score of the load volume such as CPU load and memory load. The dependency weight represents the importance weight of the service in the system.
[0038] Among them, the traffic prediction model can be based on the long short-term memory network and trained with the historical service operation data as the training samples. For example, the historical service operation data of the past 30 days is obtained, and the sliding window mechanism (for example, the sliding window size is set to 1 hour) is used to generate training samples.
[0039] S120. Generate a flow limiting rule according to the predicted traffic value, predicted load score, and dependency weight, and synchronize the flow limiting rule to the service mesh layer.
[0040] In the embodiment of the present invention, after obtaining the predicted traffic value, predicted load score, and dependency weight predicted by the data analysis module based on the traffic prediction model, a flow limiting rule is generated based on the predicted traffic value, predicted load score, and dependency weight, and the flow limiting rule is synchronized to the dynamic configuration center. On the one hand, the dynamic configuration center adjusts the configuration information based on the flow limiting rule. On the other hand, the flow limiting rule is synchronized to the service mesh layer through the control plane so that the service mesh layer performs flow limiting based on the flow limiting rule.
[0041] Specifically, a traffic correction coefficient is determined based on the predicted traffic value. The larger the predicted traffic value, the smaller the traffic correction coefficient. At the same time, a load penalty coefficient is determined based on the predicted load score. The higher the predicted load score, the heavier the load, and the smaller the load penalty coefficient. A weight reward coefficient is determined based on the dependency weight. The higher the dependency weight, the more important the current service is in the system, and the larger the weight reward coefficient.
[0042] Furthermore, based on the determined load penalty coefficient, traffic correction coefficient, and weight reward coefficient, the initial flow limiting value is updated, that is, the product of the initial flow limiting value, load penalty coefficient, traffic correction coefficient, and weight reward coefficient is calculated to obtain the updated flow limiting threshold. Finally, based on the updated flow limiting thresholds corresponding to each service in the system, a flow limiting rule is generated.
[0043] In another way, it is also possible to determine a predicted traffic ratio based on the predicted traffic value and a preset baseline traffic value, and then determine an updated flow-limiting threshold based on the predicted traffic ratio, the predicted load score, and the dependency weight, and generate a flow-limiting rule based on the updated flow-limiting threshold. Specifically, a dynamic adjustment coefficient is determined based on the predicted traffic ratio and the predicted load score, and a service level correction factor is determined based on the dependency weight. Finally, the initial flow-limiting threshold is updated based on the dynamic adjustment coefficient and the service level correction factor to obtain the updated flow-limiting threshold, and a flow-limiting rule is generated based on the updated flow-limiting threshold.
[0044] In another way, it is also possible to determine a predicted traffic ratio based on the predicted traffic value and a preset baseline traffic value, and compare the predicted traffic ratio with a set threshold. If the predicted traffic ratio is greater than the set threshold, then further determine the threshold adjustment parameters corresponding to services with different dependency weights based on the predicted load score under the current predicted load score. Finally, determine the threshold adjustment parameters corresponding to the current service based on the dependency weight of the current service. The initial flow-limiting threshold is updated based on the threshold adjustment parameters to obtain the updated flow-limiting threshold, and a flow-limiting rule is generated based on the updated flow-limiting threshold. Among them, the smaller the dependency weight, the stricter the flow limiting, that is, the smaller the flow-limiting threshold.
[0045] S130. Perform flow limiting on the currently running service based on the current service running data collected by the service mesh layer during the service operation and the flow-limiting rule.
[0046] In the embodiment of the present invention, after the service mesh layer obtains the flow-limiting rule, it will apply the flow-limiting rule to perform dynamic table flow limiting on the service. Specifically, the service mesh layer collects the current service running data during the service operation according to the second execution period, and performs flow limiting on the currently running service based on the current service running data collected by the service mesh layer during the service operation and the flow-limiting rule. Based on the current service running data, traffic prediction is performed to obtain a predicted traffic trend curve. If the difference between the updated flow-limiting threshold and the current traffic data in the current service running data is less than the difference threshold, that is, the current traffic data is about to reach or has reached the updated traffic threshold, and the traffic data in the predicted traffic trend curve rises with time, then it is necessary to increase the flow-limiting threshold in the short term, and perform flow limiting on the currently running service based on the increased flow-limiting threshold. Among them, the second execution period for performing dynamic flow limiting is less than the first execution period for performing dynamic flow-limiting configuration (i.e., generating a flow-limiting rule).
[0047] Optionally, after performing flow limiting on the currently running service based on the current service running data collected by the service mesh layer during the service operation and the flow-limiting rule, it further includes:
[0048] Collect flow-limiting effect data through the service mesh layer; the flow-limiting effect data includes the request success rate and the response time;
[0049] Determine the system performance under the current traffic limiting rule based on the traffic limiting effect data;
[0050] Perform feedback adjustment on the traffic limiting rule based on the system performance.
[0051] In this optional embodiment, after traffic limiting the currently running service based on the current service running data and the traffic limiting rule collected by the service mesh layer during the service operation, the service mesh layer collects the traffic limiting effect data, where the traffic limiting effect data includes the request success rate and the response time. Furthermore, based on the traffic limiting effect data, the system performance under the current traffic limiting rule is determined, and the traffic limiting rule is feedback-adjusted based on the system performance. For example, calculate the system performance score based on the success rate and the response time. If the score is lower than the set threshold, feedback adjustment is performed on the traffic limiting rule, and further, the traffic limiting thresholds of each service are reduced according to a preset ratio. By performing feedback adjustment on the traffic limiting rule, the dynamic configuration center further adjusts the configuration rule to form a closed-loop feedback mechanism to meet the performance requirements of each service.
[0052] The technical solution of the embodiment of the present invention is based on historical service running data to perform traffic prediction and system load prediction, obtain the predicted traffic value, the predicted load score, and the dependency weight of the service in the system. Then, according to the predicted traffic value, the predicted load score, and the dependency weight, a traffic limiting rule is generated and synchronized to the service mesh layer. Based on the current service running data and the traffic limiting rule collected by the service mesh layer during the service operation, traffic limiting is performed on the currently running service, realizing dynamic traffic limiting based on the predicted traffic and load status and meeting the traffic limiting requirements of the system service in different states.
[0053] Embodiment Two
[0054] Figure 2 It is a flowchart of a dynamic traffic limiting method provided by the second embodiment of the present invention. This embodiment is further refined on the basis of the above embodiment, providing the specific steps of generating a traffic limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and the specific steps of performing traffic limiting on the currently running service based on the current service running data and the traffic limiting rule collected by the service mesh layer during the service operation. As Figure 2 shown, the method includes:
[0055] S210. Perform traffic prediction and system load prediction based on historical service running data to obtain the predicted traffic value, the predicted load score, and the dependency weight of the service in the system; the historical service running data includes historical traffic data, system resource data, and business metric data.
[0056] S220. Determine the predicted traffic ratio based on the predicted traffic value and the preset baseline traffic value.
[0057] The baseline flow value is a preset baseline value used to determine the flow value offset.
[0058] In an embodiment of the present invention, a baseline flow threshold is preset, the ratio of the predicted flow value to the baseline flow is calculated to obtain a predicted flow ratio, so as to determine the degree to which the future flow value deviates from the baseline flow according to the predicted flow ratio.
[0059] S230. Determine an updated flow limit threshold based on the predicted flow ratio, the predicted load score, and the dependency weight, generate a flow limit rule based on the updated flow limit threshold, and synchronize the flow limit rule to the service mesh layer.
[0060] In an embodiment of the present invention, an updated flow limit threshold is determined based on the predicted flow ratio, the predicted load score, and the dependency weight, a flow limit rule is generated based on the updated flow limit threshold, and the flow limit rule is synchronized to the service mesh layer. By updating the flow limit threshold in the way of the predicted flow ratio, the predicted load score, and the dependency weight, the deviation amount of the predicted flow value relative to the baseline flow value, the future system load condition, and the importance of the service in the system are comprehensively considered to determine the updated flow limit value of the service, which can meet the service requirements and ensure service reliability.
[0061] Specifically, a dynamic adjustment coefficient is determined based on the predicted flow ratio and the predicted load score, and a service level correction factor is determined based on the dependency weight. Finally, the initial flow limit threshold is updated based on the dynamic adjustment coefficient and the service level correction factor to obtain an updated flow limit threshold, and a flow limit rule is generated based on the updated flow limit threshold.
[0062] It is also possible to determine the predicted flow ratio based on the predicted flow value and the preset baseline flow value, and compare the predicted flow ratio with a set threshold. If the predicted flow ratio is greater than the set threshold, then further determine the threshold adjustment parameters corresponding to services with different dependency weights based on the predicted load score under the current predicted load score. Finally, the threshold adjustment parameters corresponding to the current service are determined based on the dependency weight of the current service. Based on the threshold adjustment parameters, the initial flow limit threshold is updated to obtain an updated flow limit threshold, and a flow limit rule is generated based on the updated flow limit threshold. Among them, the smaller the dependency weight, the stricter the flow limit, that is, the smaller the flow limit threshold.
[0063] Optionally, determining an updated flow limit threshold based on the predicted flow ratio, the predicted load score, and the dependency weight, and generating a flow limit rule based on the updated flow limit threshold includes:
[0064] Compare the predicted flow ratio with a set threshold, and in the case where the predicted flow ratio is greater than the set threshold, determine a threshold adjustment strategy based on the predicted load score;
[0065] Determine the threshold adjustment parameters corresponding to the service in the threshold adjustment strategy based on the dependency weight;
[0066] Update the initial current limit threshold based on the threshold adjustment parameter to obtain an updated current limit threshold, and generate a current limit rule based on the updated current limit threshold.
[0067] In this alternative embodiment, a specific method for determining the updated current limit threshold based on the predicted traffic ratio, predicted load score, and dependency weight, and generating a current limit rule based on the updated current limit threshold is provided: Compare the predicted traffic ratio with the set threshold. When the predicted traffic ratio is greater than the set threshold, determine the threshold adjustment strategy based on the predicted load score. For example, pre-store the corresponding relationship between the load score range and the threshold adjustment parameters of services with different dependency weights as the threshold adjustment strategy. First, determine the range where the predicted load score is located, and determine the threshold adjustment parameters of services with various dependency weights corresponding to the range as the threshold adjustment strategy.
[0068] Exemplarily, when the load score is greater than 0.8: For services with a dependency weight greater than 0.7, the current limit threshold is lowered by 10%; for services with a dependency weight greater than 0.5 and less than or equal to 0.7, the current limit threshold is lowered by 15%; for services with a dependency weight less than or equal to 0.5, the current limit threshold is lowered by 20%. When the load score is less than 0.3: For services with a dependency weight greater than 0.7, the current limit threshold is increased by 20%; for services with a dependency weight greater than 0.5 and less than or equal to 0.7, the current limit threshold is increased by 15%; for services with a dependency weight less than or equal to 0.5, the current limit threshold is increased by 10%.
[0069] Furthermore, based on the dependency weight, determine the threshold adjustment parameter corresponding to the service in the threshold adjustment strategy, that is, in the threshold adjustment strategy, select the threshold adjustment parameter corresponding to the dependency weight of the current service. Finally, update the initial current limit threshold based on the threshold adjustment parameter to obtain an updated current limit threshold, and generate a current limit rule based on the updated current limit threshold. When the predicted traffic ratio is greater than the threshold, determining the threshold adjustment parameter corresponding to the service based on the predicted load score and dependency weight can achieve targeted adjustment of the current limit threshold for services with different dependency weights, improve the reliability of core services, and prevent system overload and collapse.
[0070] S240. During the operation of the service, monitor service requests through the service mesh layer, and periodically obtain the current service operation data.
[0071] In the embodiment of the present invention, after configuring the current limit rule to the dynamic configuration center and synchronizing it to the service mesh layer, during the operation of the service, monitor service requests through the service mesh layer, and periodically obtain the current service operation data to predict the future traffic value based on the current service operation data.
[0072] It should be noted that during the current service operation data collection period in the service operation process, it is less than the collection period of historical service operation data when configuring the flow limiting rules. The dynamic configuration method of the flow limiting rules, as the generation mechanism of the basic configuration strategy, has a relatively long execution period, for example, at the minute level, providing a policy framework for the dynamic flow limiting method. The dynamic flow limiting method, as a real-time traffic regulation means, has a shorter execution period, for example, at the second level, and makes fine-grained adjustments within the policy framework generated by the dynamic configuration. The two form a collaborative relationship of macro policy formulation and micro dynamic regulation.
[0073] S250. Based on the current service operation data, perform traffic prediction through a traffic prediction model to obtain a predicted traffic trend curve.
[0074] In the embodiments of the present invention, based on the current service operation data, perform traffic prediction through a traffic prediction model to obtain a predicted traffic trend curve. The traffic prediction model is based on a long short-term memory network as the basic model and is trained using historical service operation data as training samples.
[0075] S260. Based on the current service operation data and the predicted traffic trend curve, adjust the updated flow limiting threshold in the flow limiting rules, and based on the adjusted flow limiting threshold, limit the current running service.
[0076] In the embodiments of the present invention, based on the current service operation data and the predicted traffic trend curve, adjust the updated flow limiting threshold in the flow limiting rules. For example, when the current service operation data does not reach the updated flow limiting threshold in the flow limiting rules and the traffic data in the predicted traffic trend curve remains flat over time, the updated flow limiting threshold can be kept unchanged. Another example is that when the difference between the updated flow limiting threshold and the current traffic data is less than the difference threshold and the traffic data in the predicted traffic trend curve rises over time, the flow limiting threshold is increased. By predicting the traffic trend, the traffic peak can be effectively controlled and the system flexibility can be improved.
[0077] Optionally, based on the current service operation data and the predicted traffic trend curve, adjusting the updated flow limiting threshold in the flow limiting rules, and based on the adjusted flow limiting threshold, limiting the current running service includes:
[0078] Compare the current traffic data in the current service operation data with the updated flow limiting threshold in the flow limiting rules;
[0079] When the difference between the updated flow limiting threshold and the current traffic data is less than the difference threshold and the traffic data in the predicted traffic trend curve rises over time, increase the flow limiting threshold, and based on the increased flow limiting threshold, limit the current running service.
[0080] In this optional embodiment, a specific method for adjusting the updated flow-limiting threshold in the flow-limiting rule based on the current service operation data and the predicted traffic trend curve, and performing flow-limiting on the currently running service based on the adjusted flow-limiting threshold is provided: First, compare the current traffic data in the current service operation data with the updated flow-limiting threshold in the flow-limiting rule. If the difference between the updated flow-limiting threshold and the current traffic data is less than the difference threshold, and the traffic data in the predicted traffic trend curve increases with time, it is necessary to increase the flow-limiting threshold in the current flow-limiting rule, and perform flow-limiting on the currently running service based on the increased flow-limiting threshold. During the service operation, traffic prediction is performed based on the current service operation data, and the flow-limiting threshold is flexibly adjusted based on the predicted traffic data to improve the reliability of service operation.
[0081] The technical solution of the embodiment of the present invention is based on historical service operation data to perform traffic prediction and system load prediction, obtain the predicted traffic value, predicted load score, and the dependency weight of the service in the system, and generate a flow-limiting rule based on the predicted traffic value, predicted load score, and the dependency weight of the service in the system and synchronize it to the service mesh layer. During the service operation, the service mesh layer monitors service requests, periodically obtains the current service operation data, performs traffic prediction through a traffic prediction model based on the current service operation data to obtain a predicted traffic trend curve, adjusts the updated flow-limiting threshold in the flow-limiting rule based on the current service operation data and the predicted traffic trend curve, and performs flow-limiting on the currently running service based on the adjusted flow-limiting threshold to achieve dynamic adjustment of the flow-limiting rule.
[0082] Embodiment III
[0083] Figure 3 It is a schematic structural diagram of a dynamic flow-limiting device provided in Embodiment III of the present invention. As Figure 3 shown, the device includes:
[0084] A traffic prediction module 310, configured to perform traffic prediction and system load prediction based on historical service operation data to obtain a predicted traffic value, a predicted load score, and the dependency weight of the service in the system; the historical service operation data includes historical traffic data, system resource data, and business metric data;
[0085] A flow-limiting rule generation module 320, configured to generate a flow-limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and synchronize the flow-limiting rule to the service mesh layer;
[0086] A dynamic flow-limiting module 330, configured to perform flow-limiting on the currently running service based on the current service operation data and the flow-limiting rule collected by the service mesh layer during the service operation.
[0087] The technical solution of the embodiment of the present invention is based on historical service operation data to perform traffic prediction and system load prediction, obtain a predicted traffic value, a predicted load score, and the dependency weight of the service in the system, and then generate a flow limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and synchronize the flow limiting rule to the service mesh layer. Based on the current service operation data and the flow limiting rule collected by the service mesh layer during the service operation, limit the current running service, so as to realize dynamic flow limiting based on the predicted traffic and load status, and meet the flow limiting requirements of the system service in different states.
[0088] Optionally, the flow limiting rule generation module 320 includes:
[0089] A predicted traffic ratio determination unit, configured to determine a predicted traffic ratio based on the predicted traffic value and a preset baseline traffic value;
[0090] A flow limiting rule generation unit, configured to determine an updated flow limiting threshold based on the predicted traffic ratio, the predicted load score, and the dependency weight, and generate a flow limiting rule based on the updated flow limiting threshold.
[0091] Optionally, the flow limiting rule generation unit is specifically configured to:
[0092] Compare the predicted traffic ratio with a set threshold, and when the predicted traffic ratio is greater than the set threshold, determine a threshold adjustment strategy based on the predicted load score;
[0093] Determine a threshold adjustment parameter corresponding to the service in the threshold adjustment strategy based on the dependency weight;
[0094] Update the initial flow limiting threshold based on the threshold adjustment parameter to obtain an updated flow limiting threshold, and generate a flow limiting rule based on the updated flow limiting threshold.
[0095] Optionally, the dynamic flow limiting module 330 includes:
[0096] A data collection unit, configured to monitor service requests through the service mesh layer during the service operation, and periodically obtain current service operation data;
[0097] A traffic prediction unit, configured to perform traffic prediction based on the current service operation data through a traffic prediction model to obtain a predicted traffic trend curve;
[0098] A dynamic flow limiting unit, configured to adjust the updated flow limiting threshold in the flow limiting rule based on the current service operation data and the predicted traffic trend curve, and limit the current running service based on the adjusted flow limiting threshold.
[0099] Optionally, the dynamic flow limiting unit is specifically configured to:
[0100] Compare the current traffic data in the current service operation data with the updated traffic limiting threshold in the traffic limiting rule;
[0101] When the difference between the updated traffic limiting threshold and the current traffic data is less than the difference threshold, and the traffic data in the predicted traffic trend curve rises with time, increase the traffic limiting threshold, and based on the increased traffic limiting threshold, limit the current running service.
[0102] Optionally, the dynamic traffic limiting device further includes:
[0103] An effect data collection module, configured to collect traffic limiting effect data through the service mesh layer after limiting the current running service based on the current service operation data and the traffic limiting rule collected during the service operation process by the service mesh layer; the traffic limiting effect data includes the request success rate and the response time;
[0104] A performance determination module, which determines the system performance under the current traffic limiting rule based on the traffic limiting effect data;
[0105] A feedback adjustment module, configured to perform feedback adjustment on the traffic limiting rule based on the system performance.
[0106] The dynamic traffic limiting device provided by the embodiments of the present invention can execute the dynamic traffic limiting method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0107] In the technical solution of the present invention, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure, and application of relevant data, etc., all comply with the relevant laws, regulations, and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0108] Embodiment 4
[0109] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.
[0110] Figure 4FIG. 0 shows a schematic structural diagram of an electronic device 10 that can be used to implement embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, appliances, blade appliances, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, personal digital processors, cellular telephones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0111] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0112] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0113] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the dynamic current limiting method.
[0114] In some embodiments, the dynamic current limiting method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the dynamic current limiting method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the dynamic current limiting method by any other suitable means (e.g., by means of firmware).
[0115] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs executable and / or interpretable on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0116] The computer program for implementing the method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or appliance.
[0117] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] To provide for interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0119] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of the communication network include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0120] A computing system may include a client and an applicator. The client and the applicator are generally far from each other and usually interact via a communication network. The relationship between the client and the applicator is generated by computer programs running on respective computers and having a client-applicator relationship with each other. The applicator may be a cloud applicator, also known as a cloud computing applicator or a cloud host, which is a host product in a cloud computing application system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS applications.
[0121] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0122] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A dynamic current limiting method, characterized in that, It includes: Based on historical service operation data, conduct traffic prediction and system load prediction to obtain a predicted traffic value, a predicted load score, and the dependency weight of the service in the system; The historical service operation data includes historical traffic data, system resource data, and business metric data; Generate a traffic limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and synchronize the traffic limiting rule to the service mesh layer; Based on the current service operation data collected by the service mesh layer during service operation and the traffic limiting rule, limit the current running service.
2. The method according to claim 1, characterized in that Generating a traffic limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight includes: Based on the predicted traffic value and a preset baseline traffic value, determine a predicted traffic ratio; Based on the predicted traffic ratio, the predicted load score, and the dependency weight, determine an updated traffic limiting threshold, and generate a traffic limiting rule based on the updated traffic limiting threshold.
3. The method according to claim 2, wherein Based on the predicted traffic ratio, the predicted load score, and the dependency weight, determining an updated traffic limiting threshold, and generating a traffic limiting rule based on the updated traffic limiting threshold includes: Compare the predicted traffic ratio with a set threshold. When the predicted traffic ratio is greater than the set threshold, determine a threshold adjustment strategy based on the predicted load score; Based on the dependency weight, determine a threshold adjustment parameter corresponding to the service in the threshold adjustment strategy; Based on the threshold adjustment parameter, update the initial traffic limiting threshold to obtain an updated traffic limiting threshold, and generate a traffic limiting rule based on the updated traffic limiting threshold.
4. The method according to claim 1, characterized in that Limiting the current running service based on the current service operation data collected by the service mesh layer during service operation and the traffic limiting rule includes: During service operation, monitor service requests through the service mesh layer, and periodically obtain current service operation data; Based on the current service operation data, conduct traffic prediction through a traffic prediction model to obtain a predicted traffic trend curve; Based on the current service operation data and the predicted traffic trend curve, adjust the updated traffic limiting threshold in the traffic limiting rule, and limit the current running service based on the adjusted traffic limiting threshold.
5. The method according to claim 4, wherein Based on the current service operation data and the predicted traffic trend curve, adjusting the updated traffic limiting threshold in the traffic limiting rule, and limiting the current running service based on the adjusted traffic limiting threshold includes: Compare the current traffic data in the current service operation data with the updated traffic limiting threshold in the traffic limiting rule; When the difference between the updated traffic limiting threshold and the current traffic data is less than the difference threshold, and the traffic data in the predicted traffic trend curve rises with time, increase the traffic limiting threshold, and limit the current running service based on the increased traffic limiting threshold.
6. The method according to claim 1, characterized in that, After limiting the current running service based on the current service operation data collected by the service mesh layer during service operation and the traffic limiting rule, it further includes: Collect traffic limiting effect data through the service mesh layer; the traffic limiting effect data includes request success rate and response time; Based on the traffic limiting effect data, determine the system performance under the current traffic limiting rule; Based on the system performance, conduct feedback adjustment on the traffic limiting rule.
7. A dynamic current limiting device, characterized in that, including: a traffic prediction module configured to perform traffic prediction and system load prediction based on historical service operation data to obtain a predicted traffic value, a predicted load score, and a dependency weight of the service in the system; the historical service operation data includes historical traffic data, system resource data, and business metric data; a rate limiting rule generation module configured to generate a rate limiting rule according to the predicted traffic value, the predicted load score, and the dependency weight, and synchronize the rate limiting rule to the service mesh layer; a dynamic rate limiting module configured to perform rate limiting on the currently running service based on the current service operation data collected by the service mesh layer during service operation and the rate limiting rule.
8. An electronic device, characterized in that, The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the dynamic rate limiting method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the dynamic rate limiting method according to any one of claims 1-6 when executed.
10. A computer program product, characterized in that, The computer program product includes a computer program which, when executed by a processor, implements the dynamic rate limiting method according to any one of claims 1-6.
Citation Information
Cited By
Weight-based dynamic current limiting control method and system
CN122457553A
Weight-based dynamic throttling control method and system
CN122457553B