Gateway health prediction method and device
By clustering and predicting model analysis of the index data collected by the API gateway, actively detecting its health, solving the problem of passive detection in the existing technology, improving operation and maintenance efficiency and reducing costs.
Patent Information
- Application Number
- CN202111440204.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In the prior art, the health detection of API gateways is passive and cannot be predicted in time, resulting in low network service operation and maintenance efficiency and high operation and maintenance costs.
By collecting indicator data from the API gateway, clustering according to preset classification conditions, determining the data type, and inputting the prediction model trained by historical data to obtain health scores to actively detect the health status of the API gateway.
It realizes the health prediction of API gateways, improves the operation and maintenance efficiency of network services, reduces the operation and maintenance costs, and avoids passive data analysis.
Smart Images

Figure CN116208513B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a method and device for predicting the health of a gateway. Background Art
[0002] An enterprise's network services generally have clients and servers, and between the client and the server, there is an API (Application Programming Interface) gateway, which is used to uniformly receive requests from clients or external partners and other callers, and perform certain verification and logic processing according to the different logic of each interface before forwarding them to the server.
[0003] API gateway can realize functions such as identity authentication, monitoring, load balancing, caching, request sharding and management, and static response processing. It is an important part of network communication, so the health of API gateway is very important. However, in related technologies, only when there is a problem with the health of API gateway, the operation and maintenance staff will passively collect data for analysis, and cannot make timely judgments on the health of API gateway, resulting in low operation and maintenance efficiency for the entire network service, and greatly increased operation and maintenance costs. Summary of the invention
[0004] The embodiments of the present application provide a gateway health prediction method and device, which can predict the health of an API gateway to improve the operation and maintenance efficiency of network services and reduce operation and maintenance costs.
[0005] In a first aspect, an embodiment of the present application provides a gateway health prediction method, comprising:
[0006] Clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data;
[0007] Input each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, and obtain a health score corresponding to the preset data type;
[0008] The health of the API gateway is determined according to the health scores corresponding to the preset data types.
[0009] In one embodiment, clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data includes:
[0010] Each indicator data is clustered according to the number of times it is accessed by the API gateway within a preset time period, and a preset data type of each indicator data whose access number is greater than a preset value, and a preset data type of each indicator data whose access number is less than or equal to the preset value are determined.
[0011] In one embodiment, each of the indicator data is clustered according to the number of times the API gateway accesses it within a first preset period of time, and a preset data type of each of the indicator data whose number of accesses is greater than a preset value, and a preset data type of each of the indicator data whose number of accesses is less than or equal to the preset value are determined, including:
[0012] Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type;
[0013] Clustering each indicator data in the system type according to the number of times it is accessed by the API gateway within a preset time period, determining the preset data type of each indicator data in the system type whose access number is greater than a preset value, and the preset data type of each indicator data in the system type whose access number is less than or equal to the preset value;
[0014] Wherein, the preset value is determined according to the system type.
[0015] In one embodiment, clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data includes:
[0016] Cluster the indicator data according to the API response time corresponding to each indicator data, and determine the preset data type of each indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of each indicator data whose API response time is less than or equal to the preset time length.
[0017] In one embodiment, clustering the indicator data according to the API response time corresponding to the indicator data, determining the preset data type of the indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of the indicator data whose API response time is less than or equal to the preset time length, includes:
[0018] Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type;
[0019] Clustering each indicator data in the system type according to the API response time corresponding to each indicator data in the system type, determining the preset data type of each indicator data in the system type whose corresponding API response time is greater than the preset time length, and determining the preset data type of each indicator data in the system type whose API response time is less than or equal to the preset time length;
[0020] The preset duration is determined according to the system type.
[0021] In one embodiment, determining the health of the API gateway according to each health score corresponding to each of the preset data types includes:
[0022] Compare the health score corresponding to the preset data type with the preset fuse threshold corresponding to the preset data type to obtain a comparison result corresponding to the preset data type;
[0023] When the comparison results corresponding to the preset data types all have health scores greater than the preset fuse threshold, the API gateway is determined to be normal.
[0024] In one embodiment, it further includes:
[0025] When any of the comparison results shows that the health score is less than or equal to the preset fuse threshold, the API gateway is closed.
[0026] In a second aspect, an embodiment of the present application provides a gateway health prediction device, comprising:
[0027] The data type determination module is used to cluster the indicator data collected from the API application programming interface gateway according to the preset classification conditions and determine the preset data type of each indicator data;
[0028] A health score acquisition module, used to input each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, to obtain a health score corresponding to the preset data type;
[0029] The health prediction module is used to determine the health of the API gateway according to the health scores corresponding to the preset data types.
[0030] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program, wherein when the processor executes the program, the steps of the gateway health prediction method described in the first aspect are implemented.
[0031] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the gateway health prediction method described in the first aspect.
[0032] The gateway health prediction method and device provided in the embodiment of the present application, after clustering the indicator data collected from the API gateway, input the indicator data of each preset data type into the prediction model trained by historical indicator data, and obtain the health score corresponding to each preset data type, so as to realize the health prediction of the API gateway according to the health scores corresponding to each preset data type, so that the health profile of the API gateway can be completed through the indicator data of the API gateway, avoiding the passive collection of data for analysis when the API gateway has health problems, but actively detecting and predicting the health of the API gateway, thereby improving the operation and maintenance efficiency of network services and reducing operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 It is a flow chart of a gateway health prediction method provided by an embodiment of the present invention;
[0035] Figure 2 It is a structural schematic diagram of a gateway health prediction device provided by the present invention;
[0036] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0039] See also Figure 1, is one of the flow charts of the gateway health prediction method provided by an embodiment of the present invention, the method is applied to an electronic device, wherein the electronic device can be a server or a terminal device, and is used to predict the health of an API gateway. Figure 1 As shown, a gateway health prediction method provided in this embodiment includes:
[0040] Step 101, clustering each indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data;
[0041] Step 102, inputting each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, to obtain a health score corresponding to the preset data type;
[0042] Step 103: Determine the health of the API gateway according to the health scores corresponding to the preset data types.
[0043] By clustering the indicator data collected from the API gateway, the indicator data of each preset data type is input into the prediction model trained by the historical indicator data to obtain the health score corresponding to each preset data type, so as to realize the health prediction of the API gateway according to the health scores corresponding to each preset data type. Thus, the health profile of the API gateway can be completed through the indicator data of the API gateway, avoiding the passive collection of data for analysis when the health problems of the API gateway occur, and actively detecting and predicting the health status of the API gateway, thereby improving the operation and maintenance efficiency of network services and reducing operation and maintenance costs.
[0044] In step 101, various indicator data of the API gateway are collected from the API gateway in advance through a collector. The collector is a script for collecting various indicator data, and the script can be installed in the API gateway in the form of a plug-in.
[0045] In one embodiment, each indicator data includes multi-dimensional data such as the API log of the API gateway and other operation and maintenance data, wherein the operation and maintenance data includes external related data such as system properties, system type, request time corresponding to the API request, and the gateway's own data such as the working hours of the API gateway.
[0046] In one embodiment, each indicator data may be a specific type of API request log and multi-dimensional data in the AIP-related background components, such as only collecting API request logs corresponding to some high-priority systems and multi-dimensional data in the API-related background components. Among them, the high-priority system may be a pre-designated self-developed system, a pre-designated third-party system, or a pre-designated other evaluation platform, etc. This reduces the amount of data that needs to be processed, thereby improving the processing efficiency of the subsequent processing of the collected indicator data.
[0047] After collecting the data of each indicator, you can first clean and transform the data into structured data and pass it into the message queue for subsequent processing.
[0048] In one embodiment, the KMEANS algorithm can be used to cluster the indicator data. The KMEANS algorithm is a partition-based clustering algorithm that uses distance as a standard for measuring the similarity between data objects, that is, the smaller the distance between data objects, the higher their similarity, and the more likely they are in the same cluster. The central idea is to determine the constant K in advance, which means the final number of clustering categories. First, the initial point is randomly selected as the centroid, and the sample points are classified into the most similar class by calculating the similarity between each sample and the centroid. Then, the centroid of each class (i.e., the class center) is recalculated, and this process is repeated until the centroid no longer changes, and finally the category to which each sample belongs and the centroid of each class are determined.
[0049] Assume that the set of extracted indicator data is (x1, x2, ..., xn), and each xi is a d-dimensional vector. The purpose of K-means clustering is to divide the original data into k categories under the condition of a given type group number k (k ≤ n), S = {S1, S2, ..., Sk}.
[0050] In one embodiment, K=2, that is, the preset data type includes a primary indicator data type and a secondary indicator data type. Different preset data types have different degrees of influence on the health of the API gateway. Among them, the primary indicator data type represents a data type that has a greater impact on the health of the API gateway, and the secondary indicator data type represents a data type that has a smaller impact on the health of the API gateway. The indicator data in the primary indicator data type is the primary indicator data, and the indicator data in the secondary indicator data type is the secondary indicator data.
[0051] In one embodiment, the preset classification condition may be classification according to the system type corresponding to each indicator data. Each system type is preset with a corresponding preset priority. If the system type is a self-developed system, the importance is higher, so the preset priority is higher; if the system type is a third-party system or other evaluation platform, the preset priority is lower. Exemplarily, after collecting each indicator data, each indicator data is clustered according to the system type corresponding to each indicator data to determine the system type corresponding to each indicator data. If the indicator data is indicator data about a self-developed system, the system type corresponding to the indicator data is a self-developed system.
[0052] After determining the system type of each indicator data, the indicator data corresponding to the system type whose preset priority is greater than the specified level are divided into the same preset data type, specifically the above-mentioned main indicator data type, to obtain each main indicator data; and the indicator data corresponding to the system type whose preset priority is less than or equal to the specified level are divided into the same preset data type, specifically the above-mentioned secondary indicator data type, to obtain each secondary indicator data.
[0053] By classifying each indicator data according to the importance of the system type, the main indicator data and secondary indicator data are determined, so that the subsequent health prediction of the API gateway is more targeted.
[0054] In one embodiment, in addition to using the system type as a classification condition, the number of API accesses may also be used as a classification basis. Specifically, the various indicator data collected from the API application programming interface gateway are clustered according to the preset classification conditions to determine the preset data type of each indicator data, including:
[0055] Each indicator data is clustered according to the number of times it is accessed by the API gateway within a preset time period, and a preset data type of each indicator data whose access number is greater than a preset value, and a preset data type of each indicator data whose access number is less than or equal to the preset value are determined.
[0056] In one embodiment, each indicator data is clustered according to the number of times each indicator data is accessed by the API within a preset period of time, and each indicator data whose API access number is greater than a preset value is classified as primary indicator data, and each indicator data whose API access number is less than or equal to the preset value is classified as secondary indicator data. The preset value can be set according to actual conditions.
[0057] In one embodiment, if the number of times a certain indicator data is accessed by an API is greater than a preset value, it can be determined as a dynamic access, that is, the indicator data is frequently accessed. Otherwise, it is determined as a static access.
[0058] Since there are many API accesses in a short period of time, it means that API accesses are frequent and prone to problems. Therefore, the indicator data is clustered according to the number of API accesses, so that targeted supervision can be carried out on the access status of the API gateway in the future, thereby improving the accuracy of subsequent API gateway health prediction.
[0059] In order to further improve the accuracy of subsequent health prediction for the API gateway, in one embodiment, each indicator data is clustered according to the number of times the API gateway accesses it within the first preset period of time, and the preset data type of each indicator data whose access number is greater than the preset value and the preset data type of each indicator data whose access number is less than or equal to the preset value are determined, including:
[0060] Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type;
[0061] Clustering each indicator data in the system type according to the number of times it is accessed by the API gateway within a preset time period, determining the preset data type of each indicator data in the system type whose access number is greater than a preset value, and the preset data type of each indicator data in the system type whose access number is less than or equal to the preset value;
[0062] Wherein, the preset value is determined according to the system type.
[0063] In one embodiment, different system types are bound with different preset values in advance. For example, if the system type is a self-developed system, the preset value of the corresponding API access number is preset value A; if the system type is a third-party system, the preset value of the corresponding API access number is preset value B. After obtaining each indicator data, each indicator data is first clustered according to each system type to obtain the indicator data of each system type, such as the indicator data of the corresponding system type is a third-party system. Then, the indicator data of the corresponding system type is a third-party system, and the indicator data of each system type is clustered according to the number of API gateway accesses, and the indicator data of each API access number greater than the preset value B is obtained as the main indicator data, and the indicator data of each API access number less than or equal to the preset value B is obtained as the secondary indicator data. The indicator data of the system type is a self-developed system or other evaluation platform is similar. Thus, the clustering of the system type and the clustering of the access number are combined to divide each indicator data to obtain each main indicator data and each secondary indicator data. Since the factors of the system type and the API access number are taken into consideration, the classification result of each indicator data is more accurate, so that when the health of the API gateway is predicted according to the classified indicator data later, the prediction result is more accurate.
[0064] Considering that the speed of API access time determines the quality of network response and affects the normal operation and maintenance of the data system, that is, the speed of API access time can effectively reflect the health of the API gateway. Therefore, in order to improve the accuracy of the health prediction of the API gateway, in one embodiment, the API response time can also be used as the basis for classifying various indicator data.
[0065] Specifically, each of the indicator data is clustered according to the API response time corresponding to each of the indicator data, and the preset data type of each of the indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of each of the indicator data whose API response time is less than or equal to the preset time length are determined.
[0066] In one embodiment, each indicator data is clustered according to the API response time corresponding to each indicator data, and each indicator data whose corresponding API response time is less than the preset time is classified as the main indicator data, and each indicator data whose API access times are greater than or equal to the preset time is classified as the secondary indicator data. Among them, the preset time can be set according to the actual situation. If the API response time is less than or equal to the preset time, it means that the API response is relatively fast, indicating that the network connection is fine and the system is running normally. At this time, the corresponding indicator data has little effect on the health of the API gateway, so it can be classified as secondary indicator data; if the API response time is greater than the preset time, it means that the API response is relatively slow, which may be caused by network congestion or gateway problems. At this time, the corresponding indicator data has a greater impact on the health of the API gateway, so it can be classified as the main indicator data. Therefore, when the health of the API gateway is predicted later, the health of the API gateway can be predicted based on the network response quality, thereby improving the accuracy of the subsequent health prediction of the API gateway.
[0067] In order to further improve the accuracy of subsequent health prediction for the API gateway, in one embodiment, the indicator data are clustered according to the API response time corresponding to each indicator data, and the preset data type of each indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of each indicator data whose API response time is less than or equal to the preset time length are determined, including:
[0068] Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type;
[0069] Clustering each indicator data in the system type according to the API response time corresponding to each indicator data in the system type, determining the preset data type of each indicator data in the system type whose corresponding API response time is greater than the preset time length, and determining the preset data type of each indicator data in the system type whose API response time is less than or equal to the preset time length;
[0070] The preset duration is determined according to the system type.
[0071] In one embodiment, different system types are bound with different preset durations in advance. For example, if the system type is a self-developed system, the preset duration of its corresponding API response time is preset duration 1; if the system type is a third-party system, the preset duration of the corresponding API response time is preset duration 2. After obtaining each indicator data, each indicator data is first clustered according to each system type to obtain the indicator data of each system type, such as the indicator data of the corresponding system type being a third-party system. Then, the indicator data of the corresponding system type being a third-party system is clustered according to the corresponding API response time, and each indicator data whose corresponding API response time is greater than the preset duration 2 is obtained as the main indicator data, and each indicator data whose corresponding API response time is less than or equal to the preset duration 2 is obtained as the secondary indicator data. The same is true for the indicator data of the self-developed system or other evaluation platforms. Thus, the clustering of the system type and the clustering of the API response time are combined to divide each indicator data to obtain each main indicator data and each secondary indicator data. Since the factors of system type and API response time are taken into consideration, the classification results of each indicator data are more accurate, so that the subsequent health prediction of the API gateway based on the classified indicator data is more accurate.
[0072] In one embodiment, different system types may also be bound with different preset values and different preset durations in advance. For example, if the system type is a self-developed system, the preset value of the corresponding API access times is preset value A, and the preset duration of the corresponding API response time is preset duration 1; if the system type is a third-party system, the preset value of the corresponding API access times is preset value B, and the preset duration of the corresponding API response time is preset duration 2. After obtaining each indicator data, first cluster each indicator data according to each system type to obtain the indicator data of each system type, such as the indicator data of the corresponding system type being a third-party system. Then cluster each indicator data of the corresponding system type being a third-party system according to the corresponding API access times and the corresponding API response time, obtain each indicator data with an API access times greater than the preset value B and a corresponding API response time greater than the preset duration 2 as the main indicator data, and take other indicator data as secondary indicator data. The same is true for the indicator data of the self-developed system or other evaluation platforms. Therefore, the clustering of system type, number of API gateway accesses and API response time is combined to divide the indicator data and obtain the main indicator data and the secondary indicator data. Since the factors of system type, number of API gateway accesses and API response time are taken into consideration, the classification results of each indicator data are more accurate, so that the subsequent prediction of the health of the API gateway based on the classified indicator data is more accurate.
[0073] In step 102, taking the preset data types as the main indicator data type and the secondary indicator data type as an example, each main indicator data in the main indicator data type is input into a first prediction model trained by the historical main indicator data of the main indicator data type, so as to obtain a first health score. And each secondary indicator data in the secondary indicator data type is input into a second prediction model trained by the historical secondary indicator data of the secondary indicator data type, so as to obtain a second health score.
[0074] In one embodiment, after obtaining the first health score and the second health score, each main indicator data can be used as a training sample of the first prediction model to optimize the training of the first prediction model, and each secondary indicator data can be used as a training sample of the second prediction model to optimize the training of the second prediction model, so that the accuracy of the prediction model is higher and the predicted score is more accurate.
[0075] In one embodiment, after obtaining the health score corresponding to each preset data type, each health score can be sent to the display interface of the designated terminal to display each health score visually. Exemplarily, when the preset data types are primary indicator data types and secondary indicator data types, the health score corresponding to the primary indicator data type can be displayed through the display interface, and an indicator control for displaying the health score corresponding to the secondary indicator data type can be generated on the display interface. When the user clicks on the indicator control through the designated terminal, the health score corresponding to the secondary indicator data type is displayed on the display interface; if the user does not click on the indicator control, the health score corresponding to the secondary indicator data type is hidden.
[0076] In step 103, after obtaining each health score corresponding to each preset data type, each health score may be weighted according to the preset weight corresponding to each preset data type, so as to determine the health of the API gateway.
[0077] Considering that when determining the health of the API gateway by weighting, the influence of some indicator data will be diluted, resulting in the final predicted health of the API gateway may not be accurate enough. In order to improve the accuracy of the predicted health of the API gateway, in one embodiment, the health of the API gateway is determined according to each health score corresponding to each preset data type, including:
[0078] Compare the health score corresponding to the preset data type with the preset fuse threshold corresponding to the preset data type to obtain a comparison result corresponding to the preset data type;
[0079] When the comparison results corresponding to the preset data types all have health scores greater than the preset fuse threshold, the API gateway is determined to be normal.
[0080] Exemplarily, the preset data type includes a primary indicator data type and a secondary indicator data type, the primary indicator data type is preset with a corresponding first preset fuse threshold, and the secondary indicator data type is preset with a corresponding second preset fuse threshold. After obtaining the health score of the primary indicator data type and the health score of the secondary indicator data type, the health score of the primary indicator data type is compared with the first preset fuse threshold, and the health score of the secondary indicator data type is compared with the second preset fuse threshold. If the health score of the primary indicator data type is greater than the first preset fuse threshold, and the health score of the secondary indicator data type is greater than the second preset fuse threshold, then it is determined that the API gateway is normal.
[0081] In order to facilitate management and control, in one embodiment, the following is also included:
[0082] When any of the comparison results shows that the health score is less than or equal to the preset fuse threshold, the API gateway is closed.
[0083] Exemplarily, when the health score of the main indicator data type is less than or equal to the first preset circuit breaker threshold, or the health score of the secondary indicator data type is less than or equal to the second preset circuit breaker threshold, the health of the API gateway is determined to be abnormal. At this time, the circuit breaker mechanism is triggered, and the API gateway circuit breaker implements the circuit breaker and closes the API gateway.
[0084] By actively triggering the circuit breaker when the health score is less than or equal to the preset circuit breaker threshold, the investment in API gateway backend service resources can be reduced, while improving the efficiency of handling API gateway problems.
[0085] In one embodiment, when the API gateway is closed due to triggering a circuit breaker, the information of the blown API gateway can be obtained to generate an alarm, which is uploaded to the background, and the information of the blown API gateway, such as the logo of the API gateway, is displayed on the display interface of the designated terminal, thereby further improving processing efficiency.
[0086] The health prediction device for a gateway provided by the present invention is described below. The health prediction device for a gateway described below and the health prediction method for a gateway described above can be referred to each other.
[0087] In one embodiment, if Figure 2 As shown, a gateway health prediction device is provided, comprising:
[0088] The data type determination module 210 is used to cluster the indicator data collected from the API application programming interface gateway according to the preset classification conditions to determine the preset data type of each indicator data;
[0089] The health score acquisition module 220 is used to input each indicator data in the preset data type into the prediction model trained according to each historical indicator data corresponding to the preset data type, and obtain the health score corresponding to the preset data type;
[0090] The health prediction module 230 is used to determine the health of the API gateway according to the health scores corresponding to the preset data types.
[0091] By clustering the indicator data collected from the API gateway, the indicator data of each preset data type is input into the prediction model trained by the historical indicator data to obtain the health score corresponding to each preset data type, so as to realize the health prediction of the API gateway according to the health scores corresponding to each preset data type. Thus, the health profile of the API gateway can be completed through the indicator data of the API gateway, avoiding the passive collection of data for analysis when the health problems of the API gateway occur, and actively detecting and predicting the health status of the API gateway, thereby improving the operation and maintenance efficiency of network services and reducing operation and maintenance costs.
[0092] In one embodiment, the data type determination module 210 is specifically used to:
[0093] Each indicator data is clustered according to the number of times it is accessed by the API gateway within a preset time period, and a preset data type of each indicator data whose access number is greater than a preset value, and a preset data type of each indicator data whose access number is less than or equal to the preset value are determined.
[0094] In one embodiment, the data type determination module 210 is specifically used to:
[0095] Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type;
[0096] Clustering each indicator data in the system type according to the number of times it is accessed by the API gateway within a preset time period, determining the preset data type of each indicator data in the system type whose access number is greater than a preset value, and the preset data type of each indicator data in the system type whose access number is less than or equal to the preset value;
[0097] Wherein, the preset value is determined according to the system type.
[0098] In one embodiment, the data type determination module 210 is specifically used to:
[0099] Cluster the indicator data according to the API response time corresponding to each indicator data, and determine the preset data type of each indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of each indicator data whose API response time is less than or equal to the preset time length.
[0100] In one embodiment, the data type determination module 210 is specifically used to:
[0101] Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type;
[0102] Clustering each indicator data in the system type according to the API response time corresponding to each indicator data in the system type, determining the preset data type of each indicator data in the system type whose corresponding API response time is greater than the preset time length, and determining the preset data type of each indicator data in the system type whose API response time is less than or equal to the preset time length;
[0103] The preset duration is determined according to the system type.
[0104] In one embodiment, the health prediction module 230 is specifically used to:
[0105] Compare the health score corresponding to the preset data type with the preset fuse threshold corresponding to the preset data type to obtain a comparison result corresponding to the preset data type;
[0106] When the comparison results corresponding to the preset data types all have health scores greater than the preset fuse threshold, the API gateway is determined to be normal.
[0107] In one embodiment, the health prediction module 230 is further used to:
[0108] When any of the comparison results shows that the health score is less than or equal to the preset fuse threshold, the API gateway is closed.
[0109] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call a computer program in the memory 830 to execute the steps of the gateway health prediction method, for example including:
[0110] Clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data;
[0111] Input each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, and obtain a health score corresponding to the preset data type;
[0112] The health of the API gateway is determined according to the health scores corresponding to the preset data types.
[0113] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0114] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the gateway health prediction method provided in the above embodiments, for example, including:
[0115] Clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data;
[0116] Input each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, and obtain a health score corresponding to the preset data type;
[0117] The health of the API gateway is determined according to the health scores corresponding to the preset data types.
[0118] On the other hand, an embodiment of the present application further provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, wherein the computer program is used to enable the processor to execute the steps of the methods provided in the above embodiments, for example, including:
[0119] Clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data;
[0120] Input each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, and obtain a health score corresponding to the preset data type;
[0121] The health of the API gateway is determined according to the health scores corresponding to the preset data types.
[0122] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A gateway health prediction method, It is characterized in that include: Clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data; Input each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, and obtain a health score corresponding to the preset data type; Determining the health of the API gateway according to each of the health scores corresponding to each of the preset data types; The method of clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data includes: Clustering each of the indicator data according to the number of times the API gateway accesses them within a preset period of time, determining a preset data type for each of the indicator data whose number of accesses is greater than a preset value, and a preset data type for each of the indicator data whose number of accesses is less than or equal to the preset value; Clustering each of the indicator data according to the number of times the API gateway accesses them within a preset period of time, determining a preset data type for each of the indicator data whose number of accesses is greater than a preset value, and a preset data type for each of the indicator data whose number of accesses is less than or equal to the preset value, including: Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type; Clustering each indicator data in the system type according to the number of times it is accessed by the API gateway within a preset time period, determining the preset data type of each indicator data in the system type whose access number is greater than a preset value, and the preset data type of each indicator data in the system type whose access number is less than or equal to the preset value; Wherein, the preset value is determined according to the system type; The indicator data collected from the API application programming interface gateway are clustered according to preset classification conditions to determine the preset data type of each indicator data, including: Clustering the indicator data according to the API response time corresponding to the indicator data, determining the preset data type of the indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of the indicator data whose API response time is less than or equal to the preset time length; The clustering of the indicator data according to the API response time corresponding to the indicator data, and determining the preset data type of the indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of the indicator data whose API response time is less than or equal to the preset time length, includes: Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type; Clustering each indicator data in the system type according to the API response time corresponding to each indicator data in the system type, determining the preset data type of each indicator data in the system type whose corresponding API response time is greater than the preset time length, and determining the preset data type of each indicator data in the system type whose API response time is less than or equal to the preset time length; The preset duration is determined according to the system type.
2. The gateway health prediction method according to claim 1, It is characterized in that Determining the health of the API gateway according to the health scores corresponding to the preset data types includes: Compare the health score corresponding to the preset data type with the preset fuse threshold corresponding to the preset data type to obtain a comparison result corresponding to the preset data type; When the comparison results corresponding to the preset data types all have health scores greater than the preset fuse threshold, the API gateway is determined to be normal.
3. The gateway health prediction method according to claim 2, It is characterized in that Also includes: When any of the comparison results shows that the health score is less than or equal to the preset fuse threshold, the API gateway is closed.
4. A gateway health prediction device, include: The data type determination module is used to cluster the indicator data collected from the API application programming interface gateway according to the preset classification conditions and determine the preset data type of each indicator data; A health score acquisition module, used to input each indicator data in the preset data type into a prediction model trained according to each historical indicator data corresponding to the preset data type, to obtain a health score corresponding to the preset data type; A health prediction module, used to determine the health of the API gateway according to each health score corresponding to each preset data type; The method of clustering the indicator data collected from the API application programming interface gateway according to preset classification conditions to determine the preset data type of each indicator data includes: Clustering each of the indicator data according to the number of times the API gateway accesses them within a preset period of time, determining a preset data type for each of the indicator data whose number of accesses is greater than a preset value, and a preset data type for each of the indicator data whose number of accesses is less than or equal to the preset value; Clustering each of the indicator data according to the number of times the API gateway accesses them within a preset period of time, determining a preset data type for each of the indicator data whose number of accesses is greater than a preset value, and a preset data type for each of the indicator data whose number of accesses is less than or equal to the preset value, including: Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type; Clustering each indicator data in the system type according to the number of times it is accessed by the API gateway within a preset time period, determining the preset data type of each indicator data in the system type whose access number is greater than a preset value, and the preset data type of each indicator data in the system type whose access number is less than or equal to the preset value; Wherein, the preset value is determined according to the system type; The indicator data collected from the API application programming interface gateway are clustered according to preset classification conditions to determine the preset data type of each indicator data, including: Clustering the indicator data according to the API response time corresponding to the indicator data, determining the preset data type of the indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of the indicator data whose API response time is less than or equal to the preset time length; The clustering of the indicator data according to the API response time corresponding to the indicator data, and determining the preset data type of the indicator data whose corresponding API response time is greater than the preset time length, and the preset data type of the indicator data whose API response time is less than or equal to the preset time length, includes: Clustering the indicator data according to the system type corresponding to the indicator data to obtain the indicator data of each system type; Clustering each indicator data in the system type according to the API response time corresponding to each indicator data in the system type, determining the preset data type of each indicator data in the system type whose corresponding API response time is greater than the preset time length, and determining the preset data type of each indicator data in the system type whose API response time is less than or equal to the preset time length; The preset duration is determined according to the system type.
5. An electronic device comprising a processor and a memory storing a computer program, It is characterized in that When the processor executes the computer program, the steps of the gateway health prediction method according to any one of claims 1 to 3 are implemented.
6. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the gateway health prediction method according to any one of claims 1 to 3 are implemented.
