Traffic control method, device, apparatus and storage medium
By acquiring the service's business characteristics and historical data, calculating flow control thresholds, and dynamically adjusting traffic status, the problem of a single flow control strategy in existing technologies is solved, achieving autonomous control of traffic across the entire link and system stability.
Patent Information
- Application Number
- CN202311355766.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-10-18
AI Technical Summary
Existing technologies employ a single traffic control strategy, resulting in poor flow control effectiveness. They are unable to achieve end-to-end traffic balance in complex systems, and the communication methods between services are not unique, affecting system stability.
By acquiring service-specific business characteristic data and historical periodic data, flow control thresholds are calculated. Combined with real-time service response data and local anomaly detection data, the flow control status is dynamically adjusted to achieve end-to-end autonomous flow control.
It improves the accuracy of flow limiting threshold adjustment and flow control effect, realizes autonomous control of traffic across the entire link, and ensures continuous and stable system operation.
Smart Images

Figure CN117376255B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flow control technology, and in particular to a flow control method, apparatus, device, and storage medium. Background Technology
[0002] Modern advanced service rate limiting methods can receive user-defined policies and distribute them to each service node, achieving seamless and method-level rate limiting. Other methods dynamically adjust flow control parameters based on the current service node's flow control method. These methods primarily include acquisition, generation, and push modules. By acquiring the rate limiting metric configuration file, they push the generated rate limiting thresholds to each service node, which is a distributed service built from computer and network equipment. However, all of these methods suffer from the following problems: They rely on simplistic flow control policies, requiring users to manually set thresholds or select appropriate thresholds based on real-time traffic, resulting in unsatisfactory flow control performance. Measuring system traffic normality often involves more than just monitoring real-time traffic changes; it is closely related to business attributes, historical periodicity, and internal logic. Most flow control policies target only a single service, only suitable for simple systems. In complex systems composed of numerous services, they cannot balance the traffic of multiple services across the entire chain to achieve optimal flow control. Furthermore, inter-service communication methods are not unique. For example, when introducing message queue middleware, in addition to coordinating traffic between services, the performance and capacity of the middleware must also be considered. Summary of the Invention
[0003] The main objective of this invention is to provide a flow control method, apparatus, device, and storage medium, which aims to solve the technical problems of poor flow control effect due to the single flow control strategy in the prior art and the inability of single service flow control to guarantee the continuous and stable operation of the system.
[0004] To achieve the above objectives, the present invention provides a flow control method, the method comprising the following steps:
[0005] Obtain data on the service's own business characteristics and historical periodic data;
[0006] The service flow control threshold is calculated based on the service's own business characteristic data and the historical periodic data.
[0007] Calculate the real-time service response data and local anomaly detection data of the service;
[0008] The overall flow control trend is calculated based on the flow control threshold, the real-time service response data, and the local anomaly detection data.
[0009] The flow control status is adjusted in real time according to the overall flow control trend to achieve autonomous flow control across the entire link.
[0010] Optionally, the calculation of the service's real-time response data and local anomaly detection data includes:
[0011] Calculate the average response time of the service, and obtain real-time service response data based on the average response time;
[0012] Calculate the average response time for local anomalies of the service, and obtain local anomaly detection data based on the average response time for local anomalies of the service.
[0013] Optionally, calculating the average response time of the service and obtaining real-time service response data based on the average response time includes:
[0014] Get the average response time of the service over a unit of time and the current unit of time;
[0015] The average response time of the service is calculated based on the average response time of the service per unit time, the current unit time, and the preset statistical period.
[0016] The average response time of the service is used as the real-time response data of the service.
[0017] Optionally, calculating the average response time of local anomalies in the service and obtaining local anomaly detection data based on the average response time of local anomalies in the service includes:
[0018] When a local anomaly is detected in the service, the number of local anomalies and the weight of each local anomaly are obtained.
[0019] Obtain the average response time of local anomalies for the service within a unit of time.
[0020] The average response time of local anomalies is calculated based on the number of local anomalies, the weight of each local anomaly, the average response time of the service for local anomalies per unit time, the current unit time, and the preset statistical period.
[0021] The average response time of the local anomaly is used as the local anomaly detection data.
[0022] Optionally, the acquisition of the service's own business characteristic data and historical periodic data includes:
[0023] Obtain the business attributes and business type of the service;
[0024] Based on the business attributes and the business type, the service's own business characteristic data is obtained;
[0025] Obtain the traffic status of the service within a historical period;
[0026] Historical periodic data of the service is obtained based on the service's traffic status during a historical period and the service type.
[0027] Optionally, the step of calculating the overall flow control trend based on the flow control threshold, the real-time service response data, and the local anomaly detection data includes:
[0028] A proportionality coefficient is obtained based on the real-time service response data and the local anomaly detection data, wherein the proportionality coefficient is the ratio of the average response time to the average response time of local anomalies.
[0029] The flow control trend per unit period is calculated based on the flow control threshold, the real-time service response data, the local anomaly detection data, and the proportional coefficient.
[0030] The overall flow control trend is obtained by calculating based on the flow control trend of the unit period.
[0031] Optionally, the step of adjusting the flow control state in real time according to the overall flow control trend to achieve end-to-end autonomous flow control includes:
[0032] Update the flow control threshold to the communication middleware based on the overall flow control trend;
[0033] The communication middleware updates the flow control thresholds of upstream and downstream services based on the flow control thresholds to obtain the updated flow control thresholds of upstream and downstream services.
[0034] The flow control status is adjusted according to the updated flow control thresholds of the upstream and downstream services, and different business message queues are monitored to obtain the number of message queues backlogged.
[0035] When the number of messages accumulated in the message queue exceeds a preset threshold, a new flow control threshold is updated to the communication middleware, so that the upstream and downstream services can pull the new flow control threshold and update it, thereby achieving end-to-end autonomous flow control.
[0036] Furthermore, to achieve the above objectives, the present invention also proposes a flow control device, the flow control device comprising:
[0037] The acquisition module is used to acquire the service's own business characteristic data and historical periodic data;
[0038] The calculation module is used to calculate the flow control threshold of the service based on the service's own business characteristic data and the historical periodic data.
[0039] The calculation module is also used to calculate the real-time service response data and local anomaly detection data of the service.
[0040] The calculation module is also used to calculate the overall flow control trend based on the flow control threshold, the real-time service response data, and the local anomaly detection data.
[0041] The control module is used to adjust the flow control status in real time according to the overall flow control trend in order to achieve autonomous flow control across the entire link.
[0042] Furthermore, to achieve the above objectives, the present invention also proposes a flow control device, the flow control device comprising: a memory, a processor, and a flow control program stored in the memory and executable on the processor, the flow control program being configured to implement the steps of the flow control method as described above.
[0043] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a flow control program, which, when executed by a processor, implements the steps of the flow control method described above.
[0044] This invention acquires service-specific business characteristic data and historical periodic data; calculates the service's flow control threshold based on this data; calculates the service's real-time response data and local anomaly detection data; calculates the overall flow control trend based on the flow control threshold, real-time response data, and local anomaly detection data; and adjusts the flow control state in real time according to the overall flow control trend to achieve autonomous flow control across the entire link. By calculating the service's flow control threshold and the overall flow control trend based on it, and then adjusting the flow control state to achieve autonomous flow control across the entire link, this invention solves the problems of poor flow control effectiveness due to a single flow control strategy and the inability of single-service flow control to guarantee the continuous and stable operation of the system. It improves the accuracy of flow limit threshold adjustment and the flow control effect, achieving autonomous, end-to-end flow control. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of the structure of the flow control device in the hardware operating environment involved in the embodiments of the present invention;
[0046] Figure 2 This is a flowchart illustrating the first embodiment of the flow control method of the present invention;
[0047] Figure 3 This is a schematic diagram of the flow control algorithm dimension in one embodiment of the flow control method of the present invention;
[0048] Figure 4 This is a schematic diagram of end-to-end autonomous traffic control in one embodiment of the traffic control method of the present invention;
[0049] Figure 5 This is a flowchart illustrating the second embodiment of the flow control method of the present invention;
[0050] Figure 6 This is a structural block diagram of the first embodiment of the flow control device of the present invention.
[0051] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0052] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0053] Reference Figure 1 , Figure 1 This is a schematic diagram of the flow control device structure in the hardware operating environment involved in the embodiments of the present invention.
[0054] like Figure 1 As shown, the flow control device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0055] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the flow control device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0056] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a flow control program.
[0057] exist Figure 1In the flow control device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the flow control device of the present invention can be set in the flow control device, and the flow control device calls the flow control program stored in the memory 1005 through the processor 1001 and executes the flow control method provided in the embodiment of the present invention.
[0058] This invention provides a flow control method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the flow control method of the present invention.
[0059] In this embodiment, the flow control method includes the following steps:
[0060] Step S10: Obtain the service's own business characteristic data and historical periodic data.
[0061] It should be noted that the execution subject in this embodiment is a flow control device, but it can also be other devices that can achieve the same or similar functions. This embodiment does not limit this; this embodiment uses a flow control device as an example for explanation.
[0062] It is understood that the flow control method in this embodiment can be applied to financial market operations. The service can be a payment service or other services, and this embodiment does not impose any specific restrictions on it.
[0063] It is worth noting that, in order to more accurately assess and intervene in the traffic thresholds of various services, this embodiment proposes a comprehensive flow control algorithm based on flow control trend indicators. This algorithm analyzes and calculates traffic trends from four dimensions and dynamically adjusts the flow control thresholds, specifically including the dimensions of service characteristics, real-time service response, historical periodicity, and local anomaly detection. Figure 3 As shown, Figure 3 This is a schematic diagram of the flow control algorithm dimensions.
[0064] In practice, the service is analyzed from its own business characteristics to obtain its own business characteristic data; the service is also analyzed from its historical periodicity to obtain its historical periodicity data.
[0065] Furthermore, the step of obtaining the service's own business characteristic data and historical periodic data includes: obtaining the service's business attributes and business type; obtaining the service's own business characteristic data based on the business attributes and business type; obtaining the service's traffic status in a historical period; and obtaining the service's historical periodic data based on the service's traffic status in a historical period and the business type.
[0066] It should be noted that by analyzing the business characteristics of a service, it can be seen that different services often have their own business attributes. Based on the business attributes and business types of different services, the service's own business characteristic data can be obtained.
[0067] Understandably, historical periodic analysis of services reveals that historical periodic data represents the historical periodicity of traffic for different services, and different business types exhibit different traffic states within historical periods.
[0068] Step S20: Calculate the service flow control threshold based on the service's own business characteristic data and the historical periodic data.
[0069] It should be noted that different services often have their own business attributes. When calculating flow control thresholds in real time, the service’s own business characteristics will be taken into account. Different flow control thresholds will be assigned according to different business types. For business services with relatively stable traffic, a flow control threshold with lower tolerance will be set, while for business services with large traffic fluctuations, a flow control threshold with higher tolerance will be set.
[0070] It is understandable that historical periodicity is taken into account when calculating flow control thresholds. Different business types exhibit different traffic states within historical periods. Therefore, flow control thresholds are obtained based on periodicity algorithms.
[0071] In the specific implementation, the flow control threshold of the service is calculated based on its own business characteristics and historical periodicity, as shown in Equation 1 below:
[0072] U=f(x b )+f(y b (Equation 1)
[0073] In Equation 1, U is the flow control threshold, x b For the unique business characteristics of a single service, y b This refers to the historical cyclical nature of a single business.
[0074] Step S30: Calculate the real-time service response data and local anomaly detection data of the service.
[0075] It should be noted that the real-time service response data is the average response time, and the local anomaly detection data is the average response time for local anomalies.
[0076] Step S40: Calculate the overall flow control trend based on the flow control threshold, the real-time service response data, and the local anomaly detection data.
[0077] It should be noted that the flow control trend within a single statistical period can be calculated based on the flow control threshold, real-time service response, and local anomaly detection response. To avoid errors in the flow control trend calculation, the flow control trends of multiple unit periods are combined to obtain the final overall flow control trend.
[0078] Step S50: Adjust the flow control status in real time according to the overall flow control trend to achieve autonomous flow control across the entire link.
[0079] It should be noted that the flow control status is determined based on the overall flow control trend, and the flow control status is adjusted in real time to achieve flow control.
[0080] Furthermore, the step of adjusting the flow control status in real time according to the overall flow control trend to achieve end-to-end autonomous flow control includes: updating the flow control threshold to the communication middleware according to the overall flow control trend; updating the flow control thresholds of upstream and downstream services according to the flow control thresholds through the communication middleware to obtain the updated flow control thresholds of upstream and downstream services; adjusting the flow control status according to the updated flow control thresholds of upstream and downstream services, and monitoring different business message queues to obtain the message queue backlog; when the message queue backlog exceeds a preset threshold, updating the new flow control threshold to the communication middleware so that the upstream and downstream services pull the new flow control threshold and update it, thereby achieving end-to-end autonomous flow control.
[0081] It should be noted that flow control is achieved through real-time adjustment of the flow control status across the entire link. The flow control status is the same as the flow control state.
[0082] It is understood that the flow control method in this embodiment is applied to a flow control device, which includes a flow control threshold calculation module, a flow control adjustment module, and a flow control update module. The flow control threshold calculation module and the flow control adjustment module are deployed separately and communicate directly with the communication middleware. The flow control update module is bound to different services and communicates with the communication middleware to retrieve flow control thresholds in real time.
[0083] In the specific implementation, after calculating the overall flow control trend, full-link flow control is performed through real-time adjustment of the flow control status. The flow control adjustment module updates the flow control threshold to the middleware, which then notifies each service update module to pull the latest flow control threshold. During real-time flow control status adjustment, different business message queues are monitored simultaneously. When the number of messages accumulated in the queue exceeds a certain threshold, a new flow control threshold is updated to the middleware, which is then pulled and updated by upstream and downstream services. This enables upstream services to perceive the downstream flow control status, achieving traffic balance between upstream and downstream. The updated flow control threshold B from the upstream service... j As shown in Equation 2:
[0084]
[0085] In Equation 2, B j Here, n represents the updated flow control threshold for the upstream service, m represents the number of downstream service instances, and A represents the number of upstream service instances. i For single-instance real-time traffic processing, F c Current message queue backlog, F max α is the maximum number of messages a message queue can hold, and α is the tolerance coefficient.
[0086] like Figure 4 As shown, Figure 4 This diagram illustrates end-to-end traffic self-control. Traffic control across the entire chain is achieved through real-time adjustment of the flow control status, encompassing upstream and downstream applications of services experiencing issues, as well as message queues. All services in the chain are connected to the flow control update module. After calculating the overall flow control trend, the flow control adjustment module updates the flow control thresholds to the middleware, which then notifies each service's update module to retrieve the latest thresholds. During real-time flow control status adjustment, different business message queues are monitored simultaneously. When the number of messages accumulated in a message queue exceeds a certain threshold, new flow control thresholds are updated to the middleware, which is then retrieved and updated by upstream and downstream services. This enables upstream services to perceive the downstream flow control status, achieving traffic balance between upstream and downstream.
[0087] This embodiment acquires the service's own business characteristic data and historical periodic data; calculates the service's flow control threshold based on the business characteristic data and historical periodic data; calculates the service's real-time response data and local anomaly detection data; calculates the overall flow control trend based on the flow control threshold, real-time response data, and local anomaly detection data; and adjusts the flow control state in real time according to the overall flow control trend to achieve autonomous flow control across the entire link. Through this method, by calculating the service's flow control threshold and the overall flow control trend based on the threshold, the flow control state is adjusted to achieve autonomous flow control across the entire link. This solves the problems of poor flow control effect due to a single flow control strategy and the inability of single-service flow control to guarantee the continuous and stable operation of the system, improving the accuracy of flow limit threshold adjustment and flow control effect, and achieving autonomous full-link flow control.
[0088] refer to Figure 5 , Figure 5 This is a flowchart illustrating the second embodiment of the flow control method of the present invention.
[0089] Based on the first embodiment described above, step S30 in the flow control method of this embodiment includes:
[0090] Step S301: Calculate the average response time of the service and obtain real-time response data of the service based on the average response time.
[0091] It should be noted that calculating the average response time of the service and obtaining the real-time response data based on the average response time is equivalent to performing a real-time response dimension analysis on the service to obtain the real-time response data.
[0092] Further, the step of calculating the average response time of the service and obtaining real-time service response data based on the average response time includes: obtaining the average response time of the service within a unit time and the current unit time; calculating the average response time of the service based on the average response time of the service within a unit time, the current unit time, and a preset statistical period; and using the average response time of the service as the real-time service response data.
[0093] It should be noted that a unit of time refers to a certain period of time as a unit, such as one second, one minute, one hour, etc. This embodiment does not impose specific limitations on this.
[0094] In practical implementation, the average response time within a unit period is calculated as follows: Equation 3:
[0095]
[0096] In Equation 3, R t R is the average response time, P is the statistical period, and R is the average response time. ave t represents the average response time per unit time, where t is the current unit time.
[0097] Step S302: Calculate the average response time of local anomalies of the service, and obtain local anomaly detection data based on the average response time of local anomalies of the service.
[0098] It should be noted that calculating the average response time of local anomalies in the service and obtaining local anomaly detection data based on the average response time of local anomalies in the service is equivalent to performing local anomaly detection dimension analysis on the service and obtaining local anomaly detection data.
[0099] Further, the step of calculating the average response time of local anomalies in the service and obtaining local anomaly detection data based on the average response time of local anomalies in the service includes: when a local anomaly is detected in the service, obtaining the number of local anomalies and the weight of each local anomaly; obtaining the average response time of local anomalies in the service per unit time; calculating the average response time of local anomalies based on the number of local anomalies, the weight of each local anomaly, the average response time of local anomalies in the service per unit time, the current unit time, and the preset statistical period; and using the average response time of local anomalies as local anomaly detection data.
[0100] It should be noted that when performing analysis on the local anomaly detection dimension, the response time of the local anomalies to be detected is collected independently, and the average response time of the local anomalies is calculated, as shown in Equation 4 below:
[0101]
[0102] In Equation 4, E t The average response time for local anomalies is given by p, where p is the statistical period and E is the mean response time. ave Let be the average response time of local anomalies per unit time, t be the current unit time, k be the current number of local anomaly detections, n be the number of local anomalies (i.e., the number of local anomalies that need to be detected), and a be the average response time of local anomalies per unit time. k These are weights for local anomalies.
[0103] Further, the step of calculating the overall flow control trend based on the flow control threshold, the real-time service response data, and the local anomaly detection data includes: obtaining a proportional coefficient based on the real-time service response data and the local anomaly detection data, wherein the proportional coefficient is the ratio of the average response time to the average response time of local anomalies; calculating the flow control trend per unit period based on the flow control threshold, the real-time service response data, the local anomaly detection data, and the proportional coefficient; and calculating the overall flow control trend based on the flow control trend per unit period.
[0104] It should be noted that the proportionality coefficient β is determined based on the average response time and the average response time of local anomalies. The proportionality coefficient is the ratio of the average response time to the average response time of local anomalies.
[0105] In practical implementation, the flow control trend within a single statistical period can be calculated based on the flow control threshold, real-time service response, and local anomaly detection response, as shown in Equation 5 below:
[0106]
[0107] In Equation 5, T t R represents the flow control trend per unit period, β is the proportionality coefficient, i.e., the ratio of the average response time to the average response time of local anomalies, and R is the flow control trend per unit period. t E represents the average response time. t U represents the average response time for local anomalies, and U is the flow control threshold.
[0108] To avoid errors in flow control trend calculation, the final overall flow control trend A is obtained by combining flow control trends from multiple unit periods. t As shown in equation 6:
[0109]
[0110] In Equation 6, A tT represents the overall flow control trend for the current unit of time. t For the flow control trend per unit period, A t-1 t represents the overall flow control trend of the previous unit of time, and t represents the current unit of time.
[0111] This embodiment calculates the average response time of the service and obtains real-time service response data based on the average response time; it also calculates the average response time of local anomalies of the service and obtains local anomaly detection data based on the average response time of local anomalies. Through the above method, real-time service response data and local anomaly detection data are obtained by analyzing the real-time service response dimension and the local anomaly detection dimension respectively, thereby calculating the overall flow control trend and improving the flow control effect.
[0112] Reference Figure 6 , Figure 6 This is a structural block diagram of the first embodiment of the flow control device of the present invention.
[0113] like Figure 6 As shown, the flow control device proposed in this embodiment of the invention includes:
[0114] Module 10 is used to acquire the service's own business characteristic data and historical periodic data;
[0115] The calculation module 20 is used to calculate the flow control threshold of the service based on the service's own business characteristic data and the historical periodic data.
[0116] The calculation module 20 is also used to calculate the real-time service response data and local anomaly detection data of the service.
[0117] The calculation module 20 is also used to calculate the overall flow control trend based on the flow control threshold, the real-time service response data, and the local anomaly detection data.
[0118] The control module 30 is used to adjust the flow control status in real time according to the overall flow control trend in order to achieve autonomous flow control across the entire link.
[0119] This embodiment acquires the service's own business characteristic data and historical periodic data; calculates the service's flow control threshold based on the business characteristic data and historical periodic data; calculates the service's real-time response data and local anomaly detection data; calculates the overall flow control trend based on the flow control threshold, real-time response data, and local anomaly detection data; and adjusts the flow control state in real time according to the overall flow control trend to achieve autonomous flow control across the entire link. Through this method, by calculating the service's flow control threshold and the overall flow control trend based on the threshold, the flow control state is adjusted to achieve autonomous flow control across the entire link. This solves the problems of poor flow control effect due to a single flow control strategy and the inability of single-service flow control to guarantee the continuous and stable operation of the system, improving the accuracy of flow limit threshold adjustment and flow control effect, and achieving autonomous full-link flow control.
[0120] In one embodiment, the calculation module 20 is further configured to calculate the average response time of the service and obtain real-time response data of the service based on the average response time; calculate the average response time of local anomalies of the service and obtain local anomaly detection data based on the average response time of local anomalies of the service.
[0121] In one embodiment, the calculation module 20 is further configured to obtain the average response time of the service within a unit time and the current unit time; calculate the average response time of the service based on the average response time of the service within a unit time, the current unit time, and a preset statistical period; and use the average response time of the service as real-time response data of the service.
[0122] In one embodiment, the calculation module 20 is further configured to, when a local anomaly is detected in the service, obtain the number of local anomalies and the weight of each local anomaly; obtain the average response time of the service for local anomalies within a unit time; calculate the average response time of local anomalies based on the number of local anomalies, the weight of each local anomaly, the average response time of the service for local anomalies within a unit time, the current unit time, and the preset statistical period; and use the average response time of local anomalies as local anomaly detection data.
[0123] In one embodiment, the acquisition module 10 is further configured to acquire the service's business attributes and business type; obtain the service's own business characteristic data based on the business attributes and business type; acquire the service's traffic status in a historical period; and obtain the service's historical periodic data based on the service's traffic status in a historical period and the business type.
[0124] In one embodiment, the calculation module 20 is further configured to obtain a proportional coefficient based on the real-time service response data and the local anomaly detection data, wherein the proportional coefficient is the ratio of the average response time to the average response time of local anomalies; calculate a unit-cycle flow control trend based on the flow control threshold, the real-time service response data, the local anomaly detection data, and the proportional coefficient; and calculate the overall flow control trend based on the unit-cycle flow control trend.
[0125] In one embodiment, the control module 30 is further configured to update the flow control threshold to the communication middleware according to the overall flow control trend; update the flow control thresholds of upstream and downstream services according to the flow control thresholds through the communication middleware to obtain the updated flow control thresholds of upstream and downstream services; adjust the flow control status according to the updated flow control thresholds of upstream and downstream services, and monitor different business message queues to obtain the message queue backlog; when the message queue backlog exceeds a preset threshold, update the new flow control threshold to the communication middleware so that the upstream and downstream services pull the new flow control threshold and update it, thereby achieving end-to-end autonomous flow control.
[0126] Furthermore, to achieve the above objectives, the present invention also proposes a flow control device, the flow control device comprising: a memory, a processor, and a flow control program stored in the memory and executable on the processor, the flow control program being configured to implement the steps of the flow control method as described above.
[0127] Since this flow control device adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0128] Furthermore, embodiments of the present invention also propose a storage medium storing a flow control program, which, when executed by a processor, implements the steps of the flow control method described above.
[0129] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0130] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0131] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0132] In addition, for technical details not described in detail in this embodiment, please refer to the flow control method provided in any embodiment of the present invention, which will not be repeated here.
[0133] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0134] It should be understood that although the steps in the flowcharts of this application's embodiments 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 of the steps in the figures 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, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0135] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0136] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0137] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A flow control method, characterized in that, The method includes: Obtain data on the service's own business characteristics and historical periodic data; The service flow control threshold is calculated based on the service's own business characteristic data and the historical periodic data. Calculate the real-time service response data and local anomaly detection data of the service; The overall flow control trend is calculated based on the flow control threshold, the real-time service response data, and the local anomaly detection data. The flow control status is adjusted in real time according to the overall flow control trend to achieve autonomous flow control across the entire link; The step of calculating the overall flow control trend based on the flow control threshold, the real-time service response data, and the local anomaly detection data includes: A proportionality coefficient is obtained based on the real-time service response data and the local anomaly detection data, wherein the proportionality coefficient is the ratio of the average response time to the average response time of local anomalies. The flow control trend per unit period is calculated based on the flow control threshold, the real-time service response data, the local anomaly detection data, and the proportional coefficient. The overall flow control trend is obtained by calculating based on the flow control trend of the unit period.
2. The method as described in claim 1, characterized in that, The calculation of the service's real-time response data and local anomaly detection data includes: Calculate the average response time of the service, and obtain real-time service response data based on the average response time; Calculate the average response time for local anomalies of the service, and obtain local anomaly detection data based on the average response time for local anomalies of the service.
3. The method as described in claim 2, characterized in that, The calculation of the average response time of the service, and the obtaining of real-time service response data based on the average response time, includes: Get the average response time of the service over a unit of time and the current unit of time; The average response time of the service is calculated based on the average response time of the service per unit time, the current unit time, and the preset statistical period. The average response time of the service is used as the real-time response data of the service.
4. The method as described in claim 3, characterized in that, The calculation of the average response time for local anomalies of the service, and the obtaining of local anomaly detection data based on the average response time for local anomalies of the service, includes: When a local anomaly is detected in the service, the number of local anomalies and the weight of each local anomaly are obtained. Obtain the average response time of local anomalies for the service within a unit of time. The average response time of local anomalies is calculated based on the number of local anomalies, the weight of each local anomaly, the average response time of the service for local anomalies per unit time, the current unit time, and the preset statistical period. The average response time of the local anomaly is used as the local anomaly detection data.
5. The method as described in claim 1, characterized in that, The data obtained includes the service's own business characteristics and historical periodic data, including: Obtain the business attributes and business type of the service; Based on the business attributes and the business type, the service's own business characteristic data is obtained; Obtain the traffic status of the service within a historical period; Historical periodic data of the service is obtained based on the service's traffic status during a historical period and the service type.
6. The method according to any one of claims 1 to 5, characterized in that, The step of adjusting the flow control state in real time according to the overall flow control trend to achieve end-to-end autonomous flow control includes: Update the flow control threshold to the communication middleware based on the overall flow control trend; The communication middleware updates the flow control thresholds of upstream and downstream services based on the flow control thresholds to obtain the updated flow control thresholds of upstream and downstream services. The flow control status is adjusted according to the updated flow control thresholds of the upstream and downstream services, and different business message queues are monitored to obtain the number of message queues backlogged. When the number of messages accumulated in the message queue exceeds a preset threshold, a new flow control threshold is updated to the communication middleware, so that the upstream and downstream services can pull the new flow control threshold and update it, thereby achieving end-to-end autonomous flow control.
7. A flow control device, characterized in that, The flow control device includes: The acquisition module is used to acquire the service's own business characteristic data and historical periodic data; The calculation module is used to calculate the flow control threshold of the service based on the service's own business characteristic data and the historical periodic data. The calculation module is also used to calculate the real-time service response data and local anomaly detection data of the service. The calculation module is also used to calculate the overall flow control trend based on the flow control threshold, the real-time service response data, and the local anomaly detection data. The control module is used to adjust the flow control status in real time according to the overall flow control trend in order to achieve autonomous flow control across the entire link. The calculation module is further configured to obtain a proportional coefficient based on the real-time service response data and the local anomaly detection data, wherein the proportional coefficient is the ratio of the average response time to the average response time of local anomalies; calculate the flow control trend per unit period based on the flow control threshold, the real-time service response data, the local anomaly detection data, and the proportional coefficient; and calculate the overall flow control trend based on the flow control trend per unit period.
8. A flow control device, characterized in that, The flow control device includes: a memory, a processor, and a flow control program stored in the memory and executable on the processor, the flow control program being configured to implement the flow control method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a flow control program, which, when executed by a processor, implements the flow control method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
System current limiting method, device, equipment, medium and program product
CN116582490A
