Traffic limiting method and device, computer device and computer readable storage medium

By performing cluster analysis on the access data, the distortion time points and the number of rate-limited connections are identified, which solves the problem of inaccurate rate-limited connection thresholds in existing technologies and enables efficient access request processing under conditions of limited system resources.

CN116405441BActive Publication Date: 2026-02-06PEOPLE'S INSURANCE COMPANY OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310444178.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2026-02-06
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

In existing technologies, the connection number threshold for rate limiting is determined by the experience and strategies of the staff, which leads to inaccurate rate limiting and affects system efficiency.

Method used

The access data is analyzed using a pre-defined clustering algorithm to identify the distortion time points where the average response time is distorted, determine the distortion concurrency and distortion response time, query the number of rate-limited connections, and implement traffic limiting at the rate-limiting time points.

Benefits of technology

Under the premise of an appropriate number of rate-limited connections, the system can effectively limit the influx of a large number of access requests, maximize the number of access requests processed concurrently, avoid significant degradation in response time, and improve system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116405441B_ABST
    Figure CN116405441B_ABST
Patent Text Reader

Abstract

The application discloses a traffic limiting method and device, computer equipment and a computer readable storage medium, relates to the fields of computer technology and automatic operation and maintenance, can take specific data as reference, takes the result obtained by a clustering algorithm as basis, provides conditions for starting traffic limiting and reasonable traffic limiting connection numbers. The method comprises the following steps: acquiring all access data in a preset time period, performing clustering analysis on the all access data by using a preset clustering algorithm, and obtaining distortion time points at which average response times are distorted; identifying the all access data according to the distortion time points, determining distortion concurrent quantities and distortion response times corresponding to the distortion time points, and inquiring traffic limiting connection numbers corresponding to the distortion concurrent quantities; determining traffic limiting time points according to the distortion concurrent quantities or the distortion response times; and limiting traffic according to the traffic limiting connection numbers at the traffic limiting time points.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer technology and automated operation, and particularly relates to a traffic limiting method and device, computer equipment and a computer readable storage medium. BACKGROUND

[0002] With the continuous development of computer technology and automated operation technology, the user access volume of an online application system is increasing day by day. Under the premise of limited system resources, a large number of access requests will simultaneously rush in, which will cause the response time of each access request to be prolonged, and even cause the application system to stop responding, thereby affecting the user experience.

[0003] In the current traffic limiting method by limiting the number of connections, the connection number threshold is determined by relevant staff according to work experience and strategy, which means that in the traffic limiting process, the number of concurrent processing access requests may be reduced due to the inaccurate setting of the connection number threshold, thereby affecting the working efficiency of the system. Therefore, how to accurately set the traffic limiting connection number threshold that fits the actual operation situation while limiting a large number of access requests from rushing into the system is a persistent problem in the industry. SUMMARY

[0004] Therefore, the present application provides a traffic limiting method and device, computer equipment and a computer readable storage medium, which mainly aims to solve the problem that in the current traffic limiting method by limiting the number of connections, the connection number threshold is determined by relevant staff according to work experience and strategy, which means that in the traffic limiting process, the number of concurrent processing access requests may be reduced due to the inaccurate setting of the connection number threshold, thereby affecting the working efficiency of the system.

[0005] According to a first aspect of the present application, a traffic limiting method is provided, which comprises:

[0006] Obtaining all access data in a preset time period, performing clustering analysis on the all access data by using a preset clustering algorithm to obtain a distortion time point at which the average response time occurs distortion;

[0007] Identifying the all access data according to the distortion time point, determining a distortion concurrent quantity and a distortion response time corresponding to the distortion time point, and querying a traffic limiting connection number corresponding to the distortion concurrent quantity;

[0008] Determining a traffic limiting time point according to the distortion concurrent quantity or the distortion response time;

[0009] Limiting traffic according to the traffic limiting connection number at the traffic limiting time point.

[0010] Optionally, the total access data comprises a plurality of access data groups, each of the plurality of access data groups is associated with an access time point, the clustering analysis of the total access data by using the preset clustering algorithm to obtain the distortion time point when the average response time occurs distortion comprises:

[0011] The plurality of access data groups are sorted according to the request concurrency of each access data group by using the preset clustering algorithm;

[0012] The request concurrency of each access data group is replaced by the average response time according to the sorting order to obtain a plurality of average response times arranged in order;

[0013] The plurality of average response times are clustered according to the clustering principle indicated by the preset clustering algorithm to obtain a preset number of target cluster centers;

[0014] The average value of the preset number of target cluster centers is taken as a response time threshold;

[0015] A target average response time greater than the response time threshold is determined in the plurality of average response times by using a preset function, the access data group mapped by the target average response time is read, and the access time point associated with the access data group is taken as the distortion time point.

[0016] Optionally, the clustering of the plurality of average response times according to the clustering principle indicated by the preset clustering algorithm to obtain a preset number of target cluster centers comprises:

[0017] A preset number of initial cluster centers are selected from the plurality of average response times, and the plurality of average response times are divided into a preset number of clusters according to the initial cluster centers;

[0018] A specified cluster center is calculated for each of the preset number of clusters to obtain a preset number of specified cluster centers, and the plurality of average response times are re-divided into a preset number of clusters according to the preset number of specified cluster centers, until the preset number of specified cluster centers calculated is consistent with the preset number of historical specified cluster centers calculated last time or the number of times of calculating the preset number of specified cluster centers is equal to a preset number threshold;

[0019] The preset number of specified cluster centers calculated last time is taken as the preset number of target cluster centers.

[0020] Optionally, the identification of the total access data according to the distortion time point to determine the distortion concurrency and the distortion response time corresponding to the distortion time point comprises:

[0021] determine a distortion concurrent quantity corresponding to the distortion access data group as the distortion concurrent quantity;

[0022] determine an average response time corresponding to the distortion access data group as the distortion response time.

[0023] Optionally, the determining the flow limiting time point according to the distortion concurrent quantity or the distortion response time comprises:

[0024] obtaining a request concurrent quantity of all access requests concurrently executed at each time point and a request response time of each access request;

[0025] when a quantity of the first specified access requests at a time point meets a first preset condition or a request concurrent quantity is greater than or equal to the distortion concurrent quantity, determining the time point as the flow limiting time point;

[0026] wherein, the specified access request is used to indicate an access request with a request response time greater than or equal to the distortion response time.

[0027] Optionally, the limiting the flow at the flow limiting time point according to the limiting connection quantity comprises:

[0028] determining a target access connection in all access connections, a connection quantity of the target access connection being equal to the limiting connection quantity;

[0029] executing an access request initiated by the target access connection and adding an access request initiated by other access connections to a task queue for queuing and waiting, the other access connections being access connections other than the target access connection in the all access connections.

[0030] Optionally, the method further comprises:

[0031] when a quantity of the second specified access requests at a time point meets a second preset condition, concurrently executing all access requests initiated by all access connections, the second specified access request being used to indicate an access request with a response time less than the distortion response time.

[0032] According to the second aspect of the present application, a flow limiting device is provided, which comprises:

[0033] an obtaining module, configured to obtain all access data in a preset time period, perform clustering analysis on the all access data by using a preset clustering algorithm, and obtain a distortion time point at which an average response time is distorted;

[0034] an identifying module, configured to identify the entire access data according to the distortion time point, determine a distortion concurrency and a distortion response time corresponding to the distortion time point, and query a throttling connection number corresponding to the distortion concurrency;

[0035] a determining module, configured to determine a throttling time point according to the distortion concurrency or the distortion response time;

[0036] a throttling module, configured to throttle traffic according to the throttling connection number at the throttling time point.

[0037] Optionally, the obtaining module is configured to sort a plurality of access data groups according to request concurrency of each access data group by using the preset clustering algorithm; replace the request concurrency of each access data group with an average response time in order according to the order; cluster a plurality of average response times according to a clustering principle indicated by the preset clustering algorithm to obtain a preset number of target clustering centers; take an average value of the preset number of target clustering centers as a response time threshold; determine a target average response time greater than the response time threshold in a plurality of average response times by using a preset function, read an access data group mapped by the target average response time, and take an access time point associated with the access data group as the distortion time point.

[0038] Optionally, the obtaining module is configured to select a preset number of initial clustering centers in a plurality of average response times, divide a plurality of average response times into a preset number of clusters according to the initial clustering centers; calculate a designated clustering center for each cluster in the preset number of clusters to obtain a preset number of designated clustering centers, and redivide a plurality of average response times into a preset number of clusters according to the preset number of designated clustering centers until the preset number of designated clustering centers calculated this time are consistent with the preset number of historical designated clustering centers calculated last time or the number of times of calculating the preset number of designated clustering centers is equal to a preset number threshold; and take the preset number of designated clustering centers calculated last time as the preset number of target clustering centers.

[0039] Optionally, the identifying module is configured to determine a distortion access data group associated with the distortion time point in the entire access data, take a request concurrency corresponding to the distortion access data group as the distortion concurrency, and take an average response time corresponding to the distortion access data group as the distortion response time.

[0040] Optionally, the determining module is configured to acquire a request concurrency of all access requests concurrently executed at each time point and a request response time of each access request; and determine a time point as the flow limiting time point when a number of first specified access requests at the time point meets a first preset condition or a request concurrency at the time point is greater than or equal to the distortion concurrency; wherein the specified access request refers to an access request with a request response time greater than or equal to the distortion response time.

[0041] Optionally, the flow limiting module is configured to determine a target access connection from all access connections, wherein a number of connections of the target access connection is equal to the limit connection number; execute an access request initiated by the target access connection; and add an access request initiated by another access connection to a task queue for queuing and waiting, wherein the another access connection is an access connection other than the target access connection from the all access connections.

[0042] Optionally, the apparatus further comprises:

[0043] The recovery module is configured to concurrently execute all access requests initiated by all access connections when a number of second specified access requests at a time point meets a second preset condition, wherein the second specified access request refers to an access request with a response time less than the distortion response time.

[0044] According to a third aspect of the present application, a computer device is provided, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method according to any one of the first aspect when executing the computer program.

[0045] According to a fourth aspect of the present application, a computer readable storage medium is provided, which stores a computer program, and the computer program implements the steps of the method according to any one of the first aspect when executed by a processor.

[0046] By the above technical solution, the application provides a flow limiting method, device, computer equipment and computer readable storage medium. The application first acquires all access data in a preset time period, performs clustering analysis on the all access data by using a preset clustering algorithm, and obtains a distortion time point at which an average response time occurs distortion. Then, the all access data is identified according to the distortion time point, and a distortion concurrent quantity and a distortion response time corresponding to the distortion time point are determined. At the same time, a flow limiting connection number corresponding to the distortion concurrent quantity is queried. Then, a flow limiting time point is determined according to the distortion concurrent quantity or the distortion response time, and flow limiting is performed according to the flow limiting connection number at the flow limiting time point. The application embodiment takes specific data as a reference, and takes the result obtained by the clustering algorithm as a basis, and provides a condition for starting flow limiting and a reasonable flow limiting connection number. Then, under the premise that the flow limiting connection number is appropriate, the application can limit a large number of access requests from flowing into the system before the application access response time is greatly degraded, and maximize the number of concurrently processed access requests.

[0047] The above description is only a summary of the technical solutions of the application. In order to enable the technical means of the application to be more clearly understood, the application can be implemented according to the content of the specification, and in order to enable the above and other purposes, characteristics and advantages of the application to be more obvious and easy to understand, the following specific embodiments of the application are described. BRIEF DESCRIPTION OF DRAWINGS

[0048] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not meant to limit the present application. Furthermore, the same reference numerals are used throughout the several drawings to designate the same or similar parts. In the drawings:

[0049] Figure 1 A flow limiting method flow diagram provided by an embodiment of the application is shown;

[0050] Figure 2 A flow limiting method flow diagram provided by an embodiment of the application is shown;

[0051] Figure 3A A structure diagram of a flow limiting device provided by an embodiment of the application is shown;

[0052] Figure 3B A structure diagram of a flow limiting device provided by an embodiment of the application is shown;

[0053] Figure 4 A device structure diagram of a computer equipment provided by an embodiment of the application is shown. DETAILED DESCRIPTION

[0054] Exemplary embodiments of the present application will be described herein below with reference to the accompanying drawings. While exemplary embodiments of the present application are illustrated, it is to be understood that the application is not to be limited to those exemplary embodiments described herein. Rather, the present application is to cover all modifications and alternatives arising from the teachings of the present application.

[0055] With the continuous development of computer technology and automated operation technology, the user access volume of online application systems is increasing day by day. Under the premise of limited system resources, a large number of access requests will simultaneously pour in, which will cause the response time of each access request to be prolonged, and even cause the application system to stop responding, thereby affecting the user experience. In the current method of limiting the number of connections for flow limiting, the connection number threshold is determined by relevant staff according to work experience and strategies, which means that in the process of flow limiting, the number of concurrent processing access requests may be reduced due to the inaccurate setting of the connection number threshold, thereby affecting the working efficiency of the system. Therefore, how to accurately set the flow limiting connection number threshold that fits the actual operation situation while limiting a large number of access requests from pouring into the system is a persistent problem in the industry. Therefore, the embodiments of the present application provide a flow limiting method, which first acquires all access data in a preset time period, performs clustering analysis on all access data by using a preset clustering algorithm, and obtains a distortion time point at which the average response time is distorted. Then, all access data is identified according to the distortion time point, and the distortion concurrent quantity and the distortion response time corresponding to the distortion time point are determined. At the same time, the flow limiting connection number corresponding to the distortion concurrent quantity is queried. Then, the flow limiting time point is determined according to the distortion concurrent quantity or the distortion response time, and at the flow limiting time point, flow limiting is performed according to the flow limiting connection number. The embodiments of the present application take actual data as a reference and take the results obtained by the clustering algorithm as a basis to provide the conditions for starting flow limiting and the reasonable flow limiting connection number. Then, under the premise that the flow limiting connection number is appropriate, a large number of access requests are limited from pouring into the system before the application access response time is significantly degraded, and the number of concurrent processing access requests is maximized.

[0056] The embodiments of the present application provide a flow limiting method, as shown in Figure 1 The method comprises the following steps.

[0057] 101. Acquire all access data in a preset time period, perform clustering analysis on all access data by using a preset clustering algorithm, and obtain a distortion time point at which the average response time is distorted.

[0058] The method is suitable for a management platform of automatic operation and maintenance, and load balancing is limited through the operation and maintenance management platform. In the embodiment of the application, the load balancing is a hardware for distributing the work load of network or computing resources to multiple servers. In addition, the distortion time point is used to indicate the time point at which the average response time suddenly increases in the embodiment of the application.

[0059] In actual operation, the management platform can be connected with the BPC monitoring platform, and all access data of the system in a preset time period is obtained through the monitoring platform. Specifically, the management platform can access the data storage space of the BPC monitoring platform for storing monitoring data, and all access data in which the monitoring time point hits the preset time period is determined through data filtering according to the preset time period in the data storage space. Then, a preset clustering algorithm, such as the K-means clustering algorithm, is used to perform clustering analysis on the all access data, and the distortion time point at which the average response time is distorted is obtained.

[0060] 102、According to the distortion time point, all access data is identified, the distortion concurrent quantity and the distortion response time corresponding to the distortion time point are determined, and the connection number corresponding to the distortion concurrent quantity is queried.

[0061] The distortion concurrent quantity is used to indicate the number of all access requests executed by the load balancing system at the distortion time point. The average response time of all access requests is the distortion response time. The connection number is the maximum number of concurrent executions allowed when the flow limiting configuration is executed.

[0062] In actual operation, the management platform can query the access data group associated with the distortion time point in all access data, and the average response time and access concurrent quantity of all access requests executed by the load balancing system at the distortion time point are stored in the access data group. Then, the management platform takes the access concurrent quantity corresponding to the access data group as the distortion concurrent quantity, takes the average response time corresponding to the access data group as the distortion response time, and queries the connection number corresponding to the distortion concurrent quantity as the flow limiting connection number.

[0063] 103、The flow limiting time point is determined according to the distortion concurrent quantity or the distortion response time.

[0064] In the embodiment of the application, the management platform can obtain system running data at each moment in real time during the operation of the load balancing system. The system running data includes the number of access requests concurrently executed by the system at the current moment and the response time corresponding to each access request. Further, the management platform performs data analysis on the system running data by using the distortion concurrent quantity or the distortion response time, so as to determine whether the flow limiting configuration is needed at the current moment. If the flow limiting configuration is needed at the current moment, the current moment is determined as the flow limiting time point.

[0065] 104. At the time of rate limiting, traffic is limited according to the number of connections subject to rate limiting.

[0066] Furthermore, at the time point of rate limiting, the number of connections of the load balancing system is limited to achieve load balancing rate limiting, so as to avoid excessively long user waiting time and poor user experience due to system crashes.

[0067] The traffic limiting method provided in this embodiment first acquires all access data within a preset time period, and then uses a preset clustering algorithm to perform cluster analysis on all access data to obtain the distortion time points where the average response time is distorted. Next, all access data is identified according to the distortion time points to determine the distorted concurrency and distorted response time corresponding to each distortion time point. Simultaneously, the number of rate-limited connections corresponding to the distorted concurrency is queried. Then, the rate-limiting time point is determined based on the distorted concurrency or distorted response time, and traffic is limited according to the number of rate-limited connections at the rate-limiting time point. This embodiment, using specific data as a reference and the results obtained from the clustering algorithm as a basis, provides the conditions for enabling rate limiting and a reasonable number of rate-limited connections. Therefore, under the premise of an appropriate number of rate-limited connections, it can limit a large number of access requests from flooding the system before the application access response time deteriorates significantly, and maximize the number of concurrently processed access requests.

[0068] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and to fully illustrate the implementation process of this embodiment, this application provides a traffic limiting method, such as... Figure 2 As shown, the method includes:

[0069] 201. Retrieve all access data within a preset time period.

[0070] In this embodiment, since all access data within a preset time period includes the number of access requests executed at each moment and the average response time, the correspondence between the number of access requests and the average response time can be found by analyzing all access data, thus determining the number of access requests when the average response time is distorted. The specific process for obtaining all access data is as follows:

[0071] First, the management platform can connect to the BPC monitoring platform to obtain real runtime data that falls within a preset time period. It's important to note that all accessed data includes multiple access data groups, each associated with a specific access time point. Specifically, the management platform can access the data storage space of the BPC monitoring platform where real runtime data is stored. By traversing all real runtime data in the storage space, it determines the runtime time point of each real runtime data point. Then, it extracts all real runtime data whose runtime points match the preset time period.

[0072] Further, by data cleaning on all real running data, the data related to response time in the real running data is reserved. Next, all real running data is divided according to running time points to obtain multiple access data groups. Finally, the multiple access data groups are taken as all access data, and a preset clustering algorithm is used to perform clustering analysis on the all access data.

[0073] In addition, the management platform can also be connected with the test center to obtain test running data as all access data. Specifically, through the test environment of the test center, 50 concurrent cumulative interface tests are performed in a preset time period from 50 to 4000 concurrent pressures, and the test results are obtained as all access data.

[0074] 202, a preset clustering algorithm is used to perform clustering analysis on the all access data to obtain a distortion time point at which the average response time occurs distortion.

[0075] In the embodiments of the present application, the management platform performs clustering analysis on all access data by using a preset clustering algorithm to obtain a distortion time point at which the average response time occurs distortion. Further, a reasonable flow limiting connection number is determined by taking specific data as a reference and taking the result obtained by the clustering algorithm as a basis. The specific process of performing clustering analysis to obtain the distortion time point is as follows:

[0076] First, the management platform can use the K-means clustering algorithm to perform a harmonic progression sorting on the multiple access data groups according to the request concurrency corresponding to each access data group. Further, the request concurrency of each access data group is replaced by the average response time in order according to the sorting order to obtain multiple average response times arranged in order.

[0077] Subsequently, according to the clustering principle indicated by the preset clustering algorithm, the multiple average response times are clustered to obtain a preset number of target cluster centers. In actual operation, since the clustering data only has one type, the multiple average response times should be divided into two clusters, i.e., in the embodiments of the present application, the preset number is 2. Specifically, 2 initial cluster centers are selected from the multiple average response times, for each average response time, the distance between the average response time and the 2 cluster centers is calculated, and according to the nearest distance principle, the average response time is assigned to the cluster where the nearest cluster center is located. According to the above steps, the average response times are divided into 2 clusters. Further, for each cluster in the 2 clusters, the designated cluster center of each cluster is calculated to obtain 2 designated cluster centers, and the multiple average response times are re-divided into 2 new clusters according to the 2 designated cluster centers, until the 2 designated cluster centers calculated are consistent with the 2 historical designated cluster centers calculated last time or the number of times of calculating the designated cluster center is equal to a preset number threshold. The iteration calculation is stopped, and the 2 designated cluster centers calculated last time are taken as the 2 target cluster centers.

[0078] Finally, the average value of the two target cluster centers is taken as the response time threshold. A preset function is used to determine the first target average response time greater than the response time threshold among multiple average response times, read the access data set mapped by the target average response time, and take the access time point associated with the access data set as the distortion time point.

[0079] 203、According to the distortion time point, all access data is identified, the distortion concurrent quantity and the distortion response time corresponding to the distortion time point are determined, and the connection number corresponding to the distortion concurrent quantity is queried.

[0080] In actual operation, the management platform can query the access data set associated with the distortion time point in all access data, and the access data set stores the average response time and access concurrent quantity of all access requests executed by the load balancing system at the distortion time point. Further, the management platform takes the access concurrent quantity corresponding to the access data set as the distortion concurrent quantity, takes the average response time corresponding to the access data set as the distortion response time, and queries the connection number corresponding to the distortion concurrent quantity as the throttling connection number.

[0081] For example, the distortion time point is the 4th second, the access data set associated with the 4th second is queried in all access data, if the access data set stores

Request A: 2s

Request B: 1s

Request C: 3s

[0082] 204、According to the distortion concurrent quantity or the distortion response time, the throttling time point is determined.

[0083] In the embodiment of the present application, the management platform will acquire system running data at each moment in real time during the operation of the load balancing system, the system running data includes the number of access requests concurrently executed by the system at the current moment, and the response time corresponding to each access request. Further, the management platform analyzes the system running data by using the distortion concurrent quantity or the distortion response time, so as to determine whether the current moment needs to be throttled. If the current moment needs to be throttled, the current moment is determined as the throttling time point.

[0084] Specifically, the request concurrency of all access requests concurrently executed at each time point and the request response time of each access request are acquired. When the number of first specified access requests at a time point meets a first preset condition or the request concurrency is greater than or equal to the distortion concurrency, the time point is determined as a flow limiting time point. It should be noted that the specified access request is used to indicate an access request with a request response time greater than or equal to the distortion response time. For example, the distortion concurrency is 500, the distortion response time is 10 s, and if the concurrency of the system reaches 600 at the 50th minute, the 50th minute is taken as the flow limiting time point. If more than 90% of the access requests have a request response time greater than 10 s at the 60th minute and 50 s, the 60th minute and 50 s are taken as the flow limiting time point.

[0085] 205、At the flow limiting time point, flow limiting is performed according to the limited connection number.

[0086] This step performs flow limiting for load balancing at the flow limiting time point by limiting the connection number of the load balancing system, so as to avoid long user waiting time and poor user experience caused by system collapse.

[0087] Specifically, target access connections are determined from all access connections of the system, and then access requests initiated by the target access connections are executed, and access requests initiated by other access connections are added to a task queue for queuing and waiting. It should be noted that the connection number of the target access connection is equal to the limited connection number, and the other access connections are access connections other than the target access connections.

[0088] In addition, the application also provides a process of removing flow limiting. Specifically, when the number of second specified access requests at a time point meets a second preset condition, all access requests initiated by all access connections are concurrently executed, wherein the second specified access request is used to indicate an access request with a response time less than the distortion response time. For example, if more than 50% of the access requests have a request response time less than 10 s at the 60th minute and 30 s, flow limiting is removed at the 60th minute and 30 s, and all access requests initiated by all access connections are concurrently executed.

[0089] The method provided in the embodiments of the present application first acquires all access data in a preset time period, performs clustering analysis on the all access data by using a preset clustering algorithm, and obtains a distortion time point at which the average response time is distorted. Then, the all access data is identified according to the distortion time point, and the distortion concurrent quantity and the distortion response time corresponding to the distortion time point are determined. At the same time, the flow limiting connection quantity corresponding to the distortion concurrent quantity is queried. Then, the flow limiting time point is determined according to the distortion concurrent quantity or the distortion response time, and flow limitation is performed according to the flow limiting connection quantity at the flow limiting time point. The embodiments of the present application take actual data as a reference, and take the result obtained by the clustering algorithm as a basis, and provide the condition for starting flow limitation and the reasonable flow limiting connection quantity. Then, under the premise that the flow limiting connection quantity is appropriate, the large number of access requests is limited from flowing into the system before the application access response time is greatly deteriorated, and the number of access requests processed concurrently is maximized.

[0090] Further, as Figure 1 The specific implementation of the method, the embodiments of the present application provide a flow limiting device, as shown in Figure 3A The device includes an acquisition module 301, an identification module 302, a determination module 303, and a flow limiting module 304.

[0091] The acquisition module 301 is configured to acquire all access data in a preset time period, perform clustering analysis on the all access data by using a preset clustering algorithm, and obtain a distortion time point at which the average response time is distorted.

[0092] The identification module 302 is configured to identify the all access data according to the distortion time point, determine the distortion concurrent quantity and the distortion response time corresponding to the distortion time point, and query the flow limiting connection quantity corresponding to the distortion concurrent quantity.

[0093] The determination module 303 is configured to determine a flow limiting time point according to the distortion concurrent quantity or the distortion response time.

[0094] The flow limiting module 304 is configured to perform flow limitation according to the flow limiting connection quantity at the flow limiting time point.

[0095] In a specific application scenario, the acquisition module 301 is configured to sort a plurality of access data groups according to a request concurrency of each access data group by using the preset clustering algorithm; replace the request concurrency of each access data group with an average response time according to a sorting order to obtain a plurality of average response times arranged in sequence; cluster the plurality of average response times according to a clustering principle indicated by the preset clustering algorithm to obtain a preset number of target cluster centers; take an average value of the preset number of target cluster centers as a response time threshold; determine a target average response time greater than the response time threshold from the plurality of average response times by using a preset function, read an access data group mapped by the target average response time, and take an access time point associated with the access data group as the distortion time point.

[0096] In a specific application scenario, the acquisition module 301 is configured to select a preset number of initial cluster centers from the plurality of average response times, divide the plurality of average response times into a preset number of clusters according to the initial cluster centers; calculate a specified cluster center for each cluster in the preset number of clusters to obtain a preset number of specified cluster centers, and redivide the plurality of average response times into a preset number of clusters according to the preset number of specified cluster centers until the preset number of specified cluster centers calculated this time are consistent with the preset number of historical specified cluster centers calculated last time or the number of times of calculating the preset number of specified cluster centers is equal to a preset number threshold; and take the preset number of specified cluster centers calculated last time as the preset number of target cluster centers.

[0097] In a specific application scenario, the identification module 302 is configured to determine a distortion access data group associated with the distortion time point from the all access data, take a request concurrency of the distortion access data group as the distortion concurrency, and take an average response time of the distortion access data group as the distortion response time.

[0098] In a specific application scenario, the determination module 303 is configured to acquire a request concurrency of all access requests concurrently executed at each time and a request response time of each access request; when a number of first specified access requests at a time point meets a first preset condition or a request concurrency is greater than or equal to the distortion concurrency, determine the time point as the throttling time point; wherein the specified access request is used to indicate an access request with a request response time greater than or equal to the distortion response time.

[0099] In a specific application scenario, the flow limiting module 304 is configured to determine a target access connection from all access connections, wherein the number of connections of the target access connection is equal to the limited connection number; execute an access request initiated by the target access connection; and add an access request initiated by another access connection to a task queue for queuing and waiting, wherein the another access connection is an access connection other than the target access connection from the all access connections.

[0100] In a specific application scenario, as shown in Figure 3B , the apparatus further includes a recovery module 305.

[0101] The recovery module 305 is configured to concurrently execute all access requests initiated by all access connections when the number of second specified access requests at a time point meets a second preset condition, wherein the second specified access request is used to indicate an access request with a response time less than the distorted response time.

[0102] The apparatus provided by the embodiment of the present application first acquires all access data in a preset time period, performs clustering analysis on the all access data by using a preset clustering algorithm, and obtains a distorted time point at which an average response time is distorted. Then, the all access data is identified according to the distorted time point, and a distorted concurrency and a distorted response time corresponding to the distorted time point are determined. At the same time, the flow limiting connection number corresponding to the distorted concurrency is queried. Then, the flow limiting time point is determined according to the distorted concurrency or the distorted response time, and flow limitation is performed according to the flow limiting connection number at the flow limiting time point. The embodiment of the present application takes actual data as a reference and takes the result obtained by the clustering algorithm as a basis to provide the condition for starting flow limitation and a reasonable flow limiting connection number. Then, under the premise that the flow limiting connection number is appropriate, the application access response time is greatly degraded before the application access response time is greatly degraded, and the number of access requests that can be processed concurrently is maximized.

[0103] It should be noted that other corresponding descriptions of each functional unit involved in the flow limiting apparatus provided by the embodiment of the present application can be referred to the corresponding descriptions in Figure 1 and Figure 2 , which will not be described here in detail.

[0104] Based on the method as shown in Figure 1 , Figure 2 , correspondingly, the embodiment further provides a storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the flow limiting method.

[0105] Based on such understanding, the technical scheme of the present application can be embodied in the form of a software product. The software product to be identified can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.), and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the method described in various implementation scenarios of the present application.

[0106] Based on the above method as shown in Figure 1 , Figure 2 , and Figure 3A and Figure 3B The flow limiting device embodiment is shown, in order to achieve the above purpose, in the exemplary embodiment, referring to Figure 4 , a device is also provided, which includes a communication bus, a processor, a memory and a communication interface, and can also include an input / output interface and a display device, wherein the communication between each functional unit can be completed through the bus. The memory stores a computer program, and the processor is used to execute the program stored on the memory, and execute the flow limiting method in the above embodiment.

[0107] Optionally, the entity device can also include a user interface, a network interface, a camera, a radio frequency (Radio Frequency, RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface can include a display screen (Display), an input unit such as a keyboard (Keyboard), etc. The optional user interface can also include a USB interface, a card reader interface, etc. The network interface can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0108] Those skilled in the art can understand that the structure of the flow limiting entity device provided by the embodiment does not constitute a limitation on the entity device, and can include more or fewer components, or combine certain components, or different component arrangements.

[0109] The storage medium can also include an operating system and a network communication module. The operating system is a program for managing the hardware and software resources of the entity device, supporting the running of information processing programs and other software and / or programs. The network communication module is used to realize the communication between the components in the storage medium, and the communication with other hardware and software in the information processing entity device.

[0110] Those skilled in the art can clearly understand from the description of the above embodiments that the application can be implemented by means of software and necessary general hardware platforms, or by hardware. By applying the technical solution of the application, all access data in a preset time period is acquired first, a preset clustering algorithm is used to perform clustering analysis on the all access data, and a distortion time point at which the average response time occurs distortion is obtained. Then, the all access data is identified according to the distortion time point, and the distortion concurrent quantity and the distortion response time corresponding to the distortion time point are determined. At the same time, the flow limiting connection number corresponding to the distortion concurrent quantity is queried. Then, the flow limiting time point is determined according to the distortion concurrent quantity or the distortion response time, and at the flow limiting time point, flow limiting is performed according to the flow limiting connection number. Compared with the prior art, the embodiments of the application take actual data as a reference, take the results obtained by the clustering algorithm as a basis, and provide the condition for starting flow limiting and the reasonable flow limiting connection number. Then, under the premise that the flow limiting connection number is appropriate, the application can limit a large number of access requests from flowing into the system before the application access response time is greatly degraded, and maximize the number of concurrently processed access requests.

[0111] Those skilled in the art can understand that the modules or processes in the drawings are not necessarily required for implementing the application.

[0112] Those skilled in the art can understand that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the description of the implementation scenario, or can be changed and located in one or more devices different from the implementation scenario. The modules of the above implementation scenario can be combined into one module, or can be further split into a plurality of sub-modules.

[0113] The above application numbers are only for description, and do not represent the advantages and disadvantages of the implementation scenario.

[0114] The above disclosure is only some specific implementation scenarios of the application, but the application is not limited thereto, and any changes that can be thought of by those skilled in the art should fall within the protection scope of the application.

Claims

1. A flow limiting method, characterized in that, include: All access data within a preset time period is obtained, and a preset clustering algorithm is used to perform cluster analysis on all access data to obtain the distortion time point where the average response time is distorted. All access data within the preset time period includes the number of access requests and the average response time of multiple access requests executed at each time moment. The entire access data is identified according to the distortion time point, the distortion concurrency and distortion response time corresponding to the distortion time point are determined, and the number of rate-limited connections corresponding to the distortion concurrency is queried. The current limiting time point is determined based on the distortion concurrency or the distortion response time. At the specified rate-limiting time point, traffic is limited according to the specified number of rate-limiting connections; The step of using a preset clustering algorithm to perform cluster analysis on all access data to obtain the distortion time point when the average response time distortion occurs includes: Using the preset clustering algorithm, the multiple access data groups are sorted according to the request concurrency of each access data group; The request concurrency of each data group is replaced with the average response time in the sorting order to obtain multiple average response times arranged in order. According to the clustering principle indicated by the preset clustering algorithm, multiple average response times are clustered to obtain a preset number of target cluster centers; The average value of the preset number of target cluster centers is used as the response time threshold; Using a preset function, determine the first target average response time that is greater than the response time threshold among multiple average response times, read the access data group mapped by the target average response time, and use the access time point associated with the access data group as the distortion time point; The step of identifying all accessed data according to the aberration time point and determining the aberration concurrency and aberration response time corresponding to the aberration time point includes: In all the access data, identify the distorted access data group associated with the distorted time point, and use the request concurrency corresponding to the distorted access data group as the distorted concurrency. The average response time corresponding to the distorted access data group is taken as the distorted response time.

2. The method according to claim 1, characterized in that, The total access data includes multiple access data groups, and each of the multiple access data groups is associated with an access time point.

3. The method according to claim 2, characterized in that, The step of clustering multiple average response times according to the clustering principles indicated by the preset clustering algorithm to obtain a preset number of target cluster centers includes: A preset number of initial cluster centers are selected from the multiple average response times, and the multiple average response times are divided into a preset number of clusters according to the initial cluster centers; For each of the preset number of clusters, a specified cluster center is calculated to obtain a preset number of specified cluster centers. Then, according to the preset number of specified cluster centers, the multiple average response times are re-divided into a preset number of clusters until the preset number of specified cluster centers calculated are consistent with the preset number of historical specified cluster centers calculated last time or the number of times the preset number of specified cluster centers are calculated is equal to a preset number threshold. The preset number of designated cluster centers calculated in the last calculation are used as the preset number of target cluster centers.

4. The method according to claim 1, characterized in that, Determining the current limiting time point based on the distortion concurrency or the distortion response time includes: Get the total number of concurrent access requests executed at each time point and the response time of each access request; When the number of requests for the first specified access request at a certain point in time meets the first preset condition or the number of concurrent requests is greater than or equal to the distorted concurrency, the time point is determined as the rate limiting time point. The specified access request is used to indicate an access request whose request response time is greater than or equal to the distortion response time.

5. The method according to claim 1, characterized in that, The process of limiting traffic based on the number of connections at the specified time point includes: Determine the target access connection from all access connections, and the number of connections of the target access connection is equal to the number of rate-limited connections; Execute the access request initiated by the target access connection, and add the access requests initiated by other access connections to the task queue for queuing and waiting. The other access connections are the access connections other than the target access connection among all access connections.

6. The method according to claim 1, characterized in that, The method further includes: When the number of requests for the second specified access request at a given time point meets the second preset condition, all access requests initiated by all access connections are executed concurrently. The second specified access request is used to indicate access requests whose response time is less than the distortion response time.

7. A flow limiting device, characterized in that, include: The acquisition module is used to acquire all access data within a preset time period, and to perform cluster analysis on all access data using a preset clustering algorithm to obtain the distortion time point where the average response time is distorted. All access data within the preset time period includes the number of access requests and the average response time of multiple access requests executed at each time moment. The step of performing cluster analysis on all access data using a preset clustering algorithm to obtain the distortion time point when the average response time is distorted includes: using the preset clustering algorithm to sort multiple access data groups according to the request concurrency of each access data group; replacing the request concurrency of each access data group with the average response time one by one according to the sorting order to obtain multiple average response times arranged in sequence; clustering the multiple average response times according to the clustering principle indicated by the preset clustering algorithm to obtain a preset number of target cluster centers; using the average value of the preset number of target cluster centers as a response time threshold; using a preset function to determine the first target average response time greater than the response time threshold among the multiple average response times; reading the access data group mapped by the target average response time; and using the access time point associated with the access data group as the distortion time point. The identification module is used to identify all access data according to the distortion time point, determine the distortion concurrency and distortion response time corresponding to the distortion time point, and query the rate-limited connection number corresponding to the distortion concurrency; the step of identifying all access data according to the distortion time point and determining the distortion concurrency and distortion response time corresponding to the distortion time point includes: identifying the distorted access data group associated with the distortion time point in the all access data, taking the request concurrency corresponding to the distorted access data group as the distortion concurrency; and taking the average response time corresponding to the distorted access data group as the distortion response time. The determination module is used to determine the current limiting time point based on the distortion concurrency or the distortion response time; A rate limiting module is used to limit traffic based on the number of rate-limited connections at the rate limiting time point.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Web service system access volume control device and method based on response time trend analysis

    CN103442087A

  • Dynamic flow control method and device

    CN105791151A