Anomaly detection method, problem diagnosis method and related products

By performing text processing and aggregation on log data, and using pre-trained anomaly detection models to perform log analysis within a sliding time window, it solves the problems in the existing technology that log analysis methods require professional knowledge and is difficult to maintain, and achieves efficient anomaly detection. and problem diagnosis, reducing costs and difficulty.

CN113704008BActive Publication Date: 2024-09-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110254899.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-09
Publication Date
2024-09-10
Estimated Expiration
2041-03-09

AI Technical Summary

Technical Problem

Existing log analysis methods based on rule matching require professional knowledge, are difficult and costly to maintain, and are difficult to achieve efficient anomaly detection and problem diagnosis.

Method used

Log vectors are obtained by text processing of log data, aggregated according to sliding time windows, and pre-trained anomaly detection models (such as XGBoost models) are used for anomaly detection and problem diagnosis, which reduces the professional requirements for analysts and simplifies Rule maintenance.

Benefits of technology

It improves the system's anomaly detection efficiency and problem diagnosis efficiency, reduces implementation difficulty and cost, can obtain accurate anomaly detection results without complex maintenance, and assists in problem diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113704008B
    Figure CN113704008B
Patent Text Reader

Abstract

The present application discloses an anomaly detection method, a problem diagnosis method and related products, which at least involve natural language processing and machine learning in artificial intelligence. The log data of the target system is processed to obtain a log vector, and the log vector is aggregated according to a sliding time window. After the aggregated log vector is input, the anomaly detection model can detect whether there is an anomaly in the target system within the corresponding time. The trained anomaly detection model is used to assist in the anomaly detection of the target system, which reduces the professional requirements for analysts and does not require complex maintenance. While improving the anomaly detection efficiency of the system, it reduces the difficulty and cost of implementation. When the anomaly detection model finds that the target system is abnormal, the original log data within the relevant time can be re-input into the anomaly detection model to obtain the score of each log, and the high-scoring logs are clustered using the topic model. Finally, the system problem is diagnosed based on the cluster analysis results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an anomaly detection method, a problem diagnosis method and related products. Background Art

[0002] Log analysis is a common method used by software system developers to detect anomalies and diagnose problems in the system. The purpose of anomaly detection is to detect possible anomalies in the system through log analysis and provide feedback to developers for further diagnosis. At present, a log analysis method based on rule matching requires analysts to have a professional understanding of the software system, establish corresponding rules based on prior knowledge, and filter and classify logs based on relevant matching methods such as regular expressions to extract key information from the full log. In this way, this key information can be used to achieve anomaly detection.

[0003] However, since the above log analysis method requires relatively professional and comprehensive prior knowledge to establish matching rules, it has high requirements on personnel and the matching rules are difficult to maintain, it is difficult to implement continuously and the cost is high. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides an anomaly detection method, a problem diagnosis method and related products to improve the anomaly detection efficiency and problem diagnosis efficiency of the system while reducing the implementation difficulty and cost.

[0005] The embodiments of the present application disclose the following technical solutions:

[0006] The first aspect of the present application provides an anomaly detection method, comprising:

[0007] Perform text processing on the log data of the target system to obtain a log vector;

[0008] Aggregating the log vectors according to a sliding time window;

[0009] The aggregated vector is used as an input of an anomaly detection model to obtain an anomaly detection result of the target system output by the anomaly detection model; the anomaly detection model is trained using historical log data of the target system and problem feedback data within a corresponding time of the historical log data.

[0010] The second aspect of the present application provides a problem diagnosis method. When the abnormality detection result obtained by using the abnormality detection method provided in the first aspect indicates that the target system has an abnormality, the problem diagnosis method includes:

[0011] The log data is used as the input of the anomaly detection model to obtain the score of each log in the log data output by the anomaly detection model; the anomaly detection model is an XGBoost model;

[0012] Filter out N logs with the largest scores from the log data as abnormal logs; N is a positive integer;

[0013] The abnormal logs are clustered and analyzed using a topic model, and the problem category of the target system is diagnosed based on the cluster analysis results.

[0014] The third aspect of the present application provides an abnormality detection device, comprising:

[0015] A text processing module is used to perform text processing on the log data of the target system to obtain a log vector;

[0016] A vector aggregation module, used to aggregate the log vectors according to a sliding time window;

[0017] The anomaly detection module is used to use the aggregated vector as the input of an anomaly detection model to obtain an anomaly detection result of the target system output by the anomaly detection model; the anomaly detection model is trained using the historical log data of the target system and the problem feedback data within the corresponding time of the historical log data.

[0018] A fourth aspect of the present application provides a problem diagnosis device, comprising:

[0019] A score evaluation module, configured to, when the anomaly detection result obtained by using the anomaly detection device provided by the third aspect indicates that the target system has an anomaly, use the log data as an input of the anomaly detection model to obtain a score for each log in the log data output by the anomaly detection model; the anomaly detection model is an XGBoost model;

[0020] An abnormal log screening module is used to screen out N logs with the largest scores from the log data as abnormal logs; N is a positive integer;

[0021] A clustering analysis module, used to perform clustering analysis on the abnormal logs using a topic model;

[0022] The problem diagnosis module is used to diagnose the problem category of the target system according to the cluster analysis result.

[0023] A fifth aspect of the present application provides a computer device, the device comprising a processor and a memory;

[0024] The memory is used to store program code and transmit the program code to the processor;

[0025] The processor is used to execute the anomaly detection method provided in the first aspect, or execute the problem diagnosis method provided in the second aspect according to the instructions in the program code.

[0026] In a sixth aspect, the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the anomaly detection method provided in the first aspect, or execute the problem diagnosis method provided in the second aspect.

[0027] It can be seen from the above technical solution that the log vector is obtained by text processing the log data of the target system, the log data is converted into a vector representation, and then aggregated in the form of a vector. The log vector is aggregated according to the sliding time window, and the original log data is integrated according to the time dimension and used as the input of the anomaly detection model. In the technical solution of the present application, the training data used by the anomaly detection model matches the data input when the model is actually used and the data form of the expected output. The anomaly detection model is obtained by training the historical log data of the target system and the problem feedback data within the corresponding time of the historical log data. Therefore, after the aggregated log vector is input, the model can detect whether there is an anomaly in the target system within the corresponding time, and obtain accurate anomaly detection results in the time dimension. The present application uses a trained anomaly detection model to assist analysts in completing anomaly detection of the target system, which reduces the professional requirements for analysts and does not require complex maintenance. Therefore, it can reduce the difficulty and cost of implementation while improving the anomaly detection efficiency of the system.

[0028] When the anomaly detection model is applied and an anomaly is found in the target system, the original log data within the relevant time can be re-input into the anomaly detection model to obtain the score of each log. The higher the score, the greater the impact of the system anomaly predicted by the anomaly detection model. According to the score output by the anomaly detection model, cluster analysis is performed using the topic model, and finally the system problem can be diagnosed based on the cluster analysis results. It can be seen that the technical solution of this application can not only realize anomaly detection by using the anomaly detection model, but also assist in problem diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1A flowchart of an anomaly detection method provided in an embodiment of the present application;

[0031] Figure 2 A schematic diagram of a training process of an anomaly detection model provided in an embodiment of the present application;

[0032] Figure 3A A schematic diagram of using training data to train an anomaly detection model provided in an embodiment of the present application;

[0033] Figure 3B A schematic diagram of the evaluation results of an anomaly detection model using a ROC curve provided in an embodiment of the present application;

[0034] Figure 3C A schematic diagram of anomaly detection using an anomaly detection model provided in an embodiment of the present application;

[0035] Figure 4 A flowchart of a problem diagnosis method provided in an embodiment of the present application;

[0036] Figure 5 A schematic diagram of a process for implementing anomaly detection and problem diagnosis provided in an embodiment of the present application;

[0037] Figure 6 A schematic diagram of the structure of an abnormality detection device provided in an embodiment of the present application;

[0038] Figure 7 A schematic diagram of the structure of a problem diagnosis device provided in an embodiment of the present application;

[0039] Figure 8 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0040] Fig. 9 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0042] In the related art, when detecting software system anomalies through log analysis, professionals need to prepare rules, and then filter and classify the logs based on relevant matching methods such as regular expressions to extract key information from the full logs. In view of the problems of difficult maintenance and high implementation cost of this method, a new technical solution for anomaly detection is provided in this application.

[0043] In the technical solution of the present application, anomaly detection is implemented through a pre-trained anomaly detection model, and the anomaly detection model can also assist in problem diagnosis. When it is necessary to perform anomaly detection on a software system to be detected (hereinafter referred to as the target system), it is only necessary to extract the log data of the system, convert it into a vector form, aggregate the log data in vector form according to a sliding time window, and then input the aggregated log vector into the anomaly detection model to obtain the anomaly detection result output by the model. The technical solution of the present application reduces the professional requirements for log analysts and does not require complex maintenance. Therefore, it can reduce the difficulty and cost of implementation while improving the anomaly detection efficiency of the system.

[0044] The anomaly detection method and problem diagnosis method provided in the embodiments of the present application are based on artificial intelligence. Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.

[0045] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0046] In the embodiments of the present application, the artificial intelligence software technologies mainly involved include the above-mentioned natural language processing, machine learning / deep learning and other directions. For example, it may involve semantic understanding (Semantic understanding) in natural language processing (NLP), robot question answering, including question understanding (query understanding), answer extraction (Answer extraction), answer argumentation (Answer argument), and it may also involve deep learning (Deep Learning) in machine learning (Machine learning, ML), including various types of artificial neural networks (Artificial Neural Network, ANN).

[0047] The anomaly detection method and problem diagnosis method provided in this application can be applied to anomaly detection devices and problem diagnosis devices with data processing capabilities, such as terminal devices and servers. Among them, the terminal device can be a smart phone, a desktop computer, a laptop computer, a tablet computer, a smart speaker, a smart watch, etc., but is not limited to this; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.

[0048] Anomaly detection equipment and problem diagnosis equipment can have the ability to implement natural language processing. Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language used by people in daily life, so it is closely related to the study of linguistics. Natural language processing technology generally includes text processing, semantic understanding, machine translation, robot question and answer, knowledge graph and other technologies. In an embodiment of the present application, the text processing device can process the text through text preprocessing, semantic understanding and other technologies in natural language processing.

[0049] Anomaly detection equipment and problem diagnosis equipment can have machine learning capabilities. Machine learning is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks.

[0050] In the anomaly detection method and problem diagnosis method provided in the embodiments of the present application, the artificial intelligence model adopted mainly involves the application of natural language processing, which realizes the conversion of log data into log vectors through natural language processing, and performs system anomaly detection and scoring of log data based on the aggregated log vectors.

[0051] In addition, the text processing device provided in the embodiment of the present application also has cloud computing capabilities. Cloud computing refers to the delivery and use model of IT infrastructure, which means obtaining the required resources through the network in an on-demand, easily scalable manner; in a broad sense, cloud computing refers to the delivery and use model of services, which means obtaining the required services through the network in an on-demand, easily scalable manner. This service can be IT and software, Internet-related, or other services. Cloud computing is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing.

[0052] With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from the previous parallel distributed computing, the emergence of cloud computing will promote revolutionary changes in the entire Internet model and enterprise management model from a conceptual perspective.

[0053] Big data refers to a collection of data that cannot be captured, managed, and processed by conventional software tools within a certain time frame. It is a massive, high-growth, and diverse information asset that requires new processing models to have stronger decision-making power, insight discovery, and process optimization capabilities. With the advent of the cloud era, big data has also attracted more and more attention. Big data requires special technologies to effectively process large amounts of data within a tolerable time frame. Technologies applicable to big data include large-scale parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the Internet, and scalable storage systems.

[0054] In the embodiment of the present application, the anomaly detection device and the problem diagnosis device can use cloud computing technology to detect anomalies of the target system and diagnose problems of the target system.

[0055] Exemplary Methods

[0056] In order to facilitate understanding of the technical solution of the present application, the anomaly detection method provided in the embodiment of the present application is introduced below in combination with actual application scenarios, taking the terminal device as the anomaly detection device.

[0057] In one possible scenario, the target system is running on the terminal device, and the terminal device can obtain the log data of the target system when it is running, and perform anomaly detection based on this log data. In another possible scenario, the terminal device can communicate with other devices running the target system and obtain the log data of the target system of other devices running the target system, and the terminal device performs anomaly detection based on this log data. In another possible scenario, the terminal device can obtain the log data uploaded to the server by other devices running the target system from the server, and the terminal device performs anomaly detection on the target system running on other devices based on the above log data obtained from the server.

[0058] See also Figure 1 , which is a flow chart of an abnormality detection method provided in an embodiment of the present application. Figure 1 As shown, the anomaly detection method provided in the embodiment of the present application includes:

[0059] S101: Perform text processing on the log data of the target system to obtain a log vector.

[0060] The target system in the embodiment of the present application refers to any software system to be detected, and the function of the target system is not limited here. The log data of the target system includes but is not limited to: application logs. The application log records events of applications or general programs. Due to the complex structure and content of the log data of the target system, in order to facilitate the analysis and processing of the log during anomaly detection, the log data is text-processed in S101 to obtain a vectorized representation, i.e., a log vector. By converting to a vector, mathematical operations can be performed.

[0061] In one possible implementation, the log data may be processed using the term frequency-inverse document frequency (TF-IDF) method to generate a log vector. In practical applications, the method of converting text into a vector is not limited to the TF-IDF method, and the specific implementation of S101 is not limited in this solution.

[0062] S102: Aggregate the log vectors according to a sliding time window.

[0063] In order to achieve relatively accurate anomaly diagnosis in the time dimension, the log vectors obtained in S101 need to be aggregated in the time dimension in S102. Vector aggregation is performed according to the sliding time window. The implementation may include: obtaining multiple time windows according to the start time and the sliding step of the time window, and aggregating the log vectors into accurate time windows according to the generation time of the log data corresponding to the log vector. As an example, the earliest generation time of the log data is T start, the latest generation time is T end The starting time of the sliding time window is T 1 , the sliding step is Δt, where T 1 ≥T start , we can get the time window T 1 ~T 1 +Δt,T 1 +Δt~T 1 +2Δt,T 1 +2Δt~T 1 +3Δt, etc. The end time of the last time window is earlier than or equal to T end .

[0064] By executing S102, the log vectors obtained in S101 are aggregated according to the time windows divided by sliding, so as to facilitate the subsequent relatively accurate anomaly detection of the target system in the time dimension based on the log vectors in the time window.

[0065] S103: Using the aggregated vector as an input of an anomaly detection model to obtain an anomaly detection result of the target system output by the anomaly detection model.

[0066] Before S103 is executed, the anomaly detection model has been pre-trained. The function of the model is to perform log analysis based on the input aggregated vector and output anomaly detection results based on the aggregated vector. The essence of the anomaly detection model is a classification model, which is used to make classifications based on the input content. In the embodiment of the present application, the anomaly detection result can also be regarded as a classification result.

[0067] As an example, let the time window T 1 ~T 1 The vector aggregated within +Δt is input to the anomaly detection model. If the value output by the model is 0, it means that in the time window T 1 ~T 1 +Δt, the target system has no abnormality; if the model output value is 1, it means that in the time window T 1 ~T 1 An abnormality occurs in the target system within +Δt.

[0068] The above is an anomaly detection method provided by an embodiment of the present application, in which a log vector is obtained by text processing the log data of the target system, the log data is converted into a vector representation, and then aggregated in the form of a vector. The log vector is aggregated according to the sliding time window, and the original log data is integrated according to the time dimension and used as the input of the anomaly detection model. The model can detect whether there is an anomaly in the target system within the corresponding time, and obtain accurate anomaly detection results in the time dimension. The present application uses a trained anomaly detection model to assist analysts in completing anomaly detection of the target system, which reduces the professional requirements for analysts and does not require complex maintenance. Therefore, it can reduce the difficulty and cost of implementation while improving the anomaly detection efficiency of the system.

[0069] Below, the training process of the anomaly detection model mentioned above is introduced and explained.

[0070] See also Figure 2 , which is a schematic diagram of the training process of an anomaly detection model provided in an embodiment of the present application. Figure 2 As shown, to train an anomaly detection model, the following operations need to be performed:

[0071] S201: Obtain historical log data and problem feedback data within a corresponding period of time of the historical log data.

[0072] As the data basis for training the model, in order to distinguish it from the log data described in the aforementioned method embodiment S101, the log data used for training the model is referred to as historical log data. The generation time of the historical log data is earlier than the generation time of the log data described in S101. The type and form of the historical log data are basically the same as the log data, and no further description or limitation is made here.

[0073] In addition, it is also necessary to obtain problem feedback data. In an example scenario, the user uses the target system to perform some preset types of operations on the device running the target system, thereby generating online problem feedback data. For different target systems, the type and content of the problem feedback data may be different. Therefore, there is no restriction on the type and content of the problem feedback data here. For ease of understanding, several examples are provided below.

[0074] Example 1: User A discovers a problem of slow operation response when using the target system running on the device. He clicks the problem feedback window on the interface and selects "Slow operation response" from several problem reporting options.

[0075] Example 2: User B discovers that video playback is lagging when using the target system running on the device. He clicks the problem feedback window on the interface and enters the problem of "video playback is lagging" under the "Other problems" option.

[0076] It should be noted that when training the anomaly detection model, the training data used is required to have temporal correspondence. Therefore, in S201, the historical log data and the problem feedback data obtained are also required to have temporal correspondence. For example, the start time T 001 Until the end time T 002 The historical log data of the start time T 001 Until the end time T 002 Online problem feedback data.

[0077] S202: Perform text processing on the historical log data to obtain a historical log vector.

[0078] In the embodiment of the present application, in order to ensure the use effect of the trained anomaly detection model, it is required that the input data in the training data and the input data in the use process have the same or similar form. Combined with the description of the above embodiment S101, the log data needs to be processed into log vectors and then aggregated, and then the aggregated vectors are used as the input of the trained anomaly detection model. Therefore, in the training stage, S202 also needs to first perform text processing on the historical log data to obtain a vector representation of the historical log data.

[0079] In one possible implementation, while the historical log data text is processed into historical vector data, the TF-IDF dictionary generated during the conversion process is saved. The TF-IDF dictionary describes the conversion relationship between historical log data and historical log vectors during the execution of S202. Therefore, before executing S101, the saved TF-IDF dictionary can be deployed to the anomaly detection environment of the target system, so that when S101 is executed, the deployed TF-IDF dictionary is used to convert the log data into log vectors. Therefore, in an embodiment of the present application, by saving the dictionary used in the text processing process that forms the training data, the formal unification of the input data in the model use phase and the training phase can be ensured, thereby improving the accuracy of the model detection system anomalies.

[0080] S203: Aggregate the historical log vectors according to the sliding time window to obtain aggregated historical log vectors; and aggregate the problem feedback data according to the sliding time window to obtain aggregated problem feedback data.

[0081] In an embodiment of the present application, in order to form training data, it is necessary to aggregate the historical log vectors and problem feedback data obtained in the above steps respectively. The specific aggregation method is also based on the sliding time window. In order to ensure the accuracy of the anomaly detection results output in the model usage phase, in a possible implementation method, it can be required that when S203 aggregates historical log vectors and aggregates problem feedback data, the sliding step size of the time window is consistent with the sliding step size used by S102 aggregated log vectors, for example, the sliding step size is Δt. In addition, when the time window is divided, the start time of the time window is the same for the aggregation of historical log vectors and the aggregation of problem feedback data. Thereby ensuring that the time windows of the aggregated historical log vectors correspond to the time windows of the aggregated problem feedback data.

[0082] The following is an optional implementation method for obtaining aggregated question feedback data.

[0083] First, the number of the problem feedback data in each time window in the sliding time window is obtained by counting. Then, the number of the problem feedback data in the time window is compared with the reference value corresponding to the time window. If the number of the problem feedback data in the time window exceeds the reference value corresponding to the time window, it means that the number of the problem feedback data in the time window is too much, so it can be determined that the target system has an abnormality in the time window. Otherwise, it is considered that the system has no abnormality in the time window. The above judgment result is used as the aggregation result of the problem feedback data in the time window.

[0084] It should be noted that the reference values ​​corresponding to different time windows can be the same or different. The reference values ​​can be set according to the actual requirements for model accuracy or according to prior knowledge (such as the flow size in different time periods), and there is no restriction here.

[0085] S204: The aggregated historical log vectors and the aggregated question feedback data in the same time window are used as a set of training data, and an anomaly detection model is obtained by training the training data.

[0086] In order to ensure the temporal matching of the model input and output and to accurately detect system anomalies in the temporal dimension, in the embodiment of the present application, when forming training data, the aggregated historical log vectors and aggregated problem feedback data of the same time window are used as a set of training data. In this way, multiple sets of training data can be obtained based on different time windows.

[0087] Figure 3A A schematic diagram of using training data to train an anomaly detection model provided in an embodiment of the present application. Figure 3AAs shown, the untrained model takes the aggregated historical log vectors in a set of training data as input, and adjusts and optimizes the parameters of the model by combining the aggregated problem feedback data in the set of training data with the output results of the model.

[0088] As a possible implementation method, when the model is trained by the training data, the model is evaluated using preset evaluation indicators, and when the evaluation result meets the preset conditions, the anomaly detection model is obtained. In one example, the anomaly detection model to be trained is an extreme gradient boosting (eXtreme Gradient Boosting, XGBoost) model, which is essentially a classification model. Therefore, the relevant evaluation indicators of the classification model can be used to evaluate the model training situation. For example, the evaluation indicator used can be the area (Aera Under Curve, AUC) enclosed by the coordinate axis under the receiver operating characteristic (Receiver Operating Characteristics, ROC) curve. During the model training process, the AUC indicator of the ROC curve of the model is continuously optimized, and the final generated model file is saved when the preset conditions are met.

[0089] As an example, the preset condition is that the absolute value of the iterative change amplitude of the AUC indicator is less than the first preset threshold, and the AUC indicator is less than the second preset threshold. Here, the first preset threshold and the second preset threshold can be set according to actual needs or experience. For example, the first preset threshold is 2%, and the second preset threshold is 0.8. Figure 3B The evaluation results of the anomaly detection model using the ROC curve are shown in the figure. As shown in the figure, the AUC index reaches 0.81. Combined with the amplitude of the AUC iteration change, it is believed that Figure 3B The anomaly detection model corresponding to the evaluation results shown is available.

[0090] When the model training is completed, it can be deployed to the test environment of the target system and executed as follows Figure 1 process. Figure 3C A schematic diagram of applying anomaly detection model to perform anomaly detection provided in an embodiment of the present application can be combined with Figure 3C and Figure 1 Understand the application process of anomaly detection models. Figure 3C As shown, the aggregated vector is used as the model input, based on Figure 2 The XGBoost anomaly detection model generated by the process described above is used for classification prediction to obtain the anomaly detection result of the target system. If the classification result (i.e., the anomaly detection result) is no anomaly, the anomaly detection process ends; if the classification result is an anomaly, the problem diagnosis of the target system can be continued according to actual needs.

[0091] Combine the following Figure 4 and Figure 5 An implementation method of a problem diagnosis method provided in an embodiment of the present application is introduced. Figure 4 A flowchart of a problem diagnosis method provided in an embodiment of the present application. Figure 5 A flowchart of anomaly detection and problem diagnosis provided in an embodiment of the present application. Figure 4 As shown, the problem diagnosis method includes:

[0092] S401: Using log data as input of an anomaly detection model to obtain a score for each log in the log data output by the anomaly detection model.

[0093] When introducing the anomaly detection method in the above embodiment, it is mentioned that the log data text needs to be processed into log vectors first, and then the log vectors are aggregated according to the sliding time window, and the aggregated log vectors are used as the input of the anomaly detection model, and the anomaly detection result of the output of the anomaly detection model is obtained. If the anomaly detection result indicates that the target system has an anomaly within a certain time window, in order to diagnose the problem of the target system, in the embodiment of the present application, the original log data generated in the time window can be re-input into the anomaly detection model through S401.

[0094] In the embodiment of the present application, the anomaly detection model is an XGBoost model, which can score the influence (also known as contribution) of the input log data on the abnormal situation. Assuming that there are 50 logs in the time window T1~T1+Δt, these 50 logs can be input into the anomaly detection model respectively to obtain the score of each log. The higher the score, the greater the impact of the log on the abnormality of the target system in the time window; conversely, the lower the score, the smaller the influence.

[0095] S402: Filter out N logs with the largest scores from the log data as abnormal logs.

[0096] As mentioned above, S401 scores each log in the log data. Some of the logs have small scores and may have little effect on the problem diagnosis of the target system. In order to reduce the amount of calculation and increase the speed of problem diagnosis, the logs can be sorted in order from large to small according to the score, and then the N logs with the largest scores are determined as abnormal logs for diagnosing system problems. In the embodiment of the present application, N is the number of abnormal logs screened from the log data, which can be set according to actual needs. For example, N=20, and there is no restriction on the specific value of N in the embodiment of the present application.

[0097] S403: Perform cluster analysis on the abnormal logs using the topic model, and diagnose the problem category of the target system according to the cluster analysis results.

[0098] The topic model is a statistical model that clusters the implicit semantic structure of a collection of documents in an unsupervised learning manner. In the problem diagnosis method provided in the embodiment of the present application, the topic model can perform cluster analysis on the abnormal logs according to the set number of topics. For example, if the set number of topics is 5, the abnormal logs can be clustered into 5 problem categories through cluster analysis of the topic model. Latent Dirichlet Allocation (LDA) is a common topic model, so when S403 is executed, the LDA topic model can be specifically used to perform cluster analysis on the abnormal logs.

[0099] The topic model used in S403 can also be obtained through training before S403 is executed. For example, the model to be trained is trained through some existing abnormal logs and accurately analyzed problem categories, so as to obtain a topic model that can accurately perform cluster analysis on the abnormal logs. When S403 is executed, the abnormal logs screened out by S402 are clustered through the deployed topic model. In addition, the number of topics set can also be an empirical value obtained by pre-training the topic model.

[0100] The current training topic model is a relatively mature technology. The difference in the technical solution of this application is that in order to form a topic model that can accurately diagnose system problems, the training data used is the abnormal log and the problem category corresponding to the abnormal log. Therefore, the relevant description will not be repeated.

[0101] From the above examples, it can be seen that in the technical solution of the embodiment of the present application, the abnormal log is determined by using the score output by the anomaly detection model, and then the abnormal log is clustered and analyzed by applying the topic model, so that the problem of the target system can be diagnosed. The abnormality of the log is associated with the problem of the system to achieve accurate diagnosis of the problem.

[0102] In a possible implementation, in order to facilitate developers to subsequently fix problems based on the diagnosed problems, so that the target system can return to normal as soon as possible, in the embodiment of the present application, the diagnosed problems can also be located. For example, if 5 problems are diagnosed, the exception logs corresponding to the 5 problem categories can be output respectively. For example, the exception logs corresponding to the first category of problems are output, and developers can then locate and fix the first category of problems based on the exception logs corresponding to the first category of problems.

[0103] In the related technology, there are some solutions for anomaly detection and problem diagnosis based on log analysis through machine learning and deep learning, which can be divided into supervised learning and unsupervised learning. Among them, supervised learning methods usually require a large amount of labeled data to train the model, which is often difficult to obtain in actual production systems; unsupervised learning methods cannot diagnose and locate different types of problems. The aforementioned rule-matching-based log analysis method can only match and detect existing problem categories in terms of problem diagnosis, but cannot diagnose unknown problem categories.

[0104] Through the above introduction to the technical solution of the embodiment of the present application, the training data is obtained through the log data of the target system and the problem feedback data of the system online, and the XGBoost algorithm model is trained with this training data, and the logs in the sliding time window are predicted based on the trained XGBoost model, and possible anomalies are detected to achieve anomaly detection of the software system, solving the problem that it is difficult to obtain labeled data with supervised learning methods. In addition, by using a topic model to cluster the abnormal logs, diagnose the problem category, and output the abnormal logs of the corresponding category, the problem diagnosis and location of the software system is achieved, which greatly improves the work efficiency of developers in locating and fixing problems. Diagnosis can also be made for previously unknown problem types, so the accuracy of diagnosis is improved.

[0105] The anomaly detection method and problem diagnosis method introduced above can use machine learning algorithms to automatically detect possible anomalies in the software system, and diagnose system problems when system anomalies are detected, and throw out the anomaly log corresponding to the problem. This means that developers do not have to spend a lot of time on system problem location and error log analysis when software systems are becoming increasingly large and log information is relatively complex and redundant. As a result, the efficiency of developers repairing, optimizing, and iterating software systems is greatly improved, and the labor cost of system anomaly detection and problem diagnosis is reduced.

[0106] Based on the method provided in the above embodiment, the present application also provides an abnormality detection device and a problem diagnosis device, which are described below through drawings and embodiments.

[0107] Exemplary Devices

[0108] Figure 6 This is a schematic diagram of the structure of an abnormality detection device provided in an embodiment of the present application. Figure 6 As shown, the abnormality detection device 600 provided in the embodiment of the present application includes:

[0109] The text processing module 601 is used to perform text processing on the log data of the target system to obtain a log vector;

[0110] A vector aggregation module 602, configured to aggregate the log vectors according to a sliding time window;

[0111] The anomaly detection module 603 is used to use the aggregated vector as the input of the anomaly detection model to obtain the anomaly detection result of the target system output by the anomaly detection model; the anomaly detection model is trained using the historical log data of the target system and the problem feedback data within the corresponding time of the historical log data.

[0112] Log vectors are obtained by text processing the log data of the target system, and the log data is converted into vector representation, and then aggregated in the form of vectors. The log vectors are aggregated according to the sliding time window, and the original log data is integrated according to the time dimension and used as the input of the anomaly detection model. In the technical solution of the present application, the training data used by the anomaly detection model matches the data input when the model is actually used and the data form of the expected output. The anomaly detection model is obtained by training the historical log data of the target system and the problem feedback data within the corresponding time of the historical log data. Therefore, after the aggregated log vector is input, the model can detect whether there is an anomaly in the target system within the corresponding time, and obtain accurate anomaly detection results in the time dimension. The present application uses a trained anomaly detection model to assist analysts in completing anomaly detection of the target system, which reduces the professional requirements for analysts and does not require complex maintenance. Therefore, it can reduce the difficulty and cost of implementation while improving the anomaly detection efficiency of the system.

[0113] In an optional implementation, the anomaly detection device 600 further includes: a model training module, which is used to train the anomaly detection model. The model training module includes:

[0114] A data acquisition unit, used to obtain the historical log data and the problem feedback data within the corresponding time of the historical log data;

[0115] A text processing unit, used for performing text processing on the historical log data to obtain a historical log vector;

[0116] an aggregation unit, configured to aggregate the historical log vector according to the sliding time window to obtain an aggregated historical log vector; and to aggregate the problem feedback data according to the sliding time window to obtain an aggregated problem feedback data;

[0117] A training unit is used to use the aggregated historical log vectors and the aggregated question feedback data in the same time window as a group of training data, and obtain the anomaly detection model through training with the training data.

[0118] By pre-training the anomaly detection model, the detection efficiency of anomaly detection in the target system can be improved, greatly saving human labor.

[0119] In an optional implementation, the abnormality detection device 600 further includes:

[0120] a storage indicating unit, used for storing a dictionary generated in the process of processing the historical log data into the historical log vector;

[0121] The text processing module 601 is specifically configured to convert the log data into the log vector using the dictionary.

[0122] In this implementation, since the dictionary for converting from logs to log vectors is saved during the training phase, when performing anomaly detection on the target system, the pre-saved dictionary can be used to accurately convert log data, ensuring the consistency of the dictionary used for the previous and subsequent conversions. This improves the consistency of the model input format, which is conducive to obtaining more accurate anomaly detection results.

[0123] In an optional implementation, whether the system is abnormal or not is measured by the amount of problem feedback data. The aggregation unit includes:

[0124] A statistical subunit, used for obtaining by statistics the number of the problem feedback data in each time window in the sliding time window;

[0125] The comparison subunit is used to determine that the target system has an abnormality in a time window when the amount of the problem feedback data in the time window exceeds the reference value corresponding to the time window.

[0126] In an optional implementation, the anomaly detection module 603 is specifically used to evaluate the model using a preset evaluation index when the model is trained using the training data, and when the evaluation result meets the preset conditions, the anomaly detection model is obtained. The availability of the model can be evaluated by the preset evaluation index and the preset conditions.

[0127] Figure 7 This is a schematic diagram of the structure of a problem diagnosis device provided in an embodiment of the present application. Figure 7 As shown, the problem diagnosis device 700 provided in the embodiment of the present application includes:

[0128] A score evaluation module 701 is used to use the log data as input of the anomaly detection model to obtain the score of each log in the log data output by the anomaly detection model when the anomaly detection result obtained by the anomaly detection device 600 described above indicates that the target system has an anomaly; the anomaly detection model is an XGBoost model;

[0129] The abnormal log screening module 702 is used to screen out N logs with the largest scores from the log data as abnormal logs; N is a positive integer;

[0130] A cluster analysis module 703 is used to perform cluster analysis on the abnormal logs using a topic model;

[0131] The problem diagnosis module 704 is used to diagnose the problem category of the target system according to the cluster analysis result.

[0132] When the anomaly detection model is applied and an anomaly is found in the target system, the original log data within the relevant time can be re-input into the anomaly detection model to obtain the score of each log. The higher the score, the greater the impact of the system anomaly predicted by the anomaly detection model. According to the score output by the anomaly detection model, cluster analysis is performed using the topic model, and finally the system problem can be diagnosed based on the cluster analysis results. It can be seen that the technical solution of this application can not only realize anomaly detection by using the anomaly detection model, but also assist in problem diagnosis.

[0133] In an optional implementation, the problem diagnosis device 700 further includes:

[0134] The log output module is used to output the abnormal log corresponding to the problem category.

[0135] By outputting the exception log corresponding to the problem category, the problem is located, which makes it easier for developers to fix the problem based on the diagnosis, so that the target system can return to normal as soon as possible.

[0136] In combination with the anomaly detection device 600 and the problem diagnosis device 700 introduced above, the training data is obtained through the log data of the target system and the problem feedback data of the system line, and the XGBoost algorithm model is trained with this training data, and the logs in the sliding time window are predicted based on the trained XGBoost model, and possible anomalies are detected to realize anomaly detection of the software system, which solves the problem that it is difficult to obtain labeled data with supervised learning methods. In addition, by using the topic model to cluster the abnormal logs, diagnose the problem category, and output the abnormal logs of the corresponding category, the problem diagnosis and location of the software system is realized, which greatly improves the work efficiency of developers in locating and fixing problems. It is also possible to make a diagnosis for previously unknown problem types, so the accuracy of the diagnosis is improved.

[0137] In the technical solution provided by the embodiment of the present application, a machine learning algorithm can be used to automatically detect possible anomalies in the software system, and when a system anomaly is detected, system problems can be diagnosed and an abnormal log corresponding to the problem can be thrown out. This means that developers do not have to spend a lot of time on system problem location and error log analysis when software systems are becoming increasingly large and log information is relatively complex and redundant. As a result, the efficiency of developers repairing, optimizing, and iterating software systems is greatly improved, and the labor cost of system anomaly detection and problem diagnosis is reduced.

[0138] The embodiment of the present application also provides a computer device. The computer device provided by the embodiment of the present application will be introduced from the perspective of hardware instantiation.

[0139] See also Figure 8 , Figure 8 14 is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1422 (for example, one or more processors) and memory 1432, and one or more storage media 1430 (for example, one or more mass storage devices) storing application programs 1442 or data 1444. Among them, the memory 1432 and the storage medium 1430 may be short-term storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1422 may be configured to communicate with the storage medium 1430 to execute a series of instruction operations in the storage medium 1430 on the server 1400.

[0140] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0141] The steps performed by the server in the above embodiment can be based on the Figure 8 The server structure shown.

[0142] The CPU 1422 is used to execute the following steps:

[0143] Perform text processing on the log data of the target system to obtain a log vector;

[0144] Aggregating the log vectors according to a sliding time window;

[0145] The aggregated vector is used as an input of an anomaly detection model to obtain an anomaly detection result of the target system output by the anomaly detection model; the anomaly detection model is trained using historical log data of the target system and problem feedback data within a corresponding time of the historical log data.

[0146] When the anomaly detection result indicates that the target system has an anomaly, the log data is used as the input of the anomaly detection model to obtain the score of each log in the log data output by the anomaly detection model; the anomaly detection model is an XGBoost model;

[0147] Filter out N logs with the largest scores from the log data as abnormal logs; N is a positive integer;

[0148] The abnormal logs are clustered and analyzed using a topic model, and the problem category of the target system is diagnosed based on the cluster analysis results.

[0149] Optionally, CPU 1422 may also execute method steps of any specific implementation of the abnormality detection method and the problem diagnosis method in the embodiments of the present application.

[0150] With respect to the anomaly detection method and problem diagnosis method described above, the embodiment of the present application also provides a terminal device for the anomaly detection method and problem diagnosis method, so that the anomaly detection method and problem diagnosis method can be implemented and applied in practice.

[0151] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. For the sake of convenience, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The terminal device can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), etc., taking the terminal device as a mobile phone as an example:

[0152] Fig. 9 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig. 9The mobile phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art will understand that Fig. 9 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0153] Combine the following Fig. 9 A detailed introduction to the various components of the mobile phone:

[0154] The RF circuit 1510 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 1580 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit 1510 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 1510 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0155] The memory 1520 can be used to store software programs and modules. The processor 1580 implements various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1520. The memory 1520 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1520 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0156] The input unit 1530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1531 or near the touch panel 1531 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1531 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 1580, and can receive and execute the command sent by the processor 1580. In addition, the touch panel 1531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0157] The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1540 may include a display panel 1541. Optionally, the display panel 1541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 1531 may cover the display panel 1541. When the touch panel 1531 detects a touch operation on or near it, it is transmitted to the processor 1580 to determine the type of touch event. Subsequently, the processor 1580 provides a corresponding visual output on the display panel 1541 according to the type of touch event. Although in Fig. 9 In the embodiment, the touch panel 1531 and the display panel 1541 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 1531 and the display panel 1541 can be integrated to realize the input and output functions of the mobile phone.

[0158] The mobile phone may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1541 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1541 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0159] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the user and the mobile phone. The audio circuit 1560 can transmit the received audio data to the speaker 1561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data, and then the audio data is output to the processor 1580 for processing, and then sent to another mobile phone through the RF circuit 1510, or the audio data is output to the memory 1520 for further processing.

[0160] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1570. It provides users with wireless broadband Internet access. Fig. 9 A WiFi module 1570 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.

[0161] The processor 1580 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 1520 and calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units; preferably, the processor 1580 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1580.

[0162] The mobile phone also includes a power supply 1590 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0163] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0164] In the embodiment of the present application, the memory 1520 included in the mobile phone can store program codes and transmit the program codes to the processor.

[0165] The processor 1580 included in the mobile phone can execute the abnormality detection method and problem diagnosis method provided in the above embodiments according to the instructions in the program code.

[0166] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute the anomaly detection method and problem diagnosis method provided in the above embodiments.

[0167] The embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the anomaly detection method and problem diagnosis method provided in various optional implementations of the above aspects.

[0168] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0169] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0170] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An anomaly detection method, characterized in that: include: Perform text processing on the log data of the target system to obtain a log vector; Aggregating the log vectors according to a sliding time window; The aggregated vector is used as an input of an anomaly detection model to obtain an anomaly detection result of the target system output by the anomaly detection model; the anomaly detection model is trained using historical log data of the target system and problem feedback data within a corresponding time of the historical log data; Wherein, training the anomaly detection model comprises: Obtain the historical log data and the problem feedback data within the corresponding time of the historical log data; Performing text processing on the historical log data to obtain a historical log vector; Aggregating the historical log vectors according to the sliding time window to obtain aggregated historical log vectors; and aggregating the problem feedback data according to the sliding time window to obtain aggregated problem feedback data; Taking the aggregated historical log vectors and the aggregated question feedback data in the same time window as a set of training data, and obtaining the anomaly detection model through training with the training data; The step of aggregating the problem feedback data according to the sliding time window to obtain aggregated problem feedback data includes: Counting and obtaining the number of the problem feedback data in each time window within the sliding time window; When the amount of the problem feedback data within a time window exceeds a reference value corresponding to the time window, it is determined that an abnormality exists in the target system within the time window.

2. The anomaly detection method according to claim 1, characterized in that: Also includes: saving a dictionary generated in the process of processing the historical log data into the historical log vector; The step of performing text processing on the log data of the target system to obtain a log vector includes: The log data is converted into the log vector using the dictionary.

3. The anomaly detection method according to claim 1, characterized in that: The step of obtaining the anomaly detection model by training the training data includes: When the model is trained using the training data, the model is evaluated using preset evaluation indicators, and when the evaluation result meets the preset conditions, the anomaly detection model is obtained.

4. A problem diagnosis method, characterized in that: When the anomaly detection result obtained by using the anomaly detection method according to any one of claims 1 to 3 indicates that an anomaly exists in the target system, the problem diagnosis method comprises: The log data is used as the input of the anomaly detection model to obtain the score of each log in the log data output by the anomaly detection model; the anomaly detection model is an XGBoost model; Filter out N logs with the largest scores from the log data as abnormal logs; N is a positive integer; The abnormal logs are clustered and analyzed using a topic model, and the problem category of the target system is diagnosed based on the cluster analysis results.

5. The problem diagnosis method according to claim 4, characterized in that: Also includes: Output the exception log corresponding to the problem category.

6. An abnormality detection device, characterized in that: include: A text processing module is used to perform text processing on the log data of the target system to obtain a log vector; A vector aggregation module, used to aggregate the log vectors according to a sliding time window; an anomaly detection module, used to use the aggregated vector as an input of an anomaly detection model to obtain an anomaly detection result of the target system output by the anomaly detection model; the anomaly detection model is trained using historical log data of the target system and problem feedback data within a corresponding time of the historical log data; A training module, used for training the anomaly detection model; The training module includes: A data acquisition unit, used to obtain the historical log data and the problem feedback data within the corresponding time of the historical log data; A text processing unit, used for performing text processing on the historical log data to obtain a historical log vector; an aggregation unit, configured to aggregate the historical log vector according to the sliding time window to obtain an aggregated historical log vector; and to aggregate the problem feedback data according to the sliding time window to obtain an aggregated problem feedback data; A training unit, configured to use the aggregated historical log vectors and the aggregated question feedback data in the same time window as a set of training data, and obtain the anomaly detection model through training with the training data; Wherein, the polymerization unit comprises: A statistical subunit, used for obtaining by statistics the number of the problem feedback data in each time window in the sliding time window; The comparison subunit is used to determine that the target system has an abnormality in a time window when the amount of the problem feedback data in the time window exceeds the reference value corresponding to the time window.

7. The device according to claim 6, characterized in that The device also includes: a storage indicating unit, used for storing a dictionary generated in the process of processing the historical log data into the historical log vector; The text processing module is specifically used to convert the log data into the log vector using the dictionary.

8. The device according to claim 6, characterized in that The anomaly detection module is specifically used to evaluate the model using preset evaluation indicators when the model is trained through the training data, and when the evaluation result meets the preset conditions, the anomaly detection model is obtained.

9. A problem diagnosis device, characterized in that: include: A score evaluation module, for obtaining a score of each log in the log data output by the anomaly detection model when the anomaly detection result obtained by the anomaly detection device according to any one of claims 6 to 8 indicates that the target system has an anomaly, wherein the anomaly detection model is an XGBoost model; An abnormal log screening module is used to screen out N logs with the largest scores from the log data as abnormal logs; N is a positive integer; A clustering analysis module, used to perform clustering analysis on the abnormal logs using a topic model; The problem diagnosis module is used to diagnose the problem category of the target system according to the cluster analysis result.

10. The device according to claim 9, characterized in that The device also includes: The log output module is used to output the abnormal log corresponding to the problem category.

11. A computer device, characterized in that: The device comprises a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the anomaly detection method described in any one of claims 1 to 3, or execute the problem diagnosis method described in claim 4 or 5 according to the instructions in the program code.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the anomaly detection method described in any one of claims 1 to 3, or execute the problem diagnosis method described in claim 4 or 5.

13. A computer program product, characterized in that The computer program product includes computer instructions, and the processor of the computer device executes the computer instructions, so that the computer device executes the anomaly detection method described in any one of claims 1 to 3, or executes the problem diagnosis method described in claim 4 or 5.