A safety monitoring method, device, equipment and medium of a control cabinet

By using multi-dimensional time-series monitoring data and a hybrid neural architecture-based abnormal state prediction model, the problem of missed alarms in the single-parameter monitoring mode of the control cabinet was solved, and multi-parameter linkage early warning was realized, thereby improving the accuracy and intelligence level of the control cabinet's safety monitoring.

CN121722647BActive Publication Date: 2026-05-08埃斯凯(上海)电气科技股份有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
埃斯凯(上海)电气科技股份有限公司
Filing Date
2026-02-27
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

The existing safety monitoring method for control cabinets adopts a single-parameter independent monitoring mode, which simplifies the multi-parameter coupled system into the monitoring of multiple independent variables, resulting in missed reports and the inability to identify the critical failure state of the control cabinet in a timely manner.

Method used

We use multi-dimensional temporal monitoring data as input to train an abnormal state prediction model, and train a lightweight model through knowledge distillation and backpropagation algorithms to achieve multi-parameter linkage early warning. We then combine a hybrid neural architecture of temporal convolutional network, long short-term memory network and attention mechanism for in-depth analysis.

Benefits of technology

This has enabled a shift from single-point threshold alarms to global status assessment, reducing the false alarm rate, improving the accuracy and early warning capabilities, and enhancing the level of intelligent security monitoring for control cabinets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121722647B_ABST
    Figure CN121722647B_ABST
Patent Text Reader

Abstract

The application discloses a safety monitoring method, device and equipment of a control cabinet and a medium, relates to the safety monitoring field of the control cabinet, and obtains the abnormal state prediction result of the control cabinet by acquiring the multidimensional time sequence data of the control cabinet at the current moment and inputting the trained lightweight first abnormal state prediction model. Model training adopts a two-stage strategy: first, based on earlier historical data, the trained second abnormal state prediction model is obtained by optimizing the first comprehensive loss weight; second, the multiscale knowledge of the second abnormal state prediction model is migrated to the lightweight first abnormal state prediction model by comparing the knowledge distillation loss using newer historical data. The application balances the performance and efficiency of the model by optimizing the first comprehensive loss weight, obtains the abnormal state label describing the overall operating condition in the control cabinet, realizes the change from single-point threshold alarm to global state evaluation, and improves the intelligent level of safety monitoring of the control cabinet to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of security monitoring of control cabinets, and more particularly to a method, device, medium, and equipment for security monitoring of control cabinets. Background Technology

[0002] Existing safety early warning methods for control cabinets typically employ a single-parameter independent monitoring mode. This involves setting up independent monitoring units for key operating parameters within the control cabinet (such as temperature, current, voltage, vibration, humidity, and smoke concentration). Each monitoring unit performs real-time or periodic monitoring of the corresponding parameter based on preset fixed thresholds. When a parameter value exceeds the preset threshold, a corresponding abnormal label is output and an alarm is triggered. While this method achieves monitoring of the control cabinet's operating status to some extent, simplifying a multi-parameter coupled system into the monitoring of multiple independent variables introduces a certain degree of missed detection. For example, with preset temperature thresholds of 60℃ and voltage thresholds of 240V, if the control cabinet experiences a temperature of 55℃ and a simultaneous voltage fluctuation to 235V due to poor heat dissipation or abnormal load, although neither parameter exceeds the preset threshold, their coordinated abnormal change clearly indicates that the control cabinet is in a transitional state nearing failure. However, because the criteria for each parameter are independent, existing methods may determine that the control cabinet is operating normally, thus missing the optimal early warning opportunity and potentially leading to thermal damage or electrical failure. Summary of the Invention

[0003] This invention provides a method, device, equipment, and medium for safety monitoring of a control cabinet, in order to solve the problem of abnormal states in the prior art that use a single-parameter independent monitoring mode to output a single monitoring data, simplifying a multi-parameter coupled system into the monitoring of multiple independent variables, which has certain problems of missed reports.

[0004] In a first aspect, the present invention provides a security monitoring method for a control cabinet, the security monitoring method for the control cabinet comprising:

[0005] Step 100: Obtain at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet. Each set shall include at least three of the following: temperature, current, vibration, humidity, and smoke concentration.

[0006] Step 200: Input at least two sets of multi-dimensional time-series monitoring data at the current moment into the trained first abnormal state prediction model in the control cabinet to obtain the first abnormal state result of the control cabinet;

[0007] The training steps of the pre-trained first abnormal state prediction model include:

[0008] Step 201: Obtain N1 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N1 sets of multidimensional time-series monitoring data, the first abnormal state prediction model with parameter initialization, and the trained second abnormal state prediction model, where N1 is a positive integer greater than 1.

[0009] Step 202: Using the second abnormal state prediction model as the teacher model and the first abnormal state prediction model initialized with the parameters as the student model, input the N1 sets of multi-dimensional time-series monitoring data into the teacher model to obtain teacher multi-scale knowledge; input the N1 sets of multi-dimensional time-series monitoring data into the student model to obtain student multi-scale knowledge.

[0010] Step 203: Minimize the difference between the teacher's multi-scale knowledge and the student's multi-scale knowledge by comparing the knowledge distillation loss. Pass the fine-grained knowledge of the teacher model to the student model to complete knowledge distillation. Use the backpropagation algorithm to update the parameters of the student model using the knowledge distillation loss to obtain the trained first abnormal state prediction model.

[0011] Secondly, the present invention provides a safety monitoring device for a control cabinet, the safety monitoring device for the control cabinet comprising:

[0012] The data acquisition module is used to acquire at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet. Each set includes at least three of the following: temperature, current, vibration, humidity, and smoke concentration.

[0013] An abnormal result output module is used to input at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet into the trained first abnormal state prediction model to obtain the first abnormal state result of the control cabinet.

[0014] The sub-modules of the abnormal result output module include:

[0015] The model and data preparation submodule is used to acquire N1 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N1 sets of multidimensional time-series monitoring data, the first abnormal state prediction model with parameter initialization, and the trained second abnormal state prediction model, where N1 is a positive integer greater than 1.

[0016] The multi-scale knowledge extraction submodule is used to take the second abnormal state prediction model as the teacher model and the first abnormal state prediction model initialized with the parameters as the student model, input N1 sets of the multi-dimensional time series monitoring data into the teacher model to obtain teacher multi-scale knowledge; and input N1 sets of the multi-dimensional time series monitoring data into the student model to obtain student multi-scale knowledge.

[0017] The knowledge alignment and model update submodule is used to minimize the difference between the teacher's multi-scale knowledge and the student's multi-scale knowledge by comparing the knowledge distillation loss. It transfers the fine-grained knowledge of the teacher model to the student model to complete knowledge distillation. The knowledge distillation loss is used to update the parameters of the student model using the backpropagation algorithm to obtain the trained first abnormal state prediction model.

[0018] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the security monitoring method for the control cabinet as described in the first aspect.

[0019] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the security monitoring method for the control cabinet as described in the first aspect.

[0020] The aforementioned safety monitoring method for the control cabinet firstly inputs historical multi-dimensional time-series monitoring data (including at least two of the parameters: temperature, voltage, and current) and their corresponding abnormal state labels from within the control cabinet into a parameter-initialized first abnormal state prediction model and a trained first abnormal state prediction model, respectively, to obtain the student multi-scale knowledge of the parameter-initialized first abnormal state prediction model and the teacher multi-scale knowledge of the trained second abnormal state prediction model. The student and teacher multi-scale knowledge are then used for knowledge distillation. Secondly, the fine-grained knowledge of the second abnormal state prediction model is passed to the parameter-initialized first abnormal state prediction model. Thirdly, the knowledge distillation loss is updated using a backpropagation algorithm to update the parameters of the parameter-initialized first abnormal state prediction model, resulting in a trained first abnormal state prediction model. Finally, the current-time multi-dimensional time-series monitoring data from within the control cabinet is input into the trained first abnormal state prediction model to obtain the first abnormal state result of the control cabinet. Compared with existing technologies, this invention performs comprehensive status prediction on monitoring parameters such as temperature, voltage, and current within the control cabinet, enabling multi-parameter linkage early warning and obtaining abnormal status labels that describe the overall operating status within the control cabinet. This achieves a transformation from single-point threshold alarms to global status assessment, reducing the false alarm rate and improving the accuracy and early warning of early warnings. While ensuring the safe operation of the control cabinet, it also enhances the level of intelligent safety monitoring of the control cabinet to a certain extent. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of an application environment for a safety monitoring method for a control cabinet provided in Embodiment 1 of the present invention;

[0023] Figure 2 This is a flowchart illustrating a safety monitoring method for a control cabinet provided in Embodiment 1 of the present invention;

[0024] Figure 3 This is a schematic diagram of a safety monitoring device for a control cabinet provided in Embodiment 8 of the present invention;

[0025] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 9 of the present invention. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and 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.

[0027] The safety monitoring method for control cabinets provided in this embodiment of the invention can be applied to, for example... Figure 1 The application environment is shown. Specifically, this security monitoring method is applied in a security monitoring system, which includes, for example, [examples of such systems]. Figure 1 The diagram illustrates a client and server. The client and server communicate over a network to provide real-time updates of anomaly prediction results. The client, also known as the user terminal, is the program that provides local services to the client, corresponding to the server. The client can be installed on, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be a standalone server or a server cluster consisting of multiple servers.

[0028] In Example 1, as Figure 2 As shown, this embodiment provides a method for security monitoring of a control cabinet, which is applied to... Figure 1 Taking the client as an example, the security monitoring method of the control cabinet includes:

[0029] Step 100: Obtain at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet. Each set shall include at least three of the following: temperature, current, vibration, humidity, and smoke concentration.

[0030] Among them, the control cabinet refers to the electrical equipment that includes a sensing unit, a computing unit, and a communication unit; the sensing unit refers to the data acquisition module that includes multimodal sensors such as temperature sensors and humidity sensors; the computing unit refers to the data processing module composed of edge processors that realizes local data processing and inference; the edge processor refers to the dedicated computing hardware or computing unit that performs localized computing, storage, and processing close to the sensing unit; the communication unit refers to the data transmission and control subsystem that integrates communication modules such as Ethernet, 5G, and LoRa, and is responsible for the reliable uploading of monitoring data from the control cabinet, the real-time reception of cloud commands, and the reliable distribution of remote control signals; multidimensional time-series monitoring data refers to the time-series data set that includes at least three physical quantities, namely temperature, current, vibration, humidity, and smoke concentration, collected at a unified time reference through a multimodal sensor array deployed in the control cabinet.

[0031] For example, multidimensional time-series monitoring data has a 5×3 matrix structure, where 5 represents the total number of time steps and 3 represents the number of sensor types (temperature sensor, humidity sensor, and current sensor). The monitoring data corresponding to the first time step are 35.2℃, 45.1%RH, and 12.3A; the second time step is 35.5℃, 44.8%RH, and 12.5A; the third time step is 36.0℃, 44.5%RH, and 12.8A; the fourth time step is 36.8℃, 44.2%RH, and 13.2A; and the fifth time step is 37.5℃, 43.9%RH, and 13.6A. The multidimensional time-series monitoring data X can be represented by a matrix as follows:

[0032] .

[0033] Step 200: Input at least two sets of multi-dimensional time-series monitoring data at the current moment into the trained first abnormal state prediction model in the control cabinet to obtain the first abnormal state result of the control cabinet;

[0034] The first abnormal state prediction model refers to a lightweight abnormal state prediction model deployed on an edge server within the control cabinet, used for local real-time abnormal state monitoring and early warning. The abnormal state prediction model is a deep learning model used for control cabinet safety monitoring. Its core is a hybrid neural architecture combining temporal convolutional networks, long short-term memory networks, and attention mechanisms, designed for deep analysis and abnormal state prediction of the control cabinet's multi-dimensional time-series monitoring data. The first abnormal state result refers to the structured judgment information output by the first abnormal state prediction model after calculating the input multi-dimensional time-series monitoring data, representing the current operational health of the control cabinet, including but not limited to abnormal state labels and abnormal prediction parameters. The abnormal state is defined as follows: alarm level, probability of occurrence of abnormal state, and feature vector of abnormal state. Abnormal state label refers to a discrete classification identifier used to describe the overall operating status of the control cabinet, including but not limited to normal, over-temperature abnormality, and under-voltage abnormality. Abnormal warning level refers to an ordered risk ladder divided according to the severity and urgency of the abnormal state of the control cabinet. It is a discrete level representation, such as attention, warning, alarm, and emergency. Abnormal state occurrence probability refers to the quantitative value of the confidence or risk likelihood of the abnormal state label output by the abnormal state prediction model. The value range is [0, 1]. Abnormal state feature vector refers to a high-dimensional distributed numerical representation extracted by the deep network of the abnormal state prediction model that can characterize the essence of the current operating status in the control cabinet.

[0035] The training steps of the pre-trained first abnormal state prediction model include:

[0036] Step 201: Obtain N1 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N1 sets of multidimensional time-series monitoring data, the first abnormal state prediction model with parameter initialization, and the trained second abnormal state prediction model, where N1 is a positive integer greater than 1.

[0037] Among them, the trained second abnormal state prediction model refers to the trained lightweight abnormal state prediction model deployed in the cloud server outside the control cabinet, which is used to realize local real-time abnormal state monitoring and early warning; the cloud server refers to a remote high-performance computing and data storage platform located on the Internet.

[0038] Step 202: Using the second abnormal state prediction model as the teacher model and the first abnormal state prediction model initialized with the parameters as the student model, input the N1 sets of multi-dimensional time-series monitoring data into the teacher model to obtain teacher multi-scale knowledge; input the N1 sets of multi-dimensional time-series monitoring data into the student model to obtain student multi-scale knowledge.

[0039] Among them, the teacher model refers to a pre-trained, high-performance anomaly prediction model; teacher multi-scale knowledge refers to the set of diversified intermediate features or output distributions extracted by the teacher model from different depth levels (such as shallow, middle, and output layers) of its network structure during the forward propagation process, which can characterize the local temporal patterns, global dependencies, and final semantic logic of the input data; the student model refers to an anomaly prediction model that is being trained or is yet to be optimized, with a relatively lightweight structure; student multi-scale knowledge refers to the set of intermediate features or output distributions extracted by the student model from its corresponding network layers when it has the same input data as the teacher model, which are functionally or structurally comparable to the teacher model's knowledge at each scale.

[0040] Step 203: Minimize the difference between the teacher's multi-scale knowledge and the student's multi-scale knowledge by comparing the knowledge distillation loss. Pass the fine-grained knowledge of the teacher model to the student model to complete knowledge distillation. Use the backpropagation algorithm to update the parameters of the student model using the knowledge distillation loss to obtain the trained first abnormal state prediction model.

[0041] Knowledge distillation refers to the process of transferring rich information learned by the teacher model beyond the original training labels to the student model, thereby obtaining a lightweight and high-performance student model. Knowledge distillation loss is a loss function used to quantify the difference between the output of the student model and the output or intermediate features of the teacher model. Backpropagation algorithm is the core optimization algorithm for training the student model. It uses the chain rule to calculate the gradient of the knowledge distillation loss with respect to the parameters of each layer, starting from the loss function of the network output layer. Then, it uses optimization algorithms such as gradient descent to update these parameters, thereby minimizing the knowledge distillation loss.

[0042] The safety monitoring method for the control cabinet in this embodiment firstly inputs historical multi-dimensional time-series monitoring data (including at least two of temperature, voltage, and current) and their corresponding abnormal state labels from the control cabinet into a parameter-initialized first abnormal state prediction model and a trained first abnormal state prediction model, respectively, to obtain student multi-scale knowledge from the parameter-initialized first abnormal state prediction model and teacher multi-scale knowledge from the trained second abnormal state prediction model. The student multi-scale knowledge and teacher multi-scale knowledge are then used for knowledge distillation. Secondly, the fine-grained knowledge of the second abnormal state prediction model is passed to the parameter-initialized first abnormal state prediction model. Thirdly, the knowledge distillation loss is updated using a backpropagation algorithm to update the parameters of the parameter-initialized first abnormal state prediction model, resulting in a trained first abnormal state prediction model. Finally, the current-time multi-dimensional time-series monitoring data from the control cabinet is input into the trained first abnormal state prediction model to obtain the first abnormal state result of the control cabinet. Compared with existing technologies, this invention performs comprehensive status prediction on monitoring parameters such as temperature, voltage, and current within the control cabinet, enabling multi-parameter linkage early warning and obtaining abnormal status labels that describe the overall operating status within the control cabinet. This achieves a transformation from single-point threshold alarms to global status assessment, reducing the false alarm rate and improving the accuracy and early warning of early warnings. While ensuring the safe operation of the control cabinet, it also enhances the level of intelligent safety monitoring of the control cabinet to a certain extent.

[0043] In Embodiment 2, step 201 can be further refined into steps 2011 to 2015, including:

[0044] Step 2011: Obtain N2 sets of multi-dimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N2 sets of multi-dimensional time-series monitoring data, and the parameter-initialized third abnormal state prediction model, where N2 is a positive integer greater than 2.

[0045] Among them, the third abnormal state prediction model with parameter initialization refers to the initial abnormal state prediction model deployed on the cloud server. It is a prediction model with a complete model architecture but whose parameters are in a random initialization state. For example, the third anomalous state prediction model, composed of temporal convolutional networks, bidirectional long short-term memory networks, and multi-head self-attention mechanisms, first performs instance normalization on the input raw data X to eliminate the dimensionality influence between different features. Secondly, the normalized data is input in parallel to the temporal convolutional network and the bidirectional long short-term memory network, two feature extraction branches. The temporal convolutional network branch effectively captures local patterns and long-term dependencies in the sequence by stacking layers with dilated causal convolutions, ensuring temporal causality. The bidirectional long short-term memory network branch uses bidirectional long short-term memory network units to capture dynamic contextual information in the sequence from both forward and backward directions. The output features of the two branches are concatenated dimensionally and then input to the multi-head self-attention mechanism. Thirdly, the multi-head self-attention mechanism explicitly models the global dependencies within the fused features through parallel multi-group self-attention computation, further enhancing the expressive power of key temporal features. Finally, the output of the attention layer undergoes global average pooling dimensionality reduction and is processed by a fully connected layer and a softmax function to obtain the probability distribution corresponding to each anomalous state category, completing end-to-end classification prediction.

[0046] Step 2012: Input the multi-dimensional time-series monitoring data of group N2 into the third abnormal state prediction model to obtain the third abnormal state result of the control cabinet;

[0047] Step 2013: Based on the abnormal state label and the third abnormal state result, determine the first sub-loss, the second sub-loss, and the third sub-loss of the third abnormal state prediction model.

[0048] The first sub-loss refers to the loss of the third anomaly prediction model calculated based on the total number of historical multi-dimensional time-series monitoring data of the control cabinet input to the third anomaly prediction model, the total number of anomaly state labels output by the third anomaly prediction model, the one-hot encoding of the true anomaly state label corresponding to each multi-dimensional time-series monitoring data, the prediction probability of the third anomaly state prediction model for each anomaly state label, and the penalty weight of each anomaly state label, such as cross-entropy loss; the second loss refers to the loss of the third anomaly prediction model calculated based on the total number of historical multi-dimensional time-series monitoring data of the control cabinet input to the third anomaly prediction model, the total number of anomaly state labels output by the third anomaly prediction model, and the one-hot encoding of the true anomaly state label corresponding to each multi-dimensional time-series monitoring data. The third abnormal state prediction model calculates its loss based on the prediction probability of each abnormal state label and preset focus parameters, such as focus loss. The third sub-loss refers to the loss of the third abnormal state prediction model calculated based on the total number of historical multi-dimensional time-series monitoring data of the control cabinet input to the third abnormal state prediction model, the abnormal state labels output by the third abnormal state prediction model, the set of other data with the same abnormal state labels as each multi-dimensional time-series monitoring data, the set of other data with different abnormal state labels as each multi-dimensional time-series monitoring data, the feature vector corresponding to each multi-dimensional time-series monitoring data output by the third abnormal state prediction model, and preset temperature parameters, such as contrast loss.

[0049] Step 2014: In the set of preset weight combinations, determine the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss. Each weight combination includes the weight of the first sub-loss, the weight of the second sub-loss, and the weight of the third sub-loss.

[0050] Among them, the first weight, the second weight, and the third weight refer to the optimal weight combination of the third abnormal state prediction model. That is, in the preset weight combination, the number of correctly predicted abnormal states is maximized compared with the actual abnormal state labels, while the number of false alarms and false misses are minimized, thereby ensuring that the model has high accuracy and reliability in the abnormal identification task.

[0051] Step 2015: Determine the first comprehensive loss of the third abnormal state prediction model based on the first sub-loss, the second sub-loss, the third sub-loss, the first weight, the second weight, and the third weight. Stop model training when the first comprehensive loss meets the preset conditions to obtain the trained second abnormal state prediction model.

[0052] The first comprehensive loss refers to the weighted multi-task loss function used by the parameter-initialized third abnormal state prediction model during training. It is used to optimize the overall model performance and is composed of three sub-losses: the first sub-loss, the second sub-loss, and the third sub-loss, combined linearly with optimal weights. The preset condition is that the first comprehensive loss of the abnormal state prediction model reaches its minimum value, and the model has basic classification ability, which can strengthen the focus on difficult cases and abnormal state categories, bring the features of similar samples closer together, push away the features of dissimilar samples, and enhance the discriminative power of the feature space.

[0053] For example, the first comprehensive loss can be expressed as L total =0.2× L ce +0.5× L focal +0.3× L contrast .in, L total This represents the first comprehensive loss of the third abnormal state prediction model with initialized parameters; L ce This represents the first sub-loss of the third abnormal state prediction model with initialized parameters; L focal This represents the second sub-loss of the initialized third abnormal state prediction model; L contrast 0.2 represents the third sub-loss of the initial third abnormal state prediction model; 0.2 represents the first weight of the first sub-loss; 0.5 represents the second weight of the second sub-loss; 0.3 represents the third weight of the third sub-loss, and 0.2+0.5+0.3=1.

[0054] The safety monitoring method for the control cabinet in this embodiment first inputs the acquired historical multidimensional monitoring data and their corresponding tags into the initialized third abnormal state prediction model to obtain the third abnormal state prediction result. Then, based on the third abnormal state prediction result, it calculates a first sub-loss reflecting the model's accuracy in classifying basic abnormal state categories, a second sub-loss reflecting the model's accuracy in classifying difficult cases and abnormal state categories, and a third sub-loss reflecting the model's ability to distinguish between similar and dissimilar sample features. Finally, it determines the weight combination that optimizes the model's prediction accuracy as the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, obtaining a first comprehensive loss reflecting the classification accuracy of the third abnormal state prediction model. When the first comprehensive loss of the third abnormal state prediction model reaches its minimum value and can accurately predict the abnormal state of the control cabinet, a trained second abnormal state prediction model is obtained. Compared with existing technologies, this invention achieves the best balance between the basic classification accuracy, sensitivity to difficult cases and abnormal classes, and feature discrimination power of the first comprehensive loss by training a third abnormal state prediction model. When the first comprehensive loss reaches its minimum value, a well-trained second abnormal state prediction model is obtained, which can more accurately predict the abnormal state of the overall operation of the control cabinet, improve the accuracy and reliability of abnormal state identification, and to a certain extent improve the level of intelligent safety monitoring of the control cabinet.

[0055] In Embodiment 3, step 2014 includes:

[0056] In a set of M preset weight combinations, for each weight combination, the third abnormal state result output by the third abnormal state prediction model after inputting N2 sets of the multidimensional time series monitoring data into the third abnormal state prediction model is determined, where M is a positive integer greater than 1.

[0057] For each weight combination, based on the third abnormal state result, the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of missed abnormal states are counted.

[0058] Among them, the number of normally predicted abnormal states refers to the number of samples that the model correctly predicts as abnormal, that is, samples whose true state is abnormal and whose model also outputs as abnormal; the number of falsely reported abnormal states refers to the number of samples that the model incorrectly predicts as abnormal, that is, samples whose true state is normal, but whose model misjudges as abnormal; and the number of missed abnormal states refers to the number of samples that the model incorrectly predicts as normal, that is, samples whose true state is abnormal, but whose model fails to detect and judges as normal. For example, if the total number of historical multidimensional monitoring data input to the third abnormal state prediction model is 1000, of which 120 are true abnormal samples and 880 are true normal samples, after the model completes the prediction of all 1000 data points, the output results show a total of 135 abnormal samples, of which 105 are true abnormal samples and 30 are true normal samples; and a total of 865 normal samples, of which 15 are true abnormal samples and 850 are true normal samples. Therefore, it can be concluded that the number of normal predicted abnormal states is 105, the number of falsely reported abnormal states is 30, and the number of missed abnormal states is 15.

[0059] For each weight combination, the precision and recall of the third abnormal state result are determined based on the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of falsely reported abnormal states.

[0060] Precision refers to the proportion of correctly predicted anomalous samples out of the total number of samples predicted as anomalous by the model; recall refers to the proportion of correctly predicted anomalous samples out of the total number of truly anomalous samples. For example, if the total number of historical multidimensional monitoring data input into the third anomalous state prediction model is 1000, the model outputs 105 normal predicted anomalous states, 30 false positives, and 15 false negatives. Therefore, the precision is approximately 105 ÷ (105 + 30) ≈ 0.778, and the recall is approximately 105 ÷ (105 + 15) = 0.875.

[0061] For each weight combination, the macro F1 score of the third outlier result is determined based on the precision and the recall.

[0062] The macro F1 score refers to the overall performance evaluation index used for multi-class classification tasks. First, the precision and recall of each abnormal state category are calculated separately, and then the arithmetic mean of the F1 scores of all categories is taken. The F1 score is a harmonic average of the model's precision and recall, and its value ranges from [0, 1].

[0063] Based on the M macro F1 scores, the weight combinations corresponding to the top M1 macro F1 scores are selected as the weight combination candidate set. A weight combination is selected from the weight combination candidate set to obtain the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, where M1 is a positive integer greater than 1.

[0064] For example, suppose there are 3 sets of weight combinations, namely (0.1, 0.5, 0.4), (0.2, 0.5, 0.3), and (0.3, 0.4, 0.3), and the control cabinet has 3 abnormal state labels: normal (abnormal state label 1), over-temperature abnormal (abnormal state label 2), and under-voltage abnormal (abnormal state label 3). The validation set has 20 samples.

[0065] For the model prediction results with weight combination (0.1, 0.5, 0.4), the number of correctly predicted abnormal states for abnormal state label 1 is 8, the number of false positives is 1, and the number of false negatives is 2. The corresponding precision is 8 / (8+1)≈0.889, the recall is 8 / (8+2)=0.800, and the F1 score is 2×(0.889×0.800) / (0.889+0.800)≈0.842. For abnormal state label 2, the number of correctly predicted abnormal states is 5, the number of false positives is 3, and the number of false negatives is 2. The corresponding precision is 5 / (5+3)≈0.625, and the recall is 5 / (5+2)≈0. 0.714, F1 score is 2×(0.625×0.714) / (0.625+0.714)≈0.667; the number of normal predicted abnormal states for abnormal state label 3 is 4, the number of false positive predicted abnormal states is 2, and the number of false negative predicted abnormal states is 2, the corresponding precision is 4 / (4+2)≈0.667, the recall is 4 / (4+2)≈0.667, and the F1 score is 2×(0.667×0.667) / (0.667+0.667)=0.667; therefore, the macro F1 score of the weight combination (0.1, 0.5, 0.4) can be obtained as (0.842+0.667+0.667)÷3≈0.725.

[0066] Similarly, the macro F1 score for weights (0.2, 0.5, 0.3) is 0.756, and the macro F1 score for weights (0.3, 0.4, 0.3) is 0.753.

[0067] Ultimately, weights (0.2, 0.5, 0.3) and (0.3, 0.4, 0.3) with higher macro F1 scores were selected as the candidate set for weight combinations. This is because in anomaly detection scenarios with class imbalance, a higher macro F1 score leads to more accurate prediction of abnormal control cabinet states. Therefore, the weights (0.2, 0.5, 0.3) corresponding to the highest macro F1 score in the candidate set of weight combinations can be selected as the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss; or any set of weights can be selected from the candidate set of weight combinations as the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss.

[0068] The safety monitoring method for the control cabinet in this embodiment first obtains the third abnormal state result output by the third abnormal state prediction model based on the historical multi-dimensional time-series monitoring data and its corresponding abnormal state labels in the control cabinet. Second, it determines the number of correctly predicted abnormal states, the number of false alarms, and the number of missed alarms corresponding to each preset weight combination. Third, it calculates the macro F1 score for each weight combination based on the obtained number of correctly predicted abnormal states, false alarms, and missed alarms, and selects weight combinations with high macro F1 scores as the weight combination candidate set. The higher the macro F1 score, the more accurately the model can predict the abnormal state of the control cabinet. Finally, it selects the weight combination with the highest macro F1 score from the weight combination candidate set as the optimal weight, or randomly selects one as the optimal weight, determines the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, thereby calculating the first comprehensive loss. Compared with existing technologies, this invention obtains the optimal first comprehensive loss by introducing an automated weight evaluation and optimization mechanism based on macro F1 scores. This enables the second anomaly prediction model to achieve the best balance among basic classification accuracy, sensitivity to hard cases and anomaly classes, and feature discrimination power. It overcomes the subjectivity and inefficiency of manual parameter tuning and improves the practicality of the anomaly prediction model to a certain extent.

[0069] In Example 4, based on the M macro F1 scores ranked from highest to lowest, the weight combinations corresponding to the top M1 macro F1 scores are selected as a candidate set of weight combinations. From this candidate set, a weight combination is selected to obtain the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, including:

[0070] For each weight combination, based on the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of missed abnormal states, an indicator value for the third abnormal state result is determined, and the indicator value includes at least two of precision, accuracy, and recall.

[0071] Among them, the index value refers to a series of numerical measures used to quantitatively evaluate the performance of the model; the accuracy rate refers to the proportion of samples correctly predicted by the model in all samples (including normal samples and all types of abnormal samples).

[0072] For each weight combination, based on the indicator value and the preset indicator threshold of the third abnormal state result, the absolute error between the indicator value and the indicator threshold, the minimum absolute error between the indicator value and the indicator threshold, and the maximum absolute error between the indicator value and the indicator threshold are determined.

[0073] Among them, the index threshold refers to the pre-set ideal index value used to evaluate whether the model performance meets the standard or as an optimization target, usually 1.0, representing the perfect state; the absolute error refers to the absolute value of the difference between the actual value of a single evaluation index and the pre-set ideal index threshold, which quantifies the degree to which the model's performance deviates from the ideal state on that index; the minimum absolute error refers to the minimum value among all the obtained absolute errors; and the maximum absolute error refers to the maximum value among all the obtained absolute errors.

[0074] For each weight combination, the gray relational degree is determined based on the absolute error, the minimum absolute error, the maximum absolute error, and the preset resolution coefficient.

[0075] Grey relational degree refers to the degree of overall correlation or similarity between an anomaly prediction model and a perfect model in a multidimensional index space. For example, grey relational degree satisfies the following constraints:

[0076] ,

[0077] ,

[0078] In the formula, r i Indicates the first i Grey relational degree corresponding to the group weight combination; K This indicates the total number of assessment indicators for abnormal states of the control cabinet, including precision, accuracy, and recall. k Indicates the first k Evaluation indicators for abnormal status of each control cabinet; g i ( k ) indicates the first i The first group of weight combinations k The correlation coefficient of abnormal status tags of each control cabinet; x 0( k ) represents the threshold of the third abnormal state result, that is, the normalized result of each indicator is 1.0; x i (k ) indicates the first i The first group of weight combinations k The index values ​​of the abnormal status labels of each control cabinet; Δ i ( k ) indicates the first i The first group of weight combinations k The absolute error between the index value and the index threshold of the abnormal status label of each control cabinet; r The resolution coefficient is represented, typically taken as 0.5; min i min k Δ i ( k ) represents all the combinations of recombinations K The minimum absolute error among the abnormal status assessment indicators of each control cabinet; max i max k Δ i ( k ) represents all the combinations of recombinations K The maximum absolute error among the abnormal status assessment indicators of each control cabinet.

[0079] Among the M1 gray relation degrees, the weight combination corresponding to the largest gray relation degree is selected as the optimal weight combination, and the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss are obtained.

[0080] Assuming there are 3 control cabinet abnormal state assessment indicators, the accuracy rate ( k =1), accuracy ( k =2), Recall rate ( k =3), all indicator thresholds are 1.0, therefore the indicator threshold sequence is represented as x 0( k Given a weight set of [1.0, 1.0, 1.0], select three weight combinations: combination 1 (0.1, 0.5, 0.4), combination 2 (0.2, 0.5, 0.3), and combination 3 (0.3, 0.4, 0.3). Experiments are conducted to obtain the performance of each weight combination on these three indicators, denoted as follows: x 1( k = [0.85, 0.88, 0.82], x 2( k = [0.92, 0.90, 0.78] x 3( k )=[0.88, 0.91, 0.80], thus obtaining the absolute error Δ1( k = [0.15, 0.12, 0.18], Δ2( k = [0.08, 0.10, 0.22], Δ3( kGiven [0.12, 0.09, 0.20], the minimum absolute error min can be determined. i min k Δ i ( k The value is 0.08, and the maximum absolute error is max. i max k Δ i ( k Given a resolution coefficient of 0.22, let the resolution coefficient be... r It is 0.5.

[0081] Therefore, the correlation coefficient can be obtained. g 1( k = [0.731, 0.826, 0.655], g 2( k = [1.000, 0.905, 0.576] g 3( k Given [0.826, 0.950, 0.613], the grey relational degree is determined based on the correlation coefficient, and the values ​​are respectively... r 1 = (0.731 + 0.826 + 0.655) ÷ 3 = 0.737 r 2 = (1.000 + 0.905 + 0.576) ÷ 3 = 0.827 r 3 = (0.826 + 0.950 + 0.613) ÷ 3 = 0.796. Where... r The maximum value is 2, corresponding to a weight combination of (0.2, 0.5, 0.3), with a correlation coefficient of [missing value]. g 2( k )=[1.000, 0.905, 0.576]. Therefore, when the weight combination is (0.2, 0.5, 0.3), the resulting third abnormal state prediction model is more balanced and stable across multiple evaluation dimensions.

[0082] The control cabinet safety monitoring method of this embodiment first obtains the evaluation index values ​​of the third abnormal state prediction model under each weight combination; secondly, it calculates the absolute error between these index values ​​and preset index thresholds, and determines the minimum and maximum absolute errors; thirdly, it uses the resolution coefficient to calculate the grey relational coefficient and grey relational degree corresponding to each weight combination; finally, it determines the optimal weight combination based on the grey relational degree, which characterizes the overall balanced performance of the abnormal state prediction model in basic classification accuracy, sensitivity to difficult cases and abnormal classes, and feature discrimination power, and selects the weight combination with the highest grey relational degree as the optimal weight combination, and calculates the first comprehensive loss. Compared with the prior art, this invention, through grey relational analysis, comprehensively considers the global approximation degree of multi-dimensional evaluation indicators such as precision and recall with the ideal abnormal state prediction model, and obtains the grey relational degree that can characterize the prediction accuracy of the abnormal state prediction model. This overcomes the one-sidedness of single index optimization, can automatically balance the performance of the model in different performance dimensions, and obtain a weight combination with better overall performance. To a certain extent, it enhances the generalization ability and decision reliability of the abnormal state prediction model under complex and unbalanced operating conditions of the control cabinet.

[0083] In Example 5, step 2013, based on the abnormal state label and the third abnormal state result, determines the first sub-loss and the second sub-loss of the third abnormal state prediction model, including:

[0084] The total number of abnormal state labels output by the third abnormal state prediction model, the one-hot encoding of the real abnormal state labels corresponding to the N2 groups of multi-dimensional time-series monitoring data, the prediction probability of each abnormal state label output by the third abnormal state prediction model, and the penalty weight of each abnormal state label are obtained.

[0085] One-hot encoding refers to a standard method for converting anomalous state labels into binary vectors that are easy for anomalous state prediction models to process. For a classification problem with C categories, each category is represented as a vector of length C, where only the position corresponding to that category is 1 and all other positions are 0. Prediction probability refers to the probability value assigned to each possible anomalous state category by the output layer of the anomalous state prediction model after processing a set of multi-dimensional time-series monitoring data. Penalty weight refers to the scalar coefficients that are pre-set for different anomalous state categories.

[0086] Based on the multidimensional time-series monitoring data of group N2, the total number of abnormal state labels, the one-hot encoding, the prediction probability, and the penalty weight, the first sub-loss of the third abnormal state prediction model is determined.

[0087] For example, the first sub-loss can be expressed as:

[0088] ,

[0089] ,

[0090] In the formula, L ce Indicates the loss of the first child; N This indicates the total number of historical multidimensional time-series monitoring data entries within the control cabinet; C This indicates the total number of abnormal status categories for the control cabinet; i Indicates the first i The training sample, i.e. the th training sample i Historical multi-dimensional time-series monitoring data; c Indicates the first c Types of abnormal states; y i,c Indicates sample i The abnormal status label in the abnormal status category c One-hot encoding on the sample, if the sample i The abnormal status label is c ,but y i,c =1, otherwise y i,c =0; p i,c Indicates the model predicts samples i Belongs to the category of abnormal status c The probability satisfies ; N c This indicates that the training set belongs to the abnormal state category. c The number of samples; oh c Indicates the category of abnormal status c exist N The weights in the abnormal state labels corresponding to each multidimensional time-series monitoring data are used to alleviate class imbalance.

[0091] Let the training set have a total of N =1000 historical data entries, with 3 types of abnormal status labels: normal ( N 1=800), Over-temperature anomaly ( N 2=150), undervoltage abnormality ( N (3=50), then the weights of various abnormal state labels are: oh 1 = 1000 / (3 × 800) ≈ 0.4167, oh 2 = 1000 / (3 × 150) ≈ 2.2222, oh 1 = 1000 / (3 × 50) ≈ 6.6667, take one sample i The actual label is over-temperature anomaly ( c =2), that isy i,c =[0, 1, 0], the model predicts the probability as p i,c =[0.2, 0.7, 0.1], since only the real labels are available. c =2 y i,2 =1, others are 0, therefore the sample i The first loss is L (i) ce =-ω2×ln( p i,2 = -0.222 × ln(0.7) ≈ 0.792; Take a sample j The actual label is undervoltage abnormality ( c =3), that is y j,c =[0, 0, 1], the model predicts the probability as p j,c =[0.1, 0.2, 0.7], Sample j The first loss is L (j) ce =-ω2×ln( p j,3 ) = -0.6667 × ln(0.7) ≈ 2.378. Assume only i , j With two samples, the total first sub-loss is L ce =( L (i) ce + L (j) ce ) ÷ 2 = (0.792 + 2.378) ÷ 2 = 1.585.

[0092] Based on the multidimensional time-series monitoring data of group N2, the total number of abnormal state labels, the one-hot encoding, the prediction probability, and the preset focus parameters, the second sub-loss of the third abnormal state prediction model is determined.

[0093] The preset focus parameter is a dimensionless parameter used to dynamically adjust the relative importance of easy and difficult samples during the training process.

[0094] For example, the second sub-loss can be expressed as:

[0095] ,

[0096] In the formula, L focal Indicates the loss of the second child;N This indicates the total number of historical multidimensional time-series monitoring data entries within the control cabinet; C This indicates the total number of abnormal status categories for the control cabinet; i Indicates the first i The training sample, i.e. the th training sample i Historical multi-dimensional time-series monitoring data; c Indicates the first c Types of abnormal states; y i,c Indicates sample i The abnormal status label in the abnormal status category c One-hot encoding on the sample, if the sample i The abnormal status label is c ,but y i,c =1, otherwise y i,c =0; p i,c Indicates the model predicts samples i Belongs to the category of abnormal status c The probability satisfies ; c This represents the focus parameter, used to adjust the weights of easy and difficult samples.

[0097] Assuming there is a normal ( c =1), Over-temperature abnormality ( c =2), undervoltage abnormality ( c =3) The number of samples for these three types of control cabinet abnormal status labels. N The focal parameter is 2 (sample 1 is an easily classified sample, sample 2 is a difficult-to-classify sample). c The value is 2, where the true label of sample 1 is overtemperature anomaly. y 1,c =[0, 1, 0], predicted probability is p 1,c =[0.1, 0.8, 0.1] (The model's prediction probability for the true category is very high: 0.8); The true label for sample 2 is undervoltage anomaly. y 2,c =[0, 0, 1], predicted probability is p 2,c =[0.3, 0.5, 0.2] (the model's predicted probability for the true class is very low: 0.2), for sample 1 (the true class) c =2), because only real labels c =2 y 1,2 =1, and the others are 0, therefore L (1) focal =-(1- p1,2 ) γ ×ln( p 1,2 = -(1-0.8) 2 ×ln(0.8)≈0.00892; For sample 2 (true category c=3), since there are only true labels c =3 y 2,3 =1, and the others are 0, therefore L (2) focal =-(1- p 2,3 ) γ ×ln( p 2,3 = -(1-0.2) 2 ×ln(0.2)≈1.0300, yielding the total focal loss for sample 1 and sample 2 as follows: L focal =( L (1) focal + L (2) focal ) ÷ 2 = (0.00892 + 1.0300) ÷ 2 = 0.9163.

[0098] The control cabinet safety monitoring method in this embodiment uses historical multi-dimensional time-series monitoring data and their corresponding abnormal state labels, as well as third abnormal state results, to calculate a first sub-loss reflecting the model's basic classification accuracy using the weights of specific abnormal state categories, thus alleviating class imbalance. Simultaneously, by introducing a focus parameter to calculate a second sub-loss reflecting the model's sensitivity to difficult and abnormal classes, the weight of easily classified samples is dynamically reduced, forcing the model to focus on difficult-to-classify samples. Compared to existing technologies, this invention, by comprehensively combining the first sub-loss reflecting the model's basic classification accuracy and the second sub-loss reflecting the model's sensitivity to difficult and abnormal classes, enables the model to learn all abnormal state categories more evenly during training, focusing on tackling classification difficulties, improving the detection capability for various abnormal states, and to a certain extent, enhancing the model's prediction accuracy.

[0099] In Example 6, step 2013, based on the abnormal state label and the third abnormal state result, determines the third sub-loss of the third abnormal state prediction model, including:

[0100] Obtain a set of similar data that have the same abnormal state labels as the multidimensional time-series monitoring data of group N2, a set of dissimilar data that have different abnormal state labels as the multidimensional time-series monitoring data of group N2, and the feature vector corresponding to the multidimensional time-series monitoring data of group N2 output by the third abnormal state prediction model;

[0101] Among them, the homogeneous set refers to the set of all other data that are predicted by the model to be of the same abnormal state category as the i-th multidimensional time-series monitoring data that is currently used as the baseline center; the heterogeneous set refers to the set of all other data that are predicted by the model to be of different abnormal state categories as the i-th multidimensional time-series monitoring data that is currently used as the baseline center; the feature vector refers to a fixed-length numerical vector extracted and output by the third abnormal state prediction model from before the final classification layer when processing the historical multidimensional time-series monitoring data of a control cabinet.

[0102] Based on the multidimensional time-series monitoring data of group N2, the same type set, the different type set, the feature vector, and the preset temperature parameters, the third sub-loss of the third abnormal state prediction model is determined.

[0103] Here, the temperature parameter is a dimensionless constant used to adjust the sharpness or smoothness of the similarity score in the probability distribution. For example, the third sub-loss can be expressed as:

[0104] ,

[0105] In the formula, L contrast Indicates the loss of the third child; N This represents the total number of samples used for model training, i.e., the total number of historical multidimensional time-series monitoring data entries within the control cabinet; i Indicates the first i The training sample, i.e. the th training sample i Historical multi-dimensional time-series monitoring data; P ( i ) represents the set of positive samples, that is, in N In each training sample, with the sample i The set of other samples of the same category (excluding) i itself); A ( i ) represents the negative sample set, that is, in N In each training sample, with the sample i A collection of other samples from different categories; p Indicates a positive sample; a Indicates a negative sample; s i Indicates sample i eigenvectors;s p Indicates positive samples p eigenvectors; s a Indicates negative samples a eigenvectors; s i · s p Indicates sample i Compared with positive samples p Cosine similarity; s i · s a Indicates sample i With negative samples a Cosine similarity; t This represents a temperature parameter used to adjust the smoothness of the similarity distribution.

[0106] Assuming there are 6 training samples, temperature parameter t Taking 0.5, the true label for sample 1 is normal ( c =1), eigenvectors s 1 = [0.9, 0.2, 0.3]; The true label for sample 2 is normal ( c =1), eigenvectors s 2 = [0.8, 0.3, 0.4]; the true label for sample 3 is overheating anomaly ( c =2), eigenvectors s 3 = [0.2, 0.9, 0.3]; the true label for sample 4 is overheating anomaly ( c =2), eigenvectors s 4 = [0.3, 0.8, 0.4]; the true label for sample 5 is undervoltage anomaly ( c =3), eigenvectors s 5 = [0.3, 0.3, 0.9]; the true label for sample 6 is normal ( c =3), eigenvectors s 6 = [0.4, 0.4, 0.8], where the set of positive samples for sample 1 is... P (1) = {i = 2}, the negative sample set of sample 1 is A (1)={ i =3, i =4, i =5, i =6}.

[0107] Therefore, we can obtain exp[( s 1· s 2) ÷ t]=exp[(0.9×0.8+0.2×0.3+0.3×0.4)÷0.5]≈6.0496, exp[( s 1· s 3) ÷ t ]=exp[(0.9×0.2+0.2×0.9+0.3×0.3)÷0.5]≈2.4596, exp[( s 1· s 4) ÷ t ]=exp[(0.9×0.3+0.2×0.8+0.3×0.4)÷0.5]≈3.0042, exp[( s 1· s 5) ÷ t ]=exp[(0.9×0.3+0.2×0.3+0.3×0.9)÷0.5]≈3.3201, exp[( s 1· s 6) ÷ t ] = exp[(0.9×0.4+0.2×0.4+0.3×0.8)÷0.5]≈3.8962, and calculate the third sub-loss of sample 1 as L (1) contrast =(1÷| P (1)|)×ln{exp[( s 1· s 2) ÷ t ]}÷{exp[( s 1· s 3) ÷ t ]+exp[( s 1· s 4) ÷ t ]+exp[( s 1· s 5) ÷ t ]+exp[( s 1· s 6) ÷ t = (1 ÷ 1) × [6.0496 ÷ (2.4596 + 3.0042 + 3.3201 + 3.8962)] ≈ -0.740.

[0108] Similarly, the third sub-loss of sample 2 can be obtained. L (2) contrast The third sub-loss of sample 3 is -0.918. L (3) contrast The third sub-loss of sample 4 is -0.740. L (4) contrastThe third sub-loss of sample 5 is -0.918. L (5) contrast The third sub-loss of sample 6 is -0.760. L (6) contrast The value is -0.909, so the total third sub-loss for the 6 samples is (-0.740) + (-0.918) + (-0.740) + (-0.918) + (-0.760) + (-0.909) = -4.985.

[0109] The safety monitoring method for control cabinets in this embodiment first extracts normalized feature vectors from the intermediate layer of the third abnormal state prediction model to characterize the model's intrinsic representation of the data. Second, for each historical multidimensional monitoring data point, its similarity to similar positive samples and its similarity to dissimilar negative samples are calculated. Third, based on temperature parameters, the similarity is converted into exponential weights, and the third sub-loss for each sample is calculated using the ratio of the weights of positive samples to the sum of the weights of all negative samples, highlighting the model's discriminative power for abnormal state features. Finally, the third sub-losses of all samples are summed to obtain the model's total third sub-loss under the current weight combination. Compared to existing technologies, this invention, by introducing a structured third sub-loss representing the model's discriminative power for abnormal state features, expands the optimization objective from a single classification correctness to the discriminability of the feature space. This enhances the model's ability to distinguish similar abnormal state categories and its generalization ability to unknown abnormal state category variants, thereby improving the accuracy and reliability of control cabinet abnormal state prediction to a certain extent.

[0110] In Embodiment Seven, a security monitoring method for a control cabinet is provided. The second abnormal state prediction model is deployed on a cloud server outside the control cabinet, and the first abnormal state prediction model is deployed on an edge server inside the control cabinet. After step 200, the method further includes:

[0111] The system acquires N3 sets of multidimensional time-series monitoring data, the abnormal status labels corresponding to the N3 sets of multidimensional time-series monitoring data, the first abnormal status prediction model, and the second abnormal status prediction model in the second historical period within the control cabinet. The second historical period is after the first historical period, and N3 is a positive integer greater than 1.

[0112] The edge server obtains the first abnormal state result output by the first abnormal state prediction model, and sends the first abnormal state result to the cloud server.

[0113] Based on the first abnormal state result, the cloud server retrains the second abnormal state prediction model to obtain the trained second abnormal state prediction model, and then returns to step 202.

[0114] In embodiment eight, a safety monitoring device 400 for a control cabinet is provided. Please refer to [reference needed]. Figure 3 ,include:

[0115] The data acquisition module 4100 is used to acquire at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet. Each set includes at least three of the following: temperature, current, vibration, humidity, and smoke concentration.

[0116] The abnormal result output module 4200 is used to input at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet into the trained first abnormal state prediction model to obtain the first abnormal state result of the control cabinet.

[0117] Optionally, the above-mentioned abnormal result output module 4200 includes:

[0118] The model and data preparation submodule is used to acquire N1 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N1 sets of multidimensional time-series monitoring data, the first abnormal state prediction model with parameter initialization, and the trained second abnormal state prediction model, where N1 is a positive integer greater than 1.

[0119] The multi-scale knowledge extraction submodule is used to take the second abnormal state prediction model as the teacher model and the first abnormal state prediction model initialized with the parameters as the student model, input N1 sets of the multi-dimensional time series monitoring data into the teacher model to obtain teacher multi-scale knowledge; and input N1 sets of the multi-dimensional time series monitoring data into the student model to obtain student multi-scale knowledge.

[0120] The knowledge alignment and model update submodule is used to minimize the difference between the teacher's multi-scale knowledge and the student's multi-scale knowledge by comparing the knowledge distillation loss. It transfers the fine-grained knowledge of the teacher model to the student model to complete knowledge distillation. The knowledge distillation loss is used to update the parameters of the student model using the backpropagation algorithm to obtain the trained first abnormal state prediction model.

[0121] Optionally, the above model and data preparation sub-module includes:

[0122] The model and data preparation unit is used to acquire N2 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N2 sets of multidimensional time-series monitoring data, and the parameter-initialized third abnormal state prediction model, where N2 is a positive integer greater than 2.

[0123] The third abnormal state result acquisition unit is used to input the N2 sets of multi-dimensional time-series monitoring data into the third abnormal state prediction model to obtain the third abnormal state result of the control cabinet.

[0124] The first comprehensive loss calculation unit is used to determine the first sub-loss, the second sub-loss, and the third sub-loss of the third abnormal state prediction model based on the abnormal state label and the third abnormal state result.

[0125] The first weight set calculation unit is used to determine the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss in a preset set of weight combinations. Each weight combination includes the weight of the first sub-loss, the weight of the second sub-loss, and the weight of the third sub-loss.

[0126] The second abnormal state prediction model update unit is used to determine the first comprehensive loss of the third abnormal state prediction model based on the first sub-loss, the second sub-loss, the third sub-loss, the first weight, the second weight, and the third weight. When the first comprehensive loss meets the preset conditions, the model training is stopped, and the trained second abnormal state prediction model is obtained.

[0127] Optionally, the aforementioned first weight set calculation unit includes:

[0128] In a set of M preset weight combinations, for each weight combination, the third abnormal state result output by the third abnormal state prediction model after inputting N2 sets of the multidimensional time series monitoring data into the third abnormal state prediction model is determined, where M is a positive integer greater than 1.

[0129] For each weight combination, based on the third abnormal state result, the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of missed abnormal states are counted.

[0130] For each weight combination, the precision and recall of the third abnormal state result are determined based on the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of falsely reported abnormal states.

[0131] For each weight combination, the macro F1 score of the third outlier result is determined based on the precision and the recall.

[0132] Based on the M macro F1 scores, the weight combinations corresponding to the top M1 macro F1 scores are selected as the weight combination candidate set. A weight combination is selected from the weight combination candidate set to obtain the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, where M1 is a positive integer greater than 1.

[0133] Optionally, the aforementioned first weight set calculation unit is used to select the weight combinations corresponding to the top M1 macro F1 scores as a weight combination candidate set based on the M macro F1 scores sorted from highest to lowest, and then select a set of weight combinations from the weight combination candidate set to obtain the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, including:

[0134] For each weight combination, based on the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of missed abnormal states, an indicator value for the third abnormal state result is determined, and the indicator value includes at least two of precision, accuracy, and recall.

[0135] For each weight combination, based on the indicator value and the preset indicator threshold of the third abnormal state result, the absolute error between the indicator value and the indicator threshold, the minimum absolute error between the indicator value and the indicator threshold, and the maximum absolute error between the indicator value and the indicator threshold are determined.

[0136] For each weight combination, the gray relational degree is determined based on the absolute error, the minimum absolute error, the maximum absolute error, and the preset resolution coefficient.

[0137] Among the M1 gray relation degrees, the weight combination corresponding to the largest gray relation degree is selected as the optimal weight combination, and the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss are obtained.

[0138] Optionally, the first comprehensive loss calculation unit, based on the abnormal state label and the third abnormal state result, determines the first sub-loss and the second sub-loss of the third abnormal state prediction model, including:

[0139] Obtain the total number of abnormal state labels output by the third abnormal state prediction model, the one-hot encoding of the real abnormal state labels corresponding to the N2 groups of multi-dimensional time-series monitoring data, the prediction probability of each abnormal state label output by the third abnormal state prediction model, and the penalty weight of each abnormal state label.

[0140] Based on the multidimensional time-series monitoring data of group N2, the total number of abnormal state labels, the one-hot encoding, the prediction probability, and the penalty weight, the first sub-loss of the third abnormal state prediction model is determined.

[0141] Based on the multidimensional time-series monitoring data of group N2, the total number of abnormal state labels, the one-hot encoding, the prediction probability, and the preset focus parameters, the second sub-loss of the third abnormal state prediction model is determined.

[0142] Optionally, the first comprehensive loss calculation unit, based on the abnormal state label and the third abnormal state result, determines the third sub-loss of the third abnormal state prediction model, including:

[0143] Obtain a set of similar data that have the same abnormal state labels as the multidimensional time-series monitoring data of group N2, a set of dissimilar data that have different abnormal state labels as the multidimensional time-series monitoring data of group N2, and the feature vector corresponding to the multidimensional time-series monitoring data of group N2 output by the third abnormal state prediction model;

[0144] Based on the multidimensional time-series monitoring data of group N2, the same type set, the different type set, the feature vector, and the preset temperature parameters, the third sub-loss of the third abnormal state prediction model is determined.

[0145] Optionally, the aforementioned control cabinet safety monitoring device 400, wherein the second abnormal state prediction model is deployed on a cloud server outside the control cabinet, the first abnormal state prediction model is deployed on an edge server inside the control cabinet, and after the abnormal result output module 4200, further includes:

[0146] Obtain N3 sets of multidimensional time-series monitoring data in the second historical period in the control cabinet, the abnormal state labels corresponding to the N3 sets of multidimensional time-series monitoring data, the first abnormal state prediction model, the second abnormal state prediction model, and the third historical period after the first historical period, where N3 is a positive integer greater than one.

[0147] The edge server obtains the first abnormal state result output by the first abnormal state prediction model, and sends the first abnormal state result to the cloud server.

[0148] Based on the first abnormal state result, the cloud server retrains the second abnormal state prediction model to obtain the trained second abnormal state prediction model, and returns it to the multi-scale knowledge extraction submodule.

[0149] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0150] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0151] In embodiment nine, a computer device is provided, such as Figure 4As shown, it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the safety monitoring method for the control cabinet described in the above embodiments, for example... Figure 2 Steps 100 to 200 shown are not repeated here to avoid repetition.

[0152] In Embodiment 10, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the security monitoring method for the control cabinet described in the above embodiments, for example... Figure 2 Steps 100 to 200 shown are not repeated here to avoid repetition.

[0153] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0154] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0155] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of this invention is defined by the appended claims.

Claims

1. A method for security monitoring of a control cabinet, characterized in that, The security monitoring method for the control cabinet includes: Step 100: Obtain at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet. Each set shall include at least three of the following: temperature, current, vibration, humidity, and smoke concentration. Step 200: Input at least two sets of multi-dimensional time-series monitoring data at the current moment into the trained first abnormal state prediction model in the control cabinet to obtain the first abnormal state result of the control cabinet; The training steps of the pre-trained first abnormal state prediction model include: Step 201: Obtain N1 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N1 sets of multidimensional time-series monitoring data, the first abnormal state prediction model with parameter initialization, and the trained second abnormal state prediction model, where N1 is a positive integer greater than 1. Step 202: Using the second abnormal state prediction model as the teacher model and the first abnormal state prediction model initialized with the parameters as the student model, input the N1 sets of multi-dimensional time-series monitoring data into the teacher model to obtain teacher multi-scale knowledge; input the N1 sets of multi-dimensional time-series monitoring data into the student model to obtain student multi-scale knowledge. Step 203: Minimize the difference between the teacher's multi-scale knowledge and the student's multi-scale knowledge by comparing the knowledge distillation loss, pass the fine-grained knowledge of the teacher model to the student model to complete knowledge distillation, and use the backpropagation algorithm to update the parameters of the student model to obtain the trained first abnormal state prediction model. The training steps for the trained second abnormal state prediction model include: Step 2011: Obtain N2 sets of multi-dimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N2 sets of multi-dimensional time-series monitoring data, and the parameter-initialized third abnormal state prediction model, where N2 is a positive integer greater than 2. Step 2012: Input the multi-dimensional time-series monitoring data of group N2 into the third abnormal state prediction model to obtain the third abnormal state result of the control cabinet; Step 2013: Based on the abnormal state label and the third abnormal state result, determine the first sub-loss, the second sub-loss, and the third sub-loss of the third abnormal state prediction model. Step 2014: In the set of preset weight combinations, determine the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss. Each weight combination includes the weight of the first sub-loss, the weight of the second sub-loss, and the weight of the third sub-loss. Step 2015: Determine the first comprehensive loss of the third abnormal state prediction model based on the first sub-loss, the second sub-loss, the third sub-loss, the first weight, the second weight, and the third weight. Stop model training when the first comprehensive loss meets the preset conditions to obtain the trained second abnormal state prediction model.

2. The safety monitoring method for the control cabinet according to claim 1, characterized in that, Step 2014 includes: In a set of M preset weight combinations, for each weight combination, the third abnormal state result output by the third abnormal state prediction model after inputting N2 sets of the multidimensional time series monitoring data into the third abnormal state prediction model is determined, where M is a positive integer greater than 1. For each weight combination, based on the third abnormal state result, the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of missed abnormal states are counted. For each weight combination, the precision and recall of the third abnormal state result are determined based on the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of falsely reported abnormal states. For each weight combination, the macro F1 score of the third outlier result is determined based on the precision and the recall. Based on the M macro F1 scores, the weight combinations corresponding to the top M1 macro F1 scores are selected as the weight combination candidate set. A weight combination is selected from the weight combination candidate set to obtain the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, where M1 is a positive integer greater than 1.

3. The safety monitoring method for the control cabinet according to claim 2, characterized in that, Based on the M macro F1 scores, the weight combinations corresponding to the top M1 macro F1 scores are selected as a candidate set of weight combinations. From this candidate set, a weight combination is selected to obtain the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss, including: For each weight combination, based on the number of correctly predicted abnormal states, the number of falsely reported abnormal states, and the number of missed abnormal states, an indicator value for the third abnormal state result is determined, and the indicator value includes at least two of precision, accuracy, and recall. For each weight combination, based on the indicator value and the preset indicator threshold of the third abnormal state result, the absolute error between the indicator value and the indicator threshold, the minimum absolute error between the indicator value and the indicator threshold, and the maximum absolute error between the indicator value and the indicator threshold are determined. For each weight combination, the gray relational degree is determined based on the absolute error, the minimum absolute error, the maximum absolute error, and the preset resolution coefficient. Among the M1 gray relation degrees, the weight combination corresponding to the largest gray relation degree is selected as the optimal weight combination, and the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss are obtained.

4. The safety monitoring method for the control cabinet according to claim 1, characterized in that, In step 2013, based on the abnormal state label and the third abnormal state result, the first sub-loss and the second sub-loss of the third abnormal state prediction model are determined, including: The total number of abnormal state labels output by the third abnormal state prediction model, the one-hot encoding of the real abnormal state labels corresponding to the N2 groups of multi-dimensional time-series monitoring data, the prediction probability of each abnormal state label output by the third abnormal state prediction model, and the penalty weight of each abnormal state label are obtained. Based on the multidimensional time-series monitoring data of group N2, the total number of abnormal state labels, the one-hot encoding, the prediction probability, and the penalty weight, the first sub-loss of the third abnormal state prediction model is determined. Based on the multidimensional time-series monitoring data of group N2, the total number of abnormal state labels, the one-hot encoding, the prediction probability, and the preset focus parameters, the second sub-loss of the third abnormal state prediction model is determined.

5. The safety monitoring method for the control cabinet according to claim 1, characterized in that, In step 2013, based on the anomalous state label and the third anomalous state result, the third sub-loss of the third anomalous state prediction model is determined, including: Obtain a set of similar data that have the same abnormal state labels as the multidimensional time-series monitoring data of group N2, a set of dissimilar data that have different abnormal state labels as the multidimensional time-series monitoring data of group N2, and the feature vector corresponding to the multidimensional time-series monitoring data of group N2 output by the third abnormal state prediction model; Based on the multidimensional time-series monitoring data of group N2, the same type set, the different type set, the feature vector, and the preset temperature parameters, the third sub-loss of the third abnormal state prediction model is determined.

6. The safety monitoring method for the control cabinet according to claim 1, characterized in that, The second anomaly prediction model is deployed on a cloud server outside the control cabinet, and the first anomaly prediction model is deployed on an edge server inside the control cabinet. After step 200, the method further includes: The system acquires N3 sets of multidimensional time-series monitoring data, the abnormal status labels corresponding to the N3 sets of multidimensional time-series monitoring data, the first abnormal status prediction model, and the second abnormal status prediction model in the second historical period within the control cabinet. The second historical period is after the first historical period, and N3 is a positive integer greater than 1. The edge server obtains the first abnormal state result output by the first abnormal state prediction model, and sends the first abnormal state result to the cloud server. Based on the first abnormal state result, the cloud server retrains the second abnormal state prediction model to obtain the trained second abnormal state prediction model, and then returns to step 202.

7. A safety monitoring device for a control cabinet, characterized in that, The security monitoring device includes: The data acquisition module is used to acquire at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet. Each set includes at least three of the following: temperature, current, vibration, humidity, and smoke concentration. An abnormal result output module is used to input at least two sets of multi-dimensional time-series monitoring data at the current moment in the control cabinet into the trained first abnormal state prediction model to obtain the first abnormal state result of the control cabinet. The sub-modules of the abnormal result output module include: The model and data preparation submodule is used to acquire N1 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N1 sets of multidimensional time-series monitoring data, the first abnormal state prediction model with parameter initialization, and the trained second abnormal state prediction model, where N1 is a positive integer greater than 1. The multi-scale knowledge extraction submodule is used to take the second abnormal state prediction model as the teacher model and the first abnormal state prediction model initialized with the parameters as the student model, input N1 sets of the multi-dimensional time series monitoring data into the teacher model to obtain teacher multi-scale knowledge; and input N1 sets of the multi-dimensional time series monitoring data into the student model to obtain student multi-scale knowledge. The knowledge alignment and model update submodule is used to minimize the difference between the teacher's multi-scale knowledge and the student's multi-scale knowledge by comparing the knowledge distillation loss. The fine-grained knowledge of the teacher model is passed to the student model to complete the knowledge distillation. The knowledge distillation loss is used to update the parameters of the student model using the backpropagation algorithm to obtain the trained first abnormal state prediction model. The model and data preparation submodule includes: The model and data preparation unit is used to acquire N2 sets of multidimensional time-series monitoring data in the first historical period in the control cabinet, the abnormal state labels corresponding to the N2 sets of multidimensional time-series monitoring data, and the parameter-initialized third abnormal state prediction model, where N2 is a positive integer greater than 2. The third abnormal state result acquisition unit is used to input the N2 sets of multi-dimensional time-series monitoring data into the third abnormal state prediction model to obtain the third abnormal state result of the control cabinet. The first comprehensive loss calculation unit is used to determine the first sub-loss, the second sub-loss, and the third sub-loss of the third abnormal state prediction model based on the abnormal state label and the third abnormal state result. The first weight set calculation unit is used to determine the first weight of the first sub-loss, the second weight of the second sub-loss, and the third weight of the third sub-loss in a preset set of weight combinations. Each weight combination includes the weight of the first sub-loss, the weight of the second sub-loss, and the weight of the third sub-loss. The second abnormal state prediction model update unit is used to determine the first comprehensive loss of the third abnormal state prediction model based on the first sub-loss, the second sub-loss, the third sub-loss, the first weight, the second weight, and the third weight. When the first comprehensive loss meets the preset conditions, the model training is stopped, and the trained second abnormal state prediction model is obtained.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the safety monitoring method for the control cabinet according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the safety monitoring method for the control cabinet according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Battery cluster fault diagnosis method and system and medium

    CN121524931A