Equipment anomaly detection method, device, equipment, medium, program product and system

By encrypting data at edge devices and using teacher models to generate encrypted soft tags, combining knowledge distillation and federated learning, the security and accuracy of device anomaly detection in edge computing environments are solved, real-time response and data privacy protection are achieved.

CN120528693APending Publication Date: 2025-08-22CHINA THREE GORGES CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510889753.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

In the prior art, equipment abnormality detection lacks model security design in edge computing environments, resulting in high response delay and high false alarm rate, and the inability to achieve accurate and secure detection.

Method used

By encrypting the data after the edge device monitors the threat and sending it to the cloud teacher model to generate encrypted soft tags. The student model is trained based on the encrypted data, combining knowledge distillation and federated learning, dynamically adjusting the knowledge transfer intensity to build an edge cloud security protection mechanism.

Benefits of technology

It realizes the accuracy and security of equipment abnormality detection, reduces data latency, and builds deep coupling of security domain detection to adapt to real-time threat changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120528693A_ABST
    Figure CN120528693A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of equipment detection, and discloses an equipment anomaly detection method, device, equipment, medium, program product and system, and the method comprises the steps: when an edge device monitors a local threat according to collected local data, and after the threat level exceeds a first preset threshold value, the local data is encrypted and then sent to a teacher model; the teacher model generates an encrypted soft label according to the encrypted local data, and sends the encrypted soft label to the student model; and the student model carries out model training based on the encrypted soft label and the local data, and carries out equipment anomaly detection after training is completed. By encrypting the local data, the teacher model and the student model can be trained based on the encrypted data, and the local data is always in an unexposed state, so that an edge cloud security protection mechanism is constructed, deep coupling of security domain detection is realized, data delay is reduced, and the accuracy and security of equipment anomaly detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of equipment detection technology, and in particular to equipment anomaly detection methods, devices, equipment, media, program products and systems. Background Art

[0002] In industrial scenarios, device anomaly detection often faces issues such as edge computing limitations, data privacy requirements, and real-time requirements. Knowledge Distillation, through a "Teacher model (Teacher) → Student model (Student)" transfer learning framework, compresses the "knowledge" of complex cloud models into lightweight edge models, which can adapt to the above requirements.

[0003] However, existing technologies focus on model compression and accuracy improvement, lacking proactive design for model security (such as defense against adversarial attacks and data privacy protection). Furthermore, deployed security protection systems (such as intrusion detection and data encryption) operate independently of the model and cannot dynamically coordinate with the anomaly detection model corresponding to knowledge distillation. This results in high response delays and high false alarm rates, making it impossible to achieve accurate and secure device anomaly detection. Summary of the Invention

[0004] In view of this, the present invention provides a device anomaly detection method, apparatus, device, medium, program product and system to solve the problem of low accuracy and security of device anomaly detection.

[0005] In a first aspect, the present invention provides a device anomaly detection method, which is applied to an anomaly detection system. The anomaly detection system includes an edge device and a cloud. The edge device is deployed with a student model, and the cloud is deployed with a teacher model. The method includes:

[0006] When the edge device detects a local threat based on the collected local data and the threat level exceeds a first preset threshold, the local data is encrypted and sent to the teacher model;

[0007] The teacher model generates an encrypted soft label based on the encrypted local data and sends the encrypted soft label to the student model;

[0008] The student model is trained based on encrypted soft labels and local data, and performs device anomaly detection after training is completed.

[0009] The device anomaly detection method provided by the present invention monitors local threats based on collected local data at the edge device, and after the threat level exceeds a first preset threshold, encrypts the local data and sends it to the teacher model. The teacher model generates a soft label based on the encrypted local data and sends the encrypted soft label to the student model. The student model performs model training based on the encrypted soft label and local data, and performs device anomaly detection after the training is completed. By encrypting the local data, the present invention can ensure that the teacher model and the student model are trained based on the encrypted data, and the local data is always in an unexposed state, thereby building an edge-cloud security protection mechanism, achieving deep coupling of security domain detection, reducing data latency, and improving the accuracy and security of device anomaly detection.

[0010] In an optional embodiment, the teacher model generates an encrypted soft label based on the encrypted local data and sends the encrypted soft label to the student model, including: forward propagation based on the encrypted local data to obtain the original output value; probabilistically predicting the original output value according to the activation function to obtain a first probability distribution, and using the first probability distribution as the encrypted soft label; generating differential privacy noise, and injecting the differential privacy noise into the encrypted soft label.

[0011] The present invention conducts model training based on encrypted local data. When the threat level is high, it can offload sensitive computing tasks to the cloud security sandbox based on the security protection mechanism, thereby achieving physical isolation and blocking the threat chain. At the same time, the edge device focuses on lightweight real-time monitoring, and unloads heavy-load tasks when the threat level is high, avoiding waste of local computing power.

[0012] In an optional embodiment, the student model performs model training based on the encrypted soft label and local data, and performs device anomaly detection after the training is completed, including: determining the security weight coefficient according to the threat level, and determining the dynamic security loss function according to the security weight coefficient; decrypting the encrypted soft label to obtain a first probability distribution, and forward propagating based on the local data to obtain a second probability distribution; calculating according to the dynamic security loss function, the first probability distribution and the second probability distribution to determine whether the function value of the dynamic security loss function is less than a second preset threshold; if it is not less than the second preset threshold, adjusting the model parameters of the student model until the function value of the dynamic security loss function is less than the second preset threshold.

[0013] This method implements knowledge distillation between the teacher and student models based on security weight coefficients. It can dynamically adjust the strength of knowledge transfer based on real-time threats. When the threat level increases, knowledge transfer is strengthened, making the student model more dependent on the teacher's knowledge. Conversely, when the threat level decreases, this dependence is reduced, allowing the student model to autonomously adapt to new data.

[0014] In an optional embodiment, after adjusting the model parameters of the student model until the function value of the dynamic security loss function is less than a second preset threshold, it also includes: encrypting the updated model parameters and sending the updated model parameters to the teacher model so that the teacher model updates the global model parameters.

[0015] By feeding back the parameter adjustment results of the student model to the teacher model, the present invention can form a closed loop of "monitoring-training-optimization" and realize the construction of the subsequent federated learning framework.

[0016] In an optional embodiment, the teacher model updates the global model parameters, including: obtaining updated model parameters of multiple student models; performing weighted averaging on each updated model parameter, or calculating based on a secure aggregation algorithm to obtain the global model parameters.

[0017] By obtaining the model parameters of student models on different edge devices, the present invention can synchronize the parameters of the student model after training on the edge device to the cloud through the federated learning framework to update the global teacher model, realize distributed knowledge aggregation, integrate global distributed features, generate a more powerful global threat knowledge base, and avoid the limitations of a single node.

[0018] In the second aspect, the present invention provides a device anomaly detection device, which is applied to an anomaly detection system. The anomaly detection system includes an edge device end and a cloud end. A student model is deployed on the edge device end, and a teacher model is deployed on the cloud end. The device includes: a data monitoring module, which is used when the edge device monitors local threats based on the collected local data, and when the threat level exceeds a first preset threshold, the local data is encrypted and sent to the teacher model; a task offloading module, which is used for the teacher model to generate an encrypted soft label based on the encrypted local data, and send the encrypted soft label to the student model; an anomaly detection module, which is used for the student model to perform model training based on the encrypted soft label and local data, and perform device anomaly detection after the training is completed.

[0019] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the device anomaly detection method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the device anomaly detection method of the first aspect or any corresponding embodiment thereof.

[0021] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the device anomaly detection method according to the first aspect or any corresponding embodiment thereof.

[0022] In the sixth aspect, the present invention provides an anomaly detection system, including an edge device and a cloud, wherein a student model is deployed on the edge device and a teacher model is deployed on the cloud, for executing the device anomaly detection method of the first aspect or any corresponding embodiment thereof.

[0023] Because the abnormality detection system executes the device abnormality detection method, it has the same effect as the device abnormality detection method and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Figure 1 is a flow chart of a device anomaly detection method according to an embodiment of the present invention;

[0026] Figure 2 is a flow chart of another device abnormality detection method according to an embodiment of the present invention;

[0027] Figure 3 2. It is a schematic diagram of the encryption and distillation joint working of another device anomaly detection method according to an embodiment of the present invention;

[0028] Figure 4 2. It is a schematic diagram of a closed-loop safety response process according to another device anomaly detection method according to an embodiment of the present invention;

[0029] Figure 5 is a structural block diagram of a device abnormality detection apparatus according to an embodiment of the present invention;

[0030] Figure 6 is a block diagram of a component of an anomaly detection system according to an embodiment of the present invention;

[0031] Figure 7 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0033] Embodiments of the present invention are applicable to scenarios where the operating status of edge devices is monitored in industrial systems. Embodiments of the present invention provide a device anomaly detection method that, by building an anomaly detection system, deeply integrates knowledge distillation with security protection to improve the accuracy and security of device anomaly detection. Knowledge distillation (KD) is a model compression and optimization technology in machine learning. Its core concept is to allow a "small model" (student model) to learn the knowledge of a "large model" (teacher model), transferring the "implicit knowledge" (such as feature representation and data distribution patterns) contained in the teacher model to the student model, thereby reducing model complexity while maintaining high performance. The teacher model is typically a complex model with a large number of parameters and high performance (such as a large neural network), which may be pre-trained or trained on large-scale data. The student model is a model with a small number of parameters and a simple structure (such as a lightweight network), aiming to be efficiently deployed in resource-constrained scenarios (such as edge devices and mobile devices).

[0034] According to an embodiment of the present invention, an embodiment of a device anomaly detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0035] In this embodiment, a device anomaly detection method is provided, which can be used for terminal devices equipped with the above-mentioned device anomaly detection system, such as computers, etc. Figure 1 FIG. 1 is a flow chart of a device abnormality detection method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0036] In step S101, when the edge device detects a local threat based on the collected local data and the threat level exceeds a first preset threshold, the local data is encrypted and sent to the teacher model.

[0037] Specifically, in the embodiments of the present invention, in smart devices and network systems, edge devices serve as the frontier for data collection and preliminary processing, and undertake the important task of real-time monitoring of local threats. Edge devices continuously collect local data, such as network traffic data, device operating status data, user behavior data, etc. The built-in monitoring module of the edge device analyzes the local data to discover potential threats. The monitoring methods include rule-based detection, that is, a series of clear rules are set in advance, and when the data meets specific rules, it is determined that there is a threat; or a machine learning algorithm is used to establish a normal behavior pattern model by learning from a large amount of historical data. Once the current data deviates from the pattern to a certain extent, it is identified as an anomaly. For example, in network security monitoring, if the edge device detects a large number of access requests from the same IP address in a short period of time, and exceeds the threshold of normal access frequency, it will preliminarily determine that there may be a network attack threat.

[0038] In some optional implementations, in order to quantify the degree of threat, the edge device will perform a level assessment on the detected threat. The threat level is usually calculated based on preset indicators and weights. These indicators may involve factors such as the type of threat, scope of impact, and frequency of occurrence. For example, the threat level is divided into three levels: low, medium, and high. When the number of abnormal data packets detected exceeds 1,000 per minute, the threat level is assessed as high; between 500-1,000, it is medium; and less than 500 is low. Only when the threat level exceeds a pre-set first preset threshold (such as medium or high) will the subsequent data encryption and sending operations be triggered.

[0039] In some optional embodiments, when the threat level exceeds a first preset threshold, the edge device first preprocesses the collected local data. This includes data cleaning to remove duplicate, erroneous, or incomplete data; data normalization to convert data of varying formats and ranges to a unified standard for subsequent processing; and feature extraction to extract key information from the raw data that effectively reflects threat characteristics, such as the protocol type, source IP address, destination IP address, and port number in network traffic. To establish a security protection mechanism and ensure data security, the edge device encrypts the preprocessed data using an encryption algorithm. To minimize the impact on device performance, a lightweight and highly secure encryption algorithm, such as lightweight homomorphic encryption (TFHE), is typically selected. After data encryption is complete, the edge device needs to securely transmit the data to the teacher model. This transmission process is carried out using a secure communication protocol, such as TLS (Transport Layer Security) / SSL (Secure Sockets Layer). This protocol ensures that data cannot be eavesdropped, tampered with, or forged during transmission through an encrypted communication channel, identity verification, and data integrity verification.

[0040] In step S102, the teacher model generates an encrypted soft label based on the encrypted local data and sends the encrypted soft label to the student model.

[0041] Specifically, in an embodiment of the present invention, after the edge device sends the encrypted local data to the teacher model, the teacher model needs to process the data to generate soft labels and pass them to the student model, thereby achieving knowledge distillation and model optimization. The teacher model is located in a secure cloud environment. After receiving the encrypted data sent by the edge device, in order to achieve deep integration of security domain detection, it directly performs forward propagation in an encrypted state on the encrypted local data. Taking the teacher model as a neural network model as an example, its internal computing units (such as convolutional layers and fully connected layers) need to be adjusted to adapt to ciphertext calculations. In the convolutional layer, the teacher model uses multiplication and addition operations supported by the homomorphic encryption algorithm to convolve the encrypted image feature data with the ciphertext convolution kernel. For example, using TFHE (fully homomorphic encryption algorithm), the ciphertext feature map and the ciphertext convolution kernel are element-by-element multiplied and accumulated to obtain the encrypted convolution result. In the fully connected layer, the encrypted feature vector is matrix multiplied with the ciphertext weight matrix, and the ciphertext bias term is added, which is also achieved through the mathematical operation of homomorphic encryption. Due to their nonlinear nature, activation functions like ReLU typically use piecewise linear approximation to simulate the activation process within the ciphertext domain to ensure computational accuracy and feasibility. After multiple layers of encrypted computation, the teacher model outputs encrypted raw logits (scores that have not undergone softmax normalization). These logits contain preliminary classification or prediction information for the input data, but remain encrypted. Finally, encrypted soft labels are generated based on the raw logits.

[0042] In step S103 , the student model is trained based on the encrypted soft label and local data, and performs device anomaly detection after the training is completed.

[0043] Specifically, in an embodiment of the present invention, after the edge device where the student model is located receives the encrypted soft label sent by the teacher model, it decrypts it according to the encryption process to obtain an unencrypted soft label. At the same time, the student model performs forward propagation based on local data to obtain a hard label. The process includes: data cleaning, feature extraction, data enhancement, etc. The student model measures the difference in the output probability distribution of the student model and the teacher model (that is, the difference between the hard label and the soft label) through the KL divergence (Kullback-Leibler Divergence), and based on the training of the learning model, forces the student to learn the teacher's "knowledge", thereby obtaining a learning model with optimized performance. At this time, the learning model performs device anomaly detection.

[0044] The device anomaly detection method provided by the present invention monitors local threats based on collected local data at the edge device, and after the threat level exceeds a first preset threshold, encrypts the local data and sends it to the teacher model. The teacher model generates a soft label based on the encrypted local data and sends the encrypted soft label to the student model. The student model performs model training based on the encrypted soft label and local data, and performs device anomaly detection after the training is completed. By encrypting the local data, the present invention can ensure that the teacher model and the student model are trained based on the encrypted data, and the local data is always in an unexposed state, thereby building an edge-cloud security protection mechanism, achieving deep coupling of security domain detection, reducing data latency, and improving the accuracy and security of device anomaly detection.

[0045] In this embodiment, a device anomaly detection method is provided, which can be used for terminal devices equipped with the above-mentioned device anomaly detection system, such as computers, etc. Figure 2 FIG. 1 is a flow chart of a device abnormality detection method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0046] Step S201: When the edge device detects a local threat based on the collected local data and the threat level exceeds a first preset threshold, the local data is encrypted and sent to the teacher model. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0047] In step S202 , the teacher model generates an encrypted soft label based on the encrypted local data and sends the encrypted soft label to the student model.

[0048] Specifically, the above step S202 includes:

[0049] Step S2021: forward propagation based on the encrypted local data to obtain the original output value.

[0050] Specifically, in the embodiment of the present invention, Figure 3 As shown in the figure, when the edge device encrypts local data x (using a lightweight homomorphic encryption algorithm such as TFHE), generates the ciphertext Enc(x) (i.e., the encrypted features), and sends Enc(x) to the teacher model in the cloud, the plaintext data x is never exposed. This process is equivalent to offloading sensitive computing tasks to the cloud security sandbox. The cloud teacher model directly performs forward propagation in the encrypted state on Enc(x) to generate the encrypted original logits: Enc(z).

[0051] Step S2022: Probability prediction is performed on the original output value according to the activation function to obtain a first probability distribution, and the first probability distribution is used as the encrypted soft label.

[0052] Specifically, in this embodiment of the present invention, the cloud-based teacher model applies the encrypted domain Softmax (needs approximate calculation) to the encrypted logits: Enc(z) to obtain the encrypted soft label Enc(q_T). For example, the original output value (logits) of the teacher model is z teacher =[5.0,3.0,2.0], then q_T = softmax(z teacher / T), where T is the temperature parameter used to control the smoothness of the distribution. High temperature transfers coarse-grained knowledge, while low temperature transfers fine-grained knowledge. q_T is the output probability distribution of the teacher model after adjusting the temperature parameter T. For example, if T = 3, then: q_T = [e 5.0 / 3 / (e 5.0 / 3 +e 2.0 / 3 +e 3.0 / 3 ), e 3.0 / 3 / (e 5.0 / 3 +e 2.0 / 3 +e 3.0 / 3 ), e 2.0 / 3 / (e 5.0 / 3 +e 2.0 / 3 +e 3.0 / 3 )]≈[0.56,0.28,0.16]. In actual operation, q_T is the original soft label, and Enc(q_T) is the encrypted soft label.

[0053] Step S2023: Generate differential privacy noise and inject the differential privacy noise into the encrypted soft tag.

[0054] Specifically, in an embodiment of the present invention, an adversarial training module is integrated into the teacher model to generate soft labels containing noise perturbations, improve the robustness of the student model, and constitute a security-enhanced teacher-student model architecture. Therefore, after obtaining the encrypted soft label Enc(q_T), the cloud-based teacher model generates noise η~Laplace(0,Δ / ∈) that satisfies differential privacy, where: Δ is the sensitivity (the maximum possible change of the soft label, usually 2 / T); ∈ is the privacy budget (the smaller the value, the stronger the privacy protection). And the noise η is encrypted to Enc(η). The encrypted differential privacy noise Enc(η) is injected into the encrypted soft label Enc(q_T), that is, a homomorphic addition operation is performed in the encryption domain:

[0055] Enc(q_Tnoisy)=Enc(q_T)+Enc(η)

[0056] The noise is added in an encrypted state, so the cloud cannot know the specific values ​​of the original soft label and the noise. The cloud sends the encrypted soft label Enc(q_Tnoisy) back to the device edge. The transmission channel must use protocols such as TLS / SSL to ensure transmission security.

[0057] In step S203 , the student model is trained based on the encrypted soft label and local data, and performs device anomaly detection after the training is completed.

[0058] Specifically, the above step S203 includes:

[0059] Step S2031: Determine a security weight coefficient according to the threat level, and determine a dynamic security loss function according to the security weight coefficient.

[0060] Specifically, in this embodiment of the present invention, a security weight factor λ(t) is introduced into the traditional distillation loss (KL divergence), thereby dynamically adjusting the strength of knowledge transfer according to the real-time threat level (such as the frequency of network attacks). The traditional distillation loss function is as follows:

[0061] L_KD=T 2 *KL(q_T||p_T)

[0062] Among them, the KL divergence function is used to measure the difference between the output probability distributions of the teacher model and the student model. T is the temperature parameter, which is a key hyperparameter used to adjust the "softening" degree of the output probability distributions of the teacher model and the student model. Its core function is to control the granularity of knowledge transfer by changing the smoothness of the probability distribution. The temperature parameter T is equivalent to a "knowledge complexity regulator": at high temperatures (large T), the student model learns the coarse-grained knowledge of the teacher model (such as similarity between categories), which is suitable for the early training stage; at low temperatures (small T), the student model learns the fine-grained knowledge of the teacher model (such as high-confidence predictions of specific categories), which is suitable for later fine-tuning, and T 2 Used to balance gradient and loss scaling to ensure training stability. q_T is the output probability distribution of the teacher model after adjustment at temperature T, and p_T is the output probability distribution of the student model after adjustment at temperature T.

[0063] In some optional implementations, embodiments of the present invention introduce a security weight factor λ(t) into the traditional distillation loss function to obtain a dynamic security loss function, as shown below:

[0064] L_KD=λ(t)*T 2 *KL(q_T||p_T)

[0065] Here, λ(t) is a dynamic security weight coefficient, and λ(t) = f(r(t)). Here, r(t)∈[0,1] is the normalized real-time threat level, which controls the sensitivity of the weight to changes in threat. As the threat level r(t) increases (e.g., as the attack frequency increases), λ(t) can be increased to strengthen knowledge transfer, making the student model more dependent on the teacher's knowledge (assuming the teacher is resilient to attacks). Conversely, as the threat level decreases, this dependence is reduced, allowing the student model to autonomously adapt to new data.

[0066] Step S2032: decrypt the encrypted soft tag to obtain a first probability distribution, and forward propagate based on the local data to obtain a second probability distribution.

[0067] Specifically, in this embodiment of the present invention, the student model decrypts the encrypted soft label Enc(q_Tnoisy) to obtain the first probability distribution q_T of the teacher model, which is the teacher model's soft label. Simultaneously, the student model forward propagates based on local data (such as vibration and temperature) to obtain the second probability distribution p_T, which is the student model's hard label.

[0068] Step S2033 , performing calculations based on the dynamic security loss function, the first probability distribution, and the second probability distribution to determine whether the function value of the dynamic security loss function is less than a second preset threshold.

[0069] In some optional implementations, the first probability distribution q_T and the second probability distribution p_T are substituted into the aforementioned dynamic security loss function to calculate the function value of the dynamic security loss function. Asymmetry requires that the probability distribution q_T of the teacher model be used as the target, and the probability distribution p_T of the student model must approximate the probability distribution q_T of the teacher model. In other words, the function value of the dynamic security loss function must be less than a pre-set threshold.

[0070] Step S2034: If it is not less than the second preset threshold, the model parameters of the student model are adjusted until the function value of the dynamic security loss function is less than the second preset threshold.

[0071] Specifically, in an embodiment of the present invention, if the first probability distribution q_T and the second probability distribution p_T differ significantly, backpropagation is used to update the model parameters of the student model until the probability distribution p_T of the student model approaches the probability distribution q_T of the teacher model. At the same time, the updated model parameters are encrypted and sent to the teacher model, for example, via lightweight encryption (such as TFHE) to the cloud, and a hash signature (such as SHA-256) is attached to ensure parameter integrity, so that the teacher model updates the global model parameters.

[0072] Step S204, obtaining updated model parameters of multiple student models; performing weighted averaging on each updated model parameter, or performing calculation based on a secure aggregation algorithm to obtain a global model parameter.

[0073] Specifically, in an embodiment of the present invention, the cloud-based teacher model receives student model parameters from multiple edge devices, performs weighted averaging or secure aggregation algorithms (such as SecureAggregation) through a federated learning framework (such as FedAvg), generates global model parameters, and updates the robustness parameters of the teacher model, such as the perturbation generation strategy of the adversarial training module (step size and number of iterations of PGD attacks) and the intensity of differential privacy noise (privacy budget of Laplace noise). At the same time, the threat knowledge base is updated, including: abnormal feature patterns, attack logs and other security-related data, which are used to dynamically adjust security policies (such as threat level assessment weights). According to the global threat knowledge base (such as high-frequency attack patterns), the noise injection strategy and adversarial training intensity of the teacher model are adjusted.

[0074] In some optional implementations, federated learning (FLT) is a decentralized machine learning technology whose core concept is to enable multiple participants (e.g., devices, servers, and organizations) to collaboratively train or update a globally shared model without sharing local data. This process is particularly suitable for privacy-sensitive or data-distributed scenarios. Regarding privacy protection and data security, when an edge device detects an anomaly, each device (e.g., sensor, node) may have accumulated a large amount of local data (e.g., anomaly signatures, operation logs). Federated learning allows these devices to upload only model parameters or knowledge (rather than raw data), preventing the leakage of sensitive information (e.g., device operation details) and complying with privacy regulations (e.g., GDPR). For distributed knowledge aggregation, all participating devices train their own models (e.g., anomaly detection models) locally and only transmit model updates (e.g., gradients, weights) encrypted to a central server. The server then integrates these updates using aggregation algorithms (e.g., FedAvg) to generate a more robust global threat knowledge base. For example, when a device detects a new temperature anomaly pattern, the "experience" of its local model is incorporated into the global model, enabling other devices to identify similar threats. The above operations improve the dynamic adaptability of the device anomaly detection system. In industrial systems, devices may face ever-changing threats (such as new attacks and hardware failure modes). The federated learning framework, through periodic local training and global aggregation, allows the threat knowledge base to continuously evolve, adapting to new scenarios without manual intervention. Furthermore, unlike centralized training (which requires uploading massive amounts of data), federated learning only transmits lightweight model parameters, reducing network bandwidth pressure. Furthermore, local training can leverage the device's idle computing power, avoiding over-reliance on central servers.

[0075] In some optional implementations, such as Figure 4 As shown in the example, when a device anomaly (such as an over-temperature condition) occurs, federated learning is used to detect it. The anomalous device uses local data to update its own anomaly detection model, generating a model increment Δ. This Δ is encrypted and uploaded to the blockchain for evidence storage, participating in federated aggregation. The global threat knowledge base integrates the Δ from all devices to generate a new version of the model. After other devices download the new model, they can receive early warning of similar anomalies, even if they have never experienced the same type of failure. This mechanism protects the privacy of individual data points while enabling the collaborative evolution of swarm intelligence. It is a key technology in privacy-sensitive fields such as the Industrial Internet of Things and healthcare.

[0076] The device anomaly detection method provided by the present invention monitors local threats based on the collected local data at the edge device, and after the threat level exceeds a first preset threshold, encrypts the local data and sends it to the teacher model. The teacher model generates a soft label based on the encrypted local data and sends the encrypted soft label to the student model. The student model performs model training based on the encrypted soft label and local data, and performs device anomaly detection after the training is completed. By encrypting the local data, the present invention can embed a security verification layer (such as model hash signature), dynamic encrypted transmission (such as lightweight homomorphic encryption) and a threat-driven task offloading mechanism in the knowledge distillation framework, ensuring that the teacher model and the student model are trained based on the encrypted data, and the local data is always in an unexposed state, thereby building an edge-cloud security protection mechanism, realizing deep coupling of security domain detection, realizing a closed loop of "detection-protection-self-healing", reducing data latency, and improving the accuracy and security of device anomaly detection.

[0077] This embodiment also provides a device anomaly detection device for implementing the above-mentioned embodiments and preferred embodiments. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0078] This embodiment provides a device abnormality detection device, such as Figure 5 As shown, including:

[0079] The data monitoring module 501 is used to encrypt the local data and send it to the teacher model when the edge device detects a local threat based on the collected local data and the threat level exceeds a first preset threshold.

[0080] The task offloading module 502 is used for the teacher model to generate an encrypted soft label based on the encrypted local data and send the encrypted soft label to the student model.

[0081] The anomaly detection module 503 is used for the student model to perform model training based on the encrypted soft label and local data, and to perform device anomaly detection after the training is completed.

[0082] In some optional implementations, the task offloading module 502 includes:

[0083] The model prediction unit is used to forward propagate based on the encrypted local data to obtain the original output value.

[0084] The label generation unit is used to perform probability prediction on the original output value according to the activation function to obtain a first probability distribution, and use the first probability distribution as the encrypted soft label.

[0085] The noise injection unit is used to generate differential privacy noise and inject the differential privacy noise into the encrypted soft tag.

[0086] In some optional implementations, the anomaly detection module 503 includes:

[0087] The function building unit is used to determine a security weight coefficient according to the threat level, and to determine a dynamic security loss function according to the security weight coefficient.

[0088] a probability distribution determining unit, configured to decrypt the encrypted soft tag to obtain a first probability distribution, and forward propagate the local data to obtain a second probability distribution;

[0089] The dynamic loss judgment unit is used to perform calculations based on the dynamic safety loss function, the first probability distribution, and the second probability distribution to determine whether the function value of the dynamic safety loss function is less than a second preset threshold.

[0090] The model parameter adjustment unit is used to adjust the model parameters of the student model if it is not less than the second preset threshold value until the function value of the dynamic security loss function is less than the second preset threshold value.

[0091] In some optional implementations, the anomaly detection module 503 further includes:

[0092] The model parameter uploading unit is used to encrypt the updated model parameters and send the updated model parameters to the teacher model so that the teacher model updates the global model parameters.

[0093] In some optional embodiments, the device also includes: a federated learning module for obtaining updated model parameters of multiple student models; performing weighted averaging on each updated model parameter, or calculating based on a secure aggregation algorithm to obtain global model parameters.

[0094] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0095] The device anomaly detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0096] The embodiment of the present invention also provides an anomaly detection system, including an edge device and a cloud, wherein a student model is deployed on the edge device and a teacher model is deployed on the cloud for performing the above Figure 1 or Figure 2 The device anomaly detection method shown.

[0097] Specifically, in the embodiment of the present invention, Figure 6 As shown, the cloud teacher model includes an adversarial training module (injecting adversarial sample generators such as FGSM during the distillation process to train student models to identify and filter malicious inputs) and a differential privacy module. The edge device student model includes a lightweight security verification layer, a dynamic security loss function, and a threat level detection module. The edge device is deployed with a threat response module for executing blockchain evidence and device isolation instructions, thereby dynamically adjusting the security loss weight according to the real-time threat level, triggering task offloading and device Gree. The embodiment of the present invention can realize the linkage between anomalies and threats based on a closed-loop security response strategy, such as Figure 4 As shown in the figure, when the student model detects an equipment anomaly (such as temperature exceeding the standard), the security protocol is automatically triggered: the abnormal equipment is isolated and the backup node is started; the abnormal characteristics and operation logs are encrypted and uploaded to the blockchain for evidence storage; and the global threat knowledge base is updated based on the federated learning framework.

[0098] Because the abnormality detection system executes the device abnormality detection method, it has the same effect as the device abnormality detection method and will not be described in detail here.

[0099] The embodiment of the present invention also provides a computer device having the above Figure 5 The equipment abnormality detection device shown.

[0100] See also Figure 7 , Figure 7 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0101] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0102] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0103] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0104] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0105] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0106] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0107] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.

[0108] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A device anomaly detection method, characterized in that: Applied to an anomaly detection system, the anomaly detection system includes an edge device and a cloud, the edge device is deployed with a student model, and the cloud is deployed with a teacher model, the method includes: When the edge device detects a local threat based on the collected local data and the threat level exceeds a first preset threshold, the local data is encrypted and sent to the teacher model; The teacher model generates an encrypted soft label based on the encrypted local data, and sends the encrypted soft label to the student model; The student model performs model training based on the encrypted soft label and the local data, and performs device anomaly detection after the training is completed.

2. The method according to claim 1, characterized in that The teacher model generates an encrypted soft label according to the encrypted local data and sends the encrypted soft label to the student model, including: Based on the forward propagation of the encrypted local data, the original output value is obtained; Performing probability prediction on the original output value according to the activation function to obtain a first probability distribution, and using the first probability distribution as the encrypted soft label; Generating differential privacy noise and injecting the differential privacy noise into the encrypted soft tag.

3. The method according to claim 2, characterized in that The student model performs model training based on the encrypted soft label and the local data, and performs device anomaly detection after the training is completed, including: Determining a security weight coefficient according to the threat level, and determining a dynamic security loss function according to the security weight coefficient; Decrypting the encrypted soft tag to obtain the first probability distribution, and forward-propagating the local data to obtain a second probability distribution; performing calculations based on the dynamic safety loss function, the first probability distribution, and the second probability distribution to determine whether a function value of the dynamic safety loss function is less than a second preset threshold; If it is not less than the second preset threshold, the model parameters of the student model are adjusted until the function value of the dynamic security loss function is less than the second preset threshold.

4. The method according to claim 3, characterized in that After adjusting the model parameters of the student model until the function value of the dynamic security loss function is less than the second preset threshold, the method further includes: The updated model parameters are encrypted and sent to the teacher model so that the teacher model updates the global model parameters.

5. The method according to claim 4, characterized in that The teacher model updates the global model parameters, including: Obtaining updated model parameters of a plurality of the student models; The global model parameters are obtained by performing a weighted average on each of the updated model parameters or performing calculations based on a secure aggregation algorithm.

6. A device for detecting abnormality of equipment, characterized in that: Applied to an anomaly detection system, the anomaly detection system includes an edge device and a cloud, the edge device is deployed with a student model, the cloud is deployed with a teacher model, and the device includes: A data monitoring module, configured to encrypt and send the local data to the teacher model when the edge device detects a local threat based on the collected local data and the threat level exceeds a first preset threshold; A task offloading module, configured for the teacher model to generate an encrypted soft label based on the encrypted local data and send the encrypted soft label to the student model; An anomaly detection module is used for the student model to perform model training based on the encrypted soft label and the local data, and to perform device anomaly detection after the training is completed.

7. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the device abnormality detection method according to any one of claims 1 to 5 by executing the computer instructions.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the device abnormality detection method according to any one of claims 1 to 5.

9. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the device abnormality detection method according to any one of claims 1 to 5.

10. An anomaly detection system, characterized in that: It includes an edge device end and a cloud end, wherein the edge device end is deployed with a student model, and the cloud end is deployed with a teacher model, and is used to execute the device anomaly detection method according to any one of claims 1 to 5.