Template perception multi-task learning based intelligent control system alarm method and system
By cleaning and standardizing the historical alarm logs of the centralized control system, and combining the BERT model and multi-task loss value optimization, a target alarm model is constructed, which solves the problems of accuracy and efficiency in alarm information processing in the centralized control system, and achieves efficient fault diagnosis and alarm classification.
Patent Information
- Application Number
- CN202610201305.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-11
- Publication Date
- 2026-07-03
AI Technical Summary
Existing methods for processing alarm information in centralized control systems suffer from limited ability to extract key fault features and lack of intelligent learning capabilities when dealing with complex and disordered alarm texts. This results in low processing efficiency and a high risk of misjudgment and missed judgment.
By cleaning and standardizing historical alarm logs, deep semantic encoding is performed using a pre-built BERT model. The model is then optimized by gradient descent of parameters using template classification loss, slot sequence loss, and consistency loss. This process constructs a target alarm model, enabling intelligent alarm classification and fault diagnosis.
It improves the accuracy and efficiency of alarm information processing, can accurately extract important features from complex alarm logs, improves the accuracy and response speed of fault early warning, and adapts to complex scenarios with a wide variety of faults.
Smart Images

Figure CN122333140A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automation and intelligent operation and maintenance technology of centralized control systems, specifically to an intelligent centralized control system alarm method and system based on template-aware multi-task learning. Background Technology
[0002] With the gradual popularization of intelligent power systems, the importance of centralized control systems in modern power grids is becoming increasingly prominent. Centralized control systems are mainly used to monitor the operating status of power equipment in real time, promptly detect potential faults, and provide anomaly alerts to operation and maintenance personnel through alarm information. Most of these alarm messages are text-based, unstructured data with inconsistent formats and varying expressions, and lack effective standardization, resulting in low efficiency and a high risk of misjudgment and missed detections during manual processing.
[0003] Existing methods for processing alarm information in centralized control systems are primarily based on rule or experience template matching. These methods have limited ability to extract key fault features from alarm information and cannot handle complex scenarios arising from the wide variety of faults. Furthermore, existing methods lack intelligent learning capabilities, resulting in relatively fixed processing procedures that are difficult to adapt to changes in power equipment and the environment. With the continuous increase in power system equipment, traditional methods can no longer meet the demand for efficient and accurate processing of massive amounts of alarm information.
[0004] To address this issue, existing technologies have begun to incorporate Natural Language Processing (NLP) techniques to automatically extract fault features from alarm information. However, current NLP technologies still have many limitations when processing complex and disordered alarm texts in centralized control systems, particularly in areas such as how to effectively integrate template knowledge, how to handle template drift, and how to improve the robustness of the model; no effective solutions have yet been proposed.
[0005] For example, in the prior art, CN111259947 A discloses a power system fault early warning method and system based on multimodal learning. This method analyzes typical data features associated with abnormal operation fault records in the power information system's database and network to achieve real-time fault prediction and early warning. However, these typical data are mostly unstructured textual data with inconsistent formats and varying expressions, lacking effective standardization, resulting in low efficiency and a high risk of misjudgment and missed judgments during manual processing. CN114238577 A discloses a multi-task learning sentiment classification method that integrates a multi-head attention mechanism. This method uses a multi-head attention mechanism suitable for important feature extraction and multi-task learning to improve classification generalization performance. However, it only uses the multi-head attention mechanism to extract text semantics without effectively integrating template knowledge of the text, leading to poor model robustness.
[0006] Therefore, how to efficiently extract the core fault characteristics from the massive alarm information in the centralized control system, and then realize intelligent alarm classification and fault diagnosis to improve the accuracy and efficiency of alarm information processing, has become an urgent problem to be solved. Summary of the Invention
[0007] The technical problem to be solved by this invention is how to improve the accuracy and efficiency of alarm information processing in a centralized control system.
[0008] The present invention solves the above-mentioned technical problems through the following technical means:
[0009] Obtain historical alarm logs from the centralized control system, perform data cleaning and standardization on the historical alarm logs, and obtain standard alarm logs. The standard alarm log is matched with a preset alarm text template library to obtain a matching template. The standard alarm log is then dynamically masked according to the matching template to obtain the masked text. Based on the masked text, a training triplet corresponding to the historical alarm log is constructed. The training triplet is then subjected to deep semantic encoding using a pre-built BERT model to obtain deep semantic features. Calculate the template classification loss value, slot sequence loss value, and consistency loss value of the training triple based on the deep semantic features; The BERT model is optimized by gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model. The alarm information corresponding to the text to be alarmed is then calculated using the target alarm model.
[0010] Optionally, the step of performing data cleaning and standardization on the historical alarm logs to obtain standard alarm logs includes: Each alarm log in the historical alarm log is de-denoised to obtain a de-denoised alarm log. The denoised alarm log is segmented into sentences to obtain a log sentence sequence; The log sentence sequence is standardized and mapped using a pre-built standardized mapping table to obtain a standard alarm log.
[0011] Optionally, the step of matching the standard alarm log with a preset alarm text template library to obtain a matching template includes: Calculate the cosine similarity between the standard alarm log and the alarm text templates in the alarm text template library based on each word in the standard alarm log; The cosine similarity is calculated using the following formula:
[0012] in, Represents cosine similarity. This indicates the first alarm in the standard alarm log. One word, Alarm text template library The Middle The first alarm text template in the One slot, Represents the cosine function. This indicates that the cosine function is moving to its maximum value. Based on the cosine similarity, a matching template corresponding to the standard alarm log is selected from the alarm text template library.
[0013] Optionally, the step of dynamically masking the standard alarm log according to the matching template to obtain the masked text includes: The slot semantic category of each word in the standard alarm log is determined based on the matching template; The dynamic mask distribution function of the standard log text is calculated based on the slot semantic category using a preset mask distribution function; The dynamic mask distribution function of the standard log text is calculated using the following formula:
[0014] in, This indicates the first alarm in the standard alarm log. The mask weight of each word, , , They represent the preset first The mask weight coefficients for each training time step. Indicates equipment slot category, Words indicating variable classes, Time-related words; The standard log text is masked according to the dynamic masking distribution function to obtain the masked text.
[0015] Optionally, the step of using a pre-built BERT model to perform deep semantic encoding on the training triples to obtain deep semantic features includes: The template embedding sequence in the training triples is embedded into the alarm text sequence using a pre-built BERT model to obtain the template embedding representation; Perform multi-layer self-attention computation on the template embedding representation to obtain self-attention features; The self-attention features are processed by a feedforward neural network to obtain deep semantic features.
[0016] Optionally, calculating the template classification loss value, slot sequence loss value, and consistency loss value of the training triples based on the deep semantic features includes: Extract the target feature vector from the deep semantic features, calculate the template distribution probability of the target feature vector, and calculate the template classification loss value of the training triple based on the distribution probability; The hidden state of the standard alarm log is extracted using a bidirectional long short-term memory neural network, and the hidden state is slot-decoded using a conditional random field to obtain a predicted slot label sequence. Calculate the slot sequence loss value of the training triplet based on the predicted slot sequence label; Calculate the consistency probability between the standard alarm log and the historical alarm log based on the target feature vector; The consistency loss value of the training triples is calculated based on the consistency probability.
[0017] Optionally, the step of optimizing the BERT model using gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model includes: Calculate the standard deviations of the template classification loss value, the slot sequence loss value, and the consistency loss value, respectively. The loss weight is calculated based on the loss standard deviation. The template classification loss value, the slot sequence loss value, and the consistency loss value are then weighted and fused according to the loss weight to obtain the fused loss value. Calculate the loss weights using the following formula:
[0018] in, Indicates the loss weight. Indicates the standard deviation of loss; Calculate the gradient vector of the BERT model based on the fusion loss value; The model parameters of the BERT model are updated based on the gradient vector to obtain the target alarm model.
[0019] Optionally, updating the model parameters of the BERT model based on the gradient vector to obtain the target alarm model includes: The model parameters of the BERT model are updated using the following formula:
[0020]
[0021] in, Indicates the first The training parameters are updated after each training time step. Indicates the first The learning rate per training time step. Indicates the first Model parameters for each training time step. Indicates the first A preset moving average term for each training time step. Indicates the first The gradient vector at each training time step. This represents the preset smoothing coefficient. Indicates the first Model parameters for each training time step. This represents the preset initial learning rate. This represents the preset attenuation intensity coefficient. Indicates the first Model parameters at each training time step The gradient of the loss function.
[0022] Optionally, when optimizing the BERT model using gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model, the method further includes: Multi-layer semantic projection is performed on the deep semantic features to obtain double-layer projection features, and the final semantic features corresponding to each historical alarm log are constructed based on the projection features. The deep semantic features are subjected to multi-layer semantic projection using the following formula:
[0023] in, Represents the target feature vector in deep semantic features Projected features after performing multi-layer semantic projection This represents the preset first feature weight. This indicates the first preset bias term. This represents the average pooling vector corresponding to deep semantic features. Projected features after performing multi-layer semantic projection This represents the preset weight of the second feature. This indicates the preset second bias term; Construct positive and negative sample pairs corresponding to the final semantic features using a pre-built alarm template knowledge graph; Calculate the cosine similarity between the positive and negative sample pairs and the historical alarm log times, and calculate the contrast loss function value based on the cosine similarity; Based on the comparison loss function value, the BERT model is optimized by gradient descent to obtain the target alarm model.
[0024] To address the aforementioned problems, this invention also proposes an intelligent centralized control system alarm system based on template-aware multi-task learning, the system comprising: The data processing module is used to acquire historical alarm logs from the centralized control system, perform data cleaning and standardization on the historical alarm logs, and obtain standard alarm logs. The dynamic masking module is used to match the standard alarm log with a preset alarm text template library to obtain a matching template, and to dynamically mask the standard alarm log according to the matching template to obtain masked text. The deep semantic encoding module is used to construct training triples corresponding to the historical alarm logs based on the masked text, and to perform deep semantic encoding on the training triples using a pre-built BERT model to obtain deep semantic features. The loss calculation module is used to calculate the template classification loss value, slot sequence loss value, and consistency loss value of the training triples based on the deep semantic features. The alarm information calculation module is used to perform parameter gradient descent optimization on the BERT model based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model, and to calculate the alarm information corresponding to the text to be alarmed using the target alarm model.
[0025] The advantages of this invention are: This invention cleanses and standardizes historical alarm logs to remove invalid noise, eliminate data ambiguity, and improve computational efficiency and accuracy. It then dynamically masks the logs using a standard alarm log matching template, obtaining masked text that can be adjusted based on the error distribution during training for different tasks, focusing on key areas. Deep semantic encoding is performed on the masked text to obtain deep semantic features, enabling accurate extraction of important features from complex alarm logs and improving the accuracy and response speed of fault warnings. Finally, template classification loss, slot sequence loss, and consistency loss are calculated based on the deep semantic features to optimize the BERT model using gradient descent, resulting in a target alarm model. By utilizing the loss values from multiple tasks, this invention can address complex scenarios arising from a wide variety of faults, leading to a more accurate target alarm model and more precise alarm information calculation. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating an alarm method for an intelligent centralized control system based on template-aware multi-task learning in one embodiment of the present invention. Figure 2 This is a comparison diagram of the event consistency determination test in one embodiment of the present invention; Figure 3This is a functional module diagram of an intelligent centralized control system alarm system based on template-aware multi-task learning provided in one embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] Reference Figure 1 The diagram shown is a flowchart illustrating an intelligent centralized control system alarm method based on template-aware multi-task learning according to an embodiment of the present invention. In this embodiment, the intelligent centralized control system alarm method based on template-aware multi-task learning includes: S1. Obtain historical alarm logs from the centralized control system, perform data cleaning and standardization on the historical alarm logs to obtain standard alarm logs.
[0029] In this embodiment of the invention, the historical alarm log is the alarm text generated in the intelligent power system within a historical time period, such as the alarm log of the power system within a set time period of the past 6 months, 1 year, or 2 years.
[0030] Furthermore, data cleaning and standardization removes text noise from each alarm log and standardizes important elements such as device names, protection actions, measurements, setting numbers, and times that may exist in the alarm log.
[0031] Specifically, the process of cleaning and standardizing the historical alarm logs to obtain standard alarm logs includes: Each alarm log in the historical alarm log is de-denoised to obtain a de-denoised alarm log. The denoised alarm log is segmented into sentences to obtain a log sentence sequence; The log sentence sequence is standardized and mapped using a pre-built standardized mapping table to obtain a standard alarm log.
[0032] In this embodiment of the invention, text denoising for each alarm log in the historical alarm log involves removing irrelevant punctuation marks, correcting typos, and deleting unstructured content. For example, irrelevant punctuation marks or special characters in the alarm log are filtered out using regular expressions; then, typos are detected, identified, and replaced using a language model to obtain the denoised alarm log.
[0033] Furthermore, sentence segmentation involves dividing a complete denoised alarm log, which may contain multiple fault descriptions and status descriptions, into multiple independent and complete semantic short sentences, resulting in a log sentence sequence.
[0034] In detail, the expression format of each log sentence in the log sentence sequence is standardized. For example, each log sentence may contain important elements such as device name, protection action, measurement quantity, setting number, and time. These elements may appear in different ways in the log, so it is necessary to standardize their expression format to ensure consistency in subsequent processing.
[0035] Specifically, the standardized mapping table can be represented as:
[0036] in, Represents a standardized mapping table. This indicates the first sentence in the log sentence sequence. One word, Indicates the first words Standardized mapped words, A set of words representing a sequence of log sentences. This represents the standardized vocabulary used for standardized mapping.
[0037] In this embodiment of the invention, by cleaning and standardizing historical alarm logs, the data format of alarm logs can be unified, invalid noise in alarm logs can be removed, data ambiguity can be eliminated, and calculation efficiency and accuracy can be improved.
[0038] S2. Match the standard alarm log with a preset alarm text template library to obtain a matching template. Dynamically mask the standard alarm log according to the matching template to obtain masked text.
[0039] In this embodiment of the invention, the alarm text template library is a template knowledge base constructed based on historical alarm samples and commonly used expressions summarized manually. Template Knowledge Base Each template in Each slot This corresponds to an entity type in alarm semantics, including Device, Location, Action, Value, and Time slots.
[0040] Specifically, the step of matching the standard alarm log with a preset alarm text template library to obtain a matching template includes: Calculate the cosine similarity between the standard alarm log and the alarm text templates in the alarm text template library based on each word in the standard alarm log; Based on the cosine similarity, a matching template corresponding to the standard alarm log is selected from the alarm text template library.
[0041] Specifically, the cosine similarity is calculated using the following formula:
[0042] in, Represents cosine similarity. This indicates the first alarm in the standard alarm log. One word, Alarm text template library The Middle The first alarm text template in the One slot, Represents the cosine function. This indicates that the cosine function is moving to its maximum value.
[0043] In this embodiment of the invention, the maximum value between each word and each slot can be calculated according to the above method for calculating cosine similarity, and the slot that the word matches in the alarm text template can be obtained. The matching slots of each word in the standard alarm log can be calculated in turn, and the average value of the cosine similarity between all words in the standard alarm log can be calculated. Based on the average value, the matching template corresponding to the standard alarm log can be selected from the alarm text template library.
[0044] Specifically, the step of dynamically masking the standard alarm log according to the matching template to obtain the mask text includes: The slot semantic category of each word in the standard alarm log is determined based on the matching template; The dynamic mask distribution function of the standard log text is calculated based on the slot semantic category using a preset mask distribution function; The standard log text is masked according to the dynamic masking distribution function to obtain the masked text.
[0045] In this embodiment of the invention, the slot corresponding to each word is determined based on the cosine similarity between each word in the standard log text and each slot in the matching template when calculating the matching template. This cosine similarity defines the corresponding slot semantic category. For example, the slot semantic category corresponding to the "device" slot word is "device" slot category, the slot semantic category corresponding to the "variable" slot word is "variable" slot category, the slot semantic category corresponding to the "time" slot word is "time" slot category, and the slot semantic category corresponding to other words in the standard log text is "other background word categories."
[0046] Furthermore, the dynamic mask distribution function of the standard log text is calculated using the following formula:
[0047] in, This indicates the first alarm in the standard alarm log. The mask weight of each word, , , They represent the preset first The mask weight coefficients for each training time step. Indicates equipment slot category, Words indicating variable classes, Time-related words.
[0048] In this embodiment of the invention, the standard log text is masked and then input into different multi-task BERT models. The structure and key information of the alarm information are extracted by the multi-task BERT models to obtain deep semantic features.
[0049] Furthermore, for any input sequence corresponding to a standard log text, The masking mechanism applies a learnable masking operation to each word, and the calculation formula is as follows:
[0050] in, Indicates the first Words in each training phase Masked words, Indicates the mask weight, Indicates masking operation. This indicates an element-wise multiplication operation.
[0051] This mechanism ensures that the contextual information of the masked word can be re-predicted or reconstructed by the model, enabling it to learn the implicit dependency between the word and the template in the semantic space. The masking rate is not statically set but automatically optimized. It can be optimized using the following adaptive weight update formula:
[0052] in, , This represents the mask learning rate. This represents the partial derivative gradient of the preset mask loss function with respect to the weights. The model can autonomously adjust the mask focus area according to the error distribution of different tasks during training.
[0053] S3. Construct training triples corresponding to the historical alarm logs based on the masked text, and use the pre-built BERT model to perform deep semantic encoding on the training triples to obtain deep semantic features.
[0054] In this embodiment of the invention, the embedding layer in the pre-built BERT model is used to extract the embedding features of the masked text and the matching template corresponding to each historical alarm log, so as to obtain the alarm text sequence, the template embedding sequence and the multi-task label set corresponding to subsequent training. The alarm text sequence, the template embedding sequence and the multi-task label set of the historical alarm text corresponding to subsequent training are combined into a triplet to obtain the training triplet for subsequent training.
[0055] Specifically, taking template matching as an example, the following formula can be used for embedding feature extraction:
[0056] in, This indicates a template embedding sequence. This represents the vector representation of the slot in the matching template. This represents an embedding function that converts slots into vectors. This indicates the operation of concatenating multiple slot vectors.
[0057] The vector representation of each slot in the matching template can be generated by weighting the pre-trained embedding layer (BERT sub-embedding layer).
[0058] Furthermore, the deep semantic encoding of the training triples using the pre-built BERT model to obtain deep semantic features includes: The template embedding sequence in the training triples is embedded into the alarm text sequence using a pre-built BERT model to obtain the template embedding representation; Perform multi-layer self-attention computation on the template embedding representation to obtain self-attention features; The self-attention features are processed by a feedforward neural network to obtain deep semantic features.
[0059] In this embodiment of the invention, the purpose of template embedding is to introduce template knowledge into the input of the BERT model, helping the model to identify the structure and key information of the alarm information. Furthermore, template embedding is injected into the text representation through a cross-attention mechanism to enhance the model's understanding of the alarm information structure.
[0060] Specifically, the template embedding sequence in the training triples can be embedded into the alarm text sequence using the following formula to obtain the template embedding representation:
[0061] in, This indicates template embedding. This indicates an alarm text sequence. This represents the Sigmoid activation function. This indicates the preset embedding weights. This indicates a multi-head attention module. This indicates a template embedding sequence.
[0062] Furthermore, the BERT backbone encoding layer uses vectors that have undergone template-aware enhancement. As input, a standard Transformer structure is used for deep semantic encoding. The output of each layer is calculated through a self-attention mechanism and a feedforward network. Through multiple layers of self-attention mechanism and feedforward neural network, deep semantic features are obtained.
[0063] Specifically, the self-attention calculation and feedforward neural network calculation are as follows:
[0064]
[0065] in, Indicates the first Self-attention features of layers This indicates a normalization operation. This indicates the first generation of the feedforward neural network. The output of the layer, This indicates a multi-head self-attention mechanism. This indicates the first generation of the feedforward neural network. The output of the layer, This represents a feedforward neural network.
[0066] In this embodiment of the invention, through multi-layer self-attention and feedforward neural network calculation, slot information in the template can be embedded into text information, which is beneficial for subsequent identification of key information in deep semantic features and improves the accuracy of subsequent target alarm model construction.
[0067] S4. Calculate the template classification loss value, slot sequence loss value, and consistency loss value of the training triples based on the deep semantic features.
[0068] In this embodiment of the invention, the template classification loss value is calculated as the loss between the predicted alarm text template obtained from deep semantic encoding prediction and the matching template; the slot sequence loss value is obtained by combining BiLSTM (Bidirectional Long Short-Term Memory) and CRF (Conditional Random Field) methods, firstly extracting the slot label of each word from the text sequence of the standard alarm log. The hidden state at each time step is modeled using BiLSTM. Next, the CRF layer is used to decode the slots to obtain the optimal slot label sequence, and the loss function between the slot label sequence and the matching template slot semantic category is calculated; the consistency loss value is calculated using deep semantic features to determine the event consistency loss between each standard alarm log and the historical alarm log.
[0069] Specifically, the step of calculating the template classification loss value, slot sequence loss value, and consistency loss value of the training triples based on the deep semantic features includes: Extract the target feature vector from the deep semantic features, calculate the template distribution probability of the target feature vector, and calculate the template classification loss value of the training triple based on the distribution probability; The hidden state of the standard alarm log is extracted using a bidirectional long short-term memory neural network, and the hidden state is slot-decoded using a conditional random field to obtain a predicted slot label sequence. Calculate the slot sequence loss value of the training triplet based on the predicted slot sequence label; Calculate the consistency probability between the standard alarm log and the historical alarm log based on the target feature vector; The consistency loss value of the training triples is calculated based on the consistency probability.
[0070] In this embodiment of the invention, multi-task classification of historical alarm logs is achieved based on the template classification loss value, slot sequence loss value, and consistency loss value between each standard alarm log and other historical alarm logs. The training triplet includes the training corresponding multi-task label set, namely, the real label corresponding to the template matching of the standard alarm log when calculating the template classification loss value, the real slot label corresponding to the slot in the template matching of the standard alarm log when calculating the slot sequence loss value, the target feature vector corresponding to each historical alarm log, and the real consistency label (0 or 1, 0 indicates inconsistency, 1 indicates consistency) between historical alarm logs, etc., which are used to calculate the multi-task loss function.
[0071] In detail, the target feature vector extracted from deep semantic features is the [CLS] vector in the deep semantic features, which is the 0th row of the feature matrix corresponding to the deep semantic features. For example, after the BERT model, the final hidden state matrix H = [h_0,h_1, …, h_{L-1}] is obtained, which is the deep semantic features. Each row corresponds to the final representation of a token. Then the 0th token is always the [CLS] vector, that is, h_0 in the hidden state matrix H is used as the target feature vector.
[0072] Specifically, the template probability distribution is calculated using the following formula:
[0073] in, This represents the probability distribution of the template. express Activation function This represents the preset classification weight matrix. Represents the target feature vector. This indicates the preset bias term.
[0074] Furthermore, the template classification loss value is calculated using the cross-entropy loss function, as shown below:
[0075] in, This represents the template classification loss value. Indicates the first The true labels of a standard alarm log in the training triplet. Indicates the first The template distribution probability corresponding to the target feature vector of a standard alarm log.
[0076] In detail, the slot sequence loss value is calculated using the following formula:
[0077] in, This represents the slot sequence loss value. Indicates the first Each training session is a step in time. Indicates the first Conditional random field emission scores corresponding to the actual slot labels at each training time step. Indicates the first At each training time step, predict the conditional random field emission score corresponding to the slot label sequence. This represents an exponential function.
[0078] In this embodiment of the invention, the consistency probability between the standard alarm log and the historical alarm log is calculated using the following formula:
[0079] in, Indicates the first The first standard alarm log and the first The probability of consistency between historical alarm logs. Indicates true consistency labels, This represents the activation function. This represents the preset classification weight matrix. Indicates the first A standard alarm log target feature vector Indicates the first A standard alarm log target feature vector This indicates element-wise multiplication. This indicates a pre-defined consistency bias.
[0080] Furthermore, the consistency loss value can be calculated using the binary cross-entropy loss and used to train the consistency judgment task. The calculation formula is shown below:
[0081] in, This represents the consistency loss value. Indicates true consistency labels, Indicates the first The first standard alarm log and the first The probability of consistency between historical alarm logs.
[0082] In this embodiment of the invention, when calculating the template classification loss value, slot sequence loss value, and consistency loss value, each historical alarm log can be cleaned and standardized to obtain a standard alarm log. Then, the loss value between each standard alarm log and other historical alarm logs can be calculated. This invention, through multi-task loss values, can address complex scenarios arising from a wide variety of fault types and improve the accuracy of alarm information construction.
[0083] S5. Optimize the BERT model by performing parameter gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model. Calculate the alarm information corresponding to the text to be alarmed using the target alarm model.
[0084] In this embodiment of the invention, the parameter gradient descent optimization is to optimize the learnable parameters in the BERT model based on the template classification loss value, the slot sequence loss value, and the consistency loss value until the loss value meets the preset requirements.
[0085] Specifically, the step of optimizing the BERT model using gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model includes: Calculate the standard deviations of the template classification loss value, the slot sequence loss value, and the consistency loss value, respectively. The loss weight is calculated based on the loss standard deviation. The template classification loss value, the slot sequence loss value, and the consistency loss value are then weighted and fused according to the loss weight to obtain the fused loss value. Calculate the gradient vector of the BERT model based on the fusion loss value; The model parameters of the BERT model are updated based on the gradient vector to obtain the target alarm model.
[0086] Specifically, based on the template classification loss value, slot sequence loss value, and consistency loss value corresponding to each standard alarm log, the standard deviation of the loss value can be calculated respectively. This allows for the analysis of the fluctuation of the loss value when multiple evaluations are performed on the same task, ensuring the coordination of gradient directions among multiple tasks.
[0087] In detail, the loss weights are calculated using the following formula:
[0088] in, Indicates the loss weight. This represents the standard deviation of the loss.
[0089] Furthermore, by taking the partial derivative of the loss value with respect to the BERT model, the gradient vector of the parameters is calculated for each update, and the model parameters are updated by gradient descent based on the gradient vector.
[0090] Specifically, the model parameters of the BERT model are updated using the following formula:
[0091]
[0092] in, Indicates the first The training parameters are updated after each training time step. Indicates the first The learning rate per training time step. Indicates the first Model parameters for each training time step. Indicates the first A preset moving average term for each training time step. Indicates the first The gradient vector at each training time step. This represents the preset smoothing coefficient. Indicates the first Model parameters for each training time step. This represents the preset initial learning rate. This represents the preset attenuation intensity coefficient. Indicates the first Model parameters at each training time step The gradient of the loss function.
[0093] In this embodiment of the invention, updating the model parameters using the above formula can make the learning rate negatively correlated with the gradient strength. When the model is in the loss descent phase and the gradient is large, the learning rate shrinks exponentially to prevent it from going out of bounds. When the model is approaching the optimal solution, the gradient approaches zero, and the learning rate gradually increases to explore the smooth region, thereby improving the accuracy of the model parameter update.
[0094] Preferably, when optimizing the BERT model using gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model, the present invention further includes a template graph comparison learning method, specifically comprising: Multi-layer semantic projection is performed on the deep semantic features to obtain double-layer projection features, and the final semantic features corresponding to each historical alarm log are constructed based on the projection features. Construct positive and negative sample pairs corresponding to the final semantic features using a pre-built alarm template knowledge graph; Calculate the cosine similarity between the positive and negative sample pairs and the historical alarm log times, and calculate the contrast loss function value based on the cosine similarity; Based on the comparison loss function value, the BERT model is optimized by gradient descent to obtain the target alarm model.
[0095] In detail, the target feature vector ([CLS] vector) and the average pooling vector are extracted from the deep semantic features output by the BERT model. Multi-layer semantic projection is performed to obtain the target feature vector and the corresponding double-layer projected features of the average pooling features. The average pooling vector... This refers to the average of all non-pad vectors (non-supplementary tokens) in the deep semantic features.
[0096] Specifically, the deep semantic features are subjected to multi-layer semantic projection using the following formula:
[0097] in, Represents the target feature vector in deep semantic features Projected features after performing multi-layer semantic projection This represents the preset first feature weight. This indicates the first preset bias term. This represents the average pooling vector corresponding to deep semantic features. Projected features after performing multi-layer semantic projection This represents the preset weight of the second feature. This indicates the preset second bias term.
[0098] In this embodiment of the invention, the target feature vector is collected. and average pooling vector The corresponding projection features, the double-layer projection features, are weighted and summed to construct the final semantic features of each historical alarm log.
[0099] Specifically, the final semantic features corresponding to each of the historical alarm logs are constructed using the following formula:
[0100] in, Indicates the final semantic features, This indicates the preset adjustable fusion coefficient. Represents the target feature vector in deep semantic features Projected features after performing multi-layer semantic projection This represents the average pooling vector corresponding to deep semantic features. Projected features after performing multi-level semantic projection.
[0101] In this embodiment of the invention, an alarm template knowledge graph is first constructed, denoted as G=(V,E), where the node set V represents the template and its slot semantic units, and the edge set E represents the semantic relevance or inheritance relationship between templates. Furthermore, the node embeddings in the alarm template knowledge graph not only include textual features but also integrate slot-level statistical features and contextual association information. Specifically, the node embedding features in the alarm template knowledge graph can be calculated in the following way:
[0102] in, This represents a node in the alarm template knowledge graph. Node embedding features, This represents a node in the alarm template knowledge graph. The neighborhood group, Indicates the first One neighboring node, , Representing nodes respectively with neighboring nodes slot vector, Represents nodes calculated based on template similarity. with neighboring nodes The edge weight coefficients between them.
[0103] Furthermore, positive and negative sample pairs are constructed based on the adjacency relationships of the template nodes corresponding to each historical alarm log in the alarm template knowledge graph. Specifically, for samples belonging to the same template or adjacent templates, their final semantic features are defined as positive samples. For template samples with a large semantic distance, their final semantic features are defined as negative samples. By minimizing the distance between positive samples and maximizing the distance between negative samples, the model forms a template-separable feature distribution in a high-dimensional semantic space. Specifically, feature distances can be calculated based on node embedding features or final semantic features, and nodes with feature distances greater than a preset distance threshold are designated as negative samples.
[0104] Specifically, the contrastive loss function value is calculated using the following formula:
[0105] in, This represents the comparison loss function value. This represents the final semantic features corresponding to historical alarm logs. This indicates the first historical alarm log. One positive sample, This indicates the first historical alarm log. One negative sample, This indicates the cosine similarity calculation operation. This indicates the preset temperature parameter.
[0106] In this embodiment of the invention, the weights of the contrastive loss function values can be calculated using the method described above for calculating the standard deviation of the loss. Then, the contrastive loss values can be weighted and fused with the template classification loss values, slot sequence loss values, and consistency loss values to obtain the final fused loss value. This allows the contrastive loss values to participate in the optimization of model parameters, enabling the model to be driven during training to group alarm expressions with the same template or similar semantics together, while separating the expressions of different templates in the vector space, thereby obtaining stronger template discriminative power.
[0107] Preferably, steps S1 to S4 can be executed on the edge node to perform parameter gradient descent optimization on the BERT model in the cloud, thereby obtaining the target alarm model. The model parameters in the target alarm model are denoted as... During continuous operation in the cloud, template distribution detection and anomaly analysis are performed on aggregated event streams from multiple edge nodes. This is achieved by calculating the Kullback-Leibler divergence between the probability distributions of the old and new templates. .
[0108] like Preset divergence threshold This will automatically trigger template updates and model retraining tasks. New template vector embeddings... The embedding space is expanded through the template graph comparison learning module. Through continuous comparison learning training, the semantic space of the model is continuously reconstructed, which can identify the template relationship of new or variant alarm expressions.
[0109] Edge nodes periodically report local aggregated event summaries and model prediction bias indicators, and the cloud generates model correction amounts based on the bias trends. Updates are distributed via differential methods:
[0110] in This represents the latest parameter state of the edge model. During the runtime, the system executes a self-optimization process. Edge nodes collect feedback information through dynamic masks, the cloud adjusts global weights through rapid gradient optimization, and the template comparison learning module continuously expands the alarm semantic space.
[0111] In this embodiment of the invention, through the edge-cloud collaborative design, edge nodes can perform rapid local inference based on the optimized model trained in the cloud, and updates are only performed when the model parameters change significantly, greatly reducing communication load and computational overhead. This efficient resource utilization method and real-time feedback mechanism significantly improve the system's processing power and operational stability.
[0112] In detail, upon receiving the text to be alarmed, it first undergoes standardization, word segmentation, slot identification, and dynamic masking to generate a standardized input sequence. The target alarm model then performs deep semantic encoding on this standardized input sequence to obtain alarm semantic features. Based on these features, five-segment fields are extracted and standardized from the text to be alarmed according to a preset standard (e.g., Q / GDW11021-2013): level, time, device full path, behavior, and reason, resulting in a structured result vector. The edge layer uses a sliding window mechanism to aggregate the structured result vectors of continuously input alarm texts based on similarity. It classifies continuously input alarm texts with a cosine similarity greater than a preset threshold as belonging to the same event and generates aggregated event clusters. Each event cluster is accompanied by key semantic labels and confidence indicators to generate alarm information for rapid early warning or control logic triggering at the edge.
[0113] For example, real alarm log data from a provincial power grid control center was used as the test subject, including various types of data such as substation operation alarms, protection actions, and communication alarms, covering the entire lifecycle of the power monitoring system. The experimental platform adopted an "edge-cloud collaborative" architecture, with edge nodes configured with Intel Xeon Silver processors and 16GB of memory, and high-performance GPU servers deployed in the cloud; the communication link was a hybrid network of industrial Ethernet and 5G. The experimental scenarios covered normal operation, single alarm events, and complex multi-source alarms (such as cascading trips and communication packet loss causing false operations), with 1000 samples for each type, of which 70% were used for training and 30% for testing.
[0114] 1. Structured Extraction Accuracy Test: The accuracy of structured alarm field extraction was compared between the method of this invention and traditional rule matching methods and single-task BERT models. The results are shown in Table 1.
[0115] Table 1
[0116] As shown in Table 1, the method of this invention is significantly superior to the comparison method in all fields. In particular, in complex text scenarios, the template-aware multi-task BERT model combined with the dynamic masking mechanism significantly improves the extraction accuracy of the time and device fields.
[0117] 2. Event Consistency Judgment Test The consistency values of different methods in judging event aggregation tasks are statistically analyzed, and the results are as follows: Figure 2 As shown in the figure, the horizontal axis represents different sample sizes, and the vertical axis represents the accuracy of the event consistency value determination between the method of this invention and the traditional keyword aggregation method and rule template matching method.
[0118] from Figure 2 As can be seen, the event consistency value of the method of this invention reaches 92.4%, which is about 10 percentage points higher than the traditional keyword aggregation method. The key to the performance improvement lies in the fact that this invention establishes structural similarity relationships between template nodes in the semantic space by constructing a template knowledge graph. This enables the model to minimize the distance between semantically similar templates and maximize the distance between different templates during the training phase, thereby forming a separable cluster distribution in the high-dimensional semantic space.
[0119] 3. Training and inference latency test: The average latency of the method of this invention and the traditional BERT model during the training and inference phases are compared. The results are shown in Table 2.
[0120] Table 2
[0121] As shown in Table 2, the model of this invention reduces the average inference latency by approximately 31.9% while maintaining accuracy. This performance improvement is attributed to the dynamic masking mechanism's focus on structural slots (such as device and time) in the early stages of training, its gradual enhancement of learning variables and free text in the middle stages, and its reinforcement of event logic and causal relationships through temporal masking in the later stages. This adaptive masking distribution allows the model to focus on different information levels at different stages, thereby significantly improving gradient utilization and learning efficiency.
[0122] like Figure 3 The diagram shown is a functional block diagram of an intelligent centralized control system alarm system based on template-aware multi-task learning provided in an embodiment of the present invention.
[0123] The template-aware multi-task learning-based intelligent centralized control system alarm system 100 of this invention can be installed in a processing device. Depending on the functions implemented, the template-aware multi-task learning-based intelligent centralized control system alarm system 100 may include a data processing module 101, a dynamic masking module 102, a deep semantic encoding module 103, a loss value calculation module 104, and an alarm information calculation module 105. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, stored in the memory of the electronic device.
[0124] In this embodiment, the functions of each module / unit are as follows: The data processing module 101 is used to acquire historical alarm logs in the centralized control system, perform data cleaning and standardization on the historical alarm logs, and obtain standard alarm logs. The dynamic masking module 102 is used to match the standard alarm log with a preset alarm text template library to obtain a matching template, and to dynamically mask the standard alarm log according to the matching template to obtain masked text. The deep semantic encoding module 103 is used to construct training triples corresponding to the historical alarm logs based on the masked text, and to perform deep semantic encoding on the training triples using a pre-built BERT model to obtain deep semantic features. The loss calculation module 104 is used to calculate the template classification loss value, slot sequence loss value and consistency loss value of the training triples based on the deep semantic features. The alarm information calculation module 105 is used to perform parameter gradient descent optimization on the BERT model based on the template classification loss value, the slot sequence loss value and the consistency loss value to obtain the target alarm model, and use the target alarm model to calculate the alarm information corresponding to the text to be alarmed.
[0125] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0126] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0127] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent control system alarm method based on template perception multi-task learning, characterized in that, include: Obtain historical alarm logs from the centralized control system, perform data cleaning and standardization on the historical alarm logs, and obtain standard alarm logs. The standard alarm log is matched with a preset alarm text template library to obtain a matching template. The standard alarm log is then dynamically masked according to the matching template to obtain the masked text. Based on the masked text, a training triplet corresponding to the historical alarm log is constructed. The training triplet is then subjected to deep semantic encoding using a pre-built BERT model to obtain deep semantic features. Calculate the template classification loss value, slot sequence loss value, and consistency loss value of the training triple based on the deep semantic features; The BERT model is optimized by gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model. The alarm information corresponding to the text to be alarmed is then calculated using the target alarm model.
2. The template-aware multi-task learning based intelligent control system alarm method of claim 1, wherein, The historical alarm logs are cleaned and standardized to obtain standard alarm logs, including: Each alarm log in the historical alarm log is de-denoised to obtain a de-denoised alarm log. The denoised alarm log is segmented into sentences to obtain a log sentence sequence; The log sentence sequence is standardized and mapped using a pre-built standardized mapping table to obtain a standard alarm log.
3. The template-aware multi-task learning based intelligent control system alarm method of claim 1, wherein, The step of matching the standard alarm log with a preset alarm text template library to obtain a matching template includes: Calculate the cosine similarity between the standard alarm log and the alarm text templates in the alarm text template library based on each word in the standard alarm log; The cosine similarity is calculated using the following formula: wherein, denotes a cosine similarity, denotes the i-th word in the standard alarm log, denotes the i-th word in the standard alarm log, denotes the i-th alarm text template in the alarm text template library, denotes the i-th slot in the alarm text template, denotes the i-th slot in the alarm text template, denotes a cosine function, denotes a cosine function, denotes a cosine function without maximum value. Based on the cosine similarity, a matching template corresponding to the standard alarm log is selected from the alarm text template library.
4. The alarm method for an intelligent centralized control system based on template-aware multi-task learning as described in claim 1, characterized in that, The step of dynamically masking the standard alarm log according to the matching template to obtain the mask text includes: The slot semantic category of each word in the standard alarm log is determined based on the matching template; The dynamic mask distribution function of the standard log text is calculated based on the slot semantic category using a preset mask distribution function; The dynamic mask distribution function of the standard log text is calculated using the following formula: in, This indicates the first alarm in the standard alarm log. The mask weight of each word, , , They represent the preset first The mask weight coefficients for each training time step. Indicates equipment slot category, Words indicating variable classes, Time-related words; The standard log text is masked according to the dynamic masking distribution function to obtain the masked text.
5. The alarm method for an intelligent centralized control system based on template-aware multi-task learning as described in claim 1, characterized in that, The deep semantic encoding of the training triples using a pre-built BERT model yields deep semantic features, including: The template embedding sequence in the training triples is embedded into the alarm text sequence using a pre-built BERT model to obtain the template embedding representation; Perform multi-layer self-attention computation on the template embedding representation to obtain self-attention features; The self-attention features are processed by a feedforward neural network to obtain deep semantic features.
6. The alarm method for an intelligent centralized control system based on template-aware multi-task learning as described in claim 1, characterized in that, The step of calculating the template classification loss value, slot sequence loss value, and consistency loss value of the training triples based on the deep semantic features includes: Extract the target feature vector from the deep semantic features, calculate the template distribution probability of the target feature vector, and calculate the template classification loss value of the training triple based on the distribution probability; The hidden state of the standard alarm log is extracted using a bidirectional long short-term memory neural network, and the hidden state is slot-decoded using a conditional random field to obtain a predicted slot label sequence. Calculate the slot sequence loss value of the training triplet based on the predicted slot sequence label; Calculate the consistency probability between the standard alarm log and the historical alarm log based on the target feature vector; The consistency loss value of the training triples is calculated based on the consistency probability.
7. The alarm method for an intelligent centralized control system based on template-aware multi-task learning as described in claim 1, characterized in that, The step of optimizing the BERT model using gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model includes: Calculate the standard deviations of the template classification loss value, the slot sequence loss value, and the consistency loss value, respectively. The loss weight is calculated based on the loss standard deviation. The template classification loss value, the slot sequence loss value, and the consistency loss value are then weighted and fused according to the loss weight to obtain the fused loss value. Calculate the loss weights using the following formula: in, Indicates the loss weight. Indicates the standard deviation of loss; Calculate the gradient vector of the BERT model based on the fusion loss value; The model parameters of the BERT model are updated based on the gradient vector to obtain the target alarm model.
8. The alarm method for an intelligent centralized control system based on template-aware multi-task learning as described in claim 7, characterized in that, The step of updating the model parameters of the BERT model based on the gradient vector to obtain the target alarm model includes: The model parameters of the BERT model are updated using the following formula: in, Indicates the first The training parameters are updated after each training time step. Indicates the first The learning rate per training time step. Indicates the first Model parameters for each training time step. Indicates the first A preset moving average term for each training time step. Indicates the first The gradient vector at each training time step. This represents the preset smoothing coefficient. Indicates the first Model parameters for each training time step. This represents the preset initial learning rate. This represents the preset attenuation intensity coefficient. Indicates the first Model parameters at each training time step The gradient of the loss function.
9. The alarm method for an intelligent centralized control system based on template-aware multi-task learning as described in claim 7, characterized in that, When optimizing the BERT model using gradient descent based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model, the method further includes: Multi-layer semantic projection is performed on the deep semantic features to obtain double-layer projection features, and the final semantic features corresponding to each historical alarm log are constructed based on the projection features. The deep semantic features are subjected to multi-layer semantic projection using the following formula: in, Represents the target feature vector in deep semantic features Projected features after performing multi-layer semantic projection This represents the preset first feature weight. This indicates the first preset bias term. This represents the average pooling vector corresponding to deep semantic features. Projected features after performing multi-layer semantic projection This represents the preset weight of the second feature. This indicates the preset second bias term; Construct positive and negative sample pairs corresponding to the final semantic features using a pre-built alarm template knowledge graph; Calculate the cosine similarity between the positive and negative sample pairs and the historical alarm log times, and calculate the contrast loss function value based on the cosine similarity; Based on the comparison loss function value, the BERT model is optimized by gradient descent to obtain the target alarm model.
10. An alarm system for an intelligent centralized control system based on template-aware multi-task learning, characterized in that, include: The data processing module is used to acquire historical alarm logs from the centralized control system, perform data cleaning and standardization on the historical alarm logs, and obtain standard alarm logs. The dynamic masking module is used to match the standard alarm log with a preset alarm text template library to obtain a matching template, and to dynamically mask the standard alarm log according to the matching template to obtain masked text. The deep semantic encoding module is used to construct training triples corresponding to the historical alarm logs based on the masked text, and to perform deep semantic encoding on the training triples using a pre-built BERT model to obtain deep semantic features. The loss calculation module is used to calculate the template classification loss value, slot sequence loss value, and consistency loss value of the training triples based on the deep semantic features. The alarm information calculation module is used to perform parameter gradient descent optimization on the BERT model based on the template classification loss value, the slot sequence loss value, and the consistency loss value to obtain the target alarm model, and to calculate the alarm information corresponding to the text to be alarmed using the target alarm model.
Citation Information
Patent Citations
Multi-task learning sentiment classification method fusing multi-head attention mechanism
CN114238577A
