Full-monitoring-period industrial alarm prediction method based on Informer
The Informer model encodes the alarm sequence and sparse attention layer processing, solves the problem of ignoring alarm time information in the prior art, realizes high-precision alarm prediction within the entire monitoring cycle, and improves the robustness and accuracy of prediction.
Patent Information
- Application Number
- CN202510492438.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-08-01
AI Technical Summary
The existing industrial alarm prediction methods ignore the impact of the change in alarm rate under different states during the entire monitoring cycle, resulting in low prediction accuracy and insufficient utilization of alarm time information.
Using an Informer-based method, the alarm sequence is encoded through fixed position coding and time interval coding, an improved alarm prediction model is constructed, and the alarm sequence is divided using a sliding window and combined with the sparse attention layer and the complete attention layer for alarm prediction.
It realizes high-precision alarm prediction in the entire monitoring cycle, improves the robustness of alarm rate fluctuations and the ability to extract alarm data features, and enhances the practicality of prediction.
Smart Images

Figure CN120408307A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of complex industrial process alarm monitoring systems, and in particular to an industrial alarm prediction method based on Informer for the entire monitoring cycle. Background Art
[0002] Alarm systems are deployed in large industrial facilities to monitor the production operation status in real time and provide an important guarantee for industrial safety production. However, the occurrence of faults or abnormal conditions will trigger a large number of alarms, even leading to alarm floods. According to the international standard ANSI / ISA-18.2, alarm flood is defined as the number of alarms exceeding the range that can be effectively managed by operators. At the same time, alarm flood is also one of the main risk factors causing serious industrial accidents. Therefore, researching an efficient decision support system to help factory operators implement corrective measures in time to deal with alarm floods is an important issue in the current industrial alarm monitoring field.
[0003] During the industrial production process, faults or abnormalities spread between interconnected processes or units, making the generated alarm events dependent, and they will occur repeatedly in a certain order. By analyzing the sequential characteristics of historical alarms, upcoming alarms can be predicted, thus helping operators prevent and handle alarm floods in a timely manner. However, existing methods are mainly designed for the alarm prediction task in the alarm flood stage, ignoring the impact of the change in alarm rate under different states in the entire monitoring cycle, making these methods ineffective in the non-alarm flood stage and reducing the usability of the prediction results. On the other hand, the timestamps of alarms and their time intervals can reflect the dependence intensity between alarms, while existing prediction methods only rely on alarms and alarm sequences, ignoring the time information of alarms, which limits the improvement of prediction accuracy.
[0004] Therefore, there is an urgent need for a new prediction method to achieve accurate and efficient early prediction of industrial alarms in the entire monitoring cycle of industrial production. Summary of the Invention
[0005] The purpose of the present invention is to provide an industrial alarm prediction method based on Informer for the entire monitoring cycle to solve the problem that existing prediction methods only rely on alarms and alarm sequences, ignore the time information of alarms, and have low alarm prediction accuracy.
[0006] The above object of this application is achieved through the following technical solutions:
[0007] S1: Obtain the alarm sequence and divide it to obtain the input sequence and the target sequence;
[0008] S2: Encode the input sequence through the fixed position encoding and time interval encoding methods to obtain the encoding result;
[0009] S3: Build an alarm prediction model based on the improved Informer; train the alarm prediction model offline using the encoding results and target sequences;
[0010] S4: Obtain the real-time alarm sequence to be predicted and divide it; input the divided alarm sequence to be predicted into the trained alarm prediction model to obtain the final alarm location prediction result.
[0011] Optionally, step S1 includes:
[0012] S11: Obtain an alarm sequence from the alarm event log; the alarm sequence is a sequence pair consisting of an input sequence and a target sequence;
[0013] When the alarm rate at the time of dividing the alarm sequence is lower than the preset threshold, a fixed-length sliding window is used to divide the Γ alarms before the predicted time into the input alarm sequence. middle;
[0014]
[0015] Among them, a c Indicates that it occurs at t c The alarm at the moment, its alarm label is e c ;
[0016] S12: When the alarm rate at the time of dividing the alarm sequence is greater than or equal to the preset threshold, a time-long sliding window is used to generate the alarm sequence before the predicted time. I Alarms within a time range are divided into input alarm sequences middle;
[0017]
[0018]
[0019] in, Indicates that it occurs in [t c -Δ I ,t c ]The number of alarms in the time period; t c Indicates the prediction moment;
[0020] S13: Fix the input alarm sequence to the same length N I , which is determined by the length of the sequencing long sliding window Γ and the number of alarms in the timing long sliding window The maximum value in ;
[0021]
[0022] S14: For length less than N IThe input alarm sequence, with the placeholder Z supplemented before the input alarm sequence h , to obtain the final input sequence S I ;
[0023]
[0024] Among them, ξ(t c ) represents the alarm rate at time t c ; ξ th represents a preset threshold for judging the high or low alarm rate; Z h The h in represents the number of placeholders, h = N I -Γ,
[0025] S15: Divide the preset number of alarms after the prediction time into the input target sequence;
[0026] Through the method of truncation and supplementing placeholders, perform alignment operations on the divided target sequence to obtain the final target sequence S T ;
[0027]
[0028] Among them, represents the last alarm in the original target alarm sequence when the alarm rate is less than 10 per 10 minutes; represents placeholders; N T represents the maximum number of alarms included in the target sequence; represents the number of alarms occurring in the time period [t c , t c +600]; 600 represents 600 seconds; represents the last alarm in the target sequence when the alarm rate is higher than 10 per 10 minutes; ξ(t c +600) represents the alarm rate at time t c +600.
[0029] Optionally, step S2 includes:
[0030] S21: Initialize an embedding matrix Among them represents the number of alarm label types in the alarm system, d represents the embedding dimension, and R represents the real number field; the parameters of the embedding layer are continuously updated during the training process of the alarm prediction model; using the alarm label as an index, obtain the corresponding embedding vector from the embedding matrix to form the encoding matrix E I , that is, obtain the alarm label encoding result;
[0031]
[0032] in express The alarm label of the moment;
[0033] S22: Encode the input sequence using a fixed position encoding method to obtain a position encoding result P I ;
[0034] S23: Encode the input sequence using the time interval encoding method to obtain the time interval encoding result T I ;
[0035] S24: Add the alarm tag encoding result, position encoding result and time interval encoding result to obtain the encoding result S of the input sequence I .
[0036] Optionally, step S22 includes:
[0037] Use fixed position coding based on cosine and sine functions to assign different weights p to each alarm in the input sequence, and finally obtain the position coding matrix P of the input sequence I ;
[0038]
[0039] in, The position encoding vector corresponding to the last alarm in the input sequence.
[0040] Optionally, step S23 includes:
[0041] The specific steps of time interval coding include: calculating the time interval δ between each alarm in the input sequence and the first alarm I ;
[0042]
[0043] The time interval δ I Normalized to between 0 and 3 and processed using the Tanh function;
[0044] Extract the time interval feature and obtain the time interval encoding result T I ;
[0045]
[0046] in Represents the time interval vector after Tanh function processing; W T represents the weight matrix of the linear layer; b T represents the bias vector of the linear layer; t c Indicates alarm a in the input alarm sequence cThe corresponding time interval encoding vector.
[0047] Optionally, step S3 includes:
[0048] S31: In the first sparse attention layer of the encoder of the alarm prediction model, three linear layers are used to process the encoding results respectively to obtain a query vector, a key vector, and a value vector; the query vector, key vector, and value vector corresponding to each alarm are combined to obtain the query matrix, key matrix, and value matrix of the input sequence;
[0049] S32: For each alarm, select r key vectors from the key matrix K to form a reconstructed key matrix Calculate the sparseness measure L of the alarm j ;
[0050]
[0051] where r = ln N I And round up to the integer; represents the query vector; represents the i-th key vector of the reconstructed key matrix corresponding to the j-th alarm in the first sparse attention layer of the encoder; d represents the dimensions of the query vector, key vector, and value vector;
[0052] S33: sorting the sparse metrics of all alarms;
[0053] The alarms whose sparseness metric value is greater than or equal to the preset division threshold are determined as the first type of alarms; the attention distribution vector ω of the first type of alarms is calculated. e1 ;
[0054]
[0055] in represents the query vector; K e1 represents the bond matrix; V e1 represents the value matrix; d represents the dimension of the query vector, key vector, and value vector;
[0056] The alarms whose sparseness metric value is less than the preset division threshold are determined as the second type of alarms; the attention distribution vector of the second type of alarms is calculated by the mean of each alarm value vector;
[0057] Combine the attention distribution vectors of all alarms to obtain the attention distribution matrix Ω of the input sequence e1 ;
[0058] S34: Stack two sparse attention layers in the encoder, combined with the attention distribution matrix Ω e1 , get the encoder output Ω e , that is, the temporal characteristics of the input sequence;
[0059] S35: Include in the decoder: one layer of sparse attention layer, one layer of full attention layer, and a fully connected layer;
[0060] The input of the decoder contains half of the alarms in the input sequence of the alarm prediction model. The feature information of half of the alarms is extracted through the sparse attention layer to obtain the attention distribution matrix Ω d1 ;
[0061] S36: Through the full attention layer, fuse the encoder output Ω e and the output Ω of the sparse attention layer in the decoder d1 , to obtain the attention distribution matrix Ω of the predicted target sequence d ;
[0062] S37: Process the attention distribution matrix Ω of the predicted target sequence through the fully connected layer d , to obtain the predicted alarm probability distribution matrix D;
[0063]
[0064] where represents the attention distribution vector of the (c + N)-th alarm T ;
[0065] S38: Determine the alarm indicated by the position with the highest probability in the predicted alarm probability distribution vector d as the prediction result, and determine the final prediction result
[0066] S39: Calculate the loss value between the final prediction result and the actual target sequence through the loss function; adjust the parameters of the alarm prediction model through the loss value until the loss value is less than the preset threshold, and end the training.
[0067] An electronic device, including a processor, a memory, a user interface, and a network interface. The memory is used to store instructions. The user interface and the network interface are used to communicate with other devices. The processor is used to execute the instructions stored in the memory, so that the electronic device executes a full monitoring cycle industrial alarm prediction method based on Informer.
[0068] A computer-readable storage medium stores instructions, and when the instructions are executed, a full monitoring cycle industrial alarm prediction method based on Informer is executed.
[0069] The beneficial effects brought by the technical solution provided in this application are as follows: The alarm sequence is divided in real time according to the alarm rate, and an input sequence adapted to the alarm rate is generated; by constructing an Informer-based alarm prediction model adapted to different alarm rates and making full use of the label and timestamp information of continuous alarm event data, alarm prediction for the entire alarm monitoring period is realized. The industrial alarm prediction method provided by the present invention can adaptively extract the optimal input alarm sequence, improving the robustness to alarm rate fluctuations; at the same time, the proposed method effectively encodes the alarm timestamp, enhancing the ability to extract alarm data features; finally, the proposed alarm prediction model based on the improved Informer realizes high-precision alarm prediction for the entire alarm monitoring period, enhancing the practicality of alarm prediction. Description of the Drawings
[0070] The following will further illustrate the present application in conjunction with the drawings, where:
[0071] Figure 1 is the flowchart in the embodiment of the present application;
[0072] Figure 2 is a schematic diagram of the process of dividing the input alarm sequence in the embodiment of the present invention;
[0073] Figure 3 is a schematic diagram of the flowchart of the input alarm sequence encoding method provided by the present invention;
[0074] Figure 4 is a schematic diagram of the structure of the alarm prediction model based on the improved Informer in the embodiment of the present invention;
[0075] Figure 5 is a graph of the accuracy rate of alarm prediction based on the method of the present invention in a continuous alarm monitoring period in the embodiment of the present invention;
[0076] Figure 6 is a graph of the false alarm rate of alarm prediction based on the method of the present invention in a continuous alarm monitoring period in the embodiment of the present invention;
[0077] Figure 7 is a schematic diagram of the structure of the electronic device in the embodiment of the present application. Detailed Embodiments
[0078] In order to have a clearer understanding of the technical features, objectives, and effects of the present application, the detailed embodiments of the present application will now be described in detail with reference to the drawings.
[0079] The embodiment of the present application provides an industrial alarm prediction method based on Informer for the entire monitoring period.
[0080] Please refer to Figure 1 , Figure 1It is a flowchart of a full - monitoring - cycle industrial alarm prediction method based on Informer in an embodiment of the present application, including:
[0081] S1: Obtain the alarm sequence and partition it to get the input sequence and the target sequence;
[0082] As an embodiment, to make the alarm prediction adapt to the changes in the alarm rate under different states in the full - alarm - monitoring cycle, according to the change characteristics of the dependence strength between alarms under different alarm rates, different forms of sliding - window partition prediction model input sequences are designed, including fixed - duration sliding windows and fixed - order - length sliding windows. From the alarm event log, the obtained input sequence pairs are used for offline training of the prediction model, and only the input alarm sequence needs to be partitioned in real - time during online prediction.
[0083] S2: Encode the input sequence through fixed - position encoding and time - interval encoding methods to obtain the encoding result;
[0084] As an embodiment, in order to enable the alarm sequence to be used by a deep - learning - based model, it needs to be encoded to obtain the high - dimensional embedding representation corresponding to each alarm; in order to consider the occurrence order of each alarm, a position - encoding technique is introduced; at the same time, a time - interval encoding method is proposed to extract the information contained in the alarm timestamps.
[0085] S3: Construct an alarm prediction model based on the improved Informer; offline - train the alarm prediction model through the encoding result and the target sequence;
[0086] S4: Obtain the real - time alarm sequence to be predicted and partition it; input the partitioned alarm sequence to be predicted into the trained alarm prediction model to obtain the final alarm - position prediction result.
[0087] Step S1 includes:
[0088] S11: Obtain the alarm sequence from the alarm event log; the alarm sequence is a sequence pair composed of an input sequence and a target sequence;
[0089] When the alarm rate at the moment of partitioning the alarm sequence is lower than the preset threshold, use a fixed - order - length sliding window to partition the Γ alarms before the prediction moment into the input alarm sequence in;
[0090]
[0091] where, a c represents the alarm occurring at t c moment, and its alarm label is e c ;
[0092] S12: When the alarm rate at the time of dividing the alarm sequence is greater than or equal to the preset threshold, a time-long sliding window is used to generate the alarm sequence before the predicted time. I Alarms within a time range are divided into input alarm sequences middle;
[0093]
[0094] in, Indicates that it occurs in [t c -Δ I ,t c ]The number of alarms in the time period; t c Indicates the prediction moment;
[0095] S13: Fix the input alarm sequence to the same length N I , which is determined by the length of the sequencing long sliding window Γ and the number of alarms in the timing long sliding window The maximum value in ;
[0096]
[0097] S14: For length less than N I Input alarm sequence, add placeholder Z before input alarm sequence h , get the final input sequence S I ;
[0098]
[0099] Among them, ξ(t c ) represents t c Alarm rate at each moment; ξ th Indicates the preset threshold for judging the alarm rate; Z h The h in the string represents the number of placeholders, h=N I -Γ,
[0100] As an example, according to the ANSI / ISA-18.2 standard, it is set to 10 alarms every 10 minutes.
[0101] S15: Divide a preset number of alarms after the prediction moment into an input target sequence;
[0102] By truncating and supplementing placeholders, the target sequence obtained by division is aligned to obtain the final target sequence S T ;
[0103]
[0104] in, Indicates the last alarm in the original target alarm sequence when the alarm rate is lower than 10 per 10 minutes; Indicates placeholder; N T Indicates that the target sequence contains the maximum number of alarms; Indicates the occurrence at [t c , t c +600] time period; 600 represents 600 seconds; Indicates the last alarm in the target sequence when the alarm rate is higher than 10 per 10 minutes; ξ(t c +600) represents the alarm rate at time t c +600.
[0105] Step S2 includes:
[0106] S21: Initialize an embedding matrix where represents the number of alarm label types in the alarm system, d represents the embedding dimension, and R represents the real number field; the parameters of the embedding layer are continuously updated during the training of the alarm prediction model; the alarm label is used as an index to obtain the corresponding embedding vector from the embedding matrix to form the encoding matrix E I , that is, the alarm label encoding result is obtained;
[0107]
[0108] where represents the label of the alarm at time
[0109] S22: Encode the input sequence through the fixed-position encoding method to obtain the position encoding result P I ;
[0110] S23: Encode the input sequence through the time interval encoding method to obtain the time interval encoding result T I ;
[0111] S24: Add the alarm label encoding result, the position encoding result, and the time interval encoding result to obtain the encoding result S of the input sequence I .
[0112] Step S22 includes:
[0113] Use the fixed-position encoding based on cosine and sine functions to assign different weights p to each alarm in the input sequence, and finally obtain the position encoding matrix P of the input sequence I ;
[0114]
[0115] Among them, represents the position encoding vector corresponding to the last alarm in the input sequence.
[0116] Step S23 includes:
[0117] The specific steps of time interval encoding include: calculating the time interval δ between each alarm in the input sequence and the first alarm I ;
[0118]
[0119] Normalize the time interval δ I to between 0 and 3 and process it using the Tanh function;
[0120] Extract the features of the time interval to obtain the time interval encoding result T I ;
[0121]
[0122] Among them represents the time interval vector after being processed by the Tanh function; W T represents the weight matrix of the linear layer; b T represents the bias vector of the linear layer; t c represents the time interval encoding vector corresponding to the alarm a c in the input alarm sequence.
[0123] Step S3 includes:
[0124] S31: In the first-layer sparse attention layer of the encoder of the alarm prediction model, use three linear layers to process the encoding result respectively to obtain a query vector, a key vector, and a value vector; combine the query vectors, key vectors, and value vectors corresponding to each alarm to obtain the query matrix, key matrix, and value matrix of the input sequence;
[0125] S32: For each alarm, select r key vectors from the key matrix K to form a reconstructed key matrix Calculate the sparse metric L of this alarm j ;
[0126]
[0127] where r = ln N I and round up to the nearest integer; represents the query vector; represents the i-th key vector of the reconstructed key matrix corresponding to the j-th alarm in the first-layer sparse attention layer of the encoder; d represents the dimension of the query vector, key vector, and value vector;
[0128] S33: Sort the sparse metrics of all alarms;
[0129] In a specific embodiment of the present application, the results of the sparse metrics of all alarms are sorted by size, and the division threshold is determined according to different preset alarm quantity ratios under different alarm rates.
[0130] Alarms with sparse metric values greater than or equal to the preset division threshold are determined as the first type of alarms; calculate the attention distribution vector ω of the first type of alarms e1 ;
[0131]
[0132] where represents the query vector; K e1 represents the key matrix; V e1 represents the value matrix; d represents the dimensions of the query vector, key vector, and value vector;
[0133] Alarms with sparse metric values less than the preset division threshold are determined as the second type of alarms; calculate the attention distribution vector of the second type of alarms through the mean of each alarm value vector;
[0134] As an embodiment, only alarms with high sparse metric values participate in the calculation of the attention distribution matrix, and the attention distribution matrix of alarms with low sparse metric values is replaced by the mean of each alarm value vector. Among them, fewer alarms participate in the calculation of the attention distribution matrix when the alarm rate is low, and more alarms participate in the calculation of the attention distribution matrix when the alarm rate is high.
[0135] Combine the attention distribution vectors of all alarms to obtain the attention distribution matrix Ω of the input sequence e1 ;
[0136] S34: Stack two layers of sparse attention layers in the encoder, and combine the attention distribution matrix Ω e1 , to obtain the encoder output Ω e , that is, the temporal characteristics of the input sequence;
[0137] S35: The decoder includes: one layer of sparse attention layer, one layer of full attention layer, and a fully connected layer;
[0138] The input of the decoder contains half of the alarms in the input sequence of the alarm prediction model. The feature information of half of the alarms is extracted through the sparse attention layer to obtain the attention distribution matrix Ω d1 ;
[0139] S36: Through the full attention layer, fuse the encoder output Ω e and the output Ω of the sparse attention layer in the decoder d1 , to obtain the attention distribution matrix Ω of the predicted target sequenced ;
[0140] S37: Process the attention distribution matrix Ω of the predicted target sequence through the fully connected layer d , and obtain the predicted alarm probability distribution matrix D;
[0141]
[0142] where represents the attention distribution vector of the (c + N)-th alarm; T th alarm;
[0143] S38: Determine the alarm indicated by the position with the highest probability in the predicted alarm probability distribution vector d as the prediction result, and determine the final prediction result
[0144] S39: Calculate the loss value between the final prediction result and the actual target sequence through the loss function; adjust the parameters of the alarm prediction model through the loss value until the loss value is less than the preset threshold, and end the training.
[0145] The present invention generates alarm data based on the simulation of the Vinyl Acetate Monomer (VAM) model of the industrial simulation platform to verify the effectiveness of the method provided by the present invention. During the data generation process, 5 typical faults are cyclically configured, and the obtained process data is compared with the corresponding thresholds to generate alarm event data. At the same time, a delay device is designed to eliminate chattering alarms. After obtaining the simulation data, experimental verification is carried out.
[0146] Figure 1 is a flowchart of a full-monitoring-cycle industrial alarm prediction method based on multi-layer coding and Informer in an embodiment of the present invention, including two stages: offline model training and online prediction.
[0147] Offline model training:
[0148] The offline model training stage mainly includes three steps, including: division of input-target alarm sequence pairs, encoding of input alarm sequences, and construction and training of offline models.
[0149] 1) Division of input-target alarm sequence pairs
[0150] For historical alarm data, at each alarm occurrence moment, the input alarm sequence and the corresponding target alarm sequence are obtained by using a sliding window to form an input-target alarm sequence pair.
[0151] Figure 2It is a schematic diagram of the input alarm sequence division process in an embodiment of the present invention. According to the different alarm rates at this moment, different forms of sliding windows are used to divide the input alarm sequence, specifically as follows: a) When the alarm rate is low, a fixed-order-length sliding window with a length of 70 is used to divide a fixed number of alarms that occurred before this moment into the input alarm sequence; b) When the alarm rate is high, a fixed-time-length sliding window with a length of 10 minutes is used to divide all alarms that occurred within a fixed time length before this moment into the input alarm sequence. After obtaining the original input alarm sequence, perform the operation of supplementing placeholders to make the length of the input alarm sequence consistent. Finally, the input alarm sequence obtained is:
[0152] According to the ANSI / ISA-18.2 standard, the predicted target alarm sequence is set as the alarms that will occur within the next 10 minutes, and the maximum number of predicted alarms is limited to 10. When the number of alarms within 10 minutes is less than 10, supplement placeholders; when the number of alarms within 10 minutes exceeds 10, take a truncation operation.
[0153] Traverse the historical alarm data to generate a set of input-target alarm sequence pairs for the training of the prediction model.
[0154] 2) Encoding of the input alarm sequence
[0155] Figure 3 It is a schematic diagram of the encoding process of the input alarm sequence in an embodiment of the present invention. The specific implementation steps are described as follows.
[0156] a) Alarm label encoding: Design an embedding layer, which contains embedding vectors equal in number to the number of alarm labels. The label of each alarm is used as an index to extract the corresponding embedding vector to form the embedding matrix of the input alarm sequence. Set the encoding dimension to 512.
[0157] b) Position encoding: Use a fixed position encoding method based on sine and cosine functions to obtain the weight encoding vector corresponding to each position.
[0158] c) Time interval encoding: Calculate the time interval between each alarm in the input alarm sequence and the first alarm, normalize the time interval vector, and process the time interval vector using the Tanh function. Further, use a linear layer to extract the features of the time interval vector to achieve dimension alignment with the embedding vector and the position weight encoding vector.
[0159] d) Finally, add the alarm label embedding matrix, the position weight encoding matrix, and the time interval matrix to obtain the encoding matrix of the input alarm sequence.
[0160] 3) Offline model construction and training
[0161] Figure 4It is a schematic diagram of the alarm prediction model structure based on the improved Informer in the embodiments of the present invention. Considering the characteristic that there are differences in the intensity of the dependence relationship between alarms under different alarm rate states, an alarm prediction model based on Informer is constructed, and its attention mechanism is improved. In the improved attention mechanism, the model will enable different numbers of alarms to participate in the calculation of the attention distribution matrix according to different alarm rates, specifically as follows: a) When the alarm rate is low, 20% of the alarms in the input alarm sequence are adaptively selected to participate in the calculation of the attention distribution matrix; b) When the alarm rate is high, 100% of the alarms in the input alarm sequence are enabled to participate in the calculation of the attention distribution matrix.
[0162] The alarm prediction task can be regarded as a multi-label multi-classification task. Therefore, during the training process, the cross-entropy loss function is used to calculate the difference between the model prediction output result and the target alarm sequence. The Adam optimizer is used to update the parameters in the prediction model to achieve model training. The set of input-target alarm sequence pairs obtained in step 1) is divided into a training set, a validation set, and a test set at a ratio of 8:1:1. Combining the validation set and the early stopping mechanism, the model is trained to achieve the best prediction effect.
[0163] Online alarm prediction:
[0164] The online alarm prediction stage mainly includes three steps: input alarm sequence division, input alarm sequence encoding, and alarm prediction.
[0165] 1) Input alarm sequence division: When an alarm occurs, the input alarm sequence is divided according to the current alarm rate.
[0166] 2) Input alarm sequence encoding: The obtained input alarm sequence is encoded for alarm labels and time intervals, and combined with position encoding to obtain the encoding matrix of the input alarm sequence.
[0167] 3) Alarm prediction: The encoded matrix is input into the alarm prediction model trained offline to obtain the online alarm prediction result.
[0168] To evaluate the prediction effect of the alarm prediction model, two evaluation indicators are designed: accuracy rate M a and false alarm rate M f , and the calculation formulas are as follows
[0169]
[0170] where R is the number of alarms that actually occur within the prediction range, A is the number of alarms that are accurately predicted, and F is the number of alarms that are wrongly predicted.
[0171] [[ID=3�]] Figure 5 and Figure 6They are respectively the accuracy rate and false alarm rate of alarm prediction based on the method of the present invention in a continuous alarm monitoring period of the embodiment of the present invention. This continuous alarm monitoring period includes 5 alarm flood stages and 5 non-alarm flood stages. The prediction effect of the prediction model in this continuous alarm monitoring period is shown in Table 1.
[0172] Table 1
[0173]
[0174]
[0175] This application also discloses an electronic device. Referring to Figure 7 , Figure 7 is a schematic structural diagram of an electronic device disclosed in an embodiment of this application. The electronic device 500 may include: at least one processor 501, at least one network interface 504, a user interface 503, a memory 505, and at least one communication bus 502.
[0176] Among them, the communication bus 502 is used to realize the connection and communication between these components.
[0177] Among them, the user interface 503 may include a display screen, and optionally the user interface 503 may further include a standard wired interface and a wireless interface.
[0178] Among them, the network interface 504 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0179] This application also discloses a computer-readable storage medium, which stores multiple instructions suitable for being loaded by a processor to execute the above-mentioned Informer-based full monitoring period industrial alarm prediction method.
[0180] The above are only exemplary embodiments of the present disclosure and should not be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure.
[0181] This application aims to cover any variations, uses, or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not recorded in the present disclosure. The description and embodiments are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. An Informer-based industrial alarm prediction method for the full monitoring period, characterized in that, The method includes the following steps: S1: Obtain an alarm sequence and partition it to obtain an input sequence and a target sequence; S2: Encode the input sequence through a fixed position encoding and a time interval encoding method to obtain an encoding result; S3: Construct an alarm prediction model based on the improved Informer; offline train the alarm prediction model through the encoding result and the target sequence; S4: Obtain a real-time alarm sequence to be predicted and partition it; input the partitioned alarm sequence to be predicted into the trained alarm prediction model to obtain a final alarm position prediction result.
2. The full-monitoring cycle industrial alarm prediction method based on Informer according to claim 1, wherein Step S1 includes: S11: Obtain an alarm sequence from the alarm event log; the alarm sequence is a sequence pair composed of an input sequence and a target sequence; When the alarm rate at the moment of dividing the alarm sequence is lower than the preset threshold, use a fixed-order-length sliding window to divide the Γ alarms before the prediction moment into the input alarm sequence ; Among them, a c represents an alarm that occurs at t c moment, and its alarm label is e c ; S12: When the alarm rate at the moment of dividing the alarm sequence is greater than or equal to the preset threshold, use a sliding window with a fixed duration to divide the alarms that occurred within the Δ I duration range before the prediction moment into the input alarm sequence ; Among them, represents the number of alarms that occurred during the time period [[t c -Δ I , t c ; t c represents the prediction time; S13: Fix the input alarm sequence to the same length N I , which is determined by the maximum value of the fixed-order length sliding window length Γ and the number of alarms within the fixed-time length sliding window ; S14: For an input alarm sequence with a length less than N I before the input alarm sequence, supplement the placeholder Z h to obtain the final input sequence S I ; Among them, ξ(t c ) represents the alarm rate at time t c ; ξ th represents a preset threshold for judging the high or low alarm rate; h in Z h represents the number of placeholders, h = N I - Γ, S15: Partition a preset number of alarms after the prediction moment into the input target sequence; Align the obtained target sequence by truncating and supplementing placeholders to obtain the final target sequence S T ; Among them, represents the last alarm in the original target alarm sequence when the alarm rate is lower than 10 per 10 minutes; represents placeholder; N T represents the maximum number of alarms included in the target sequence; represents the occurrence at [t c , t c +600] time period; 600 represents 600 seconds; represents the last alarm in the target sequence when the alarm rate is higher than 10 per 10 minutes; ξ(t c +600) represents the alarm rate at t c +600 moment.
3. The full-monitoring cycle industrial alarm prediction method based on Informer according to claim 1, wherein Step S2 includes: S21: Initialize an embedding matrix where represents the number of alarm label types in the alarm system, d represents the embedding dimension, and R represents the real number field; the parameters of the embedding layer are continuously updated during the training process of the alarm prediction model; the alarm label is used as an index to obtain the corresponding embedding vector from the embedding matrix to form the encoding matrix E I , that is, the alarm label encoding result is obtained; Among them indicates the label of the alarm at the moment S22: Encode the input sequence through the fixed-position encoding method to obtain the position encoding result P I ; S23: Encode the input sequence using the time interval encoding method to obtain the time interval encoding result T I ; S24: Add the encoding results of the alarm label, the position encoding, and the time interval encoding to obtain the encoding result S of the input sequence I .
4. The all-monitoring cycle industrial alarm prediction method based on Informer according to claim 3, characterized in that Step S22 includes: Using fixed-position encoding based on cosine and sine functions, different weights p are assigned to each alarm in the input sequence, and finally the position encoding matrix P of the input sequence is obtained I ; Among them, represents the position coding vector corresponding to the last alarm in the input sequence.
5. The industrial alarm prediction method based on Informer with a full monitoring cycle according to claim 3, wherein Step S23 includes: The specific steps of time interval encoding include: calculating the time interval δ between each alarm in the input sequence and the first alarm I ; Normalize the time interval δ I to between 0 and 3 and process it using the Tanh function; Extract the time interval feature to obtain the time interval encoding result T I ; Among them represents the time interval vector after being processed by the Tanh function; W T represents the weight matrix of the linear layer; b T represents the bias vector of the linear layer; t c represents the time interval coding vector corresponding to the alarm a c in the input alarm sequence.
6. The full-monitoring cycle industrial alarm prediction method based on Informer according to claim 1, characterized in that, Step S3 includes: S31: In the first layer of sparse attention layer of the encoder of the alarm prediction model, use three linear layers to process the encoding result respectively to obtain a query vector, a key vector, and a value vector; combine the query vectors, key vectors, and value vectors corresponding to each alarm to obtain a query matrix, a key matrix, and a value matrix of the input sequence; S32: For each alarm, select r key vectors from the key matrix K to form a reconstructed key matrix Calculate the sparsity metric L of this alarm j ; where r = lnN I and round up to an integer; denotes the query vector; denotes the i-th key vector of the reconstruction key matrix corresponding to the j-th alarm in the first layer of sparse attention layer of the encoder; d denotes the dimension of the query vector, key vector and value vector; S33: Sort the sparse metrics of all alarms; Determine the alarms with sparse metric values greater than or equal to the preset division threshold as the first type of alarms; calculate the attention distribution vector ω of the first type of alarms e1 ; Among them represents the query vector; K e1 represents the key matrix; V e1 represents the value matrix; d represents the dimension of the query vector, key vector, and value vector; Determine the alarms with sparse metric values less than a preset partition threshold as the second type of alarms; calculate the attention distribution vector of the second type of alarms through the mean of the value vectors of each alarm; Combine all the attention distribution vectors of the alarms to obtain the attention distribution matrix Ω of the input sequence e1 ; S34: Stack two layers of sparse attention layers in the encoder, and combine the attention distribution matrix Ω e1 , to obtain the encoder output Ω e , which is also the temporal feature of the input sequence; S35: The decoder includes: a layer of sparse attention layer, a layer of full attention layer, and a fully connected layer; The input of the decoder contains half of the alarms in the input sequence of the alarm prediction model, and the feature information of half of the alarms is extracted through the sparse attention layer to obtain the attention distribution matrix Ω d1 ; S36: Through the full attention layer, fuse the encoder output Ω e and the output Ω of the sparse attention layer in the decoder d1 , to obtain the attention distribution matrix Ω of the predicted target sequence d ; S37: Process the attention distribution matrix Ω of the predicted target sequence through a fully connected layer d , and obtain the predicted alarm probability distribution matrix D; Among them represents the attention distribution vector of the (c + N)-th alarm T alarm; S38: Determine the alarm indicated by the position with the highest probability in the predicted alarm probability distribution vector d as the prediction result, and determine the final prediction result S39: Calculate the loss value between the final prediction result and the actual target sequence through a loss function; adjust the parameters of the alarm prediction model through the loss value until the loss value is less than a preset threshold, and end the training.
7. An electronic device, characterized in that, It includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions. The user interface and the network interface are used to communicate with other devices. The processor is used to execute the instructions stored in the memory to enable the electronic device to execute the method according to any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions. When the instructions are executed by a computer, the method according to any one of claims 1-6 is executed.