Service monitoring method and device, storage medium, and electronic device

By obtaining real-time call data of the service interface, the service system failure is quickly determined, and the problem of insufficient timeliness of fault detection in the existing technology is solved, and faster fault identification and alarm are achieved.

CN112395155BActive Publication Date: 2024-11-01MICRO INSURANCE AGENCY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011232331.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-06
Publication Date
2024-11-01
Estimated Expiration
2040-11-06

AI Technical Summary

Technical Problem

In the prior art, fault detection is of poor timeliness, and problems are needed to accumulate before the fault can be identified and alarms are issued, resulting in insufficient timeliness.

Method used

By receiving monitoring instructions, obtaining the call data of the service interface, determining whether the service system has failed based on real-time data, and achieving rapid failure detection.

Benefits of technology

It improves the timeliness of fault detection, can determine whether a fault occurs at the first time, and solves the problem of poor timeliness of fault detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112395155B_ABST
    Figure CN112395155B_ABST
Patent Text Reader

Abstract

The present application discloses a service monitoring method and device, storage medium, and electronic device. The method includes: receiving a monitoring instruction, wherein the monitoring instruction is used to indicate whether a service abnormality occurs in the monitoring service system; in response to the monitoring instruction, obtaining the call data of the service interface, wherein the call data is the data generated when the application of the calling end calls the service of the server end through the service interface, and the service system includes the calling end, the service interface, and the server end; based on the call data, determining whether a service failure occurs in the service system. The present application solves the technical problem of poor timeliness of fault detection in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet, and specifically, to a service monitoring method and device, a storage medium, and an electronic device. Background Art

[0002] In a production environment, various application systems will be deployed on numerous servers or containers. These systems will output various logs during operation to reflect the system status and feedback on business execution. By collecting and analyzing this log information, fault analysis and monitoring alarms can be performed.

[0003] In related technologies, problems need to be accumulated to a certain extent before data can be retrieved and analyzed before faults can be identified and alarms can be issued, which results in some lag in timeliness.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a service monitoring method and device, a storage medium, and an electronic device to at least solve the technical problem of poor timeliness of fault detection in the related art.

[0006] According to one aspect of an embodiment of the present application, a service monitoring method is provided, comprising: receiving a monitoring instruction, wherein the monitoring instruction is used to indicate whether a service anomaly occurs in a monitoring service system; in response to the monitoring instruction, obtaining call data of a service interface, wherein the call data is data generated when an application at a calling end calls a service at a server end through a service interface, and the service system comprises a calling end, a service interface, and a server end; and determining whether a service failure occurs in the service system based on the call data.

[0007] According to another aspect of an embodiment of the present application, a service monitoring device is also provided, including: a receiving unit, used to receive a monitoring instruction, wherein the monitoring instruction is used to indicate whether a service abnormality occurs in the monitoring service system; an acquisition unit, used to obtain call data of the service interface in response to the monitoring instruction, wherein the call data is data generated when an application on the calling end calls a service on the server end through the service interface, and the service system includes a calling end, a service interface and a server end; and a monitoring unit, used to determine whether a service failure occurs in the service system based on the call data.

[0008] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above method is executed when the program is run.

[0009] According to another aspect of an embodiment of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above method through the computer program.

[0010] In an embodiment of the present application, when it is necessary to monitor whether a service anomaly occurs in a service system, the call data of the service interface can be obtained, and based on the call data, it can be determined whether a service failure occurs in the service system. Since the acquired call data is real-time data, it can be determined at the first time whether a failure occurs, which can solve the technical problem of poor timeliness of fault detection in related technologies, thereby achieving the technical effect of improving detection timeliness. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0012] Figure 1 is a schematic diagram of a hardware environment of a service monitoring method according to an embodiment of the present application;

[0013] Figure 2 is a flowchart of an optional service monitoring method according to an embodiment of the present application;

[0014] Figure 3 is a schematic diagram of an optional service monitoring solution according to an embodiment of the present application;

[0015] Figure 4 is a schematic diagram of an optional service monitoring solution according to an embodiment of the present application;

[0016] Figure 5 is a schematic diagram of an optional service monitoring solution according to an embodiment of the present application;

[0017] Figure 6 is a schematic diagram of an optional service monitoring solution according to an embodiment of the present application;

[0018] Figure 7 is a schematic diagram of an optional indicator frequency according to an embodiment of the present application;

[0019] Figure 8 is a schematic diagram of a box plot of an optional indicator according to an embodiment of the present application;

[0020] Fig. 9 is a schematic diagram of an optional service monitoring device according to an embodiment of the present application;

[0021] as well as

[0022] Fig.10 It is a structural block diagram of a terminal according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] According to one aspect of the embodiments of the present application, an embodiment of a service monitoring method is provided. The method can be applied in a business scenario where real-time monitoring and alarming of a business is performed. For example, when a failure occurs on the calling end, service interface, or server, an alarm can be sent to a code engineer via SMS or email to prompt the failure, so that the code engineer can accurately locate the problem, troubleshoot, and repair the problem.

[0026] Optionally, in the embodiment of the present application, the above method can be applied to Figure 1 In the hardware environment shown in the figure. Figure 1 As shown, the terminal 102 may include a memory 104, a processor 106, and a display 108 (optional component). The terminal 102 may be connected to a server 112 via a network 110 for communication. The server 112 may be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal. A database 114 may be set on the server 112 or independently of the server 112 to provide data storage services for the server 112. In addition, a processing engine 116 may be running in the server 112, and the processing engine 116 may be used to execute the steps executed by the server 112.

[0027] Optionally, the terminal 102 may be, but is not limited to, a terminal that can calculate data, such as a mobile terminal (e.g., a mobile phone, a tablet computer), a laptop, a PC (Personal Computer), etc. The above network may include, but is not limited to, a wireless network or a wired network. The wireless network includes: Bluetooth, WIFI (Wireless Fidelity) and other networks that implement wireless communication. The above wired network may include, but is not limited to: a wide area network, a metropolitan area network, and a local area network. The above server 112 may include, but is not limited to, any hardware device that can perform calculations.

[0028] In addition, in this embodiment, the above method can also be applied to, but not limited to, an independent processing device with a relatively powerful processing capability without data interaction. For example, the processing device can be, but not limited to, a terminal device with a relatively powerful processing capability, that is, each operation in the above method can be integrated in an independent processing device. The above is only an example, and this embodiment does not make any limitation to this.

[0029] In the embodiment of the present application, the above method can be executed by the server 112, or can be executed by the server 112 and the terminal 102 together. The following description will be made by taking the execution by the server 112 as an example. Figure 2 is a flow chart of an optional service monitoring method according to an embodiment of the present application, such as Figure 2 As shown, the method may include the following steps:

[0030] Step S202: The server receives a monitoring instruction, where the monitoring instruction is used to instruct the monitoring service system whether a service anomaly occurs.

[0031] Step S204, in response to the monitoring instruction, the server obtains the calling data of the service interface, wherein the calling data is the data generated when the application of the calling end calls the service of the server end through the service interface, and the service system includes the calling end, the service interface and the server end.

[0032] The calling end is the side where the application that calls the service is located. The application can be an application used by the user on the terminal, or it can be another service that calls the basic service. The service end is the side that provides the service and can be deployed on a server or cloud.

[0033] Step S206: The server determines whether a service failure occurs in the service system based on the call data.

[0034] In the related art, when using logs to analyze faults, it is necessary to accumulate problems. After the accumulation is completed, when it is necessary to detect the fault, logs with a certain information delay relative to time are collected, and then the logs are analyzed to determine whether a fault has occurred. The problem accumulation and log analysis take time, and the information recorded in the analyzed logs has a certain delay, resulting in poor timeliness of fault detection. In the technical solution of the present application, through the above steps, when it is necessary to monitor whether the service system has a service anomaly, the call data of the service interface can be obtained, and based on the call data, it can be determined whether a service failure has occurred in the service system. Since the acquired call data is real-time data, it can be determined at the first time whether a fault has occurred, which can solve the technical problem of poor timeliness of fault detection in the related art, and thus achieve the technical effect of improving the timeliness of detection. The following further details the technical solution of the present application in combination with a specific implementation scheme:

[0035] Step 11: When it is necessary to monitor whether a service abnormality occurs in the service system, trigger a monitoring instruction.

[0036] For example, 1) a timer can be started, and the monitoring instruction is triggered after the timer records a time period (such as 1 minute, 1 hour, etc.); 2) the user pre-configures the script and configures the conditions for triggering the monitoring instruction in the script, and the monitoring instruction is triggered when the conditions are met; 3) the user performs manual operations in the background to trigger the monitoring instruction according to needs.

[0037] Step 12: The server obtains call data of multiple service interfaces.

[0038] Each service can be accessed through one or more service interfaces, and the data routed through the interface (such as request data, response data) can be obtained by the monitoring side.

[0039] Step 13, for each service interface, it can be determined based on the call data of the service interface whether at least one of the service interface, the application at the call end of the service interface, and the service at the service end of the service interface fails.

[0040] In this scheme, the calling data of each service interface can be processed as follows: the service interface that generates the currently processed calling data is used as the target interface; by analyzing the calling data of the target interface one by one, it is determined whether at least one of the target interface, target application and target service has a fault, the target application is the application located at the calling end of the target interface, and the target service is the service located at the service end of the target interface.

[0041] For example, if the received request data is abnormal (such as the amount of request data decreases, the data format of the request data is incorrect, etc.), it can be determined that the application on the calling end has failed; if the received request data is normal, but the response data is abnormal (such as the amount of response data decreases, the data format of the response data is incorrect, etc.), it can be determined that the service on the server side has failed; if a service interface hardly receives request data and response data (that is, the target interface's transmission frequency of call data is lower than the first threshold), while other interfaces that provide the same service are normal (that is, other service interfaces' transmission frequency of call data is higher than the second threshold, the first threshold is determined based on the second threshold, such as the first threshold is 10% of the second threshold), it can be determined that the service interface has failed. The following text uses the example of confirming whether the application on the application side has failed:

[0042] Optionally, when determining whether an application at the calling end of a service interface fails based on call data of each service interface among multiple service interfaces, the call data includes a call frequency, and the multiple service interfaces include a target interface currently being processed (a specific fault determination scheme is described below using a single target interface as an example. In actual processing, if serial processing is adopted for each service interface, multiple service interfaces are sequentially used as target interfaces and processed in the following manner. In actual processing, if parallel processing is adopted for each service interface, service interfaces of the same number as the parallel amount are taken as target interfaces from the multiple service interfaces according to the parallel amount, and each target interface is processed separately in the following manner). Determining whether a target application fails based on the call frequency of the target interface includes the following methods:

[0043] Method 1: Determine whether a target application fails by comparing the call frequency of the target interface with the frequency threshold.

[0044] Before determining whether a target application fails by comparing the call frequency of the target interface with the frequency threshold, the lowest call frequency and the highest call frequency of the target interface when the service system is operating normally are counted in advance; considering that the above statistics may be somewhat one-sided, the product of the lowest call frequency and the reduction factor (such as 0.7) can be used as the lowest frequency threshold, and the product of the highest call frequency and the amplification factor (such as 1.5) can be used as the highest frequency threshold.

[0045] During comparison, if the calling frequency of the target interface is between the highest frequency threshold and the lowest frequency threshold, it is determined that no abnormality has occurred, and if the calling frequency of the target interface is higher than the highest frequency threshold or lower than the lowest frequency threshold, it can be determined that a fault has occurred.

[0046] Method 2: determining whether a target application fails based on the position of the target interface call frequency in the frequency data set, where the frequency data set includes the target interface call frequency.

[0047] That is, whether a fault occurs is determined by comparing the current call frequency with the historical big data. If the current call frequency is within the range of the historical big data, it is determined that no fault occurs, otherwise a fault occurs.

[0048] For example, a box plot can be used to represent historical big data.

[0049] Step 131, obtaining the minimum value min and the maximum value max of the historical call frequency of the target interface in the historical big data.

[0050] Step 132, determine the first quartile Q1, the median Q2 and the third quartile Q3 according to the minimum value and the maximum value, the first quartile is the sum of one quarter of the difference between the maximum value max and the minimum value min and the minimum value, that is, Q1=min+(max-min) / 4, the median is one half of the sum of the maximum value and the minimum value, that is, Q2=(max+min) / 2, and the third quartile is the sum of three quarters of the difference between the maximum value and the minimum value and the minimum value, that is, Q3=min+(max-min)3 / 4.

[0051] Step 133, obtaining the difference between the third quartile and the first quartile as the interquartile range IQR, that is, IQR = Q3 - Q1.

[0052] Step 134, obtain the difference between the first quartile and X times the interquartile range as the lower frequency limit (Q1-X*IQR), and obtain the sum between the third quartile and Y times the interquartile range as the upper frequency limit (Q4+Y*IQR).

[0053] For the values ​​of X and Y, multiple sets of data can be substituted into the above formula to obtain a suitable value of X and Y.

[0054] When using the above formula to judge, if the location of the call frequency of the target interface in the frequency data set is between the lower frequency limit (Q1-X*IQR) and the upper frequency limit (Q4+Y*IQR), then it can be judged that the application side is normal, otherwise a fault occurs.

[0055] Method three, compare the data of adjacent time periods. A time period can be divided into multiple time periods (i.e., sub-periods). For example, a day can be divided into four sub-periods (0:00 to 6:00, 6:00 to 12:00, 12:00 to 18:00, and 18:00 to 24:00) in units of 6 hours. By comparing the call frequency in the first sub-period with the call frequency in the second sub-period, it is determined whether the target application has a fault. The first sub-period is the time sub-period in which the currently acquired call frequency is located (such as 12:00 to 18:00), and the second sub-period is the sub-period before the first sub-period (such as 6:00 to 12:00).

[0056] Method 4: compare the data of the current time period with the historical data of the same period, and determine whether the target application has a fault by comparing the calling frequency in the first sub-period with the calling frequency in the third sub-period. The position of the first sub-period in the first period is the same as the position of the third sub-period in the second period, and the second period is the previous time period of the first period. For example, taking days as the time period, the division scheme of sub-periods within each day is the same as the scheme in method 3. If the first period is the current day, the second period is the day before the current day. If the first sub-period is from 12:00 to 18:00 on the current day, the third sub-period is from 12:00 to 18:00 on the previous day.

[0057] In the year-on-year and month-on-month technical solutions, the trend, upper and lower limits, etc. of the data within the time period can be compared. If there is a different trend, the upper limit is too large or the lower limit is too small, it is determined that a fault has occurred, otherwise it is normal.

[0058] Step 14, after or during the process of determining whether a service failure occurs in the service system based on the call data, the call data of the target interface currently obtained can be saved in the database so that it can be used as historical big data to determine whether the subsequent data is abnormal. The database can delete expired call data according to the configured expiration time.

[0059] Step 15, after determining whether a service failure occurs in the service system based on the call data, an alarm is pushed to the terminal of the maintenance personnel to facilitate maintenance of the entire service system.

[0060] The log monitoring alarm in the related technology is based on the application system error log for real-time monitoring and alarm, and does not actively monitor the interface call frequency. However, this solution can add call frequency monitoring on the basis of real-time monitoring and alarm based on error log keywords. Through active monitoring, service anomalies can be discovered in time, rather than detecting faults only after feedback to business data reports.

[0061] Monitoring based on error logs mainly monitors the service itself, while monitoring based on interface call frequency not only monitors the service from the call frequency perspective but also monitors the associated upstream service callers. This expands the monitoring scope and can be used as a supplementary monitoring method for error log monitoring. Especially in a microservice system, since there are many service splits, it is very necessary to expand the monitoring scope, such as Figure 3 As shown, the frequency monitoring and error log monitoring of microservices can be integrated.

[0062] As an optional embodiment, the technical solution of the present application is further described in detail below in combination with a specific implementation scheme:

[0063] like Figure 3 As shown in , this solution can integrate frequency monitoring and error log monitoring. Figure 4 As shown, error log monitoring focuses on the monitoring of error logs within the system, with an emphasis on services, such as Figure 5 As shown, call frequency monitoring focuses on monitoring the call frequency of services exposed to external interfaces, with an emphasis on the periphery.

[0064] The above integration solution can be implemented based on the log monitoring and alarm platform LogMonitor and the log web (WorldWide Web) online monitoring tool Prometheus. The basic principle of Prometheus is to periodically capture the status of the monitored components through the HTTP (HyperText Transfer Protocol) protocol. Any component can be connected to the monitoring as long as it provides the corresponding HTTP interface. The HTTP interface that outputs the monitored component information is called the indicator collection interface exporter (exporter is an important component of Prometheus monitoring and is responsible for the collection of data indicators). At present, most of the components commonly used by Internet companies have indicator collection interfaces that can be used directly.

[0065] like Figure 5 As shown, the Prometheus client can collect the number of calls to each interface in a specified time period, thereby calculating the call frequency of each dimension. Each service interface can expose an HTTP service interface to Prometheus to facilitate the scheduled capture of frequency data. Prometheus supports pre-configuration of capture targets through configuration files, text files, etc., such as the interface where the data to be captured is located, the field where the data is located, etc.; after the configuration is completed, Prometheus will periodically capture the frequency number on the interface, store all captured frequency data locally, clean and organize the data according to certain rules, and store the results in a new time series.

[0066] In the above scheme, the frequency monitoring process of Prometheus is as follows Figure 6 As shown:

[0067] In step 21, the Prometheus service component (prometheus server) periodically pulls application indicator data from the service interface through the HTTP protocol, such as the number of requests for each interface per minute within a specified period.

[0068] Step 22, present the specified frequency rules according to the business characteristics and previous data indicators, traverse the enabled frequency rules, pull the indicators regularly according to the rule configuration time, and then store them in the redis database. The expiration time of the redis data is determined by the comparison period of the indicator.

[0069] For example, for year-on-year monthly data, the data expiration time can be set to more than two months. For year-on-year data, the expiration time must be set to more than two years. The expiration time is set to avoid filling up the cache database due to excessive indicator data. When the data is no longer used, it will be automatically cleaned up when the expiration time is reached.

[0070] The comparison period is determined by the monitoring rules configured in the log monitoring and alarm platform. For example, if the frequency statistics period of interface A is daily, then only the indicator data of the most recent month needs to be cached. The indicator data of the day can be compared with the most recent month through the box line method to determine whether it is abnormal. If it is a month, then the comparison indicator data of about a year needs to be cached.

[0071] Step 23: When the log monitoring and alarm platform triggers the indicator comparison, it first obtains the indicator from Prometheus.

[0072] The indicator here is the indicator collected according to the preset indicator collection rules for the system interface call. It is a system indicator for collection and statistics. This indicator data is subsequently compared with the threshold to determine whether it is abnormal.

[0073] Step 24, compare the frequency index with the manually preset threshold, store the index in redis, compare it with the preset threshold, and return the comparison result.

[0074] like Figure 7 As shown in the figure, it is the call volume of the homepage interface of a production environment activity within a period of time. The horizontal axis represents time and the vertical axis represents frequency. If the call frequency is more than 200 times per minute, the call frequency threshold of 100 / min can be set for this interface. If it is lower than 100, it can be considered abnormal. For indicators with large frequency fluctuations, the box plot method can also be introduced.

[0075] Step 25, for the year-on-year and quarter-on-quarter solutions, the indicators can be stored in redis, and then the year-on-year or quarter-on-quarter objects can be pulled for comparison, the comparison results can be compared with the preset values, and the final comparison results can be returned.

[0076] Whether to use year-on-year or month-on-month comparison can be determined according to the characteristics of the business interface. For example, the year-on-year comparison can be the comparison between the first week of this month and the first week of last month, or the comparison between this month of this year and this month of last year; the month-on-month comparison can be the comparison between this week and last week, or the comparison between this month and last month.

[0077] Step 26, determine whether the comparison result reaches the alarm level, and if so, trigger an alarm of the response level. Take the alarm using a box plot as an example:

[0078] like Figure 8 The calculation steps for the box plot shown are as follows:

[0079] Find the first quartile position Q1, the median Q2, and the third quartile position Q3;

[0080] Calculate the interquartile range: IQR = Q3-Q1;

[0081] Calculate the upper and lower limits, for example, Q1-1.5IQR, Q3+1.5IQR;

[0082] Since each called interface of each system has its own business characteristics, the coefficient can be set according to the actual situation, Q1-X*IQR≤T≤Q3+Y*IQR, and the values ​​of X and Y can be continuously adjusted and optimized according to the control parameters configured according to the actual business situation to provide accuracy of the alarm.

[0083] For interfaces with daily statistical call cycles, 60 days of data are taken and divided into 5 groups of 12 days of call data to determine the proportional coefficient of the box plot. If abnormal point data is removed in the past 12 days, continue to take the previous one.

[0084] Take a set of numbers and arrange them in order: X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12.

[0085] Find the first quartile: Q1 = (12 + 1) / 4 = 3, then Q1 = X3;

[0086] Q3=3*(12+1) / 4=9, then Q3=X9;

[0087] IQR = X9-X3;

[0088] X3-X(X9-X3)≤T≤X9+Y(X9-X3);

[0089] Through five sets of data, the critical point X and the critical point Y of the box plot are calculated according to the critical point.

[0090] As data is generated, X and Y are recalculated and adjusted dynamically. For the statistical result T called on the day, it is determined whether T meets the condition X3-m*X(X9-X3)≤T≤X9+n*Y(X9-X3), where m and n are adjustable coefficients. The specific setting size is set according to the fluctuation of the interface call frequency.

[0091] This solution can monitor the health of the system interface calls through interface frequency monitoring, expanding the monitoring scope so that the service itself and upstream services are also monitored and protected. The system frequency data is analyzed in real time, and the system automatically adjusts the monitoring threshold parameters under each comparison indicator scenario. At the same time, the system can automatically adjust the frequency pull cycle through its own interface data analysis to obtain more accurate monitoring results.

[0092] The traffic reported to the Prometheus interface is counted by time dimension for call frequency. Then, according to the actual business characteristics, the interface call frequency alarm threshold is determined by year-on-year or month-on-month comparison. When the call is lower than the threshold, a phone call or other method of alarm is issued. This solution can effectively monitor the situation where the frequency of calling (callback) the current service interface is reduced or interrupted due to external service failure.

[0093] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0095] According to another aspect of an embodiment of the present application, a service monitoring device for implementing the above-mentioned service monitoring method is also provided. Fig. 9 is a schematic diagram of an optional service monitoring device according to an embodiment of the present application, such as Fig. 9 As shown, the device may include:

[0096] The receiving unit 901 is used to receive a monitoring instruction, wherein the monitoring instruction is used to indicate whether a service abnormality occurs in the monitoring service system;

[0097] An acquisition unit 903 is used to acquire the call data of the service interface in response to the monitoring instruction, wherein the call data is data generated when the application of the calling end calls the service of the server end through the service interface, and the service system includes the calling end, the service interface and the server end;

[0098] The monitoring unit 905 is used to determine whether a service failure occurs in the service system based on the call data.

[0099] It should be noted that the receiving unit 901 in this embodiment can be used to execute step S202 in the embodiment of the present application, the acquisition unit 903 in this embodiment can be used to execute step S204 in the embodiment of the present application, and the monitoring unit 905 in this embodiment can be used to execute step S206 in the embodiment of the present application.

[0100] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware.

[0101] When using logs to analyze faults, it is necessary to accumulate problems. After the accumulation is completed, when it is necessary to detect the fault, logs with a certain information delay relative to time are collected, and then whether a fault occurs is determined by analyzing the logs. The problem accumulation and log analysis take time, and the information recorded in the analyzed logs has a certain delay, resulting in poor timeliness of fault detection. In the technical solution of the present application, through the above solution, when it is necessary to monitor whether the service system has service anomalies, the call data of the service interface can be obtained, and based on the call data, it can be determined whether a service failure occurs in the service system. Since the obtained call data is real-time data, it can be determined at the first time whether a fault occurs, which can solve the technical problem of poor timeliness of fault detection in related technologies, thereby achieving the technical effect of improving the timeliness of detection.

[0102] Optionally, the acquisition unit is also used to acquire call data of multiple service interfaces; the monitoring unit can also be used to determine whether at least one of the service interface, the application located at the calling end of the service interface, and the service located at the service end of the service interface has failed based on the call data of each of the multiple service interfaces.

[0103] Optionally, the monitoring unit can also be used to: determine that a target application has failed when an exception occurs in request data received by the target interface, wherein the target interface is a service interface currently being processed, the target application is an application located at the calling end of the target interface, and the calling data includes the request data; determine that an exception occurs in the target service when the request data received by the target interface is normal and an exception occurs in response data corresponding to the request data, wherein the target service is a service located at the service end of the target interface, and the calling data includes the response data; determine that an exception occurs in the target interface when the target interface transmits call data at a frequency lower than a first threshold and transmits call data at a frequency higher than a second threshold with other service interfaces providing the target service, wherein the second threshold is higher than the first threshold.

[0104] Optionally, the monitoring unit can also be used to: use the service interface that generates the currently processed call data as the target interface; determine whether at least one of the target interface, target application and target service has a fault by analyzing the call data of the target interface, wherein the target application is an application located at the calling end of the target interface, and the target service is a service located at the service end of the target interface.

[0105] Optionally, the call data includes a call frequency, and the monitoring unit can also be used to: determine whether the target application has a fault by comparing the call frequency of the target interface and a frequency threshold; determine whether the target application has a fault by the position of the call frequency of the target interface in a frequency data set, wherein the frequency data set includes the call frequency of the target interface; determine whether the target application has a fault by comparing the call frequency within a first sub-cycle with the call frequency within a second sub-cycle, wherein the first sub-cycle is a time sub-cycle in which the currently acquired call frequency is located, and the second sub-cycle is a sub-cycle before the first sub-cycle; determine whether the target application has a fault by comparing the call frequency within the first sub-cycle with the call frequency within a third sub-cycle, wherein the position of the first sub-cycle in the first cycle is the same as the position of the third sub-cycle in the second cycle, and the second cycle is a time period before the first cycle.

[0106] Optionally, the monitoring unit can also be used to: before determining whether the target application fails by comparing the call frequency of the target interface and the frequency threshold, count the minimum call frequency and the maximum call frequency of the target interface when the service system is operating normally; use the product of the minimum call frequency and the reduction factor as the minimum frequency threshold, and use the product of the maximum call frequency and the amplification factor as the maximum frequency threshold.

[0107] Optionally, the monitoring unit may also be used to: before determining whether the target application fails by the position of the call frequency of the target interface in the frequency data set, obtain the minimum and maximum values ​​of the historical call frequency of the target interface; determine a first quartile Q1, a median Q2, and a third quartile Q3 according to the minimum and maximum values, wherein the first quartile is the sum of one quarter of the difference between the maximum and the minimum and the minimum, the median is one half of the sum of the maximum and the minimum, and the third quartile is the sum of three quarters of the difference between the maximum and the minimum and the minimum; obtain the difference between the third quartile and the first quartile as the interquartile range IQR; obtain the difference between the first quartile and X times the interquartile range as the lower frequency limit (Q1-X*IQR), and obtain the sum between the third quartile and Y times the interquartile range as the upper frequency limit (Q4+Y*IQR).

[0108] Optionally, the monitoring unit may also be used to: after determining whether a service failure occurs in the service system based on the call data, save the currently acquired call data of the target interface into a database, wherein the database deletes expired call data according to a configured expiration time.

[0109] This solution can monitor the health of the system interface calls through interface frequency monitoring, expanding the monitoring scope so that the service itself and upstream services are also monitored and protected. The system frequency data is analyzed in real time, and the system automatically adjusts the monitoring threshold parameters under each comparison indicator scenario. At the same time, the system can automatically adjust the frequency pull cycle through its own interface data analysis to obtain more accurate monitoring results.

[0110] The traffic reported to the Prometheus interface is counted by time dimension for call frequency. Then, according to the actual business characteristics, the interface call frequency alarm threshold is determined by year-on-year or month-on-month comparison. When the call is lower than the threshold, a phone call or other method of alarm is issued. This solution can effectively monitor the situation where the frequency of calling (callback) the current service interface is reduced or interrupted due to external service failure.

[0111] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.

[0112] According to another aspect of the embodiments of the present application, a server or terminal for implementing the monitoring method of the above-mentioned service is also provided.

[0113] Fig.10 is a structural block diagram of a terminal according to an embodiment of the present application, such as Fig.10 As shown, the terminal may include: one or more (only one is shown in the figure) processors 1001, a memory 1003, and a transmission device 1005, such as Fig.10 As shown, the terminal may also include an input and output device 1007 .

[0114] Among them, the memory 1003 can be used to store software programs and modules, such as the program instructions / modules corresponding to the monitoring method and device of the service in the embodiment of the present application, and the processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1003, that is, realizing the monitoring method of the above-mentioned service. The memory 1003 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1003 may further include a memory remotely arranged relative to the processor 1001, and these remote memories may be connected to the terminal 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.

[0115] The above-mentioned transmission device 1005 is used to receive or send data via a network, and can also be used for data transmission between a processor and a memory. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1005 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1005 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.

[0116] Specifically, the memory 1003 is used to store application programs.

[0117] The processor 1001 may call the application program stored in the memory 1003 through the transmission device 1005 to perform the following steps:

[0118] Receiving a monitoring instruction, wherein the monitoring instruction is used to instruct the monitoring service system whether a service abnormality occurs;

[0119] In response to the monitoring instruction, acquiring the call data of the service interface, wherein the call data is data generated when the application of the calling end calls the service of the server end through the service interface, and the service system includes the calling end, the service interface and the server end;

[0120] Based on the call data, it is determined whether a service failure occurs in the service system.

[0121] The processor 1001 is further configured to execute the following steps:

[0122] Determining whether the target application fails by comparing the call frequency of the target interface with a frequency threshold;

[0123] Determining whether the target application fails by the position of the calling frequency of the target interface in the frequency data set, wherein the frequency data set includes the calling frequency of the target interface;

[0124] Determine whether the target application fails by comparing the calling frequency in a first sub-cycle with the calling frequency in a second sub-cycle, wherein the first sub-cycle is a time sub-cycle in which the currently acquired calling frequency is located, and the second sub-cycle is a sub-cycle before the first sub-cycle;

[0125] Whether the target application fails is determined by comparing the calling frequency in the first sub-cycle with the calling frequency in the third sub-cycle, wherein the position of the first sub-cycle in the first cycle is the same as the position of the third sub-cycle in the second cycle, and the second cycle is a time period before the first cycle.

[0126] In the related art, when using logs to analyze faults, it is necessary to accumulate problems. After the accumulation is completed, when it is necessary to detect the fault, logs with a certain information delay relative to time are collected, and then whether a fault occurs is determined by analyzing the logs. The problem accumulation and log analysis take time, and the information recorded in the analyzed logs has a certain delay, resulting in poor timeliness of fault detection. In the technical solution of the present application, through the above steps, when it is necessary to monitor whether a service abnormality occurs in the service system, the call data of the service interface can be obtained, and based on the call data, it can be determined whether a service failure occurs in the service system. Since the obtained call data is real-time data, it can be determined at the first time whether a fault occurs, which can solve the technical problem of poor timeliness of fault detection in the related art, thereby achieving the technical effect of improving the timeliness of detection.

[0127] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0128] It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only, and the terminal may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.10 It does not limit the structure of the above electronic device. For example, the terminal may also include Fig.10 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.10 Different configurations shown.

[0129] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0130] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to execute the program code of the service monitoring method.

[0131] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0132] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0133] Receiving a monitoring instruction, wherein the monitoring instruction is used to instruct the monitoring service system whether a service abnormality occurs;

[0134] In response to the monitoring instruction, acquiring the call data of the service interface, wherein the call data is data generated when the application of the calling end calls the service of the server end through the service interface, and the service system includes the calling end, the service interface and the server end;

[0135] Based on the call data, it is determined whether a service failure occurs in the service system.

[0136] Optionally, the storage medium is further configured to store program codes for executing the following steps:

[0137] Determining whether the target application fails by comparing the call frequency of the target interface with a frequency threshold;

[0138] Determining whether the target application fails by the position of the calling frequency of the target interface in the frequency data set, wherein the frequency data set includes the calling frequency of the target interface;

[0139] Determine whether the target application fails by comparing the calling frequency in a first sub-cycle with the calling frequency in a second sub-cycle, wherein the first sub-cycle is a time sub-cycle in which the currently acquired calling frequency is located, and the second sub-cycle is a sub-cycle before the first sub-cycle;

[0140] Whether the target application fails is determined by comparing the calling frequency in the first sub-cycle with the calling frequency in the third sub-cycle, wherein the position of the first sub-cycle in the first cycle is the same as the position of the third sub-cycle in the second cycle, and the second cycle is a time period before the first cycle.

[0141] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0142] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0143] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the above solution.

[0144] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0145] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0146] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0147] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0148] 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0149] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0150] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A service monitoring method, characterized in that: include: Receiving a monitoring instruction, wherein the monitoring instruction is used to instruct the monitoring service system whether a service abnormality occurs; In response to the monitoring instruction, acquiring call data of multiple service interfaces, wherein the call data is data generated when an application at a calling end calls a service at a server end through the service interface, and the service system includes the calling end, the service interface and the server end; Determining whether a service failure occurs in the service system based on the call data; The call data includes a call frequency, the plurality of service interfaces include a target interface currently being processed, the service failure includes a failure of a target application located at a calling end of the target interface, and determining whether the target application fails according to the call frequency of the target interface includes one of the following: Determining whether the target application fails by comparing the call frequency of the target interface with a frequency threshold; Determining whether the target application fails by the position of the calling frequency of the target interface in the frequency data set, wherein the frequency data set includes the calling frequency of the target interface; Determine whether the target application fails by comparing the calling frequency in a first sub-cycle with the calling frequency in a second sub-cycle, wherein the first sub-cycle is a time sub-cycle in which the currently acquired calling frequency is located, and the second sub-cycle is a sub-cycle before the first sub-cycle; Whether the target application fails is determined by comparing the calling frequency in the first sub-cycle with the calling frequency in the third sub-cycle, wherein the position of the first sub-cycle in the first cycle is the same as the position of the third sub-cycle in the second cycle, and the second cycle is a time period before the first cycle.

2. The method according to claim 1, characterized in that Determining whether a service failure occurs in the service system based on the call data includes: Determine whether at least one of the service interface, the application at the calling end of the service interface, and the service at the serving end of the service interface fails based on the calling data of each of the multiple service interfaces.

3. The method according to claim 2, characterized in that Determining whether at least one of the service interface, an application at a calling end of the service interface, and a service at a serving end of the service interface fails according to the calling data of the service interface includes: In the case that request data received by the target interface is abnormal, determining that a target application fails, wherein the call data includes the request data; In the case that the request data received by the target interface is normal and the response data corresponding to the request data is abnormal, determining that the target service is abnormal, wherein the target service is a service located at the service end of the target interface, and the call data includes the response data; When the target interface transmits call data at a frequency lower than a first threshold and transmits call data at a frequency higher than a second threshold with other service interfaces providing the target service, it is determined that an abnormality occurs in the target interface, wherein the second threshold is higher than the first threshold.

4. The method according to claim 1, characterized in that: The frequency threshold includes a minimum frequency threshold and a maximum frequency threshold, wherein before determining whether the target application fails by comparing the call frequency of the target interface with the frequency threshold, the method further includes: Counting the lowest calling frequency and the highest calling frequency of the target interface when the service system is operating normally; The product of the lowest calling frequency and the reduction coefficient is used as the lowest frequency threshold, and the product of the highest calling frequency and the amplification coefficient is used as the highest frequency threshold.

5. The method according to claim 1, characterized in that Before determining whether the target application fails by the position of the call frequency of the target interface in the frequency data set, the method further includes: Obtain the minimum and maximum values ​​of the historical call frequencies of the target interface; Determine a first quartile Q1, a median Q2, and a third quartile Q3 according to the minimum value and the maximum value, wherein the first quartile is the sum of one quarter of the difference between the maximum value and the minimum value and the minimum value, the median is one half of the sum of the maximum value and the minimum value, and the third quartile is the sum of three quarters of the difference between the maximum value and the minimum value and the minimum value; The difference between the third quartile and the first quartile is obtained as the interquartile range (IQR); The difference between the first quartile and X times the interquartile range is obtained as the lower frequency limit (Q1-X*IQR), and the sum between the third quartile and Y times the interquartile range is obtained as the upper frequency limit (Q4+Y*IQR), where X and Y are control parameters.

6. The method according to claim 1, characterized in that After determining whether a service failure occurs in the service system based on the call data, the method further includes: The currently acquired call data of the target interface is saved in a database, wherein the database deletes expired call data according to a configured expiration time; and / or, when it is determined that a service failure occurs in the service system, an alarm message is pushed.

7. A service monitoring device, characterized in that: include: A receiving unit, used to receive a monitoring instruction, wherein the monitoring instruction is used to indicate whether a service abnormality occurs in the monitoring service system; an acquisition unit, configured to acquire, in response to the monitoring instruction, call data of a plurality of service interfaces, wherein the call data is data generated when an application at a calling end calls a service at a server end through the service interface, and the service system comprises the calling end, the service interface, and the server end; A monitoring unit, configured to determine whether a service failure occurs in the service system based on the call data; The calling data includes a calling frequency, the plurality of service interfaces include a target interface currently being processed, the service failure includes a failure of a target application located at a calling end of the target interface, and the monitoring unit is further configured to determine whether a failure occurs in the target application according to the calling frequency of the target interface, including one of the following: Determining whether the target application fails by comparing the call frequency of the target interface with a frequency threshold; Determining whether the target application fails by the position of the calling frequency of the target interface in the frequency data set, wherein the frequency data set includes the calling frequency of the target interface; Determine whether the target application fails by comparing the calling frequency in a first sub-cycle with the calling frequency in a second sub-cycle, wherein the first sub-cycle is a time sub-cycle in which the currently acquired calling frequency is located, and the second sub-cycle is a sub-cycle before the first sub-cycle; Whether the target application fails is determined by comparing the calling frequency in the first sub-cycle with the calling frequency in the third sub-cycle, wherein the position of the first sub-cycle in the first cycle is the same as the position of the third sub-cycle in the second cycle, and the second cycle is a time period before the first cycle.

8. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the method described in any one of claims 1 to 6 through the computer program.

10. An electronic device comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by a processor, the method described in any one of claims 1 to 6 is implemented.