Fault prediction method and device, electronic device, and storage medium
By obtaining and analyzing the timestamp and category information in the log file in the server, and using the recurrent neural network model for fault prediction, it solves the problem of fault detection under the complex structure of the server, achieves fast and accurate fault location and type judgment, and improves fault management. Prediction accuracy and interpretability.
Patent Information
- Application Number
- CN202211022626.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-08-24
AI Technical Summary
In the context of the development of technologies such as cloud computing, blockchain, and sixth-generation mobile communications, the complex internal structure of servers makes fault detection and debugging difficult. Existing deep learning models have insufficient interpretability, making it difficult to quickly and accurately locate faults. and determine the time and type of failure.
By obtaining the log files generated during the operation of the equipment, identify and use the timestamp information and category information of the log data for feature analysis, generate importance parameters, and combine it with the recurrent neural network model for semantic encoding processing to determine the prediction information for equipment failure. , improve the accuracy and speed of fault prediction.
It improves the accuracy and speed of fault prediction, can quickly and accurately locate equipment faults, enhances the interpretability of the model, and improves the matching degree and data processing accuracy of the recurrent neural network through the importance parameters and attention mechanism.
Smart Images

Figure CN115328753B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a fault prediction method and device, an electronic device, and a storage medium. Background Art
[0002] The development of new technologies such as cloud computing, blockchain, and the sixth generation of mobile communications has led to a massive demand for new servers, and servers are also evolving towards intensive integrated management. At the same time, virtualized server resources have brought more efficient resource utilization, but the overly complex internal structure makes it difficult for developers to quickly debug and test, and also brings great difficulties to fault detection. Therefore, how to quickly and accurately locate faults and determine the time and type of faults is a very meaningful research direction in the future. Summary of the invention
[0003] To solve the above technical problems, the embodiments of the present application provide a fault prediction method and device, an electronic device, a computer-readable storage medium, and a computer program product.
[0004] According to one aspect of an embodiment of the present application, a fault prediction method is provided, comprising: obtaining a log file generated during the operation of a device; wherein the log file comprises timestamp information and category information of the log data; performing feature analysis on the log data based on the timestamp information and category information of the log data to obtain importance parameters for characterizing the log data; performing semantic coding processing on the log data based on the importance parameters to obtain a target semantic coding result; and determining prediction information of a failure of the device based on the target semantic coding result.
[0005] According to one aspect of an embodiment of the present application, a fault prediction device includes: an acquisition module, used to acquire a log file generated during the operation of a device; wherein the log file includes timestamp information and category information of the log data; an analysis module, used to perform feature analysis on the log data according to the timestamp information and category information of the log data, and obtain importance parameters for characterizing the log data; a processing module, used to perform semantic encoding processing on the log data according to the importance parameters to obtain a target semantic encoding result; and a determination module, used to determine prediction information of a failure of the device according to the target semantic encoding result.
[0006] In another exemplary embodiment, there are multiple log data items; performing feature analysis on the log data based on timestamp information and category information of the log data to obtain importance parameters for characterizing the log data includes: generating a vector matrix based on the timestamp information and category information of each log data item; performing feature analysis based on the vector matrix to obtain importance parameters for characterizing the log data.
[0007] In another exemplary embodiment, the log file also includes attribute information of the log data; generating a vector matrix based on the timestamp information and category information of each piece of log data includes: vectorizing the timestamp information, category information, and attribute information of each piece of log data to obtain a word vector corresponding to each piece of log data; generating the vector matrix based on the word vector corresponding to each piece of log data.
[0008] In another exemplary embodiment, the feature analysis is performed according to the vector matrix to obtain the importance parameters for characterizing the log data, including: performing data analysis preprocessing on the feature elements contained in the vector matrix to obtain the vector matrix after data analysis preprocessing; wherein the data analysis preprocessing includes at least one of the removal of abnormal feature elements, the removal of repeated feature elements, and the filling of incomplete feature elements; performing feature analysis on the feature elements contained in the vector matrix after data analysis preprocessing to obtain the importance parameters corresponding to each feature element in the vector matrix.
[0009] In another exemplary embodiment, the log file also includes attribute information of the log data; the semantic encoding processing of the log data according to the importance parameter to obtain a target semantic encoding result includes: obtaining a vector matrix; wherein the vector matrix is obtained based on the timestamp information, category information, and attribute information of the log data; semantic encoding processing of the vector matrix to obtain a semantic encoding result; and adjusting the semantic encoding result according to the importance parameter to obtain the target semantic encoding result.
[0010] In another exemplary embodiment, the number of log data is multiple; the semantic coding result is adjusted according to the importance parameter to obtain the target semantic coding result, including: using the importance parameter as a weight, and performing a weighted operation on the semantic coding result according to the weight to obtain the target semantic coding result corresponding to each log data.
[0011] In another exemplary embodiment, determining the prediction information of the device failure based on the target semantic coding result includes: decoding the target semantic coding result to obtain a decoding result; using the value of the decoding result as prediction information, wherein the prediction information is a probability value of the device failure, and the category of the failure corresponds to multiple log data in the log file.
[0012] According to one aspect of an embodiment of the present application, an electronic device includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the fault prediction method as described above.
[0013] According to one aspect of an embodiment of the present application, a computer-readable storage medium stores computer-readable instructions thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer executes the fault prediction method as described above.
[0014] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the fault prediction method provided in the above various optional embodiments.
[0015] In the technical solution provided in the embodiment of the present application, after obtaining the log file generated during the operation of the device, the timestamp information and category information of the log data included in the log file are identified. The timestamp information and category information can increase the speed of subsequent understanding and processing of the log data, and slightly improve the accuracy of feature analysis. Afterwards, based on the timestamp information and category information of the log data, feature analysis is performed on the log data to obtain importance parameters for characterizing the log data. The importance parameters reflect the correlation between the log data and the device failure. According to the importance parameters, semantic coding is performed on the log data to obtain the target semantic coding result. Finally, according to the target semantic coding result, the prediction information of the device failure is determined, the fault prediction is completed, and an error is reported. In this way, the accuracy of the fault prediction is improved by adding the importance parameters corresponding to the log data, and the timestamp information and category information of the log data can quickly and accurately locate the device failure.
[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0018] Figure 1It is a schematic diagram of an implementation environment involved in this application;
[0019] Figure 2 yes Figure 1 A schematic diagram of the module structure of a server in the implementation environment shown in one embodiment;
[0020] Figure 3 is a flow chart of a fault prediction method shown in an exemplary embodiment of the present application;
[0021] Figure 4 yes Figure 3 A flowchart of step S302 in the illustrated embodiment in an exemplary embodiment;
[0022] Figure 5 yes Figure 4 A flowchart of step S401 in the illustrated embodiment in an exemplary embodiment;
[0023] Figure 6 yes Figure 4 The illustrated embodiment is a flow chart of performing convolution processing on each element vector in a vector matrix in an exemplary embodiment;
[0024] Figure 7 yes Figure 3 In the embodiment shown, steps S303 to S304 are Figure 6 A flow chart of the exemplary embodiment shown;
[0025] Figure 8 is a structural diagram of an operation and maintenance system for applying a fault prediction method shown in an exemplary embodiment of the present application;
[0026] Fig. 9 is a schematic diagram of a vector matrix provided with position coding and type coding in an exemplary embodiment of the present application;
[0027] Fig.10 is a block diagram of a fault prediction device shown in an exemplary embodiment of the present application;
[0028] Fig.11 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0029] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0030] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0031] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0032] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0033] Among related technologies, the development of new technologies such as cloud computing, blockchain, and the sixth generation of mobile communications has driven a massive demand for new servers, and servers are also evolving towards intensive integrated management. At the same time, virtualized server resources have brought more efficient resource utilization, but the overly complex internal structure makes it difficult for developers to quickly debug and test, and also brings great difficulties to fault detection.
[0034] Nowadays, fault diagnosis is usually performed by locating abnormal requests based on log data that records variables and execution status during program runtime through deep learning models. However, due to the limitations of the applicable data format of deep learning models, log sequences need to be viewed as text data, and each log corresponds to a word. The model is trained on annotated abnormal logs and normal logs, resulting in insufficient interpretability of deep neural networks. Interpretability means that while clarifying the object predicted by the model, it should also be clear how the model gives the prediction result. For example, if an application is developed based on a deep learning model to help doctors determine patient risks, in addition to the final judgment result, it is also necessary to understand what factors of the patient the model is based on to make such a judgment. The greater the interpretability, the higher the reliability of the model.
[0035] Therefore, how to quickly and accurately locate faults and determine the time and type of faults is a very meaningful research direction in the future.
[0036] In order to solve the above problems, the embodiments of the present application propose a fault prediction method and device, an electronic device, and a computer-readable storage medium mainly involving data processing technology, and these embodiments will be described in detail below.
[0037] First see Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes a terminal 10 and a server 20, and the terminal 10 and the server 20 communicate with each other through a wired or wireless network.
[0038] The server 20 is used to process the log files that need to be predicted for faults, by obtaining the log files generated during the operation of the equipment; wherein the log files include the timestamp information and category information of the log data; according to the timestamp information and category information of the log data, feature analysis is performed on the log data to obtain the importance parameters used to characterize the log data; according to the importance parameters, semantic coding is performed on the log data to obtain the target semantic coding result; according to the target semantic coding result, the prediction information of the equipment failure is determined, and the obtained prediction information is transmitted to the terminal 10 for display and corresponding fault error reporting. Compared with the fault prediction scheme of the prior art, the fault prediction method provided by the present implementation environment can improve the accuracy and prediction speed of fault prediction.
[0039] It should be noted that Figure 1 The terminal 10 in the implementation environment shown can be any electronic device such as a smart phone, tablet, laptop, computer, etc.; the server 20 server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms, etc., and there is no restriction here.
[0040] See also Figure 2 , Figure 2 yes Figure 1 The illustrated implementation environment is a schematic diagram of the module structure of the server 20 in one embodiment.
[0041] The server 20 includes a pre-processing unit 21 and a prediction unit 22, wherein the prediction unit 22 processes data using a recurrent neural network with a seq2seq (Sequence to Sequence) model architecture. The pre-processing unit 21 obtains the log file generated during the operation of the device, and the log file includes the timestamp information and category information of the log data; then, based on the timestamp information and category information of the log data, the log data is feature analyzed to obtain importance parameters for characterizing the log data. The pre-processing unit 21 transmits the importance parameters to the prediction unit 22, and the prediction unit 22 performs semantic coding processing on the log data according to the importance parameters to obtain the target semantic coding results; finally, the prediction information of the device failure is determined based on the target semantic coding results. Through the above-mentioned pre-processing unit 21 and prediction unit 22, the accuracy of fault prediction is improved based on the added importance parameters corresponding to the log data, and the fault of the device can be quickly and accurately located in conjunction with the timestamp information and category information of the log data.
[0042] Figure 3 is a flowchart of a fault prediction method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown in Figure 1 The server 20 in the embodiment shown is specifically implemented. In other implementation environments, the method may be implemented by devices in other implementation environments, and this embodiment does not limit this.
[0043] like Figure 3 As shown, in an exemplary embodiment, the fault prediction method may include steps S301 to S304, which are described in detail as follows:
[0044] Step S301, obtaining a log file generated during the operation of the device; wherein the log file includes timestamp information and category information of the log data.
[0045] Log data is text data generated by the output code embedded in the program, which records key information such as variables and execution status when the program is running. Through the log files including log data generated during the operation of the device, it is possible to locate abnormal requests, track program execution logic, and perform fine-grained fault diagnosis.
[0046] In the embodiment provided by the present application, in order to understand the log data more quickly and enhance the understanding of the log data by the recurrent neural network model applied by the prediction unit, after obtaining the log file generated during the operation of the device, the log file is identified to include the timestamp information and category information of the log data, thereby improving the understanding of the log file, the convergence speed and the reading accuracy.
[0047] Step S302 : performing feature analysis on the log data according to the timestamp information and category information of the log data to obtain importance parameters for characterizing the log data.
[0048] After obtaining the timestamp information and category information of the log data, feature analysis is performed on the log data. The features targeted by the feature analysis include but are not limited to the timestamp information and category information of the log data. Specifically, based on the various features of the log data and the relevance of various preset log data to equipment fault detection, after importance calculation, the greater the value of the importance parameter of the log data that can affect equipment fault detection, the smaller the value.
[0049] Step S303: perform semantic coding processing on the log data according to the importance parameter to obtain a target semantic coding result.
[0050] The recurrent neural network model used by the prediction unit is additionally provided with an attention mechanism, and the importance parameter obtained in the feature analysis stage in step S302 is used as a parameter of the attention mechanism. Specifically, the prediction unit performs semantic encoding processing on the acquired log data, and then the attention mechanism affects the log data after the semantic encoding processing through the importance parameter, thereby obtaining the target semantic encoding result. In this way, the importance parameter obtained in the feature analysis stage affects the semantic encoding result of the log data, which improves the interpretability of the recurrent neural network model used by the prediction unit. Based on the above-mentioned attention mechanism, the recurrent neural network model can be more matched with the log data to be processed, so the convergence speed is faster and the accuracy of the model in data processing is also higher.
[0051] Step S304: determining prediction information of equipment failure according to the target semantic coding result.
[0052] Finally, the prediction unit uses the seq2seq model architecture to decode the target semantic encoding result obtained in step S303 to obtain prediction information of equipment failure. The prediction information is a probability value. Each category of log data in the log file corresponds to a fault category, that is, the obtained prediction information is the probability value of the equipment fault type corresponding to the log file, and the corresponding fault that needs to be reported is reported according to the probability value represented by the prediction information.
[0053] As can be seen from the above, in the method provided in this embodiment, after obtaining the log file generated during the operation of the device, the timestamp information and category information of the log data included in the log file are identified. The timestamp information and category information can increase the speed of the recurrent neural network model to understand the log data and the processing speed, and slightly improve the accuracy of the feature analysis. Afterwards, the prediction unit performs feature analysis on the log data according to the timestamp information and category information of the log data, and obtains the importance parameter used to characterize the log data. The importance parameter reflects the correlation between the log data and the equipment failure. The importance parameter is used as a parameter of the attention mechanism to affect the result of the semantic encoding processing of the log data, and then the target semantic encoding result is obtained. Finally, the prediction unit determines the prediction information of the equipment failure according to the target semantic encoding result, completes the fault prediction, and reports an error. In this way, the accuracy of the fault prediction is improved by adding the importance parameter corresponding to the log data, and the timestamp information and category information of the log data can quickly and accurately locate the equipment failure.
[0054] See also Figure 4 , Figure 4 yes Figure 3 The step S302 in the illustrated embodiment is a flow chart in an exemplary embodiment. Figure 4 As shown, step S302 may specifically include steps S401 to S403. The importance parameters corresponding to each log data are determined through the above steps, which are described in detail as follows:
[0055] Step S401: Generate a vector matrix according to the timestamp information and category information of each piece of log data.
[0056] In the embodiment provided by the present application, the number of log data included in the log file is multiple, and the log data is character information. Since the recurrent neural network cannot understand character information, in order for the recurrent neural network used by the prediction unit in this embodiment to understand the log data, the log data and the timestamp information and category information of the log data are vectorized to obtain the word vector corresponding to each log data, and then the vector matrix formed by the multiple word vectors is obtained, and the understanding of the recurrent neural network model to the data, i.e., the vector matrix, is enhanced by adding the category information and timestamp information.
[0057] Step S402, performing data analysis preprocessing on the characteristic elements contained in the vector matrix to obtain the vector matrix after data analysis preprocessing.
[0058] The pre-processing unit includes a functional submodule of feature engineering, and the feature engineering performs data analysis preprocessing on the feature elements contained in the vector matrix to obtain the vector matrix after data analysis preprocessing.
[0059] Among them, data analysis preprocessing can be achieved through the pandas tool, including at least one of the removal of abnormal feature elements, the removal of repeated feature elements, and the filling of incomplete feature elements. The name of the pandas tool comes from panel data and python data analysis. Pandas was created to solve data analysis tasks. It can incorporate a large number of libraries and some standard data models, and provides the tools needed to efficiently operate large data sets.
[0060] Step S403, performing feature analysis on the feature elements contained in the vector matrix after data analysis preprocessing, and obtaining importance parameters corresponding to each feature element in the vector matrix.
[0061] The feature engineering of the pre-processing unit also performs feature analysis on the feature elements contained in the vector matrix after data analysis preprocessing, so as to obtain the importance parameter corresponding to each feature element in the vector matrix. In this embodiment, the feature analysis is to calculate the importance of the feature based on the feature element, so as to obtain the corresponding importance parameter.
[0062] In the embodiments provided in the present application, feature importance calculation can be performed by a random forest algorithm, which can learn the importance of each log data by continuous learning and serial construction of tree branches. After the importance calculation, the greater the value of the importance parameter of the log data that can affect the equipment fault detection, the smaller the value. Among them, random forest is an integrated algorithm composed of decision trees, which has the characteristics of being able to judge the importance of features, being simple to implement, and being able to maintain accuracy even if features are missing in the data.
[0063] In this embodiment, after obtaining the vector data corresponding to the log data, data analysis processing is performed and importance parameters are calculated to obtain the importance of each log data for fault detection. In the prediction unit, the importance parameters are used to influence the log data after semantic coding processing, and then the target semantic coding result that can determine the prediction information is obtained. The importance parameters obtained in the pre-processing unit can make the prediction unit converge faster and the output prediction information for fault prediction more accurate.
[0064] See also Figure 5 , Figure 5 yes Figure 4 The step S401 in the embodiment shown is a flow chart in an exemplary embodiment. Figure 5 As shown, step S401 may specifically include steps S501 to S502, which are described in detail as follows:
[0065] Step S501, vectorize the timestamp information, category information, and attribute information of each log data to obtain a word vector corresponding to each log data.
[0066] The log files generated by the operation of the equipment also include the attribute information of the log data. When converting multiple log data into vector matrices, the attribute information is used as the word code of the element vector in the matrix, and then the timestamp information and category information of each log data obtained are recorded in the corresponding word code. The corresponding timestamp information, category information and word code form a word vector that matches the log data. In this way, a position for recording timestamp information and category information separately is added to each element vector in the vector matrix, thereby enhancing the recurrent neural network model's understanding of the data, i.e., the vector matrix.
[0067] Step S502: Generate a vector matrix based on the word vectors corresponding to each piece of log data.
[0068] Since the log file includes multiple log data, after obtaining the word vector corresponding to each log data through the above steps, a vector matrix which is a word embedding matrix is obtained based on the word vectors corresponding to all log data.
[0069] From the above, it can be seen that in the method provided in this embodiment, when converting each log data into a vector matrix that can be understood by the recurrent neural network, the timestamp information and category information of each log data obtained are recorded in the corresponding word encoding to form a word vector matching the log data, and then multiple word vectors are used to obtain a vector matrix. In this way, adding a position for separately recording the timestamp information and category information in each element vector in the vector matrix can enhance the recurrent neural network model's understanding of the data, i.e., the vector matrix, and improve the convergence speed of the recurrent neural network for the log file, thereby affecting the prediction information output by the prediction unit through the importance parameters calculated based on the vector matrix, and slightly improving the prediction accuracy.
[0070] In another exemplary embodiment of the present application, the pre-processing unit performs convolution processing on the vector matrix corresponding to the log data and transmits it to the prediction unit with the calculated importance parameter, such as Figure 6 As shown, Figure 6 yes Figure 4 The illustrated embodiment is a flow chart of performing convolution processing on each element vector in a vector matrix in an exemplary embodiment.
[0071] like Figure 6 As shown, the fault detection method may further include steps S601 to S603. Through the above steps, a data structure applicable to the prediction unit after convolution processing is obtained, which is described in detail as follows:
[0072] Step S601, performing multi-channel convolution processing on the vector matrix to obtain a convolution result.
[0073] In order to better understand the information content of the log file, the fault prediction method provided in this embodiment performs multi-channel convolution processing on the vector matrix corresponding to each log data to obtain the convolution result before transmitting the vector matrix to the prediction unit for prediction.
[0074] Since each row element vector of the vector matrix provided by the present application corresponds to a log information, a one-dimensional convolution is adopted, that is, the data has only one axis, the width of the convolution kernel is equal to the width of the vector matrix, and it will only move in the length direction of the matrix. And the length of the convolution kernel of the convolution adopts multiple length types, such as 3, 4, and 5 types, to realize multi-channel convolution, so that the context information of the log data can be mined from multiple angles and a large number of local features can be captured. It is worth mentioning that since the present application uses a multi-channel convolution method of multiple convolution kernel types to convolve the vector matrix, the feature extraction of text data exceeding the length of the convolution kernel type will be insufficient. For example, when using 3, 4, and 5 types of military aircraft and convolution kernel lengths, the performance ability on long texts exceeding 5 will be significantly weakened, so the extraction of more time series features of the log data in the log file is reflected in the subsequent seq2seq structure of the recurrent neural network.
[0075] Step S602, performing pooling processing on the convolution result to obtain a pooling result.
[0076] Since the log data processed by the pre-processing unit needs to be transmitted to the prediction unit, and the seq2seq structural model adopted by the prediction unit has a large number of parameters, in order to reduce the complexity of the system and data processing, this embodiment of the present application performs maximum pooling processing on the convolution results obtained by multi-channel convolution processing, and converts the variable-length log data obtained by different convolution kernels into the same length, so that the length of the convolution result is greatly compressed to a preset length. The preset length can be consistent with the length of the element vector in the vector matrix, which is convenient for subsequent prediction units to process the data.
[0077] Step S603: convert the pooling results and importance parameters into sentence structures.
[0078] In order to facilitate data processing and match the batchsize (the number of data samples captured for one training) of the seq2seq structure, this embodiment of the present application also includes converting the corresponding pooling results and importance parameters obtained in the pre-processing unit for each log data into sentence structure data and sending them to the recurrent neural network used by the prediction unit. In addition, in this embodiment, while converting to sentence structure, the sequence length of the pooling results and importance parameters is fixed to a preset sequence length, for example, the sequence length of the pooling results and importance parameters is converted to a preset sequence length of 30 words, and the converted importance parameters are independent of each other and only correspond to the log data related to them.
[0079] In this way, when the pooling results and importance parameters are input into the prediction unit, since the sentence structure with the preset sequence length is to match the number of data samples captured in one training of the seq2seq structure, that is to say, the information to be processed received by the prediction unit is also input as a group according to the number of data corresponding to the preset sequence length. For example, when the preset sequence length is thirty, the pooling results corresponding to thirty log data are input into the prediction unit as a group, and the importance parameters corresponding to each sentence structure are also transmitted to the attention mechanism in groups of thirty.
[0080] After converting each log data into a vector matrix containing timestamp information and category information, this embodiment performs multi-channel convolution processing on the vector matrix through the convolution layer set in the pre-processing unit, and in order to reduce the complexity of the overall system including seq2seq and data processing, a pooling layer is also set to perform pooling processing on the convolved vector matrix, converting all log data to the same length for subsequent processing; and in order to match the prediction unit, the pooling results and importance parameters are converted into a preset sequence length sentence structure. In this way, the pre-processing unit integrates the pre-processing unit and the prediction unit through the adaptive conversion of the pooling results and importance parameters for the prediction unit and their application in the prediction unit, further increasing the interpretability of the model and the efficiency of data processing.
[0081] See also Figure 7 , Figure 7 yes Figure 3 In the embodiment shown, steps S303 to S304 are Figure 6 Flowchart of the exemplary embodiment shown in FIG. Figure 7 As shown, step S303 may specifically include steps S701 to S705. Through the above steps, the prediction unit realizes the prediction of the equipment failure, which is described in detail as follows:
[0082] Step S701, identifying feature information of the pooling result, converting the feature information of the pooling result and the pooling result into numerical data, and obtaining a numerical result.
[0083] Since the recurrent neural network used by the prediction unit can only understand numerical data, it cannot understand characters, and the log file generated by the device input in this application is actually characters, so it needs to be converted into numerical data. Specifically, since the above-mentioned convolution processing of the vector matrix to obtain the convolution result is a feature extraction process, the prediction unit can identify the feature information from the pooling result transmitted by the pre-processing unit, and after identification, convert the feature information and the pooling result into numerical data to obtain a numerical result.
[0084] Step S702, obtaining a feature vector based on the numerical result, and converting the feature vector into a feature tensor.
[0085] The numerical results obtained above are actually vectors composed of numbers, which contain the feature information extracted from the pooling results. Therefore, based on the numerical results, feature vectors can be obtained. Common deep learning frameworks need to convert vectors into tensor formats before sending them to recurrent neural networks for processing. Therefore, after obtaining the feature vector, it is further converted into a feature tensor, which is numerical data containing the feature information of the log file.
[0086] Step S703, semantic encoding is performed on the feature tensor to obtain a semantic encoding result.
[0087] The seq2seq model applied by the prediction unit is an architecture represented by encoding (Encode) and decoding (Decode). Correspondingly, in the embodiment provided by the present application, an encoder and a decoder are provided, and the encoder semantically encodes the feature tensor that can be understood by the recurrent neural network to obtain a semantic encoding result.
[0088] Among them, the encoder adopts a recurrent neural network to obtain the semantic coding result. The recurrent neural network is composed of multiple network elements, and the order of processing the feature tensor input to the recurrent neural network is not parallel but serial, which can be understood as processing from left to right. Therefore, each network element has a corresponding hidden state that can be output after processing (hidden information is extracted, so it can also be called a hidden state). This embodiment retains the last hidden state that records all information. Since the hidden state of the encoder saves the encoded semantic information, the hidden state finally output by the encoder is used as the semantic coding result.
[0089] Step S704: Use the importance parameter as a weight, and perform a weighted operation on the semantic encoding result according to the weight to obtain a target semantic encoding result corresponding to each log data.
[0090] In this embodiment, the importance parameter is used as the weight, which is reflected in changing the operating parameters of the attention mechanism through the importance parameter of the prediction unit. Specifically, the importance parameter is used to judge the influence of the log data on the equipment failure prediction. The greater the influence, that is, the more important the log data, the greater the weight will be given by the attention mechanism. That is, the weight given to the log data by the attention mechanism is proportional to the value of its important parameter.
[0091] Furthermore, the log data is input into the prediction unit in the form of sentence structures, each sentence structure includes pooling results of a number of data corresponding to a preset sequence length, and there is a weight distinction between each group of pooling results in each sentence structure. The weight of each pooling result in the group is the relative influence of the log data corresponding to each pooling result on fault prediction in the group.
[0092] In this way, when the semantic encoding results are weighted according to the weights, the semantic encoding results of the sentence structure are weighted through the attention mechanism. In this embodiment, a multiplicative weighted model is adopted, that is, weighting is performed in the form of multiplication. The specific formula is: c = ∑ i a i v i , where α represents the attention mechanism, v represents the weight matrix formed by the weights of each pooling result in a sentence structure, and after multiplication and weighting by the above formula, the obtained c represents the weight of a sentence structure as a whole, which is used as the target semantic encoding result and transmitted to the decoder.
[0093] Step S705 , decoding the target semantic coding result to obtain a decoding result, and using the value of the decoding result as prediction information.
[0094] Among them, the prediction information is the probability value of equipment failure, which is a numerical data, that is, the probability of fault detection of different categories. The fault category corresponds to multiple log data in the log file. In fact, the operation and maintenance problem related to fault detection is converted into a text classification problem. The final output prediction information is the probability of each fault category, and each text type represents the occurrence of a fault. The result of the prediction information is jointly affected by the encoder and the attention mechanism, that is, the hidden state and importance parameters output by the encoder as the semantic encoding result.
[0095] The decoder decodes the target semantic encoding result to obtain the decoding result. The decoder also uses a recurrent neural network, and processes the data from left to right. All the networks on the right receive the input of the network on the left, and the output is a probability distribution.
[0096] Therefore, through the method of this embodiment, the present application weights the semantic coding output by the encoder in the prediction unit through the importance parameters obtained in the pre-processing unit to obtain the target semantic coding result, and then the decoder decodes the target semantic coding result to obtain prediction information.
[0097] In this way, after the technical solution of this embodiment of the present application obtains the importance parameters through the feature engineering of the pre-processing unit, the parameters of the attention mechanism are modified according to the importance parameters that characterize the influence of the log data on fault detection. Therefore, the prediction unit can be more matched with the data to be processed, and thus the convergence speed is faster and the accuracy is higher; and through the importance parameters and the added attention mechanism, the attention mechanism of the prediction unit and the feature engineering of the pre-processing unit are integrated, thereby improving the interpretability of the model used.
[0098] Figure 8 yes Figure 2 The pre-processing unit and the prediction unit in the illustrated embodiment are schematic diagrams of the structure of an operation and maintenance system including the pre-processing unit and the prediction unit, which are applied to the fault prediction method provided by the present application, in an exemplary embodiment. Figure 8 The system includes a pre-processing unit 810 and a prediction unit 820. The pre-processing unit 810 includes an embedding module 811, a convolution module 812 and a feature engineering 813. The convolution module 812 also includes a convolution layer 8121 and a pooling layer 8122. The prediction unit 820 includes an encoder 821, an attention mechanism 822 and a decoder 823.
[0099] The embedding module 811 is used to obtain the log files generated during the operation of the device. The log files include attribute information, timestamp information and category information of the log data; the attribute information is vectorized and written into the word encoding of the vector matrix, and the timestamp information and category information are vectorized and written into the added position encoding and type encoding respectively to obtain the word vector corresponding to each log data. The word vectors of multiple log data form a vector matrix, such as Fig. 9 As shown, Fig. 9 This is a schematic diagram of a vector matrix with position coding and type coding in an exemplary embodiment of the present application, so as to increase the model's understanding of data, i.e., the vector matrix, through timestamp information and category information.
[0100] The convolution module 812 is used to receive the vector matrix transmitted by the embedding module 811, perform multi-channel convolution on the vector matrix in the convolution layer 8121, and perform maximum pooling processing on the convolution result in the pooling layer 8122, converting the variable-length log data obtained by different convolution kernels into the same preset length to obtain the pooling result, so as to reduce the complexity of the system and data processing.
[0101] Feature engineering 813 is used to receive the vector matrix transmitted by the embedding module 811, and perform data analysis preprocessing on the feature elements contained in the vector matrix, the data analysis preprocessing includes at least one of the removal of abnormal feature elements, the removal of repeated feature elements, and the filling of incomplete feature elements; then, the feature elements contained in the vector matrix after data analysis preprocessing are analyzed by the random forest algorithm to obtain the importance parameters corresponding to each feature element in the vector matrix. Among them, the greater the value of the importance parameter of the log data that can affect the equipment fault detection, the smaller it is.
[0102] The encoder 821 of the prediction unit 820 is used to receive the pooling result output by the convolution module 812, identify the feature information of the pooling result, convert the feature information of the pooling result and the pooling result into numerical data that can be understood by the recurrent neural network, obtain the numerical result, and obtain the feature vector based on the numerical result, convert the format of the feature vector to obtain a feature tensor in a tensor format that can be processed by the recurrent neural network; then, the feature tensor that can be understood by the recurrent neural network is semantically encoded through multiple network elements of the recurrent neural network, and the last hidden state output by the recurrent neural network is used as the semantic encoding result.
[0103] The attention mechanism 822 is used to receive the importance parameters output by the feature engineering 813, and modify the operating parameters of the attention mechanism 822 itself into importance parameters; the semantic encoding results output by the encoder 821 are multiplied and weighted by the important parameters to obtain the target semantic encoding results corresponding to each log data.
[0104] Decoder 823 is used to decode the target semantic encoding result to obtain a decoding result, and use the value of the decoding result as prediction information to convert the operation and maintenance problem related to fault detection into a text classification problem. The final output prediction information is the probability of each fault category, and each text type represents the occurrence of a fault.
[0105] Therefore, the fault detection method provided by the present application is implemented through the operation and maintenance system provided by the above embodiment, and the writing of timestamp information and category information is added by the embedding module 811, so that the recurrent neural network model can understand the log data content of the log file at the first time; after the feature engineering 813 of the pre-processing unit 810 obtains the importance parameter, the operating parameters of the attention mechanism 822 are modified according to the importance parameter that characterizes the influence of the log data on fault detection, so that the prediction unit 820 can be more matched with the data to be processed, so the convergence speed is faster and the fault detection accuracy is also higher; and through the importance parameter and the added attention mechanism, the attention mechanism of the prediction unit and the feature engineering of the pre-processing unit can be integrated, thereby improving the interpretability of the model used.
[0106] Fig.10 FIG. 1 is a block diagram of a fault prediction device 1000 shown in an exemplary embodiment of the present application. Fig.10 As shown, the device comprises:
[0107] The acquisition module 1001 is used to acquire the log file generated during the operation of the device; wherein the log file includes the timestamp information and category information of the log data; the analysis module 1002 is used to perform feature analysis on the log data according to the timestamp information and category information of the log data to obtain importance parameters for characterizing the log data; the processing module 1003 is used to perform semantic coding processing on the log data according to the importance parameters to obtain a target semantic coding result; the determination module 1004 is used to determine the prediction information of the equipment failure according to the target semantic coding result.
[0108] The device applies the fault prediction method provided by the present application, improves the processing speed of log data by acquiring the timestamp information and category information of the log data obtained by the acquisition module 1001, and improves the accuracy of fault prediction by analyzing the importance parameters obtained in the processing module 1003, so that the determination module 1004 can quickly and accurately locate the fault of the equipment.
[0109] In another exemplary embodiment, the acquisition module 1001 is also used to vectorize the timestamp information, category information, and attribute information of each log data to obtain the word vector corresponding to each log data; and generate a vector matrix according to the word vector corresponding to each log data.
[0110] In another exemplary embodiment, the analysis module 1002 is also used to perform data analysis preprocessing on the characteristic elements contained in the vector matrix to obtain the vector matrix after data analysis preprocessing; wherein the data analysis preprocessing includes at least one of the removal of abnormal characteristic elements, the removal of repeated characteristic elements, and the filling of incomplete characteristic elements; feature analysis is performed on the characteristic elements contained in the vector matrix after data analysis preprocessing to obtain the importance parameters corresponding to each characteristic element in the vector matrix.
[0111] In another exemplary embodiment, the processing module 1003 is also used to obtain a vector matrix; wherein the vector matrix is obtained based on the timestamp information, category information, and attribute information of the log data; the vector matrix is semantically encoded to obtain a semantic encoding result; the importance parameter is used as a weight, and the semantic encoding result is weighted according to the weight to obtain a target semantic encoding result corresponding to each log data.
[0112] In another exemplary embodiment, the determination module 1004 is also used to decode the target semantic coding result to obtain a decoding result; the value of the decoding result is used as prediction information, wherein the prediction information is a probability value of a device failure, and the category of the failure corresponds to multiple log data in the log file.
[0113] It should be noted that the fault prediction device provided in the above embodiment and the fault prediction method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the fault prediction device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0114] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by one or more processors, the electronic device implements the fault prediction method provided in the above-mentioned embodiments.
[0115] Fig.11 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0116] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103, such as executing the method in the above embodiment. In RAM 1103, various programs and data required for system operation are also stored. CPU 1101, ROM 1102 and RAM 1103 are connected to each other through a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0117] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0118] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0119] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0120] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the above-mentioned module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0121] The units and modules involved in the embodiments described in this application may be implemented by software or hardware, and the units and modules described may also be set in a processor. The names of these units and modules do not, in some cases, constitute limitations on the units and modules themselves.
[0122] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the fault prediction method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0123] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the fault prediction method provided in each of the above embodiments.
[0124] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A fault prediction method, characterized in that: The method comprises: Obtaining a log file generated during the operation of the device; wherein the log file includes timestamp information and category information of the log data; the number of the log data is multiple; Generate a vector matrix according to the timestamp information and category information of each log data; perform feature analysis according to the vector matrix to obtain importance parameters for characterizing the log data; Performing semantic coding processing on the vector matrix to obtain a semantic coding result; adjusting the semantic coding result according to the importance parameter to obtain a target semantic coding result; The target semantic coding result is decoded to obtain a decoding result; the value of the decoding result is used as prediction information, wherein the prediction information is a probability value of failure of the device, and each category of log data in the log file corresponds to a failure category.
2. The method according to claim 1, characterized in that: The log file also includes attribute information of the log data; The generating of a vector matrix according to the timestamp information and category information of each log data includes: Vectorize the timestamp information, category information, and attribute information of each log data to obtain the word vector corresponding to each log data; The vector matrix is generated according to the word vectors corresponding to the respective log data.
3. The method according to claim 1, characterized in that The performing feature analysis according to the vector matrix to obtain importance parameters for characterizing the log data includes: Performing data analysis preprocessing on the characteristic elements contained in the vector matrix to obtain a vector matrix after data analysis preprocessing; wherein the data analysis preprocessing includes at least one of a removal process of abnormal characteristic elements, a removal process of repeated characteristic elements, and a filling process of incomplete characteristic elements; Perform feature analysis on the feature elements contained in the vector matrix after the data analysis preprocessing to obtain the importance parameter corresponding to each feature element in the vector matrix.
4. The method according to claim 1, characterized in that: The number of the log data is multiple; the adjusting the semantic coding result according to the importance parameter to obtain the target semantic coding result includes: The importance parameter is used as a weight, and a weighted operation is performed on the semantic encoding result according to the weight to obtain a target semantic encoding result corresponding to each log data.
5. A fault prediction device, characterized in that: include: An acquisition module, used to acquire a log file generated during the operation of the device; wherein the log file includes timestamp information and category information of the log data; and the number of the log data is multiple; An analysis module, used to generate a vector matrix according to the timestamp information and category information of each log data; perform feature analysis according to the vector matrix to obtain importance parameters for characterizing the log data; A processing module, used for performing semantic coding processing on the vector matrix to obtain a semantic coding result; adjusting the semantic coding result according to the importance parameter to obtain a target semantic coding result; A determination module is used to decode the target semantic coding result to obtain a decoding result; the value of the decoding result is used as prediction information, wherein the prediction information is a probability value of failure of the device, and each category of log data in the log file corresponds to a fault category.
6. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the fault prediction method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the fault prediction method according to any one of claims 1 to 4.
