Online application programming interface early warning method and electronic equipment

By proxy monitoring and filtering network data of online APIs, filtering and warning interface abnormalities, the defects of the existing technology being unable to monitor and timely discover online API problems are solved, and real-time monitoring and early warning of API stability and connectivity are achieved.

CN119537229APending Publication Date: 2025-02-28TUS CLOUD CONTROL (BEIJING) TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411630521.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing technology cannot monitor the API after the system is launched, it is difficult to detect problems with the online interface in a timely manner, and it is impossible to operate real online data, resulting in unreal and reliable tests.

Method used

The network data of the online application programming interface is obtained through proxy monitoring, the interface data is obtained, and the interface abnormal data is filtered from it for early warning.

Benefits of technology

It realizes the stability and connectivity monitoring of the online interface, promptly warns of interface abnormalities, notifies relevant personnel to investigate and solve problems, and improves the timeliness of problems being discovered.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537229A_ABST
    Figure CN119537229A_ABST
Patent Text Reader

Abstract

The invention discloses an online application programming interface early warning method and electronic equipment. The method comprises the steps of obtaining network data obtained through proxy monitoring, wherein the network data is data generated by a system where one or more online application programming interfaces are located; filtering the network data to obtain interface data of each online application programming interface; and screening interface abnormal data from the interface data, and performing early warning on the interface abnormal data. According to the method, the data of the system where the application programming interface is located is monitored through the agent, and the interface data is filtered out from the data for early warning, so that the stability of the online interface and the connectivity of the interface can be monitored, and early warning can be carried out in time when the interface is abnormal so as to inform related personnel to troubleshoot and solve corresponding problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field related to automated testing, and in particular to an online application programming interface early warning method, electronic equipment, storage medium and computer program product. Background Art

[0002] The application programming interface (API) test of the prior art is carried out during the unit test, integration test, system test, and acceptance test stages. After the interface tests in these stages are completed, the system will be deployed to the actual operating environment and then put into formal use.

[0003] The prior art does not have a universal method for online monitoring of online API interface testing. Generally, only smoke tests are performed regularly on some core interfaces of the system, and some interfaces cannot be tested and verified regularly because they are in an online environment and online data cannot be changed at will. For example, for new data, the prior art test needs to simulate request data, and then make API requests through tools or methods such as postman that can make interface requests. This new addition will create some false data in the online environment, which will affect the authenticity of the environment, especially when it comes to functions related to money transactions. At the same time, because some interface tests are performed regularly, it is impossible to promptly discover problems with the interface and locate them, nor is it possible to promptly notify the corresponding personnel to make modifications, and it is impossible to globally analyze the operation of the overall interface and conduct overall monitoring and analysis of the stability of the online interface API.

[0004] Therefore, the API testing method of the prior art cannot monitor the interface after the system is launched, making it difficult to timely discover problems with the online interface, and thus unable to solve the problems in a timely manner. In addition, since the API testing of the prior art is aimed at the test development environment, it is impossible to operate on real online data, such as adding users, deleting users, etc. The prior art can only trigger the test through pre-set data, and this test is not real and reliable. Summary of the invention

[0005] Based on this, it is necessary to provide an online application programming interface early warning method, electronic device, storage medium and computer program product to address the technical problem that the existing technology cannot monitor the API after the system is launched.

[0006] The present invention provides an online application programming interface early warning method, comprising:

[0007] Acquire network data obtained through proxy monitoring, where the network data is data generated by a system where one or more online application programming interfaces are located;

[0008] Filtering the network data to obtain interface data of each of the online application programming interfaces;

[0009] Interface abnormal data is filtered from the interface data, and an early warning is issued for the interface abnormal data.

[0010] Further, filtering the network data to obtain interface data of each online application programming interface includes:

[0011] The network data is filtered through the domain name of the system and the routing path prefix of each of the online application programming interfaces to obtain interface data of each of the online application programming interfaces.

[0012] Further, the filtering of interface abnormal data from the interface data and issuing an early warning for the interface abnormal data includes:

[0013] Acquire a status code of the interface data, wherein the status code includes a normal status code and an abnormal status code;

[0014] filtering interface abnormal data from the interface data based on a status code of the interface data;

[0015] An early warning is issued for abnormal data of the interface.

[0016] Furthermore, the filtering of interface abnormality data from the interface data based on the status code of the interface data includes:

[0017] When the status code of the interface data is a normal status code, extract an assertion from the interface data, obtain an expected result of the assertion of the online application programming interface when the status code is normal, and if the assertion is consistent with the expected result of the assertion, judge that the interface data is normal data; otherwise, judge that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code normal assertion failure;

[0018] When the status code of the interface data is an abnormal status code, it is determined that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code abnormality.

[0019] Furthermore, the step of providing an early warning for the abnormal interface data includes:

[0020] An early warning is issued according to the priority of the abnormal type of the interface abnormal data and / or the priority of the online application programming interface.

[0021] Furthermore, it also includes:

[0022] Get the specified time dimension, calculate the abnormal statistical rate of interface abnormal data in the specified time dimension to the total number of all interfaces, and the error rate of each abnormal type.

[0023] Furthermore, it also includes:

[0024] Obtain a specified time period and a specified time dimension, calculate the change trend of the abnormal statistical rate of interface abnormal data to normal interfaces in the specified time period under the specified time dimension, and calculate the change trend of the error rate of each abnormal type in the specified time period under the specified time dimension.

[0025] The present invention provides an electronic device, comprising:

[0026] at least one processor; and,

[0027] a memory communicatively connected to at least one of the processors; wherein,

[0028] The memory stores instructions that can be executed by at least one of the processors, and the instructions are executed by at least one of the processors to enable at least one of the processors to execute the online application programming interface early warning method as described above.

[0029] The present invention provides a storage medium, which stores computer instructions. When a computer executes the computer instructions, it is used to execute all the steps of the online application programming interface early warning method as described above.

[0030] The present invention provides a computer program product, comprising a computer program / instruction, which implements the online application programming interface early warning method as described above when the computer program / instruction is executed by a processor.

[0031] The present invention monitors the data of the system where the application programming interface is located through a proxy, and filters out the interface data for early warning, so as to monitor the stability of the online interface and the connectivity of the interface, and can promptly issue an early warning when an abnormality occurs in the interface to notify relevant personnel, so as to troubleshoot and solve the corresponding problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A flowchart of an online application programming interface early warning method according to an embodiment of the present invention;

[0033] Figure 2 This is a workflow diagram of an online application programming interface early warning method according to another embodiment of the present invention;

[0034] Figure 3A workflow diagram of an online application programming interface early warning method according to the best embodiment of the present invention;

[0035] Figure 4 The figure is a schematic diagram of the hardware structure of an electronic device of the present invention. DETAILED DESCRIPTION

[0036] The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings. The same components are represented by the same reference numerals. It should be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the accompanying drawings, and the words "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.

[0037] like Figure 1 The figure shows a workflow diagram of an online application programming interface early warning method according to an embodiment of the present invention, including:

[0038] Step S101, obtaining network data obtained through proxy monitoring, wherein the network data is data generated by a system where one or more online application programming interfaces are located;

[0039] Step S102, filtering the network data to obtain interface data of each of the online application programming interfaces;

[0040] Step S103, filtering interface abnormal data from the interface data, and issuing an early warning for the interface abnormal data.

[0041] Specifically, the present invention can be applied to electronic devices with processing capabilities, such as computers.

[0042] Specifically, a device tool in the form of software is used to implement an online application programming interface warning method. The device tool can implement the interface of the online application programming interface warning method based on PyQt, and include relevant configurations for warning notifications, including warning methods such as DingTalk, WeChat, etc., and also includes detailed display of abnormal APIs monitored online. Among them, Qt is a cross-platform C++ development framework for creating desktop applications and mobile applications. It provides a wealth of GUI components, tool libraries, and platform-related functions; and PyQt is a cross-platform library of Python for creating desktop applications and mobile applications. It is based on the Qt framework and provides a wealth of GUI components and tool libraries.

[0043] The overall implementation logic is as follows:

[0044] First, step S101 is executed to obtain network data obtained through proxy monitoring, where the network data is data generated by a system where one or more online application programming interfaces are located.

[0045] Specifically, online API monitoring is mainly based on Mitmproxy, which is an interactive proxy tool that can be used to intercept, inspect, modify and replay HTTP / HTTPS traffic.

[0046] First, configure the proxy in the browser to forward network data (i.e. network traffic) to Mitmproxy, and then use Mitmproxy to monitor the corresponding web port, thereby monitoring the operation of the entire interface and obtaining the network data generated by the system where one or more online application programming interfaces are located.

[0047] Then, step S102 is executed to filter the network data to obtain interface data of each of the online application programming interfaces.

[0048] Specifically, the network data monitored by Mitmproxy is filtered, and based on the characteristics of the interface data of each online application programming interface, the interface data of each online application programming interface is filtered out.

[0049] Finally, step S103 is executed to filter interface abnormal data from the interface data and issue an early warning for the interface abnormal data.

[0050] Specifically, according to preset conditions, interface abnormal data is screened from the interface data, and an early warning operation is performed on the interface abnormal data.

[0051] The present invention monitors the data of the system where the application programming interface is located through a proxy, and filters out the interface data for early warning, so as to monitor the stability of the online interface and the connectivity of the interface, and can promptly issue an early warning when an abnormality occurs in the interface to notify relevant personnel, so as to troubleshoot and solve the corresponding problems.

[0052] like Figure 2 The figure is a workflow diagram of an online application programming interface early warning method in another embodiment of the present invention, comprising:

[0053] Step S201, obtaining network data obtained through proxy monitoring, wherein the network data is data generated by a system where one or more online application programming interfaces are located.

[0054] Step S202: filtering the network data by the domain name of the system and the routing path prefix of each of the online application programming interfaces to obtain interface data of each of the online application programming interfaces.

[0055] Step S203, obtaining a status code of the interface data, wherein the status code includes a normal status code and an abnormal status code.

[0056] Step S204: filtering interface abnormal data from the interface data based on the status code of the interface data.

[0057] In one embodiment, filtering interface abnormality data from the interface data based on the status code of the interface data includes:

[0058] When the status code of the interface data is a normal status code, extract an assertion from the interface data, obtain an expected result of the assertion of the online application programming interface when the status code is normal, and if the assertion is consistent with the expected result of the assertion, judge that the interface data is normal data; otherwise, judge that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code normal assertion failure;

[0059] When the status code of the interface data is an abnormal status code, it is determined that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code abnormality.

[0060] Step S205: issuing an early warning for the abnormal interface data.

[0061] In one embodiment, the warning of the abnormal interface data includes:

[0062] An early warning is issued according to the priority of the abnormal type of the interface abnormal data and / or the priority of the online application programming interface.

[0063] Step S206, obtaining a specified time dimension, and calculating the abnormal statistical rate of interface abnormal data to the total number of all interfaces under the specified time dimension and the error rate of each abnormal type.

[0064] Step S207, obtain a specified time period and a specified time dimension, calculate the change trend of the abnormal statistical rate of interface abnormal data to normal interfaces in the specified time period under the specified time dimension, and calculate the change trend of the error rate of each of the abnormal types in the specified time period under the specified time dimension.

[0065] Specifically, step S201 is first executed to obtain network data obtained through proxy monitoring, where the network data is data generated by a system where one or more online application programming interfaces are located.

[0066] Specifically, online API monitoring is mainly based on Mitmproxy, which is an interactive proxy tool that can be used to intercept, inspect, modify and replay HTTP / HTTPS traffic.

[0067] First, configure the proxy in the browser to forward network data (i.e. network traffic) to Mitmproxy, and then use Mitmproxy to monitor the corresponding web port, thereby monitoring the operation of the entire interface and obtaining the network data generated by the system where one or more online application programming interfaces are located.

[0068] This embodiment will capture the API interface of all user operation requests, so there is no need to simulate data. For online users, such as newly added data, this embodiment can directly obtain the result of the user's newly added data and obtain interface data of whether the newly added data is successful or failed.

[0069] Then, step SS202 is executed to filter the network data through the domain name of the system and the routing path prefix of each of the online application programming interfaces to obtain interface data of each of the online application programming interfaces.

[0070] Specifically, when multiple APIs are to be published to the same domain name, a unified prefix is ​​added after the domain name to distinguish and route to the specified API. Therefore, the network data that needs to be screened and viewed is filtered according to the domain name and the routing path prefix. Specifically, the filtering is mainly performed by filtering by domain name first, and then by routing path prefix, so as to obtain the interface data of each online API. The overall filtering is mainly to monitor the overall situation of the online API in real time. At the same time, users can determine the routing path prefix of the online API to be monitored according to their needs, so as to focus on the API of the core module that they want to monitor through the routing path prefix.

[0071] Then, step S203 is executed to obtain a status code of the interface data, where the status code includes a normal status code and an abnormal status code.

[0072] Specifically, the status code of the interface data is obtained, and the interface data is classified based on the status code. Specifically, the interface API status code can be filtered out as 200 or non-200. Among them, the status code 200 is the status code indicating a successful request in the HTTP protocol. Therefore, the status code 200 is a normal status code. When the status code is non-200, it is an abnormal status code.

[0073] Then, step S204 is executed to filter interface abnormal data from the interface data based on the status code of the interface data.

[0074] Specifically, when the status code is not 200, the corresponding API can be judged as interface abnormal data, and then the detailed interface information such as the request header, request body, response header, response body, etc. corresponding to the monitored abnormal API can be obtained. When the status code is 200, further judgment is required.

[0075] In one embodiment, filtering interface abnormality data from the interface data based on the status code of the interface data includes:

[0076] When the status code of the interface data is a normal status code, extract an assertion from the interface data, obtain an expected result of the assertion of the online application programming interface when the status code is normal, and if the assertion is consistent with the expected result of the assertion, judge that the interface data is normal data; otherwise, judge that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code normal assertion failure;

[0077] When the status code of the interface data is an abnormal status code, it is determined that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code abnormality.

[0078] Specifically, when performing online monitoring, in addition to verifying the status code of the interface, you can also verify whether the assertion of each interface is the same as the expected result of the assertion. Among them, assertion is a debugging mechanism used to verify whether the code meets the expectations of the coder. Before starting monitoring, for the API that needs to be monitored, pre-determine the assertion when the corresponding API is in normal state as the expected result of the assertion.

[0079] Then, during online monitoring, first, when the status code of the interface data is a normal status code, such as 200, the expected result of the assertion of the corresponding online application programming interface in the normal status code is further obtained. If the assertion extracted from the interface data is consistent with the preset expected result of the assertion, the interface data is judged to be normal data, otherwise, the interface data is judged to be interface abnormal data, and the abnormal type of the interface abnormal data is status code normal assertion failure.

[0080] If the status code of the interface data is an abnormal status code, for example, not 200, the interface data is directly determined to be interface abnormal data, and the abnormal type of the interface abnormal data is status code abnormality.

[0081] Finally, step S205 is executed to issue an early warning for the abnormal interface data.

[0082] Specifically, you can set the monitoring alarm method before monitoring, that is, the specific form in which the corresponding personnel are notified. Then, through the above method, the online API will be monitored at all times. When the status code of the API is not 200 or the assertion of the API interface is different from the expected result of the assertion, the relevant personnel will be notified according to the configured alarm notification method, so as to timely troubleshoot the relevant problems of the online API.

[0083] For alarm notifications of abnormal APIs, you can also set the warning priority.

[0084] In one embodiment, the warning of the abnormal interface data includes:

[0085] An early warning is issued according to the priority of the abnormal type of the interface abnormal data and / or the priority of the online application programming interface.

[0086] Specifically, the exception types are mainly divided into two categories: status code exceptions and status code normal assertion failures. Different priorities can be set for different online application programming interfaces, and / or priorities can be set for different exception types, and then different warning operations can be set for different priorities. Warning operations include but are not limited to: recording and displaying on the interface and issuing warning notifications.

[0087] In some embodiments, the issuing of an early warning according to the priority of the abnormal type of the interface abnormal data includes:

[0088] Check the status code of the interface abnormal data;

[0089] If the status code starts with 5, the alarm level of the interface abnormal data is set to urgent abnormality. If the status code starts with 4, the alarm level of the interface abnormal data is set to severe error. If the status code starts with 3 or 2, and the abnormal type is normal assertion failure of the status code, the alarm level of the interface abnormal data is set to minor.

[0090] Execute corresponding warning operations according to the alarm level of the interface abnormal data.

[0091] Specifically, interface abnormal data includes but is not limited to request parameter abnormalities, request type abnormalities, request address abnormalities, service abnormalities, gateway errors, permission errors, etc.

[0092] Status codes include but are not limited to:

[0093] 301: Redirection indicates that the client needs to take further action to complete the request;

[0094] 400: The request content is incorrect. The server does not understand the syntax of the request. This error may occur if the request content is incorrect or the format is incorrect. The corresponding request parameters are incorrect.

[0095] 404: The requested resource cannot be found on the server. In addition, it can also be used when the server rejects the request but does not want to give a reason for the rejection; the corresponding request address is wrong.

[0096] 405: The request method is incorrect. For example, if the defined method is POST but the request is GET, this error will be reported. The corresponding request type is incorrect.

[0097] 500: Internal server error. The server encountered an error and could not complete the request. The corresponding service is abnormal.

[0098] 502: Wrong gateway. This error occurs when ngnix is ​​not started or the proxy is written incorrectly.

[0099] 401: Unauthorized.

[0100] 403: Forbidden (access denied).

[0101] 200: Normal response.

[0102] Therefore, three alert levels are set: urgent, serious, and minor. Several major categories of problems can be set for different response codes. 2xx-successful response. 3xx-redirection. 4xx-client error. 5xx-server error.

[0103] Then, based on the above-mentioned problem types, online API monitoring is performed and the corresponding status codes and assertion exceptions are automatically classified and filtered. Then, alarm information is automatically generated and an alarm is issued according to the alarm level.

[0104] While issuing the warning, steps S206 and S207 may also be executed to statistically summarize the result data of the monitoring API finally obtained and / or store it in a visual form.

[0105] Step S206, obtaining a specified time dimension, and calculating the abnormal statistical rate of interface abnormal data to the total number of all interfaces under the specified time dimension and the error rate of each abnormal type.

[0106] Specifically, the results are aggregated over time, and the time is split according to the specified time dimensions of day, week, and month. The specified time dimension can be pre-set by the system or specified by the user. For example, in units of days, the abnormal statistical rate of the corresponding interface abnormal data occupying the normal interface is calculated, and the error rate of different abnormal types is calculated. The abnormal statistical rate and error rate of the specified time dimension can be displayed on the interface.

[0107] The final monitored API result data will be stored in a visual form. The results of different time periods can be further aggregated, and the time can be split according to the dimensions of day, week, and month. For example, in units of days, the abnormal statistical rate of the corresponding interface abnormal data to the total number of all interfaces will be displayed, and the error rate between different abnormal types will be calculated. The error rate is calculated by classifying the abnormalities, and then counting the number of each type of abnormality within a period of time, and dividing the number of each type of abnormality by the total number of all interfaces within a period of time to obtain the interface error rate of each type of abnormality.

[0108] Step S207, obtain a specified time period and a specified time dimension, calculate the change trend of the abnormal statistical rate of interface abnormal data to normal interfaces in the specified time period under the specified time dimension, and calculate the change trend of the error rate of each of the abnormal types in the specified time period under the specified time dimension.

[0109] Specifically, the specified time period and the specified time dimension may be preset by the system or specified by the user. After calculating the abnormal statistical rate of abnormal data of multiple interfaces in the specified time dimension to the normal interface within the specified time period, a change trend of the abnormal statistical rate that changes with time is generated. Specifically, a trend chart may be used to represent the change trend. That is, a trend chart of the abnormal statistical rate within the specified time period is drawn.

[0110] Similarly, multiple error rates of each abnormal type in a specified time dimension are calculated within a specified time period, and then the change trend of the error rate of each abnormal type over time is generated. Specifically, a trend chart can be used to represent the change trend. That is, a trend chart of the error rate within a specified time period is drawn.

[0111] Furthermore, the stability of the system functions can be automatically analyzed. The error rates of abnormal types between different modules can also be automatically analyzed to find out which modules in the system need to focus on the corresponding problems.

[0112] In addition to the above statistical data and trend charts, corresponding reports can also be generated, and the statistical data can be generated into corresponding reports according to the time dimension and sent to relevant personnel. The early warning interface can also be aggregated and counted according to time and sent to relevant personnel.

[0113] This embodiment can directly monitor the online API interface, and the coverage of the interface is more comprehensive. Compared with the prior art that only executes the interface test script regularly, this embodiment takes into account the data problems of the online environment and can achieve complete coverage. At the same time, this embodiment can timely monitor the status of the online API interface, and can issue a timely warning when an abnormality occurs in the interface, and notify the relevant personnel to troubleshoot and repair the problem, thereby improving the timeliness of problem discovery. Finally, this embodiment calculates the overall interface stability trend, interface statistical reports, error rates and other related monitoring indicator data, and performs overall monitoring and analysis of the online API interface.

[0114] like Figure 3 The flowchart of an online application programming interface early warning method according to the best embodiment of the present invention is shown, comprising:

[0115] Step S301, open the device tool.

[0116] Step S302, set the module range of the API to be monitored, set the interface warning priority, set the warning method, and set the expected result of the API assertion. Among them, a product has multiple modules, and the routing path of the API of each module is different. You can set which module to be monitored specifically, set the module common route, and only filter the corresponding module API of the corresponding product for monitoring.

[0117] Step S303, online monitoring of the API interface, filtering the interface data. The interface data is filtered based on the status code. When the status code of the interface data is a normal status code, if the assertion of the interface data is consistent with the expected result of the API assertion, the interface data is judged to be normal data, otherwise the interface data is judged to be interface abnormal data, and the abnormal type of the interface abnormal data is status code normal assertion failure; when the status code of the interface data is an abnormal status code, the interface data is judged to be interface abnormal data, and the abnormal type of the interface abnormal data is status code abnormality.

[0118] Step S304: timely notify relevant personnel according to the warning priority and warning method. Then, statistically analyze the overall monitoring API stability and interface abnormal data error rate according to the time dimension of day, week, and month, analyze the overall trend and statistical data of the interface, and obtain the overall report data.

[0119] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0120] like Figure 4 The figure shows a hardware structure diagram of an electronic device of the present invention, including:

[0121] at least one processor 401; and,

[0122] A memory 402 is communicatively connected to at least one of the processors 401; wherein,

[0123] The memory 402 stores instructions that can be executed by at least one of the processors. The instructions are executed by at least one of the processors to enable at least one of the processors to execute the online application programming interface early warning method as described above.

[0124] Figure 4 A processor 401 is taken as an example.

[0125] The electronic device may further include: an input device 403 and a display device 404 .

[0126] The processor 401, the memory 402, the input device 403 and the display device 404 may be connected via a bus or other means, and the figure takes the connection via a bus as an example.

[0127] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the online application programming interface early warning method in the embodiment of the present application, for example, Figure 1 , Figure 2 The processor 401 executes various functional applications and data processing by running the non-volatile software programs, instructions and modules stored in the memory 402, that is, the online application programming interface early warning method in the above embodiment is implemented.

[0128] The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the online application programming interface early warning method, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to a device for executing the online application programming interface early warning method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0129] The input device 403 can receive user clicks and generate signal inputs related to user settings and function control of the online application programming interface early warning method. The display device 404 can include display devices such as a display screen.

[0130] The one or more modules are stored in the memory 402, and when executed by the one or more processors 401, the online application programming interface early warning method in any of the above method embodiments is executed.

[0131] The present invention monitors the data of the system where the application programming interface is located through a proxy, and filters out the interface data for early warning, so as to monitor the stability of the online interface and the connectivity of the interface, and can promptly issue an early warning when an abnormality occurs in the interface to notify relevant personnel, so as to troubleshoot and solve the corresponding problems.

[0132] An embodiment of the present invention provides a storage medium, wherein the storage medium stores computer instructions. When a computer executes the computer instructions, the storage medium is used to execute all steps of the online application programming interface early warning method as described above.

[0133] In the context of the present disclosure, a storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. The storage medium may be a machine-readable signal medium or a machine-readable storage medium. Alternatively, the storage medium may be a non-temporary computer-readable storage medium, for example, a non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (Compact Disc ROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0134] An embodiment of the present invention provides a computer program product, including a computer program / instruction, which implements the online application programming interface early warning method as described above when the computer program / instruction is executed by a processor.

[0135] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. An online application programming interface early warning method, characterized in that: include: Acquire network data obtained through proxy monitoring, where the network data is data generated by a system where one or more online application programming interfaces are located; Filtering the network data to obtain interface data of each of the online application programming interfaces; Interface abnormal data is filtered from the interface data, and an early warning is issued for the interface abnormal data.

2. The online application programming interface early warning method according to claim 1, characterized in that: The filtering of the network data to obtain the interface data of each online application programming interface includes: The network data is filtered through the domain name of the system and the routing path prefix of each of the online application programming interfaces to obtain interface data of each of the online application programming interfaces.

3. The online application programming interface early warning method according to claim 1, characterized in that: The filtering of abnormal interface data from the interface data and issuing an early warning for the abnormal interface data includes: Acquire a status code of the interface data, wherein the status code includes a normal status code and an abnormal status code; filtering interface abnormal data from the interface data based on a status code of the interface data; An early warning is issued for abnormal data of the interface.

4. The online application programming interface early warning method according to claim 3 is characterized in that: The filtering of interface abnormality data from the interface data based on the status code of the interface data includes: When the status code of the interface data is a normal status code, extract an assertion from the interface data, obtain an expected result of the assertion of the online application programming interface when the status code is normal, and if the assertion is consistent with the expected result of the assertion, judge that the interface data is normal data; otherwise, judge that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code normal assertion failure; When the status code of the interface data is an abnormal status code, it is determined that the interface data is interface abnormal data, and the abnormal type of the interface abnormal data is status code abnormality.

5. The online application programming interface early warning method according to claim 4 is characterized in that: The step of providing an early warning for abnormal interface data includes: An early warning is issued according to the priority of the abnormal type of the interface abnormal data and / or the priority of the online application programming interface.

6. The online application programming interface early warning method according to any one of claims 1 to 5, characterized in that: Also includes: Get the specified time dimension, calculate the abnormal statistical rate of interface abnormal data in the specified time dimension to the total number of all interfaces, and the error rate of each abnormal type.

7. The online application programming interface early warning method according to any one of claims 1 to 5, characterized in that: Also includes: Get the specified time period and the specified time dimension, calculate the change trend of the abnormal statistical rate of interface abnormal data to normal interfaces in the specified time period under the specified time dimension, and calculate the change trend of the error rate of each abnormal type in the specified time period under the specified time dimension.

8. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by at least one of the processors, and the instructions are executed by at least one of the processors to enable at least one of the processors to execute the online application programming interface early warning method as described in any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium stores computer instructions, which, when executed by a computer, are used to execute all steps of the online application programming interface early warning method as described in any one of claims 1 to 7.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the online application programming interface early warning method as described in any one of claims 1 to 7 is implemented.