Abnormal service early warning method and device, storage medium and electronic equipment
By sending preset requests to the OCR service at the target time and obtaining server operation information, combined with the status prediction model, the OCR service monitoring lag problem is solved and early warning and stable operation are achieved.
Patent Information
- Application Number
- CN202410611635.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-23
AI Technical Summary
There is lag in the monitoring method of OCR service in the existing technology, which leads to abnormal business execution, and no effective solution has been proposed yet.
By sending a preset request to the OCR service at the target time, receiving feedback information and determining the interface status, obtaining server operation information, and predicting whether there are abnormalities in the OCR service based on the status prediction model, early warning is provided to ensure stable operation.
It eliminates the island problem of OCR service status monitoring, realizes early warning, ensures the stable operation of OCR services, and avoids abnormalities in business execution.
Smart Images

Figure CN118537871A
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to an abnormal service early warning method, device, storage medium, and electronic device. Background Art
[0002] When financial institutions process business, they usually use a variety of target services to assist in processing the business, thereby improving business processing efficiency. Among them, OCR (Optical Character Recognition) technology services, as a target service, have been widely used in multiple business areas in financial institutions. Therefore, new and more stringent requirements have been put forward for OCR recognition technology with higher recognition accuracy, faster processing speed, and more stable operation status. Faced with the continuous in-depth exploration and advancement of business scenarios, the traffic pressure on OCR services is increasing. The stability of OCR services directly affects the development of business. Therefore, it is necessary to determine the stability of OCR services to ensure the normal execution of business.
[0003] Currently, when determining whether the OCR service is running normally, the method usually used is to obtain the processing results of the OCR service after processing the image, and determine whether the processing results are correct, and then determine whether the OCR service is running normally. However, this monitoring method has a lag, and when it is determined that there is an abnormality in the OCR service, it has already affected the business, thereby causing abnormal business execution.
[0004] There is a lag problem in the methods for monitoring target services in related technologies, and no effective solution has been proposed yet. Summary of the invention
[0005] The present application provides an abnormal service early warning method, device, storage medium and electronic device to solve the problem of lag in the method of monitoring the target service in the related art.
[0006] According to one aspect of the present application, an abnormal service early warning method is provided. The method includes: sending a preset request to a target service at a target time, receiving feedback information sent by the target service, and determining the interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image; obtaining the operation information of the server where the target service is located at the target time, and determining the operation index data of the server according to the operation information, and obtaining multiple operation index data; inputting the multiple operation index data and the interface status information into a state prediction model to obtain the prediction result of the target service, wherein the prediction result is used to characterize whether the target service is abnormal.
[0007] Optionally, determining the interface status information of the target service based on the feedback information includes: determining whether the feedback information contains a first status code, wherein the first status code is used to indicate the interface status of the target service; in a case where the feedback information contains the first status code, determining the interface status information of the target service based on the identification time in the feedback information, wherein the identification time is the time for the target service to identify a preset image; in a case where the feedback information does not contain the first status code, determining that the interface status information of the target service is abnormal.
[0008] Optionally, determining the interface status information of the target service based on the identification time in the feedback information includes: judging whether the identification time is greater than a time threshold; when the identification time is greater than the time threshold, determining that the interface status information of the target service is abnormal; when the identification time is less than or equal to the time threshold, determining that the interface status information of the target service is normal.
[0009] Optionally, when the identification duration is greater than a duration threshold, the method also includes: obtaining interface status information of the target service at multiple historical moments within a historical time period to obtain multiple historical interface status information; judging whether multiple historical interface status information are all abnormal; when multiple historical interface status information are all abnormal, determining that the interface status information of the target service at the target moment is faulty; when there is at least one normal historical interface status information among multiple historical interface status information, determining that the interface status information of the target service at the target moment is abnormal.
[0010] Optionally, determining the operation index data of the server according to the operation information, and obtaining multiple operation index data includes: receiving server operation information sent by a monitoring module deployed on the server, wherein the operation information includes M operation data, wherein M is a positive integer; filtering the M operation data in the operation information through preset instructions, filtering to obtain N operation data, and obtaining multiple operation indicators, wherein N is a positive integer and N is less than M; determining the indicator value of each operation indicator in turn through the N operation data, and obtaining multiple operation index data.
[0011] Optionally, the state prediction model is trained in the following manner: historical information of the target service is obtained, and multiple sample data are generated based on the historical information, wherein each sample data includes historical interface state information of the target service at any historical moment, historical operating indicator data of the server, and operating state of the target service; the initial classification model is trained with multiple sample data to obtain a state prediction model.
[0012] Optionally, sending a preset request to a target service at a target time includes: determining whether the target time has been reached, wherein the target time is determined based on a start time and a preset detection period; generating a heartbeat monitoring package when the target time has been reached, wherein the heartbeat monitoring package includes a preset picture, and an amount of text recognition in the preset picture is less than a preset amount; generating a preset request based on the heartbeat monitoring package, and sending the preset request to the target service.
[0013] According to another aspect of the present application, an early warning device for abnormal service is provided. The device includes: a first determination unit, which is used to send a preset request to a target service at a target time, receive feedback information sent by the target service, and determine the interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image; a second determination unit, which is used to obtain the operation information of the server where the target service is located at the target time, and determine the operation index data of the server according to the operation information to obtain multiple operation index data; a prediction unit, which is used to input multiple operation index data and interface status information into a state prediction model to obtain the prediction result of the target service, wherein the prediction result is used to characterize whether the target service is abnormal.
[0014] According to another aspect of the present invention, a computer storage medium is provided, which is used to store a program, wherein when the program is running, the device where the computer storage medium is located is controlled to execute an abnormal service early warning method.
[0015] According to another aspect of the present invention, an electronic device is provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein when the computer-readable instructions are executed, an abnormal service early warning method is executed.
[0016] Through this application, the following steps are adopted: sending a preset request to the target service at the target time, receiving feedback information sent by the target service, and determining the interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image; obtaining the operation information of the server where the target service is located at the target time, and determining the operation index data of the server according to the operation information, and obtaining multiple operation index data; inputting multiple operation index data and interface status information into the state prediction model to obtain the prediction result of the target service, wherein the prediction result is used to characterize whether the target service is abnormal. The problem of lag in the method for monitoring the target service in the related technology is solved. First, the interface status of the OCR service is monitored and the interface status of the OCR service is recorded, and then the server operation information is monitored and collected to form the server operation index data. Finally, the OCR service status prediction model is constructed by combining these two parts of data to eliminate the island problem of these two parts of data, and through the OCR service status prediction model, it is predicted whether the OCR service is abnormal, thereby achieving the technical effect of early warning to ensure the stable operation of the OCR service. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 is a flowchart of an abnormal service early warning method provided according to an embodiment of the present application;
[0019] Figure 2 is a flowchart of an optional method for obtaining interface status information of a target service according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of an early warning system for abnormal services provided according to an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of an early warning device for abnormal services provided according to an embodiment of the present application;
[0022] Figure 5 It is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0024] 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.
[0025] 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 sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. 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.
[0026] It should be noted that the early warning method, device, storage medium and electronic device for abnormal service determined in the present disclosure can be used in the field of artificial intelligence, and can also be used in any field other than the field of artificial intelligence. The application field of the early warning method, device, storage medium and electronic device for abnormal service determined in the present disclosure is not limited.
[0027] It should be noted that the collected information, user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) used in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated. Corresponding operation portals are provided for users to choose to authorize or refuse to use. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0028] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0029] CPU: Central Processing Unit.
[0030] GPU: Graphics Processing Unit, graphics processor.
[0031] LightGBM algorithm: Light Gradient Boosting Machine, lightweight gradient boosting machine algorithm, is a machine learning algorithm based on gradient boosting decision tree. It has high efficiency and accuracy when processing large-scale data sets and high-dimensional features.
[0032] According to an embodiment of the present application, a warning method for abnormal service is provided.
[0033] Figure 1 1 is a flow chart of an abnormal service warning method provided according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0034] Step S101, sending a preset request to a target service at a target time, receiving feedback information sent by the target service, and determining the interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image.
[0035] It should be noted that the target service can be an OCR service. The OCR service can be set in a client or a business system and connected to the monitoring server used in this application. The monitoring server will send a preset request to the target service at the target time, and the preset request will be processed by the target service to obtain feedback information, and then the interface status information of the target service is determined according to the feedback information. The interface indicated by the interface status information is the service interface used by the target service to process images. After receiving the interface status information, it can be determined whether the target service is running normally according to the interface status information.
[0036] Specifically, the preset request may be an image recognition request sent to the target service. After the preset request is sent to the service interface of the target service, the target service can recognize the text in the preset image in the preset request according to the preset request, obtain the recognition result, and send feedback information based on the recognition result. The feedback information may include a status code, and then it can be determined whether the target service executes the preset request based on the status code, thereby determining whether the interface status of the target service is normal.
[0037] For example, when the status code in the feedback information is 100, it is determined that the interface status of the target service is abnormal, and when the status code in the feedback information is 200, it is determined that the interface status of the target service is normal.
[0038] Step S102, obtaining the operation information of the server where the target service is located at the target time, and determining the operation index data of the server according to the operation information to obtain a plurality of operation index data.
[0039] It should be noted that the server's operating information may include not only the server's hardware operating status, such as CPU usage, amount of used memory, etc., but also the server's network connection status, such as network delay, network speed, etc., thereby obtaining multiple operating indicator data of the server.
[0040] Specifically, after obtaining the interface status information, it is also necessary to obtain the operating information of the server where the target service is located at the target moment, so as to determine the operating indicator data of the server based on the operating information, and determine the operating status of the server running the target service based on the operating indicator data, so as to determine whether the target service is running normally from the server's perspective, that is, determine whether the server is running normally based on multiple operating indicator data of the server, and then determine the operating status of the target service based on the operating status of the server.
[0041] Step S103, inputting a plurality of operation indicator data and interface status information into a status prediction model to obtain a prediction result of the target service, wherein the prediction result is used to characterize whether the target service has an abnormality.
[0042] It should be noted that the state prediction model can be used to warn the operating status of the OCR service. When the prediction result of the state prediction model is normal, it indicates that the operating status of the OCR service is normal. When the prediction result of the state prediction model is abnormal, it indicates that the operating status of the OCR service is abnormal.
[0043] Specifically, after obtaining the data of the above two dimensions, that is, obtaining multiple operating indicator data and interface status information, the multiple operating indicator data and interface status information can be analyzed through the model to predict the operating status of the target service, and when the prediction result is abnormal, the target service can be maintained in time to ensure that the target service can perform business processing normally.
[0044] The early warning method for abnormal service provided by the embodiment of the present application is to send a preset request to the target service at the target time, receive feedback information sent by the target service, and determine the interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image; obtain the operation information of the server where the target service is located at the target time, and determine the operation index data of the server according to the operation information to obtain multiple operation index data; input the multiple operation index data and the interface status information into the state prediction model to obtain the prediction result of the target service, wherein the prediction result is used to characterize whether the target service is abnormal. The problem of lag in the method for monitoring the target service in the related technology is solved. First, the interface status of the OCR service is monitored and the interface status of the OCR service is recorded, and then the server operation information is monitored and collected to form the server operation index data. Finally, the OCR service status prediction model is constructed by combining these two parts of data to eliminate the island problem of these two parts of data, and through the OCR service status prediction model, it is predicted whether the OCR service is abnormal, so as to achieve the technical effect of early warning to ensure the stable operation of the OCR service.
[0045] In order to determine the interface status information of the target service, optionally, in the early warning method for abnormal service provided in an embodiment of the present application, determining the interface status information of the target service based on the feedback information includes: judging whether the feedback information contains a first status code, wherein the first status code is used to indicate the interface status of the target service; in a case where the feedback information contains the first status code, determining the interface status information of the target service based on the recognition time in the feedback information, wherein the recognition time is the time for the target service to recognize a preset picture; in a case where the feedback information does not contain the first status code, determining that the interface status information of the target service is abnormal.
[0046] It should be noted that since the interface status information can indicate whether the target service processes the preset request normally, after sending the preset request to the target service, the interface status information can be determined through the received feedback information, thereby further determining whether the operating status of the target service is abnormal based on the interface status information.
[0047] Specifically, when determining the interface status information, first determine whether there is a first status code in the feedback information. If there is no first status code, it indicates that the result of this detection is an abnormal interface status, and the interface status information can be recorded as 1. If there is a first status code, it is necessary to further determine the interface status information based on the recognition time in the feedback information, wherein the recognition time in the feedback information is the time taken for the target service to identify the text in the preset picture in the preset request when executing the preset request, thereby making an initial judgment on the interface status information through the first status code.
[0048] In order to improve the accuracy of judging the interface status information, optionally, in the early warning method for abnormal service provided in the embodiment of the present application, determining the interface status information of the target service according to the identification time in the feedback information includes: judging whether the identification time is greater than a time threshold; when the identification time is greater than the time threshold, determining that the interface status information of the target service is abnormal; when the identification time is less than or equal to the time threshold, determining that the interface status information of the target service is normal.
[0049] It should be noted that, since the processing time of the target service for the request will also increase when an exception occurs, the operating status of the target service can be determined according to the processing time of the preset image in the preset request.
[0050] Specifically, when the first status code exists in the feedback information, the identification time can be obtained, and it can be determined whether the identification time is greater than the threshold. If it is greater than the threshold, it indicates that the result of this detection is an abnormal interface status, and the interface status information can be recorded as 1. When the identification time is less than or equal to the time threshold, the interface status information of the target service is determined to be normal, and the interface status information can be recorded as 0, so as to make further judgment on the interface status based on the identification time.
[0051] Optionally, in the early warning method for abnormal service provided in the embodiment of the present application, when the identification duration is greater than a duration threshold, the method also includes: obtaining interface status information of the target service at multiple historical moments within a historical time period to obtain multiple historical interface status information; judging whether multiple historical interface status information are all abnormal; when multiple historical interface status information are all abnormal, determining that the interface status information of the target service at the target moment is faulty; when there is at least one normal historical interface status information among multiple historical interface status information, determining that the interface status information of the target service at the target moment is abnormal.
[0052] Specifically, when the identification duration is greater than the duration threshold, the detection results of multiple detections of the interface status information within the historical time period can also be obtained, and when multiple detection results all indicate that the interface status information is abnormal, it is determined that the interface status information of the target service at the target time is a fault, and the interface status information can be recorded as 2. Therefore, when the interface status information is detected to be abnormal for multiple consecutive times, the interface status information is upgraded to a fault, so that the operation and maintenance personnel can give priority to the corresponding maintenance operations on the target service, ensuring that the target service can resume normal operation as soon as possible.
[0053] Figure 2 is a flowchart of an optional method for obtaining interface status information of a target service according to an embodiment of the present application, such as Figure 2As shown, the operation of sending a preset request to the target service can be a heartbeat detection operation, and a heartbeat packet is sent to the target service according to a preset period (for example, 1s), and the heartbeat packet includes a preset picture. After receiving the feedback information, if the interface return status is not 200, then record the number of abnormal heartbeats once, if the interface return status is 200, then determine whether this recognition exceeds 30s, if not more than 30s, record the interface status as 0 (normal) and record the time-consuming OCR recognition of this heartbeat request. If it exceeds 30s, then determine whether the continuous abnormal heartbeat number exceeds 3 times, if not more than 3 times, record the interface status as 1 (abnormal) and record the time-consuming OCR recognition of this heartbeat request, if the continuous abnormal heartbeat number is greater than 3 times, record the interface status as 2 (fault) and record the time-consuming OCR recognition of this heartbeat request, and then determine the interface status information of the target service at the target time through the heartbeat detection operation, and further determine whether the target service is running normally according to the interface status information.
[0054] In order to accurately obtain the operating status of the server, optionally, in the early warning method for abnormal service provided in the embodiment of the present application, the operating index data of the server is determined according to the operating information, and multiple operating index data are obtained, including: receiving server operating information sent by a monitoring module deployed on the server, wherein the operating information includes M operating data, where M is a positive integer; filtering the M operating data in the operating information through preset instructions, filtering to obtain N operating data, and obtaining multiple operating indicators, where N is a positive integer and N is less than M; determining the indicator value of each operating indicator in turn through the N operating data to obtain multiple operating indicator data.
[0055] Specifically, when obtaining the operation index data, firstly, the server monitoring device can be used to execute Linux commands on the server where the OCR service is located every second to view the basic server information such as the server CPU, memory, GPU memory, GPU graphics card temperature, GPU fan speed, etc., to form a server basic information monitoring table, thereby obtaining M operation data, as shown in Table 1:
[0056] Table 1
[0057] Indicator Chinese name Indicator English name Total memory Mem_Total Amount of free memory Mem_Free Amount of memory used Mem_Used User space CPU usage CPU_User System kernel CPU usage CPU_Sys Idle CPU CPU_Idle GPU fan speed GPU_Fan GPU graphics card temperature GPU_Temp GPU total memory GPU_Total GPU memory consumption GPU_Used GPU memory usage GPU_Memory_Usage
[0058] When obtaining the above-mentioned operation data, the data can be obtained in the following ways:
[0059] 1. Check and record the server CPU information. Use Linux commands to check the server CPU load and record data such as user space CPU usage, system kernel CPU usage, and idle CPU percentage.
[0060] 2. Check and record the server memory information. Use Linux commands to check the server memory load and record data such as total memory, used memory, and available memory.
[0061] 3. Check and record GPU memory information. Use Linux commands to check GPU graphics card load and record data such as GPU total memory, GPU memory consumption, and GPU memory usage.
[0062] 4. Check and record the GPU graphics card temperature. Use Linux commands to check the GPU fan speed, GPU graphics card temperature and other data.
[0063] Furthermore, after obtaining the above-mentioned operating data, feature screening is required. The M operating data in the operating information are screened through preset instructions to obtain N operating data, and the input data required for the prediction model, that is, the operating indicators, are obtained. The value of each operating indicator is further calculated based on the operating data to obtain multiple operating indicator data.
[0064] For example, the preset instruction may be a plurality of screening conditions. For example, if the preset instruction includes the screening condition of "no GPU memory consumption data is required", the GPU memory consumption operation data may be deleted from the operation data in Table 1, thereby obtaining N operation data after screening. Furthermore, in the case where the operation indicator is the memory usage rate, the total memory and the used memory may be used to calculate the memory usage rate to obtain (total memory-used memory) / total memory, thereby completing the calculation of the indicator value corresponding to the operation indicator to obtain a plurality of operation indicator data. The operation indicator data may be as shown in Table 2:
[0065] Table 2
[0066] Indicator Chinese name Indicator English name OCR service interface status ocr_interfacee_status Memory usage Mem_Used_rate User space CPU usage CPU_User System kernel CPU usage CPU_Sys GPU fan speed GPU_Fan GPU graphics card temperature GPU_Temp GPU memory usage GPU_Memory_Usage
[0067] In order to improve the accuracy of the status prediction model, optionally, in the early warning method for abnormal services provided in an embodiment of the present application, the status prediction model is trained in the following manner: historical information of the target service is obtained, and multiple sample data are generated based on the historical information, wherein each sample data includes historical interface status information of the target service at any historical moment, historical operating indicator data of the server, and operating status of the target service; the initial classification model is trained using multiple sample data to obtain a status prediction model.
[0068] Specifically, when training the model, multiple historical information of the target service is required as sample data to train the model, wherein each sample data includes the historical interface status information of the target service at any historical moment, the historical operating indicator data of the server, and the operating status of the target service, so that the model can determine the operating status of the target service based on the interface status information and the server operating indicator data, thereby improving the prediction accuracy of the model.
[0069] Optionally, in the early warning method for abnormal services provided in an embodiment of the present application, sending a preset request to the target service at a target time includes: determining whether the target time has been reached, wherein the target time is determined based on the start time and a preset detection period; when the target time has been reached, generating a heartbeat monitoring package, wherein the heartbeat monitoring package includes a preset picture, and the amount of text recognition in the preset picture is less than a preset number; generating a preset request based on the heartbeat monitoring package, and sending the preset request to the target service.
[0070] Specifically, in order to ensure the timeliness of monitoring the target service, the target service can be detected according to a preset detection cycle. For example, the running status of the target service is detected once per second, and whether the target time for detecting the target service has arrived is determined based on the starting time and the detection cycle. When the target time is reached, a heartbeat monitoring package needs to be generated and sent to the target service, so as to determine the interface status information of the target service based on the feedback information of the target service.
[0071] It should be noted that in order not to affect the normal execution of business by the target service, when generating a heartbeat monitoring package, it is necessary to place a picture with less text content in the heartbeat monitoring package, thereby reducing the time it takes for the target service to recognize the text in the picture, thereby achieving the technical effect of monitoring the interface status information of the target service without affecting the normal operation of the target service.
[0072] Figure 3 is a schematic diagram of an early warning system for abnormal services provided according to an embodiment of the present application, such as Figure 3 As shown, the warning system for abnormal services includes: multiple OCR services, a heartbeat monitoring module, a server monitoring module, and an OCR service warning module, among which:
[0073] The heartbeat monitoring module is connected to multiple OCR services and is used to send a heartbeat packet to the OCR service every second. The heartbeat packet contains a picture that can be quickly recognized. The return of the heartbeat request of the OCR service interface is recorded to form the heartbeat monitoring indicator data. A heartbeat request is sent to the OCR service once per second. If the interface return status is not 200, the number of abnormal heartbeats is recorded. If the interface return status is 200, it is determined whether the recognition exceeds 30s. If it does not exceed 30s, the interface status is recorded as 0 (normal) and the time consumed for the heartbeat request OCR recognition is recorded. If the recognition time exceeds 30s or the number of consecutive abnormal heartbeats is less than 3 times (including 3 times), the interface status is recorded as 1 (abnormal) and the time consumed for the heartbeat request OCR recognition is recorded. If the number of abnormal heartbeats exceeds 3 times, the interface status is recorded as 2 (unavailable) and the time consumed for the heartbeat request OCR recognition is recorded, thereby determining the interface status of each OCR service.
[0074] The server detection module is connected to multiple OCR services and is used to monitor the operating data of the server where each OCR service is located, thereby determining the operating indicator data of each server based on the operating data, and then predicting the operating status of each OCR service based on the operating indicator data to obtain a prediction result.
[0075] The OCR service early warning module is connected to the server detection module and the heartbeat monitoring module, and is used to receive the operating indicator data sent by the service detection module and the interface status recorded by the heartbeat monitoring module, and predict the operating status of the ORC service according to the operating indicator data and the interface status to obtain the prediction result, thereby completing the effective monitoring and management of the ORC service and ensuring the normal operation of the ORC service.
[0076] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0077] The embodiment of the present application also provides an abnormal service warning device. It should be noted that the abnormal service warning device of the embodiment of the present application can be used to execute the abnormal service warning method provided by the embodiment of the present application. The abnormal service warning device provided by the embodiment of the present application is introduced below.
[0078] Figure 4 Schematic diagram of an abnormal service warning device provided according to an embodiment of the present application. Figure 4 As shown, the device includes: a first determining unit 41, a second determining unit 42, and a predicting unit 43.
[0079] The first determination unit 41 is used to send a preset request to the target service at a target time, receive feedback information sent by the target service, and determine the interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image.
[0080] The second determining unit 42 is used to obtain the operation information of the server where the target service is located at the target time, and determine the operation index data of the server according to the operation information to obtain a plurality of operation index data.
[0081] The prediction unit 43 is used to input a plurality of operation indicator data and interface status information into the status prediction model to obtain a prediction result of the target service, wherein the prediction result is used to characterize whether the target service has an abnormality.
[0082] The early warning device for abnormal service provided in the embodiment of the present application is used, through the first determination unit 41, to send a preset request to the target service at the target time, receive the feedback information sent by the target service, and determine the interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image; the second determination unit 42 is used to obtain the operation information of the server where the target service is located at the target time, and determine the operation index data of the server according to the operation information to obtain multiple operation index data; the prediction unit 43 is used to input the multiple operation index data and the interface status information into the state prediction model to obtain the prediction result of the target service, wherein the prediction result is used to characterize whether the target service is abnormal. The problem of hysteresis in the method for monitoring the target service in the related art is solved. First, the interface status of the OCR service is monitored and the interface status of the OCR service is recorded, and then the server operation information is monitored and collected to form the server operation index data. Finally, the OCR service status prediction model is constructed by combining the two parts of data to eliminate the island problem of the two parts of data, and the OCR service status prediction model is used to predict whether the OCR service is abnormal, thereby achieving the technical effect of early warning to ensure the stable operation of the OCR service.
[0083] Optionally, in the early warning device for abnormal service provided in the embodiment of the present application, the first determination unit 41 includes: a first judgment module, used to determine whether the feedback information contains a first status code, wherein the first status code is used to indicate the interface status of the target service; a first determination module, used to determine the interface status information of the target service according to the recognition time in the feedback information when the feedback information contains the first status code, wherein the recognition time is the time for the target service to recognize a preset picture; a second determination module, used to determine that the interface status information of the target service is abnormal when the feedback information does not contain the first status code.
[0084] Optionally, in the early warning device for abnormal service provided in the embodiment of the present application, the first determination module includes: a judgment submodule, used to determine whether the identification time is greater than a time threshold; a first determination submodule, used to determine that the interface status information of the target service is abnormal when the identification time is greater than the time threshold; and a second determination submodule, used to determine that the interface status information of the target service is normal when the identification time is less than or equal to the time threshold.
[0085] Optionally, in the early warning device for abnormal service provided in the embodiment of the present application, when the identification duration is greater than a duration threshold, the device also includes: a first acquisition unit, used to acquire interface status information of the target service at multiple historical moments within a historical time period, and obtain multiple historical interface status information; a judgment unit, used to judge whether multiple historical interface status information are all abnormal; a third determination unit, used to determine that the interface status information of the target service at the target moment is faulty when multiple historical interface status information are all abnormal; and a fourth determination unit, used to determine that the interface status information of the target service at the target moment is abnormal when there is at least one normal historical interface status information among the multiple historical interface status information.
[0086] Optionally, in the early warning device for abnormal services provided in the embodiment of the present application, the second determination unit 42 includes: a receiving module, used to receive server operation information sent by a monitoring module deployed on the server, wherein the operation information includes M operation data, wherein M is a positive integer; a screening module, used to screen the M operation data in the operation information through preset instructions, screen out N operation data, and obtain multiple operation indicators, wherein N is a positive integer and N is less than M; a third determination module, used to determine the indicator value of each operation indicator in turn through the N operation data, and obtain multiple operation indicator data.
[0087] Optionally, in the early warning device for abnormal services provided in an embodiment of the present application, the state prediction model is trained in the following manner: a second acquisition unit obtains historical information of the target service and generates multiple sample data based on the historical information, wherein each sample data includes historical interface state information of the target service at any historical moment, historical operating indicator data of the server, and operating status of the target service; a training unit trains the initial classification model through multiple sample data to obtain a state prediction model.
[0088] Optionally, in the early warning device for abnormal service provided in the embodiment of the present application, the first determination unit 41 includes: a second judgment module, used to judge whether the target time has been reached, wherein the target time is determined based on the start time and a preset detection period; a generation module, used to generate a heartbeat monitoring package when the target time is reached, wherein the heartbeat monitoring package includes a preset picture, and the amount of text recognition in the preset picture is less than a preset number; a sending module, used to generate a preset request based on the heartbeat monitoring package, and send the preset request to the target service.
[0089] The above-mentioned warning device for abnormal service includes a processor and a memory. The above-mentioned first determination unit 41, second determination unit 42, prediction unit 43, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0090] The processor includes a kernel, and the kernel calls the corresponding program unit from the memory. One or more kernels can be set, and the problem of lag in the method of monitoring the target service in the related art is solved by adjusting the kernel parameters.
[0091] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0092] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the early warning method for abnormal service is implemented.
[0093] An embodiment of the present invention provides a processor, which is used to run a program, wherein the early warning method for abnormal service is executed when the program is running.
[0094] Figure 5 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 5 As shown, an embodiment of the present invention provides an electronic device, the electronic device 50 includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor executes the program to implement the steps of the above-mentioned abnormal service warning method. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0095] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of initializing the early warning method for the above-mentioned abnormal service.
[0096] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0097] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0098] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0100] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0101] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0102] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0103] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0104] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. An early warning method for abnormal service, It is characterized in that include: Sending a preset request to a target service at a target time, receiving feedback information sent by the target service, and determining interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image; Acquire the operation information of the server where the target service is located at the target time, and determine the operation index data of the server according to the operation information to obtain a plurality of operation index data; The plurality of operation indicator data and the interface status information are input into a status prediction model to obtain a prediction result of the target service, wherein the prediction result is used to characterize whether there is an abnormality in the target service.
2. The method according to claim 1, It is characterized in that Determining the interface status information of the target service according to the feedback information includes: Determining whether the feedback information includes a first status code, wherein the first status code is used to indicate an interface status of the target service; In a case where the feedback information includes the first status code, determining the interface status information of the target service according to the identification time in the feedback information, wherein the identification time is the time taken by the target service to identify the preset image; When the feedback information does not include the first status code, it is determined that the interface status information of the target service is abnormal.
3. The method according to claim 2, It is characterized in that Determining the interface status information of the target service according to the identification duration in the feedback information includes: Determine whether the recognition time is greater than a time threshold; In a case where the identification duration is greater than the duration threshold, determining that the interface status information of the target service is abnormal; When the identification duration is less than or equal to the duration threshold, it is determined that the interface status information of the target service is normal.
4. The method according to claim 3, It is characterized in that In a case where the recognition time is greater than the time threshold, the method further includes: Acquire interface status information of the target service at multiple historical moments in a historical time period to obtain multiple historical interface status information; Determine whether the plurality of historical interface status information are all abnormal; In a case where the plurality of historical interface status information are all abnormal, determining that the interface status information of the target service at the target time is faulty; In a case where there is at least one normal historical interface status information among the multiple historical interface status information, it is determined that the interface status information of the target service at the target time is abnormal.
5. The method according to claim 1, It is characterized in that Determining the operation index data of the server according to the operation information, obtaining a plurality of operation index data includes: Receiving server operation information sent by a monitoring module deployed on the server, wherein the operation information includes M operation data, where M is a positive integer; The M operation data in the operation information are screened by a preset instruction to obtain N operation data, and a plurality of operation indicators are obtained, wherein N is a positive integer and N is less than M; The index value of each operating index is determined in sequence through the N operating data to obtain the multiple operating index data.
6. The method according to claim 1, It is characterized in that The state prediction model is trained in the following way: Acquire historical information of the target service, and generate multiple sample data according to the historical information, wherein each sample data includes historical interface status information of the target service at any historical moment, historical operation indicator data of the server, and operation status of the target service; The initial classification model is trained using the multiple sample data to obtain the state prediction model.
7. The method according to claim 1, It is characterized in that Sending a preset request to a target service at a target time includes: Determining whether the target time has been reached, wherein the target time is determined according to the start time and a preset detection period; When the target time is reached, a heartbeat monitoring package is generated, wherein the heartbeat monitoring package includes a preset picture, and the amount of text recognition in the preset picture is less than a preset amount; The preset request is generated according to the heartbeat monitoring package, and the preset request is sent to the target service.
8. An early warning device for abnormal service, It is characterized in that include: A first determining unit is configured to send a preset request to a target service at a target time, receive feedback information sent by the target service, and determine interface status information of the target service according to the feedback information, wherein the preset request carries a preset image, and the preset request is used to instruct the target service to identify the preset image; A second determining unit is used to obtain the operation information of the server where the target service is located at the target time, and determine the operation index data of the server according to the operation information to obtain a plurality of operation index data; The prediction unit is used to input the multiple operation indicator data and the interface status information into a status prediction model to obtain a prediction result of the target service, wherein the prediction result is used to characterize whether the target service has an abnormality.
9. A computer storage medium, It is characterized in that The computer storage medium is used to store a program, wherein when the program is running, the device where the computer storage medium is located is controlled to execute the abnormal service early warning method according to any one of claims 1 to 7.
10. An electronic device, It is characterized in that It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the abnormal service early warning method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Information processing method and device, electronic equipment and medium
CN111698131A
Abnormal event detection method and device, storage medium and electronic equipment
CN116302821A
Kafka anomaly monitoring method and device based on AI algorithm
CN117056171A
Method and system monitoring model set associated with character recognition
KR102626798B1
