API gateway fault location method, device, system and medium
Through automated data feature screening and establishment of corresponding relationships, the problem of low efficiency of API gateway fault location is solved, fast and accurate fault location is achieved, and time and labor costs are saved.
Patent Information
- Application Number
- CN202210719973.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-06-23
AI Technical Summary
Existing technology makes it difficult to quickly and accurately locate API gateway faults, especially in cluster deployment and high traffic situations, resulting in manual troubleshooting that is time-consuming and error-prone, affecting user use.
By obtaining the API gateway interface access data, establishing the corresponding relationship between data characteristics and interface access data, filtering error data characteristics to locate fault clusters and users, and realizing automated fault location.
API gateway faults can be accurately located without manual troubleshooting, reducing time and labor costs and improving fault handling efficiency.
Smart Images

Figure CN115102845B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to an API gateway fault locating method, device, system and medium. Background Art
[0002] API (Application Programming Interface) gateways serve as the unified entrance and exit for the civil aviation industry. When a failure occurs, since API gateways are usually deployed in clusters and the number of users accessing the API gateways is very large, it takes a very long time to manually check the logs to find the cause of the failure, which affects user usage. In addition, manual troubleshooting is prone to errors.
[0003] Therefore, how to quickly and accurately locate the cause of the fault is a technical problem that needs to be solved in this field. Summary of the invention
[0004] In view of this, the purpose of this application is to provide an API gateway fault location method, device, system and medium.
[0005] To achieve the above purpose, this application has the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides an API gateway fault location method, including:
[0007] Get API gateway interface access data;
[0008] Establishing a correspondence between the interface access data and predefined data features;
[0009] Filtering the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data;
[0010] According to the error data, the cluster and user where the fault corresponding to the error data occurs are obtained to locate the API gateway fault.
[0011] In a second aspect, an embodiment of the present application provides an API gateway fault locating device, including:
[0012] An acquisition unit is used to acquire API gateway interface access data;
[0013] An establishing unit, used for establishing a corresponding relationship between the interface access data and predefined data features;
[0014] A screening unit, screening the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data;
[0015] The positioning unit is used to obtain the cluster and user where the fault corresponding to the error data occurs according to the error data, so as to locate the API gateway fault.
[0016] An embodiment of the present application provides an API gateway fault locating method, device, system and medium, the method comprising: obtaining API gateway interface access data, establishing a correspondence between the interface access data and predefined data features, filtering the interface access data according to error data features in the predefined data features to obtain error data in the interface access data, obtaining the cluster and user where the fault corresponding to the error data occurs according to the error data, so as to locate the API gateway fault, and accurately locate the API gateway fault without manually troubleshooting the cause of the fault, thereby reducing time waste and saving time and labor costs.
[0017] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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.
[0019] Figure 1 A flowchart of an API gateway fault locating method provided in an embodiment of the present application is shown;
[0020] Figure 2 A schematic diagram of an API gateway fault locating system provided in an embodiment of the present application is shown;
[0021] Figure 3 A schematic diagram showing information included in offline aggregated access data provided by an embodiment of the present application is shown;
[0022] Figure 4 A schematic diagram showing information included in offline aggregated error data provided by an embodiment of the present application is shown;
[0023] Figure 5 A schematic diagram of an API gateway fault locating device provided in an embodiment of the present application is shown.
[0024] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. DETAILED DESCRIPTION
[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0026] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0027] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0028] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0029] As described in the background technology, the API (Application Programming Interface) gateway serves as a unified entrance and exit for providing services in the civil aviation industry. When a failure occurs, since the API gateway is usually deployed in a cluster and the number of users visiting the API gateway is very large, it takes a very long time to manually check the logs and troubleshoot the cause of the failure, which affects user usage, and manual troubleshooting is prone to errors.
[0030] Therefore, how to quickly and accurately locate the cause of the fault is a technical problem that needs to be solved in this field.
[0031] In order to solve the above technical problems, the embodiments of the present application provide an API gateway fault locating method, device, system and medium, the method comprising: obtaining API gateway interface access data, establishing a correspondence between the interface access data and predefined data features, filtering the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data, and obtaining the cluster and user where the fault corresponding to the error data occurs according to the error data to locate the API gateway fault. The API gateway fault can be accurately located without manual troubleshooting of the cause of the fault, thereby reducing time waste and saving time and labor costs.
[0032] Exemplary Methods
[0033] See also Figure 1 As shown, it is a flowchart of an API gateway fault locating method provided in an embodiment of the present application, including:
[0034] S101: Obtain API gateway interface access data.
[0035] In the embodiment of the present application, the API gateway serves as the unified entrance and exit for providing services on the civil aviation industry network. The number of users visiting the API gateway will be very large, so the performance and stability of the API gateway are crucial. In order to locate possible failures in the current API gateway, it is first necessary to obtain access data of the API gateway interface.
[0036] Specifically, when the API gateway is online or when a problem occurs, it needs to be monitored in order to locate the API gateway failure in a timely manner. If only log analysis is performed on a single network server to locate the failure, the operation is relatively easy and you only need to be familiar with the operating system to view it.
[0037] However, the API gateways that provide services on the civil aviation network have a huge amount of traffic and call backends a lot, so they are deployed as large systems in a distributed manner. If the means of monitoring and locating faults at this time is only to view logs, it is obviously not enough. When some users have faults or even large-scale faults occur, the efficiency will be extremely low. The main problems faced are:
[0038] 1) Usually the gateway is deployed in a cluster, which means that when troubleshooting a problem, you need to troubleshoot many machines in the entire cluster;
[0039] 2) The gateway has a large number of visits, which means a large volume of logs, making text search very difficult;
[0040] 3) The problem may occur on all servers, or it may occur on only one server due to configuration, deployment, or machine reasons, making it impossible to accurately locate the fault.
[0041] These problems result in a very long time to troubleshoot the problem by manually checking the logs, which affects user usage and may also expand the scale of the failure. At this time, a method is needed to quickly locate the specific server through the key information of the failure, check the failure log, quickly discover the cause of the failure and solve the problem.
[0042] Specifically, the access data of the API gateway interface can be obtained by actively pushing it after the user calls the API gateway interface. Figure 2 As shown, it is a schematic diagram of an API gateway fault locating system provided in an embodiment of the present application. The API gateway service may include an interface access information push module, which may actively push structured logs to push out important features of user access to the gateway interface as structured logs. Optional API gateway interface access data may include visitor information (access IP address (Internet Protocol Address), access timestamp, request number, user name, user channel), call background service information (access interface name and version, access interface protocol type, background time), access gateway information (transaction number, execution result, error code, error message, gateway time), etc.
[0043] That is, in the embodiment of the present application, the API gateway interface access data is pushed in a structured manner by actively pushing the data, which can improve the efficiency of log parsing.
[0044] In one possible implementation, you can use the Kafka cluster to obtain API gateway interface access data, see Figure 2 As shown, the structured log of API gateway interface access data can be obtained through the Kafka cluster. Specifically, the Kafka cluster is an open source high-throughput distributed publish-subscribe message system, that is, it is a distributed streaming media platform. It can guarantee constant time access performance even for data above TB level, and its high-throughput streaming computing characteristics also ensure the transmission efficiency of a single machine. In the API gateway fault location system provided in the embodiment of the present application, the Kafka cluster is used as a distributed interface access log push pipeline to obtain API gateway interface access data.
[0045] S102: Establishing a correspondence between the interface access data and predefined data features.
[0046] In an embodiment of the present application, in order to accurately locate API gateway failures, after obtaining the API gateway interface access data, a correspondence between the interface access data and predefined data features can be established so that the data features can be used to accurately locate the API gateway failures subsequently.
[0047] In one possible implementation, see Figure 2 As shown, the Logstash tool can be used to store the correspondence between the interface access data and the predefined data features in the Elasticsearch engine. Specifically, the Logstash tool is mainly used to collect, analyze, and filter logs. In an embodiment of the present application, the Logstash tool can be used as a log filtering tool, that is, by receiving the structured log from Kafka, that is, obtaining the API gateway interface access data, generating feature key-value pairs according to the configuration, and storing them in Elasticsearch, that is, establishing the correspondence between the interface access data and the predefined data features.
[0048] Among them, the Elasticsearch engine is an open source distributed search engine that can provide three major functions: collecting, analyzing, and storing data.
[0049] S103: filtering the interface access data according to the error data features in the predefined data features to obtain error reporting data in the interface access data;
[0050] S104: Obtaining, according to the error data, a cluster and a user where a fault corresponding to the error data occurs, so as to locate the API gateway fault.
[0051] In an embodiment of the present application, the interface access data can be filtered according to the error data features in the predefined data features to obtain the error data in the interface access data, so as to facilitate the subsequent accurate positioning of the API gateway failure according to the error data.
[0052] In one possible implementation, the Kibana platform can be used to filter interface access data according to error data features in predefined data features to obtain error data in the interface access data. Kibana is an open source analysis and visualization platform. Kibana can be used to search and view data stored in Elasticsearch, and provide operation and maintenance personnel with a result display function for searching for specific feature values. That is, after using the Logstash tool to store the correspondence between the interface access data and the predefined data features in the Elasticsearch engine, kibana can be used to filter the interface access data according to the error data features in the predefined data features to obtain error data in the interface access data.
[0053] For example, error data features may include an execution result of business failure and an error message of timeout. Access request records containing all of the above features can be filtered out based on the error data features and the access interface name of the API gateway to obtain error data in the interface access data.
[0054] In an embodiment of the present application, after obtaining the error data in the interface access data, the cluster and user where the fault corresponding to the error data occurs can be obtained based on the error data to locate the API gateway fault. Specifically, the error data and the cluster and user where the fault corresponding to the error data occurs can be combined to determine whether the user access is irregular or the API gateway background application is running unhealthy, resulting in the inability to process the access request, so that subsequent operation and maintenance personnel can accurately handle the fault.
[0055] That is, in the embodiment of the present application, the API gateway interface access data is combined with ELK (ELK is a combination of Elasticsearch, logstash, and kibana, and is a real-time log analysis platform) as a message to be pushed externally. Compared with the traditional method of collecting data at the buried point, it will not have an intrusive performance impact on the gateway, thereby isolating the gateway fault location monitoring function from the gateway's normal service function.
[0056] In a possible implementation, the method provided in the embodiment of the present application also includes: using the Grafana platform to display the cluster and user where the fault corresponding to the error data occurs, so that subsequent operation and maintenance personnel can handle the fault in a timely manner according to the display.
[0057] Among them, Grafana is an open source visual data monitoring and data analysis platform that can display complex data clearly and concisely. Grafana also supports multiple data sources and alarm functions. You can use some open source dials and real-time log data provided by Grafana to provide visualization pages of various dimensions.
[0058] That is, in the embodiment of the present application, the personalized front-end page is customized using the open source tools kibana and grafana, which can display monitoring data from multiple angles and dimensions. It provides a query function based on the specified feature value within a period of time, so that the problem can be quickly located.
[0059] The above embodiments mainly show that in a real-time monitoring scenario, for API gateway fault location, real-time interface access data can be used to quickly locate problems with a specific request, but some problems, such as triggering interface fuses, sudden increases or decreases in interface access volume affected by seasonal factors, etc., require statistical aggregation data based on the interface to judge the problem. Therefore, the embodiments of the present application can also provide a visual monitoring function based on aggregated offline data to achieve API gateway fault location.
[0060] Specifically, real-time data usually contains high information redundancy because it needs to be located at a single request. When some interfaces are affected by seasonality or holidays, historical data within a longer time range is required as a reference. In the embodiments of the present application, see Figure 2 As shown, a scheduled task can be run once a day to query Elasticsearch and logs to obtain aggregated offline data of interface access. That is, in the case of offline aggregation, the scheduled task will calculate the daily interface access situation through statistics, process it into cluster access, user access, interface access and other information, and then store it in the database. Specifically, the aggregated offline data obtained by the query may include Figure 3 and Figure 4 Various information included in.
[0061] For example, if the number of visits to an API gateway interface increases or decreases suddenly, there may be many factors that may lead to this situation, or it may be normal. You can filter out all access records within a period of time based on the phenomenon of the problem and then analyze the cause of the problem.
[0062] Specifically, you can first schedule tasks to aggregate and calculate daily interface access situations and store them in the database by querying logs and Elasticsearch.
[0063] Then, you can obtain the sudden increase in the number of visits to a certain interface through daily offline aggregation or real-time monitoring visualization front-end, and query the total number of calls to the interface in the past period of time to see if there are periodic sudden increases or decreases. Take the ticket booking gateway interface as an example. During the National Day Golden Week, the number of visits to the interface increased sharply. By comparing the proportion of the sudden increase during last year's National Day, it was found that this was a normal phenomenon. However, if the error rate of the interface is too high, it is necessary to consider whether the API gateway backend cannot provide services 100% normally due to the sudden increase in visits, and thus issue a warning so that subsequent operation and maintenance personnel can make repairs in time according to the warning.
[0064] That is, in the embodiment of the present application, a scheduled task can be used to aggregate and organize the daily interface access situation and persist it, and display it as a daily visual report, so as to quickly understand the overall access situation of the past day. At the same time, intelligent monitoring capabilities are provided, such as combining historical data to analyze some interface services affected by seasonality and holidays.
[0065] An embodiment of the present application provides an API gateway fault locating method, the method comprising: obtaining API gateway interface access data, establishing a correspondence between the interface access data and predefined data features, filtering the interface access data according to error data features in the predefined data features to obtain error data in the interface access data, and obtaining a cluster and user where the fault corresponding to the error data occurs according to the error data to locate the API gateway fault. Accurately locating the API gateway fault can be achieved without manually troubleshooting the cause of the fault, thereby reducing time waste and saving time and labor costs.
[0066] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0067] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0068] Although operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0069] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0070] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0071] Exemplary Devices
[0072] See also Figure 5 As shown, an API gateway fault locating device provided in an embodiment of the present application includes:
[0073] The acquisition unit 501 is used to acquire API gateway interface access data;
[0074] An establishing unit 502, used to establish a corresponding relationship between the interface access data and a predefined data feature;
[0075] A screening unit 503, screening the interface access data according to the error data feature in the predefined data feature to obtain the error data in the interface access data;
[0076] The positioning unit 504 is used to obtain the cluster and user where the fault corresponding to the error data occurs according to the error data, so as to locate the API gateway fault.
[0077] In a possible implementation, the acquisition unit is specifically configured to:
[0078] Use the Kafka cluster to obtain API gateway interface access data.
[0079] In a possible implementation manner, the establishing unit is specifically configured to:
[0080] The corresponding relationship between the interface access data and the predefined data features is stored in the Elasticsearch engine using the Logstash tool.
[0081] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0082] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0083] Based on the above embodiments, the present application also provides an API gateway fault location system, including:
[0084] Memory for storing computer programs;
[0085] A processor is used to implement the steps of the above-mentioned API gateway fault locating method when executing the computer program.
[0086] Based on the above embodiments, the embodiments of the present application further provide a computer-readable medium, on which a computer program is stored, and when the computer program is processed and executed, the steps of the above-mentioned API gateway fault locating method are implemented.
[0087] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0088] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0089] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart.
[0090] According to one or more embodiments of the present disclosure, a method for locating an API gateway fault is provided, including:
[0091] Get API gateway interface access data;
[0092] Establishing a correspondence between the interface access data and predefined data features;
[0093] Filtering the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data;
[0094] According to the error data, the cluster and user where the fault corresponding to the error data occurs are obtained to locate the API gateway fault.
[0095] According to one or more embodiments of the present disclosure, a method for locating an API gateway fault is provided, wherein obtaining API gateway interface access data includes:
[0096] Use the Kafka cluster to obtain API gateway interface access data.
[0097] According to one or more embodiments of the present disclosure, a method for locating an API gateway fault is provided, wherein establishing a correspondence between the interface access data and predefined data features includes:
[0098] The corresponding relationship between the interface access data and the predefined data features is stored in the Elasticsearch engine using the Logstash tool.
[0099] According to one or more embodiments of the present disclosure, a method for locating an API gateway fault is provided, wherein the interface access data is filtered according to the error data features in the predefined data features to obtain the error data in the interface access data, including:
[0100] The Kibana platform is used to filter the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data.
[0101] According to one or more embodiments of the present disclosure, a method for locating an API gateway fault is provided.
[0102] The method further comprises:
[0103] The Grafana platform is used to display the cluster and user where the fault occurs corresponding to the error data.
[0104] According to one or more embodiments of the present disclosure, a device for locating an API gateway fault is provided, including:
[0105] An acquisition unit is used to acquire API gateway interface access data;
[0106] An establishing unit, used for establishing a corresponding relationship between the interface access data and predefined data features;
[0107] A screening unit, screening the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data;
[0108] The positioning unit is used to obtain the cluster and user where the fault corresponding to the error data occurs according to the error data, so as to locate the API gateway fault.
[0109] According to one or more embodiments of the present disclosure, the acquisition unit is specifically configured to:
[0110] Use the Kafka cluster to obtain API gateway interface access data.
[0111] According to one or more embodiments of the present disclosure, the establishing unit is specifically configured to:
[0112] The corresponding relationship between the interface access data and the predefined data features is stored in the Elasticsearch engine using the Logstash tool.
[0113] According to one or more embodiments of the present disclosure, a system for locating an API gateway fault is provided, including:
[0114] Memory for storing computer programs;
[0115] A processor is used to implement the steps of the above-mentioned API gateway fault locating method when executing the computer program.
[0116] According to one or more embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is processed and executed, the steps of the above-mentioned API gateway fault locating method are implemented.
[0117] The above is only a preferred implementation of the present application. Although the present application has been disclosed as a preferred embodiment, it is not intended to limit the present application. Any technician familiar with the art can use the above disclosed methods and technical contents to make many possible changes and modifications to the technical solution of the present application without departing from the scope of the technical solution of the present application, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application still falls within the scope of protection of the technical solution of the present application.
[0118] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0119] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0120] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
Claims
1. A method for locating an API gateway fault, characterized in that: include: Obtaining API gateway interface access data, wherein the interface access data includes multiple access request records; The corresponding relationship between the interface access data and the predefined data features is stored in the Elasticsearch engine by using the Logstash tool; the interface access data is filtered according to the error data features in the predefined data features to obtain the error data in the interface access data, wherein the error data is the access request record containing the error data features; According to the error data, the cluster and user where the fault occurs corresponding to the error data are obtained to locate the API gateway fault; Through the scheduled task, the Elasticsearch engine and logs are queried daily to obtain the aggregated offline data of API gateway interface access; the aggregated offline data includes aggregated access data and aggregated error data; the aggregated access data includes call time, interface name, interface version, user name, channel, number of calls and number of failures; The aggregated error data includes interface name, interface version, user name, number of errors, error code and error information; Based on the aggregated offline data, the access volume of the API gateway interface is obtained through daily offline aggregated daily reports or real-time monitoring visualization front-ends. If there is a sudden increase or decrease, the access volume of the API gateway interface within a fixed time range in the past is queried to determine whether there is a periodic sudden increase or decrease; if it is determined to be a periodic sudden increase or decrease, no warning is issued; If the API gateway interface error rate is high, a warning is issued to locate the API gateway failure.
2. The method according to claim 1, characterized in that The obtaining of API gateway interface access data includes: Use the Kafka cluster to obtain API gateway interface access data.
3. The method according to claim 1, characterized in that The filtering the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data includes: The Kibana platform is used to filter the interface access data according to the error data features in the predefined data features to obtain the error data in the interface access data.
4. The method according to claim 1, characterized in that: The method further comprises: The Grafana platform is used to display the cluster and user where the fault occurs corresponding to the error data.
5. An API gateway fault location device, characterized in that: include: An acquisition unit, used to acquire API gateway interface access data, wherein the interface access data includes multiple access request records; Establishing a unit, for storing the correspondence between the interface access data and the predefined data features in an Elasticsearch engine by using a Logstash tool; a screening unit, screening the interface access data according to the error data feature in the predefined data feature to obtain error reporting data in the interface access data, wherein the error reporting data is the access request record containing the error data feature; A positioning unit, used to obtain, according to the error data, a cluster and a user where the fault corresponding to the error data occurs, so as to locate the API gateway fault; Through the scheduled task, the Elasticsearch engine and logs are queried daily to obtain the aggregated offline data of API gateway interface access; the aggregated offline data includes aggregated access data and aggregated error data; the aggregated access data includes call time, interface name, interface version, user name, channel, number of calls and number of failures; The aggregated error data includes interface name, interface version, user name, number of errors, error code and error information; Based on the aggregated offline data, the access volume of the API gateway interface is obtained through daily offline aggregated daily reports or real-time monitoring visualization front-ends. If there is a sudden increase or decrease, the access volume of the API gateway interface within a fixed time range in the past is queried to determine whether there is a periodic sudden increase or decrease; if it is determined to be a periodic sudden increase or decrease, no warning is issued; If the API gateway interface error rate is high, a warning is issued to locate the API gateway failure.
6. The device according to claim 5, characterized in that The acquisition unit is specifically used for: Use the Kafka cluster to obtain API gateway interface access data.
7. An API gateway fault location system, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of the API gateway fault locating method as described in any one of claims 1-4 when executing the computer program.
8. A computer-readable medium, characterized in that The computer-readable medium stores a computer program, which, when processed and executed, implements the steps of the API gateway fault locating method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Unified service traffic-limiting fusing platform and method thereof
CN111787073A
Business data monitoring method, device and system
CN113190423A
System error processing method and device, electronic equipment and storage medium
CN114398200A
Failure prediction method and apparatus implementing same
WO2022071615A1
