CN116208513A - Gateway Health Prediction Method and Device - Google Patents

Gateway Health Prediction Method and Device Download PDF

Info

Publication number
CN116208513A
CN116208513A CN202111440204.3A CN202111440204A CN116208513A CN 116208513 A CN116208513 A CN 116208513A CN 202111440204 A CN202111440204 A CN 202111440204A CN 116208513 A CN116208513 A CN 116208513A
Authority
CN
China
Prior art keywords
preset
index data
data
type
api
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111440204.3A
Other languages
Chinese (zh)
Other versions
CN116208513B (en
Inventor
滕滨
肖爱元
王一寒
王静
张琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111440204.3A priority Critical patent/CN116208513B/en
Publication of CN116208513A publication Critical patent/CN116208513A/en
Application granted granted Critical
Publication of CN116208513B publication Critical patent/CN116208513B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供一种网关的健康度预测方法及装置。所述方法包括:将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;将预设数据类型中的各指标数据,输入根据预设数据类型对应的各历史指标数据训练得到的预测模型中,获取预设数据类型对应的健康度分数;根据各预设数据类型对应的各健康度分数,确定API网关的健康度。本申请实施例提供的网关的健康度预测方法能够预测API网关的健康度,以提高网络服务的运维效率,降低运维成本。

Figure 202111440204

The present application provides a gateway health degree prediction method and device. The method includes: clustering the index data collected from the API application programming interface gateway according to the preset classification conditions, and determining the preset data type of each index data; each index data in the preset data type, Input the prediction model obtained according to the historical index data training corresponding to the preset data type to obtain the health score corresponding to the preset data type; determine the health of the API gateway according to each health score corresponding to each preset data type. The method for predicting the health degree of a gateway provided in the embodiment of the present application can predict the health degree of an API gateway, so as to improve the operation and maintenance efficiency of network services and reduce the operation and maintenance cost.

Figure 202111440204

Description

网关的健康度预测方法及装置Gateway Health Prediction Method and Device

技术领域technical field

本申请涉及网络技术领域,具体涉及一种网关的健康度预测方法及装置。The present application relates to the field of network technologies, and in particular to a gateway health degree prediction method and device.

背景技术Background technique

企业的网络服务一般有客户端和服务端,而客户端和服务端之间,存在有API(Application Programming Interface,应用程序编程接口)网关,用于统一接收客户端或者外部合作伙伴等调用方的请求,并根据各个接口不同的逻辑,进行一定的校验和逻辑处理,再转发给服务端。Enterprise network services generally have a client and a server, and there is an API (Application Programming Interface, application programming interface) gateway between the client and the server, which is used to uniformly receive calls from the client or external partners. Request, and according to the different logic of each interface, perform certain verification and logic processing, and then forward it to the server.

API网关能够实现身份验证、监控、负载均衡、缓存、请求分片与管理以及静态响应处理等功能,是网络通信中重要的一环,因此API网关的健康度是十分重要的。然而,相关技术中,只有在API网关健康出现问题时,运维工作人员才被动的去收集数据进行分析,无法及时地对API网关的健康度做出判断,导致给整个网络服务的运维效率低,同时运维成本也大大提升。The API gateway can realize functions such as authentication, monitoring, load balancing, caching, request fragmentation and management, and static response processing. It is an important part of network communication, so the health of the API gateway is very important. However, in related technologies, only when there is a problem with the health of the API gateway, the operation and maintenance staff will passively collect data for analysis, and cannot make timely judgments on the health of the API gateway, resulting in the operation and maintenance efficiency of the entire network service At the same time, the operation and maintenance cost is also greatly increased.

发明内容Contents of the invention

本申请实施例提供一种网关的健康度预测方法及装置,能够预测API网关的健康度,以提高网络服务的运维效率,降低运维成本。The embodiments of the present application provide a gateway health degree prediction method and device, which can predict the health degree of an API gateway, so as to improve the operation and maintenance efficiency of network services and reduce operation and maintenance costs.

第一方面,本申请实施例提供一种网关的健康度预测方法,包括:In the first aspect, the embodiment of the present application provides a method for predicting the health degree of a gateway, including:

将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;Cluster the index data collected from the API application programming interface gateway according to the preset classification conditions, and determine the preset data type of each index data;

将所述预设数据类型中的各指标数据,输入根据所述预设数据类型对应的各历史指标数据训练得到的预测模型中,获取所述预设数据类型对应的健康度分数;Input each index data in the preset data type into the prediction model obtained according to the training of each historical index data corresponding to the preset data type, and obtain the health score corresponding to the preset data type;

根据各所述预设数据类型对应的各所述健康度分数,确定所述API网关的健康度。The health degree of the API gateway is determined according to each health degree score corresponding to each preset data type.

在一个实施例中,所述将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型,包括:In one embodiment, the clustering of the indicator data collected from the API application programming interface gateway according to preset classification conditions, and the determination of the preset data type of each indicator data include:

将各所述指标数据,根据在预设时段内被所述API网关访问的次数进行聚类,确定访问次数大于预设值的各所述指标数据的预设数据类型,以及访问次数小于或等于所述预设值的各所述指标数据的预设数据类型。Clustering each of the index data according to the number of visits by the API gateway within a preset period of time, determining the preset data type of each of the index data whose number of visits is greater than a preset value, and the number of visits is less than or equal to A preset data type of each of the index data of the preset value.

在一个实施例中,将各所述指标数据,根据在第一预设时段内被所述API网关访问的次数进行聚类,确定访问次数大于预设值的各所述指标数据的预设数据类型,以及访问次数小于或等于所述预设值的各所述指标数据的预设数据类型,包括:In one embodiment, each of the index data is clustered according to the number of accesses by the API gateway within the first preset period, and the preset data of each of the index data whose access times are greater than a preset value is determined type, and the preset data type of each indicator data whose access times are less than or equal to the preset value, including:

将各所述指标数据,根据各所述指标数据对应的系统类型进行聚类,获取各所述系统类型的指标数据;clustering each of the index data according to the system type corresponding to each of the index data, and obtaining the index data of each of the system types;

将所述系统类型中的各指标数据,根据在预设时段内被所述API网关访问的次数进行聚类,确定所述系统类型中,访问次数大于预设值的各所述指标数据的预设数据类型,以及所述系统类型中,访问次数小于或等于所述预设值的各所述指标数据的预设数据类型;Clustering the index data in the system type according to the number of accesses by the API gateway within a preset period of time, and determining the expected value of each index data in the system type whose access times are greater than a preset value. Set the data type, and the preset data type of each of the index data whose access times are less than or equal to the preset value in the system type;

其中,所述预设值根据所述系统类型确定。Wherein, the preset value is determined according to the system type.

在一个实施例中,所述将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型,包括:In one embodiment, the clustering of the indicator data collected from the API application programming interface gateway according to preset classification conditions, and the determination of the preset data type of each indicator data include:

将各所述指标数据,根据各所述指标数据对应的API响应时间进行聚类,确定对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型。Clustering each of the index data according to the API response time corresponding to each of the index data, and determining the preset data type of each of the index data whose corresponding API response time is greater than the preset duration, and the API response time is less than or A preset data type of each indicator data equal to the preset duration.

在一个实施例中,所述将各所述指标数据,根据各所述指标数据对应的API响应时间进行聚类,确定对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型,包括:In one embodiment, the index data is clustered according to the API response time corresponding to each of the index data, and the preset data of each of the index data whose corresponding API response time is greater than the preset duration is determined type, and the preset data type of each indicator data whose API response time is less than or equal to the preset duration, including:

将各所述指标数据根据各所述指标数据对应的系统类型进行聚类,获取各所述系统类型的指标数据;clustering each of the index data according to the system type corresponding to each of the index data, and obtaining the index data of each of the system types;

将所述系统类型中的各指标数据,根据所述系统类型中的各指标数据对应的API响应时间进行聚类,确定所述系统类型中,对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及确定所述系统类型中,API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型;Cluster the index data in the system type according to the API response time corresponding to the index data in the system type, and determine the system types whose corresponding API response time is longer than the preset duration. The preset data type of the indicator data, and the preset data type of each indicator data whose API response time is less than or equal to the preset duration in the system type;

其中,所述预设时长根据所述系统类型确定。Wherein, the preset duration is determined according to the system type.

在一个实施例中,根据各所述预设数据类型对应的各健康度分数,确定所述API网关的健康度,包括:In one embodiment, determining the health of the API gateway according to the health scores corresponding to each of the preset data types includes:

将所述预设数据类型对应的所述健康度分数,与所述预设数据类型对应的预设熔断阈值进行比对,获取所述预设数据类型对应的比对结果;comparing the health score corresponding to the preset data type with the preset fusing threshold corresponding to the preset data type, and obtaining a comparison result corresponding to the preset data type;

当各所述预设数据类型对应的各比对结果,均为所述健康度分数大于所述预设熔断阈值时,则判定所述API网关正常。When each comparison result corresponding to each preset data type is that the health score is greater than the preset fusing threshold, it is determined that the API gateway is normal.

在一个实施例中,还包括:In one embodiment, also includes:

当各所述比对结果中,任一所述比对结果为所述健康度分数小于或等于所述预设熔断阈值时,关闭所述API网关。When any of the comparison results is that the health score is less than or equal to the preset fusing threshold, the API gateway is closed.

第二方面,本申请实施例提供一种网关的健康度预测装置,包括:In the second aspect, the embodiment of the present application provides a device for predicting the health of a gateway, including:

数据类型确定模块,用于将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;The data type determination module is used to cluster the index data collected from the API application programming interface gateway according to the preset classification conditions, and determine the preset data type of each index data;

健康度分数获取模块,用于将所述预设数据类型中的各指标数据,输入根据所述预设数据类型对应的各历史指标数据训练得到的预测模型中,获取所述预设数据类型对应的健康度分数;The health score acquisition module is used to input each index data in the preset data type into the prediction model obtained according to the training of each historical index data corresponding to the preset data type, and obtain the data corresponding to the preset data type. health score;

健康度预测模块,用于根据各所述预设数据类型对应的各健康度分数,确定所述API网关的健康度。A health degree prediction module, configured to determine the health degree of the API gateway according to each health degree score corresponding to each preset data type.

第三方面,本申请实施例提供一种电子设备,包括处理器和存储有计算机程序的存储器,所述处理器执行所述程序时实现第一方面所述的网关的健康度预测方法的步骤。In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program. When the processor executes the program, the steps of the gateway health degree prediction method described in the first aspect are implemented.

第四方面,本申请实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现第一方面所述的网关的健康度预测方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the gateway health degree prediction method described in the first aspect are implemented.

本申请实施例提供的网关的健康度预测方法及装置,通过将从API网关采集到的各指标数据进行聚类后,将每个预设数据类型的指标数据输入由历史指标数据训练好的预测模型中,得到每个预设数据类型对应的健康度分数,以根据各预设数据类型对应的各健康度分数实现API网关的健康度预测,从而能够通过API网关的各指标数据,完成API网关的健康度画像,避免了API网关健康出现问题时,再被动地去收集数据进行分析,而是主动检测并预判API网关的健康情况,进而提高网络服务的运维效率,降低运维成本。The method and device for predicting the health of the gateway provided by the embodiment of the present application, after clustering the index data collected from the API gateway, input the index data of each preset data type into the prediction trained by the historical index data In the model, the health score corresponding to each preset data type is obtained, so as to realize the health prediction of the API gateway according to each health score corresponding to each preset data type, so that the API gateway can be completed through the index data of the API gateway The health portrait of the API gateway avoids passively collecting data for analysis when there is a problem with the health of the API gateway. Instead, it actively detects and predicts the health of the API gateway, thereby improving the operation and maintenance efficiency of network services and reducing operation and maintenance costs.

附图说明Description of drawings

为了更清楚地说明本申请或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in this application or the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are the present For some embodiments of the application, those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是本发明实施例提供的网关的健康度预测方法的流程示意图;FIG. 1 is a schematic flowchart of a gateway health degree prediction method provided by an embodiment of the present invention;

图2是本发明提供的网关的健康度预测装置的结构示意图;Fig. 2 is a schematic structural diagram of a health degree prediction device of a gateway provided by the present invention;

图3是本发明提供的电子设备的结构示意图。Fig. 3 is a schematic structural diagram of an electronic device provided by the present invention.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。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 this application Examples, not all examples. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.

下面结合附图对本申请实施例进行详细的阐述。Embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

参见图1,是本发明实施例提供的网关的健康度预测方法的流程示意图之一,该方法应用与电子设备中,其中电子设备具体可以是服务器或终端设备,用于进行API网关的健康度预测。如图1所示,本实施例提供的一种网关的健康度预测方法包括:Referring to FIG. 1 , it is one of the flow diagrams of the method for predicting the health of the gateway provided by the embodiment of the present invention. The method is applied to electronic devices, where the electronic device can specifically be a server or a terminal device, and is used to perform the health degree of the API gateway. predict. As shown in Figure 1, a method for predicting the health of a gateway provided in this embodiment includes:

步骤101,将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;Step 101, clustering the index data collected from the API application programming interface gateway according to preset classification conditions, and determining the preset data type of each index data;

步骤102,将所述预设数据类型中的各指标数据,输入根据所述预设数据类型对应的各历史指标数据训练得到的预测模型中,获取所述预设数据类型对应的健康度分数;Step 102, input each index data in the preset data type into the prediction model trained according to the historical index data corresponding to the preset data type, and obtain the health score corresponding to the preset data type;

步骤103,根据各所述预设数据类型对应的各健康度分数,确定所述API网关的健康度。Step 103: Determine the health of the API gateway according to the health scores corresponding to the preset data types.

通过将从API网关采集到的各指标数据进行聚类后,将每个预设数据类型的指标数据输入由历史指标数据训练好的预测模型中,得到每个预设数据类型对应的健康度分数,以根据各预设数据类型对应的各健康度分数实现API网关的健康度预测,从而能够通过API网关的各指标数据,完成API网关的健康度画像,避免了API网关健康出现问题时,再被动地去收集数据进行分析,而是主动检测并预判API网关的健康情况,进而提高网络服务的运维效率,降低运维成本。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 the historical indicator data, and obtain the health score corresponding to each preset data type , to realize the health degree prediction of the API gateway based on the health degree scores corresponding to each preset data type, so that the health degree portrait of the API gateway can be completed through the various index data of the API gateway, avoiding the health problems of the API gateway. Passively collect data for analysis, but actively detect and predict the health of the API gateway, thereby improving the operation and maintenance efficiency of network services and reducing operation and maintenance costs.

在步骤101中,预先通过采集器从API网关中采集API网关的各指标数据。其中,采集器为用于采集各指标数据的脚本,该脚本可以以插件的方式安装至API的网关中。In step 101, each index data of the API gateway is collected from the API gateway in advance through the collector. Among them, the collector is a script used to collect the data of each indicator, and the script can be installed in the gateway of the API in the form of a plug-in.

在一实施例中,各指标数据包括API网关的API日志以及其他运维数据等多维度的数据,其中,运维数据包括API请求所对应的系统属性、系统类型、请求时间等外部相关数据,以及API网关的工作时长等网关本身的数据。In one embodiment, each indicator data includes multi-dimensional data such as API logs of the API gateway and other operation and maintenance data, wherein the operation and maintenance data includes external related data such as system attributes, system types, and request times corresponding to API requests, And the data of the gateway itself such as the working hours of the API gateway.

在一实施例中,各指标数据可以是特定类型的API请求日志以及AIP相关后台组件中的多维度数据,如只采集一些优先级高的系统所对应的API请求日志以及API相关后台组件中的多维度数据。其中,优先级高的系统可以是预先指定的自主研发的系统、预先指定的第三方系统或预先指定的其他评定平台等。从而减少需要处理的数据量,进而提高后续对采集到的各指标数据进行处理时的处理效率。In an embodiment, each indicator data can be a specific type of API request log and multi-dimensional data in AIP-related background components, such as only collecting API request logs corresponding to some high-priority systems and API-related background components multidimensional data. Among them, the system with high priority can be a pre-designated self-developed system, a pre-designated third-party system or other pre-designated evaluation platforms. Therefore, the amount of data to be processed is reduced, and the processing efficiency of subsequent processing of the collected index data is improved.

在采集到各指标数据后,可先将各指标数据进行清洗以及转化,形成结构化数据,并传入消息队列中,方便后续进行处理。After the data of each indicator is collected, the data of each indicator can be cleaned and transformed to form structured data, which is then passed into the message queue for subsequent processing.

在一实施例中,可采用KMEANS算法对各指标数据进行聚类,KMEANS算法是一种基于划分的聚类算法,以距离作为数据对象间相似性度量的标准,即数据对象间的距离越小,则它们的相似性越高,则它们越有可能在同一个类簇。其中心思想是事先确定常数K,常数K意味着最终的聚类类别数,首先随机选定初始点为质心,并通过计算每一个样本与质心之间的相似度,将样本点归到最相似的类中,接着,重新计算每个类的质心(即为类中心),重复这样的过程,直到质心不再改变,最终就确定了每个样本所属的类别以及每个类的质心。In one embodiment, the KMEANS algorithm can be used to cluster each index data. The KMEANS algorithm is a clustering algorithm based on division, and the distance is used as the standard for measuring the similarity between data objects, that is, the smaller the distance between data objects , the higher their similarity is, the more likely they are in the same cluster. The central idea is to determine the constant K in advance, and the constant K 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 by calculating the similarity between each sample and the centroid. Then, recalculate the centroid of each class (that is, the class center), repeat this process until the centroid does not change, and finally determine the category to which each sample belongs and the centroid of each class.

假设提取到各指标数据的集合为(x1,x2,…,xn),并且每个xi为d维的向量。K-means聚类的目的就是,在给定类型组数k(k≤n)值的条件下,将原始数据分成k类,S={S1,S2,…,Sk}。Assume that the set of extracted index 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 number of type groups k (k≤n), S={S1,S2,...,Sk}.

在一实施例中,K=2,即预设数据类型包括主要指标数据类型和次要指标数据类型。不同预设数据类型对API网关的健康度的影响程度不同。其中,主要指标数据类型表示对API网关的健康度影响较大的数据类型,次要指标数据类型表示对API网关的健康度影响较小的数据类型。主要指标数据类型中的指标数据即为主要指标数据,次要指标数据类型中的指标数据即为次要指标数据。In an embodiment, K=2, that is, the preset data type includes a primary index data type and a secondary index data type. Different preset data types have different impacts on the health of the API gateway. Among them, the data type of the primary index represents a data type that has a greater impact on the health of the API gateway, and the data type of the secondary index represents a data type that has a lesser 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.

在一实施例中,预设分类条件可以是根据各指标数据对应的系统类型进行分类。每个系统类型都预设有一个对应的预设优先级。如系统类型为自主研发的系统,则重要程度较高,因此预设优先级较高;系统类型为第三方系统或其他评定平台,则预设优先级较低。示例性的,在采集到各指标数据后,根据各指标数据对应的系统类型对各指标数据进行聚类,确定各指标数据对应的系统类型。如该指标数据是关于自主研发的系统的指标数据,则该指标数据对应的系统类型为自主研发的系统。In an embodiment, the preset classification condition may be to classify according to the system type corresponding to each index data. Each system type is preset with a corresponding preset priority. If the system type is a self-developed system, the degree of importance is higher, so the default priority is higher; if the system type is a third-party system or other evaluation platform, the default priority is lower. Exemplarily, after each index data is collected, each index data is clustered according to the system type corresponding to each index data, and the system type corresponding to each index data is determined. If the index data is index data about a self-developed system, the system type corresponding to the index data is a self-developed system.

在确定各指标数据的系统类型后,将预设优先级大于指定级别的系统类型所对应的各指标数据,划分为同一个预设数据类型,具体为上述的主要指标数据类型,得到各主要指标数据;并将预设优先级小于或等于指定级别的系统类型所对应的各指标数据,划分为同一个预设数据类型,具体为上述的次要指标数据类型,得到各次要指标数据。After determining the system type of each index data, divide the index data corresponding to the system type with a preset priority higher than the specified level into the same preset data type, specifically the above-mentioned main index data types, and obtain each main index data; and divide the index data corresponding to the system type whose preset priority is less than or equal to the specified level into the same preset data type, specifically the above-mentioned secondary index data type, to obtain each secondary index data.

通过系统类型的重要程度对各指标数据进行分类,确定主要指标数据和次要指标数据,从而使后续对API网关的健康度预测更具针对性。The data of each index is classified according to the importance of the system type, and the data of the main index and the data of the secondary index are determined, so that the subsequent prediction of the health of the API gateway is more targeted.

在一实施例中,除以系统类型作为分类条件外,还可以以API访问次数作为分类依据。具体的,所述将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型,包括:In an embodiment, in addition to the system type as the classification condition, the number of API visits may also be used as the classification basis. Specifically, the described index data collected from the API application programming interface gateway is clustered according to preset classification conditions, and the preset data type of each index data is determined, including:

将各所述指标数据,根据在预设时段内被所述API网关访问的次数进行聚类,确定访问次数大于预设值的各所述指标数据的预设数据类型,以及访问次数小于或等于所述预设值的各所述指标数据的预设数据类型。Clustering each of the index data according to the number of visits by the API gateway within a preset period of time, determining the preset data type of each of the index data whose number of visits is greater than a preset value, and the number of visits is less than or equal to A preset data type of each of the index data of the preset value.

在一实施例中,根据各指标数据在预设时段内被API访问的次数,对各指标数据进行聚类,将API访问次数大于预设值的各指标数据划分为主要指标数据,将API访问次数小于或等于预设值的各指标数据划分为次要指标数据。其中,预设值可根据实际情况设定。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 times are greater than a preset value is divided into main indicator data, and the API access Each indicator data whose frequency is less than or equal to the preset value is divided into secondary indicator data. Wherein, the preset value can be set according to actual conditions.

在一实施例中,某一指标数据被API访问次数大于预设值,则可判定为动态访问,即该指标数据经常被访问。否则,则判定为静态访问。In one embodiment, if a certain indicator data is accessed by the API more than a preset value, it can be determined as a dynamic access, that is, the indicator data is frequently accessed. Otherwise, it is judged as static access.

由于在短时间内API访问次数多,说明API访问比较频繁,容易出现问题。因此根据API访问次数对各指标数据进行聚类,从而使后续可针对API网关的访问情况进行针对性监督,进而提高后续API网关的健康度预测的准确性。Due to the large number of API accesses in a short period of time, it means that API accesses are frequent and problems are prone to occur. Therefore, the data of each indicator is clustered according to the number of API visits, so that subsequent targeted supervision can be carried out for the visits of the API gateway, thereby improving the accuracy of the health prediction of the subsequent API gateway.

为进一步提高后续针对API网关的健康度预测的准确性,在一实施例中,将各所述指标数据,根据在第一预设时段内被所述API网关访问的次数进行聚类,确定访问次数大于预设值的各所述指标数据的预设数据类型,以及访问次数小于或等于所述预设值的各所述指标数据的预设数据类型,包括:In order to further improve the accuracy of the follow-up health prediction for the API gateway, in one embodiment, each of the index data is clustered according to the number of times the API gateway visits within the first preset time period, and the visit is determined. The preset data type of each index data whose number of visits is greater than the preset value, and the preset data type of each of the index data whose access times are less than or equal to the preset value include:

将各所述指标数据,根据各所述指标数据对应的系统类型进行聚类,获取各所述系统类型的指标数据;clustering each of the index data according to the system type corresponding to each of the index data, and obtaining the index data of each of the system types;

将所述系统类型中的各指标数据,根据在预设时段内被所述API网关访问的次数进行聚类,确定所述系统类型中,访问次数大于预设值的各所述指标数据的预设数据类型,以及所述系统类型中,访问次数小于或等于所述预设值的各所述指标数据的预设数据类型;Clustering the index data in the system type according to the number of accesses by the API gateway within a preset period of time, and determining the expected value of each index data in the system type whose access times are greater than a preset value. Set the data type, and the preset data type of each of the index data whose access times are less than or equal to the preset value in the system type;

其中,所述预设值根据所述系统类型确定。Wherein, the preset value is determined according to the system type.

在一实施例中,预先将不同系统类型进行不同预设值的绑定。如系统类型为自主研发的系统,其对应的API访问次数的预设值为预设值A;系统类型为第三方系统,对应的API访问次数的预设值为预设值B。在获取到各指标数据后,先根据各系统类型对各指标数据进行聚类,得到各系统类型的指标数据,如对应的系统类型为第三方系统的指标数据。然后将对应的系统类型为第三方系统的各指标数据,根据API网关访问的次数进行聚类,获取API访问次数大于预设值B的各指标数据作为主要指标数据,获取API访问次数小于或等于预设值B的各指标数据作为次要指标数据。系统类型为自主研发的系统或其他评定平台的指标数据同理。从而联合系统类型的聚类以及访问次数的聚类,对各指标数据进行划分,得到各主要指标数据和各次要指标数据。由于考虑了系统类型和API访问次数的因素,因此使各指标数据的分类结果更为准确,从而使得后续根据分类后的各指标数据进行API网关的健康度预测时,预测结果更为准确。In an embodiment, different system types are bound with different preset values in advance. If the system type is a self-developed system, the default value of the corresponding number of API visits is preset value A; if the system type is a third-party system, the default value of the corresponding number of API visits is preset value B. After obtaining the index data, first cluster the index data according to each system type to obtain the index data of each system type, for example, the corresponding system type is the index data of a third-party system. Then cluster the indicator data corresponding to the third-party system according to the number of API gateway visits, obtain the indicator data whose API access times are greater than the preset value B as the main indicator data, and obtain the API access times less than or equal to Each index data of the preset value B is used as the secondary index data. The same applies to index data of self-developed systems or other evaluation platforms. In this way, the clustering of the system type and the clustering of the number of visits are combined to divide the data of each index, and obtain the data of each main index and each secondary index. Since the system type and the number of API accesses are considered, the classification results of each index data are more accurate, so that when the health degree of the API gateway is predicted based on the classified index data, the prediction results are more accurate.

考虑到API访问时间快慢决定了网络响应质量,影响数据的系统的正常运维,即API访问时间快慢能够有效地反映API网关的健康度,因此为提高API网关的健康度预测的准确度,在一实施例中,还可以以API响应时间作为各指标数据的分类依据。Considering that the speed of API access determines the quality of network response and affects the normal operation and maintenance of the data system, that is, the speed of API access 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 In an embodiment, the API response time may also be used as a classification basis for each index data.

具体的,将各所述指标数据,根据各所述指标数据对应的API响应时间进行聚类,确定对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型。Specifically, each of the index data is clustered according to the API response time corresponding to each of the index data, and the preset data type of each of the index data whose corresponding API response time is greater than the preset duration is determined, and the API response A preset data type of each indicator data whose time is less than or equal to the preset duration.

在一实施例中,根据各指标数据对应的API响应时间,对各指标数据进行聚类,将对应的API响应时间小于预设时长的各指标数据划分为主要指标数据,将API访问次数大于或等于预设时长的各指标数据划分为次要指标数据。其中,预设时长可根据实际情况设定。如果API响应时间小于或等于预设时长,则说明API响应比较快,说明了网络连接没问题,系统正常运行,此时对应的指标数据对API网关的健康度影响不大,因此可划分为次要指标数据;若API响应时间大于预设时长,则说明API响应比较慢,可能使由于网络拥堵或网关有问题造成的,此时对应的指标数据对API网关的健康度影响程度较大,因此可划分为主要指标数据。从而使后续进行API网关的健康度预测时,可针对网络响应质量进行API网关的健康度预测,提高后续API网关的健康度预测的准确性。In one embodiment, each index data is clustered according to the API response time corresponding to each index data, each index data whose corresponding API response time is shorter than the preset duration is divided into main index data, and the number of API visits greater than or Each indicator data equal to the preset duration is divided into secondary indicator data. Wherein, the preset duration can be set according to actual conditions. 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 normal and the system is running normally. At this time, the corresponding indicator data has little impact on the health of the API gateway, so it can be divided into secondary Need indicator data; if the API response time is longer 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 Can be divided into main indicator data. Therefore, when predicting the health degree of the API gateway in the future, the health degree prediction of the API gateway can be performed according to the network response quality, and the accuracy of the health degree prediction of the subsequent API gateway can be improved.

为进一步提高后续针对API网关的健康度预测的准确性,在一实施例中,所述将各所述指标数据,根据各所述指标数据对应的API响应时间进行聚类,确定对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型,包括:In order to further improve the accuracy of subsequent health degree prediction for the API gateway, in one embodiment, the index data is clustered according to the API response time corresponding to each of the index data, and the corresponding API response is determined. The preset data type of each indicator data whose time is longer than the preset duration, and the preset data type of each indicator data whose API response time is less than or equal to the preset duration include:

将各所述指标数据根据各所述指标数据对应的系统类型进行聚类,获取各所述系统类型的指标数据;clustering each of the index data according to the system type corresponding to each of the index data, and obtaining the index data of each of the system types;

将所述系统类型中的各指标数据,根据所述系统类型中的各指标数据对应的API响应时间进行聚类,确定所述系统类型中,对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及确定所述系统类型中,API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型;Cluster the index data in the system type according to the API response time corresponding to the index data in the system type, and determine the system types whose corresponding API response time is longer than the preset duration. The preset data type of the indicator data, and the preset data type of each indicator data whose API response time is less than or equal to the preset duration in the system type;

其中,所述预设时长根据所述系统类型确定。Wherein, the preset duration is determined according to the system type.

在一实施例中,预先将不同系统类型进行不同预设时长的绑定。如系统类型为自主研发的系统,其对应的API响应时间的预设时长为预设时长1;系统类型为第三方系统,对应的API响应时间的预设时长为预设时长2。在获取到各指标数据后,先根据各系统类型对各指标数据进行聚类,得到各系统类型的指标数据,如对应的系统类型为第三方系统的指标数据。然后将对应的系统类型为第三方系统的各指标数据,根据对应的API响应时间进行聚类,获取对应的API响应时间大于预设时长2的各指标数据作为主要指标数据,获取对应的API响应时间小于或等于预设时长2的各指标数据作为次要指标数据。系统类型为自主研发的系统或其他评定平台的指标数据同理。从而联合系统类型的聚类以及API响应时间的聚类,对各指标数据进行划分,得到各主要指标数据和各次要指标数据。由于考虑了系统类型和API响应时间的因素,因此使各指标数据的分类结果更为准确,从而使得后续根据分类后的各指标数据进行API网关的健康度预测时,预测结果更准确。In an embodiment, different system types are bound for different preset durations in advance. If the system type is a self-developed system, the default duration of the corresponding API response time is preset duration 1; if the system type is a third-party system, the default duration of the corresponding API response time is preset duration 2. After obtaining the index data, first cluster the index data according to each system type to obtain the index data of each system type, for example, the corresponding system type is the index data of a third-party system. Then cluster the index data whose corresponding system type is a third-party system according to the corresponding API response time, obtain the index data whose corresponding API response time is greater than the preset duration 2 as the main index data, and obtain the corresponding API response Each indicator data whose time is less than or equal to the preset duration 2 is used as secondary indicator data. The same applies to index data of self-developed systems or other evaluation platforms. In this way, the clustering of the system type and the clustering of the API response time are combined to divide the data of each index, and the data of each main index and each secondary index are obtained. Since the factors of system type and API response time are considered, the classification result of each index data is more accurate, so that when the health degree of the API gateway is predicted based on the classified index data, the prediction result is more accurate.

在一实施例中,还可以预先将不同系统类型进行不同预设值以及不同预设时长的绑定。如系统类型为自主研发的系统,其对应的API访问次数的预设值为预设值A,同时对应的API响应时间的预设时长为预设时长1;系统类型为第三方系统,对应的API访问次数的预设值为预设值B,同时对应的API响应时间的预设时长为预设时长2。在获取到各指标数据后,先根据各系统类型对各指标数据进行聚类,得到各系统类型的指标数据,如对应的系统类型为第三方系统的指标数据。然后将对应的系统类型为第三方系统的各指标数据,根据对应的API访问次数,以及对应的API响应时间进行聚类,获取API访问次数大于预设值B,且对应的API响应时间大于预设时长2的各指标数据作为主要指标数据,并将其他各指标数据作为次要指标数据。系统类型为自主研发的系统或其他评定平台的指标数据同理。从而联合系统类型、API网关访问的次数以及API响应时间的聚类,对各指标数据进行划分,得到各主要指标数据和各次要指标数据。由于考虑了系统类型、API网关访问的次数和API响应时间的因素,因此使各指标数据的分类结果更为准确,从而使得后续根据分类后的各指标数据进行API网关的健康度预测时,预测结果更准确。In an embodiment, different system types may also be bound in advance with different preset values and different preset durations. If the system type is a self-developed system, the default value of the corresponding number of API visits is preset value A, and the default duration of the corresponding API response time is preset duration 1; the system type is a third-party system, and the corresponding The preset value of the number of API visits is preset value B, and the preset duration of the corresponding API response time is preset duration 2. After obtaining the index data, first cluster the index data according to each system type to obtain the index data of each system type, for example, the corresponding system type is the index data of a third-party system. Then cluster the index data of the corresponding system type as the third-party system according to the corresponding number of API visits and the corresponding API response time, and obtain the number of API visits greater than the preset value B, and the corresponding API response time is greater than the preset value Let the index data of duration 2 be the main index data, and the other index data be the secondary index data. The same applies to index data of self-developed systems or other evaluation platforms. In this way, the clustering of the system type, the number of API gateway visits and the API response time is combined to divide the data of each index, and obtain the data of each main index and each secondary index. Due to the consideration of the system type, the number of API gateway visits and the API response time, the classification results of each index data are more accurate, so that when the health of the API gateway is predicted based on the classified index data, the prediction The result is more accurate.

在步骤102中,以预设数据类型为主要指标数据类型和次要指标数据类型为例,将主要指标数据类型中的各主要指标数据,输入由主要指标数据类型的历史主要指标数据训练得到的第一预测模型中,即可得到第一健康度分数。并将次要指标数据类型中的各次要指标数据,输入由次要指标数据类型的历史次要指标数据训练得到的第二预测模型中,即可得到第二健康度分数。In step 102, taking the preset data type as the main index data type and the secondary index data type as an example, each main index data in the main index data type is input into the training result obtained from the historical main index data of the main index data type In the first prediction model, the first health score can be obtained. And input the secondary index data in the secondary index data type into the second prediction model obtained by training the historical secondary index data of the secondary index data type, so as to obtain the second health degree score.

在一实施例中,在得到第一健康度分数和第二健康度分数后,还可以将各主要指标数据作为第一预测模型的训练样本,对第一预测模型进行优化训练,以及将各次要指标数据作为第二预测模型的训练样本,对第二预测模型进行优化训练,从而使得预测模型的精确度更加高,预测出的分数更加精准。In an embodiment, after obtaining the first health score and the second health score, each main indicator data can also be used as a training sample of the first prediction model, and the first prediction model can be optimized for training, and each time The index data is used as the training sample of the second prediction model, and the second prediction model is optimized for training, so that the accuracy of the prediction model is higher and the predicted score is more accurate.

在一实施例中,在得到各预设数据类型对应的健康度分数后,可将各健康度分数发送至指定终端的展示界面,对各健康度分数进行可视化展示。示例性的,当预设数据类型为主要指标数据类型和次要指标数据类型时,可通过展示界面显示主要指标数据类型对应的健康度分数,并在展示界面生成用于显示次要指标数据类型对应的健康度分数的指标控件。当用户通过指定终端点击该指标控件时,则在展示界面显示次要指标数据类型对应的健康度分数;若用户未点击该指标控件,则将次要指标数据类型对应的健康度分数进行隐藏。In an embodiment, after obtaining the health scores corresponding to each preset data type, each health score can be sent to a display interface of a designated terminal, and each health score can be visually displayed. Exemplarily, when the preset data types are the main indicator data type and the secondary indicator data type, the health score corresponding to the main indicator data type can be displayed through the display interface, and the data type used to display the secondary indicator data can be generated on the display interface The indicator control of the corresponding health score. When the user clicks the indicator control through the specified terminal, the health score corresponding to the secondary indicator data type is displayed on the display interface; if the user does not click the indicator control, the health score corresponding to the secondary indicator data type is hidden.

在步骤103中,在获取到各预设数据类型对应的各健康度分数后,可将各健康度分数,根据各预设数据类型对应的预设权重进行加权,从而确定API网关的健康度。In step 103, after obtaining the health scores corresponding to each preset data type, each health score can be weighted according to the preset weight corresponding to each preset data type, so as to determine the health of the API gateway.

考虑到通过加权确定API网关的健康度时,一些指标数据的影响会被淡化,导致最终预测的API网关的健康度可能不够准确。为提高预测到的API网关的健康度的准确性,在一实施例中,根据各所述预设数据类型对应的各健康度分数,确定所述API网关的健康度,包括:Considering that when determining the health of the API gateway through weighting, the impact of some indicator data will be diluted, resulting in the final prediction of the 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 the health scores corresponding to each of the preset data types, including:

将所述预设数据类型对应的所述健康度分数,与所述预设数据类型对应的预设熔断阈值进行比对,获取所述预设数据类型对应的比对结果;comparing the health score corresponding to the preset data type with the preset fusing threshold corresponding to the preset data type, and obtaining a comparison result corresponding to the preset data type;

当各所述预设数据类型对应的各比对结果,均为所述健康度分数大于所述预设熔断阈值时,则判定所述API网关正常。When each comparison result corresponding to each preset data type is that the health score is greater than the preset fusing threshold, it is determined that the API gateway is normal.

示例性的,预设数据类型包括主要指标数据类型和次要指标数据类型,主要指标数据类型预设有对应的第一预设熔断阈值,次要指标数据类型预设有对应的第二预设熔断阈值。在得到主要指标数据类型的健康度分数,以及次要指标数据类型的健康度分数后,将主要指标数据类型的健康度分数,与第一预设熔断阈值进行比较,以及将次要指标数据类型的健康度分数,与第二预设熔断阈值进行比较。若主要指标数据类型的健康度分数,大于第一预设熔断阈值,同时次要指标数据类型的健康度分数,大于第二预设熔断阈值,则判定API网关正常。Exemplarily, the preset data type includes a primary index data type and a secondary index data type, the primary index data type is preset with a corresponding first preset fusing threshold, and the secondary index data type is preset with a corresponding second preset Fuse threshold. After getting the health score of the main indicator data type and the health score of the secondary indicator data type, compare the health score of the main indicator data type with the first preset fusing threshold, and compare the health score of the secondary indicator data type The health score of is compared with the second preset fusing 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, it is determined that the API gateway is normal.

为了能够更加方便管控,在一实施例中,还包括:In order to be more convenient to manage and control, in an embodiment, it also includes:

当各所述比对结果中,任一所述比对结果为所述健康度分数小于或等于所述预设熔断阈值时,关闭所述API网关。When any of the comparison results is that the health score is less than or equal to the preset fusing threshold, the API gateway is closed.

示例性的,当主要指标数据类型的健康度分数,小于或等于第一预设熔断阈值,或者次要指标数据类型的健康度分数,小于或等于第二预设熔断阈值,则判定API网关的健康度异常,此时触发熔断机制,由API网关熔断器实施熔断并关闭该API网关。Exemplarily, when the health score of the primary 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, it is determined that the API gateway The health degree is abnormal. At this time, the fuse mechanism is triggered, and the API gateway fuse implements the fuse and closes the API gateway.

通过当健康度分数小于或等于预设熔断阈值时,主动触发熔断,从而可以减少了API网关后端服务资源的投入,同时又提升了API网关问题的处理效率。By proactively triggering a circuit breaker when the health score is less than or equal to the preset circuit breaker threshold, the investment in API gateway back-end service resources can be reduced, and at the same time, the processing efficiency of API gateway problems can be improved.

在一实施例中,当API网关因触发熔断而关闭的同时,还可获取熔断的API网关的信息产生警报,并上传后台,且在指定终端的显示界面上显示熔断API网关的信息,如该API网关的标识,从而进一步提升处理效率。In one embodiment, when the API gateway is closed due to the triggering of the fuse, the information of the fuse API gateway can also be obtained to generate an alarm, and uploaded to the background, and the information of the fuse API gateway is displayed on the display interface of the designated terminal, as shown in this The identifier of the API gateway, thereby further improving processing efficiency.

下面对本发明提供的网关的健康度预测装置进行描述,下文描述的网关的健康度预测装置与上文描述的网关的健康度预测方法可相互对应参照。The gateway health degree prediction device provided by the present invention is described below, and the gateway health degree prediction device described below and the gateway health degree prediction method described above can be referred to in correspondence.

在一实施例中,如图2所示,提供了一种网关的健康度预测装置,包括:In one embodiment, as shown in FIG. 2 , a device for predicting the health degree of a gateway is provided, including:

数据类型确定模块210,用于将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;The data type determination module 210 is used to cluster the index data collected from the API application programming interface gateway according to the preset classification conditions, and determine the preset data type of each index data;

健康度分数获取模块220,用于将所述预设数据类型中的各指标数据,输入根据所述预设数据类型对应的各历史指标数据训练得到的预测模型中,获取所述预设数据类型对应的健康度分数;The health score acquisition module 220 is configured to input each index data in the preset data type into a prediction model trained according to the historical index data corresponding to the preset data type, and obtain the preset data type Corresponding health score;

健康度预测模块230,用于根据各所述预设数据类型对应的各健康度分数,确定所述API网关的健康度。The health degree prediction module 230 is configured to determine the health degree of the API gateway according to each health degree score corresponding to each preset data type.

通过将从API网关采集到的各指标数据进行聚类后,将每个预设数据类型的指标数据输入由历史指标数据训练好的预测模型中,得到每个预设数据类型对应的健康度分数,以根据各预设数据类型对应的各健康度分数实现API网关的健康度预测,从而能够通过API网关的各指标数据,完成API网关的健康度画像,避免了API网关健康出现问题时,再被动地去收集数据进行分析,而是主动检测并预判API网关的健康情况,进而提高网络服务的运维效率,降低运维成本。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 the historical indicator data, and obtain the health score corresponding to each preset data type , to realize the health degree prediction of the API gateway based on the health degree scores corresponding to each preset data type, so that the health degree portrait of the API gateway can be completed through the various index data of the API gateway, avoiding the health problems of the API gateway. Passively collect data for analysis, but actively detect and predict the health of the API gateway, thereby improving the operation and maintenance efficiency of network services and reducing operation and maintenance costs.

在一实施例中,数据类型确定模块210具体用于:In one embodiment, the data type determining module 210 is specifically used for:

将各所述指标数据,根据在预设时段内被所述API网关访问的次数进行聚类,确定访问次数大于预设值的各所述指标数据的预设数据类型,以及访问次数小于或等于所述预设值的各所述指标数据的预设数据类型。Clustering each of the index data according to the number of visits by the API gateway within a preset period of time, determining the preset data type of each of the index data whose number of visits is greater than a preset value, and the number of visits is less than or equal to A preset data type of each of the index data of the preset value.

在一实施例中,数据类型确定模块210具体用于:In one embodiment, the data type determining module 210 is specifically used for:

将各所述指标数据,根据各所述指标数据对应的系统类型进行聚类,获取各所述系统类型的指标数据;clustering each of the index data according to the system type corresponding to each of the index data, and obtaining the index data of each of the system types;

将所述系统类型中的各指标数据,根据在预设时段内被所述API网关访问的次数进行聚类,确定所述系统类型中,访问次数大于预设值的各所述指标数据的预设数据类型,以及所述系统类型中,访问次数小于或等于所述预设值的各所述指标数据的预设数据类型;Clustering the index data in the system type according to the number of accesses by the API gateway within a preset period of time, and determining the expected value of each index data in the system type whose access times are greater than a preset value. Set the data type, and the preset data type of each of the index data whose access times are less than or equal to the preset value in the system type;

其中,所述预设值根据所述系统类型确定。Wherein, the preset value is determined according to the system type.

在一实施例中,数据类型确定模块210具体用于:In one embodiment, the data type determining module 210 is specifically used for:

将各所述指标数据,根据各所述指标数据对应的API响应时间进行聚类,确定对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型。Clustering each of the index data according to the API response time corresponding to each of the index data, and determining the preset data type of each of the index data whose corresponding API response time is greater than the preset duration, and the API response time is less than or A preset data type of each indicator data equal to the preset duration.

在一实施例中,数据类型确定模块210具体用于:In one embodiment, the data type determining module 210 is specifically used for:

将各所述指标数据根据各所述指标数据对应的系统类型进行聚类,获取各所述系统类型的指标数据;clustering each of the index data according to the system type corresponding to each of the index data, and obtaining the index data of each of the system types;

将所述系统类型中的各指标数据,根据所述系统类型中的各指标数据对应的API响应时间进行聚类,确定所述系统类型中,对应的API响应时间大于预设时长的各所述指标数据的预设数据类型,以及确定所述系统类型中,API响应时间小于或等于所述预设时长的各所述指标数据的预设数据类型;Cluster the index data in the system type according to the API response time corresponding to the index data in the system type, and determine the system types whose corresponding API response time is longer than the preset duration. The preset data type of the indicator data, and the preset data type of each indicator data whose API response time is less than or equal to the preset duration in the system type;

其中,所述预设时长根据所述系统类型确定。Wherein, the preset duration is determined according to the system type.

在一实施例中,健康度预测模块230具体用于:In one embodiment, the health degree prediction module 230 is specifically used for:

将所述预设数据类型对应的所述健康度分数,与所述预设数据类型对应的预设熔断阈值进行比对,获取所述预设数据类型对应的比对结果;comparing the health score corresponding to the preset data type with the preset fusing threshold corresponding to the preset data type, and obtaining a comparison result corresponding to the preset data type;

当各所述预设数据类型对应的各比对结果,均为所述健康度分数大于所述预设熔断阈值时,则判定所述API网关正常。When each comparison result corresponding to each preset data type is that the health score is greater than the preset fusing threshold, it is determined that the API gateway is normal.

在一实施例中,健康度预测模块230还用于:In one embodiment, the health degree prediction module 230 is also used for:

当各所述比对结果中,任一所述比对结果为所述健康度分数小于或等于所述预设熔断阈值时,关闭所述API网关。When any of the comparison results is that the health score is less than or equal to the preset fusing threshold, the API gateway is closed.

图3示例了一种电子设备的实体结构示意图,如图3所示,该电子设备可以包括:处理器(processor)810、通信接口(Communication Interface)820、存储器(memory)830和通信总线840,其中,处理器810,通信接口820,存储器830通过通信总线840完成相互间的通信。处理器810可以调用存储器830中的计算机程序,以执行网关的健康度预测方法的步骤,例如包括:FIG. 3 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 3 , the electronic device may include: a processor (processor) 810, a communication interface (Communication Interface) 820, a memory (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 the computer program in the memory 830 to execute the steps of the method for predicting the health of the gateway, including, for example:

将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;Cluster the index data collected from the API application programming interface gateway according to the preset classification conditions, and determine the preset data type of each index data;

将所述预设数据类型中的各指标数据,输入根据所述预设数据类型对应的各历史指标数据训练得到的预测模型中,获取所述预设数据类型对应的健康度分数;Input each index data in the preset data type into the prediction model obtained according to the training of each historical index data corresponding to the preset data type, and obtain the health score corresponding to the preset data type;

根据各所述预设数据类型对应的各所述健康度分数,确定所述API网关的健康度。The health of the API gateway is determined according to the health scores corresponding to the preset data types.

此外,上述的存储器830中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above logic instructions in the memory 830 may be implemented in the form of software functional units and when sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .

另一方面,本申请实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各实施例所提供的网关的健康度预测方法的步骤,例如包括:On the other hand, the embodiment of the present application also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and the computer program is executed by a processor , the computer can execute the steps of the method for predicting the health of the gateway provided by the above embodiments, for example, including:

将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;Cluster the index data collected from the API application programming interface gateway according to the preset classification conditions, and determine the preset data type of each index data;

将所述预设数据类型中的各指标数据,输入根据所述预设数据类型对应的各历史指标数据训练得到的预测模型中,获取所述预设数据类型对应的健康度分数;Input each index data in the preset data type into the prediction model obtained according to the training of each historical index data corresponding to the preset data type, and obtain the health score corresponding to the preset data type;

根据各所述预设数据类型对应的各所述健康度分数,确定所述API网关的健康度。The health degree of the API gateway is determined according to each health degree score corresponding to each preset data type.

另一方面,本申请实施例还提供一种处理器可读存储介质,所述处理器可读存储介质存储有计算机程序,所述计算机程序用于使处理器执行上述各实施例提供的方法的步骤,例如包括:On the other hand, the embodiment of the present application also provides a processor-readable storage medium, the processor-readable storage medium stores a computer program, and the computer program is used to make the processor execute the methods provided by the above-mentioned embodiments Steps include, for example:

将从API应用程序编程接口网关采集到的各指标数据,根据预设分类条件进行聚类,确定各指标数据的预设数据类型;Cluster the index data collected from the API application programming interface gateway according to the preset classification conditions, and determine the preset data type of each index data;

将所述预设数据类型中的各指标数据,输入根据所述预设数据类型对应的各历史指标数据训练得到的预测模型中,获取所述预设数据类型对应的健康度分数;Input each index data in the preset data type into the prediction model obtained according to the training of each historical index data corresponding to the preset data type, and obtain the health score corresponding to the preset data type;

根据各所述预设数据类型对应的各所述健康度分数,确定所述API网关的健康度。The health of the API gateway is determined according to the health scores corresponding to the preset data types.

所述处理器可读存储介质可以是处理器能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器(例如软盘、硬盘、磁带、磁光盘(MO)等)、光学存储器(例如CD、DVD、BD、HVD等)、以及半导体存储器(例如ROM、EPROM、EEPROM、非易失性存储器(NANDFLASH)、固态硬盘(SSD))等。The processor-readable storage medium can be any available medium or data storage device that can be accessed by a processor, including but not limited to magnetic storage (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.), and semiconductor memory (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state disk (SSD)), etc.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims (10)

1. A method for predicting the health of a gateway, comprising:
clustering all index data acquired from an API application programming interface gateway according to preset classification conditions, and determining preset data types of all index data;
inputting each index data in the preset data type into a prediction model obtained by training according to each historical index data corresponding to the preset data type, and obtaining a health score corresponding to the preset data type;
and determining the health degree of the API gateway according to the health degree scores corresponding to the preset data types.
2. The method for predicting the health of a gateway according to claim 1, wherein clustering the index data collected from the API gateway according to a predetermined classification condition, determining a predetermined data type of the index data, includes:
Clustering the index data according to the access times of the API gateway in a preset period, and determining the preset data type of the index data with the access times larger than a preset value and the preset data type of the index data with the access times smaller than or equal to the preset value.
3. The method according to claim 2, wherein clustering each of the index data according to the number of accesses by the API gateway in a first preset period of time, determining a preset data type of each of the index data having the number of accesses greater than a preset value, and a preset data type of each of the index data having the number of accesses less than or equal to the preset value, comprises:
clustering the index data according to the system types corresponding to the index data to obtain the index data of the system types;
clustering each index data in the system type according to the access times of the API gateway in a preset period, and determining the preset data type of each index data with the access times larger than a preset value in the system type and the preset data type of each index data with the access times smaller than or equal to the preset value in the system type;
Wherein the preset value is determined according to the system type.
4. The method for predicting the health of a gateway according to claim 1, wherein clustering the index data collected from the API gateway according to a predetermined classification condition, determining a predetermined data type of the index data, includes:
clustering the index data according to the API response time corresponding to the index data, and determining the preset data type of the index data with the corresponding API response time being longer than the preset time length and the preset data type of the index data with the API response time being shorter than or equal to the preset time length.
5. The method for predicting the health of a gateway according to claim 4, wherein said clustering each of the index data according to the API response time corresponding to each of the index data, determining the preset data type of each of the index data having the corresponding API response time greater than a preset duration, and the preset data type of each of the index data having the API response time less than or equal to the preset duration, comprises:
clustering the index data according to the system types corresponding to the index data to obtain the index data of the system types;
Clustering each index data in the system type according to the API response time corresponding to each index data in the system type, determining the preset data type of each index data with the corresponding API response time being longer than the preset duration in the system type, and determining the preset data type of each index data with the API response time being shorter than or equal to the preset duration in the system type;
the preset duration is determined according to the system type.
6. The method for predicting the health of a gateway according to any one of claims 1 to 5, wherein determining the health of the API gateway according to the health score corresponding to each of the preset data types includes:
comparing the health score corresponding to the preset data type with a preset fusing threshold corresponding to the preset data type to obtain a comparison result corresponding to the preset data type;
and when the health score is larger than the preset fusing threshold value according to the comparison results corresponding to the preset data types, judging that the API gateway is normal.
7. The method of claim 6, further comprising:
And closing the API gateway when any comparison result in the comparison results is that the health score is smaller than or equal to the preset fusing threshold value.
8. A health prediction apparatus of a gateway, comprising:
the data type determining module is used for clustering all index data acquired from the API application programming interface gateway according to preset classification conditions and determining preset data types of all the index data;
the health degree score acquisition module is used for inputting each index data in the preset data type into a prediction model obtained by training according to each historical index data corresponding to the preset data type to acquire a health degree score corresponding to the preset data type;
and the health degree prediction module is used for determining the health degree of the API gateway according to each health degree score corresponding to each preset data type.
9. An electronic device comprising a processor and a memory storing a computer program, characterized in that the processor implements the steps of the method for predicting the health of a gateway according to any one of claims 1 to 7 when executing the computer program.
10. A computer program product comprising a computer program, characterized in that the computer program when executed by a processor implements the steps of the method for predicting the health of a gateway according to any one of claims 1 to 7.
CN202111440204.3A 2021-11-30 2021-11-30 Gateway health prediction method and device Active CN116208513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111440204.3A CN116208513B (en) 2021-11-30 2021-11-30 Gateway health prediction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111440204.3A CN116208513B (en) 2021-11-30 2021-11-30 Gateway health prediction method and device

Publications (2)

Publication Number Publication Date
CN116208513A true CN116208513A (en) 2023-06-02
CN116208513B CN116208513B (en) 2024-11-15

Family

ID=86506337

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111440204.3A Active CN116208513B (en) 2021-11-30 2021-11-30 Gateway health prediction method and device

Country Status (1)

Country Link
CN (1) CN116208513B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117221049A (en) * 2023-09-26 2023-12-12 石家庄常宏智能科技有限公司 Gateway data intelligent acquisition method and system
CN118413454A (en) * 2024-06-27 2024-07-30 新华三人工智能科技有限公司 Abnormality prediction method and device of network equipment and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886481A (en) * 2017-02-28 2017-06-23 深圳市华傲数据技术有限公司 A kind of system health degree static analysis Forecasting Methodology and device
CN111092811A (en) * 2018-10-24 2020-05-01 北京金山云网络技术有限公司 A request processing method, device, API gateway and readable storage medium
CN111756579A (en) * 2020-06-24 2020-10-09 北京百度网讯科技有限公司 Abnormity early warning method, device, equipment and storage medium
CN111931189A (en) * 2020-08-14 2020-11-13 中国工商银行股份有限公司 API interface transfer risk detection method and device and API service system
CN112468326A (en) * 2020-11-11 2021-03-09 北京工业大学 Access flow prediction method based on time convolution neural network
CN112527601A (en) * 2020-12-17 2021-03-19 航天信息股份有限公司 Monitoring early warning method and device
US20210168127A1 (en) * 2019-12-03 2021-06-03 Aetna Inc. Hybrid cloud application programming interface management platform
CN113297307A (en) * 2020-08-15 2021-08-24 阿里巴巴集团控股有限公司 Database request identification and anomaly detection method, device, equipment and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886481A (en) * 2017-02-28 2017-06-23 深圳市华傲数据技术有限公司 A kind of system health degree static analysis Forecasting Methodology and device
CN111092811A (en) * 2018-10-24 2020-05-01 北京金山云网络技术有限公司 A request processing method, device, API gateway and readable storage medium
US20210168127A1 (en) * 2019-12-03 2021-06-03 Aetna Inc. Hybrid cloud application programming interface management platform
CN111756579A (en) * 2020-06-24 2020-10-09 北京百度网讯科技有限公司 Abnormity early warning method, device, equipment and storage medium
CN111931189A (en) * 2020-08-14 2020-11-13 中国工商银行股份有限公司 API interface transfer risk detection method and device and API service system
CN113297307A (en) * 2020-08-15 2021-08-24 阿里巴巴集团控股有限公司 Database request identification and anomaly detection method, device, equipment and medium
CN112468326A (en) * 2020-11-11 2021-03-09 北京工业大学 Access flow prediction method based on time convolution neural network
CN112527601A (en) * 2020-12-17 2021-03-19 航天信息股份有限公司 Monitoring early warning method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117221049A (en) * 2023-09-26 2023-12-12 石家庄常宏智能科技有限公司 Gateway data intelligent acquisition method and system
CN117221049B (en) * 2023-09-26 2024-04-09 石家庄常宏智能科技有限公司 Gateway data intelligent acquisition method and system
CN118413454A (en) * 2024-06-27 2024-07-30 新华三人工智能科技有限公司 Abnormality prediction method and device of network equipment and electronic equipment
CN118413454B (en) * 2024-06-27 2024-09-17 新华三人工智能科技有限公司 Abnormality prediction method and device of network equipment and electronic equipment

Also Published As

Publication number Publication date
CN116208513B (en) 2024-11-15

Similar Documents

Publication Publication Date Title
US20220255817A1 (en) Machine learning-based vnf anomaly detection system and method for virtual network management
CN105590055B (en) Method and device for identifying user credible behaviors in network interaction system
US11516240B2 (en) Detection of anomalies associated with fraudulent access to a service platform
CN112003846B (en) A credit threshold training, IP address detection method and related device
CN113298638B (en) Root cause location method, electronic equipment and storage medium
CN116208513A (en) Gateway Health Prediction Method and Device
WO2020232902A1 (en) Abnormal object identification method and apparatus, computing device, and storage medium
CN111343127A (en) Method, device, medium and equipment for improving crawler recognition recall rate
CN111176565A (en) Method and device for determining storage load of application
CN115935220A (en) Behavior analysis method, device, electronic device and computer program product
CN110866831A (en) Asset activity level determination method and device and server
CN114169439A (en) Method, device, electronic device and readable medium for identifying abnormal communication number
CN117421145A (en) A heterogeneous hard disk system fault early warning method and device
CN116560794A (en) Exception handling method and device for virtual machine, medium and computer equipment
CN115426161A (en) Abnormal device identification method, apparatus, device, medium, and program product
CN111654853B (en) Data analysis method based on user information
CN117527523A (en) Cloud computing-based server security monitoring system
CN114363082B (en) Network attack detection method, device, equipment and computer readable storage medium
CN116963072A (en) Fraud user early warning method and device, electronic equipment and storage medium
CN116483670A (en) Wind control method and device based on user access behaviors
CN115687034A (en) Method and device for determining availability of service system plane
CN114022712A (en) User classification method and device, computer equipment and storage medium
US20250013916A1 (en) Systems and methods for identifying model degradation and performing model retraining
US20190138931A1 (en) Apparatus and method of introducing probability and uncertainty via order statistics to unsupervised data classification via clustering
US20250036971A1 (en) Managing data processing system failures using hidden knowledge from predictive models

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant