Industrial internet equipment anomaly detection method and system based on block chain and federated learning

By combining blockchain smart contracts and lightweight model pruning with multi-dimensional contribution evaluation, the problems of data privacy and resource efficiency in the Industrial Internet of Things are solved, achieving efficient anomaly detection and collaborative modeling, and improving the robustness and fairness of the system.

CN121644211APending Publication Date: 2026-03-10XIDIAN UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies in the Industrial Internet of Things (IIoT) suffer from insufficient data privacy protection and resource efficiency optimization, especially on edge devices where model training and communication overhead are too high, making it difficult to achieve efficient anomaly detection and collaborative modeling.

Method used

Decentralized registration is achieved using blockchain smart contracts, combined with lightweight model pruning and multi-dimensional contribution evaluation algorithms. Through the combination of blockchain and federated learning, dynamic election committee nodes are used to perform model aggregation and anomaly detection.

Benefits of technology

This approach improves model efficiency and real-time anomaly detection while protecting data privacy, reduces computational and communication overhead for edge devices, and enhances system robustness and fairness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644211A_ABST
    Figure CN121644211A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial internet equipment anomaly detection method and system based on a block chain and federal learning. The method comprises the following steps: realizing decentralized registration of industrial nodes and on-chain release of an initial global model by using a block chain smart contract; training a global model by each node based on local data, and carrying out lightweight processing through model pruning; a multi-dimensional contribution scoring mechanism is adopted, the training quality, the data scale and the computing resource contribution of the nodes are comprehensively evaluated, and committee nodes are dynamically elected according to the training quality and the data scale; the committee node performs weighted aggregation on the verified local model, generates an updated global model and writes summary information of the updated global model into the block chain; and finally, carrying out real-time anomaly detection and alarm on log data of the industrial equipment based on the global model. According to the invention, on the premise of protecting data privacy, efficient and fair cooperative training and reliable anomaly monitoring are realized, and the method is suitable for an industrial Internet of Things environment with limited resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial equipment testing technology, specifically to an industrial internet equipment anomaly detection method and system based on blockchain and federated learning. Background Technology

[0002] The Industrial Internet of Things (IIoT) connects physical devices to the internet, enabling interconnectivity and data sharing between devices. With the rapid development of IIoT, the amount of data generated by industrial equipment is exploding. This data not only includes equipment operating status and production process information, but also involves core competitiveness and trade secrets of enterprises. Therefore, how to fully utilize this data to improve service quality while ensuring data privacy has become a significant challenge for IIoT. In the IIoT environment, the massive amounts of data generated by devices contain enormous value. However, data privacy protection and resource efficiency optimization have become key bottlenecks in achieving data sharing: traditional data sharing methods typically require centralized storage of data on a central server, which may lead to system paralysis due to single points of failure; industrial equipment resources, computing power, and storage space are limited. Blockchain, as a decentralized trust mechanism, can effectively solve the trust problem in data sharing. However, existing blockchain consensus algorithms (such as Proof-of-Work) suffer from problems such as high computational overhead and insufficient evaluation of data quality and contribution. In the Industrial Internet of Things (IIoT) scenario, the combination of federated learning and blockchain has gradually become a research hotspot to achieve cross-device collaborative modeling while ensuring data privacy. Blockchain provides a decentralized trust foundation for federated learning, which can avoid single points of failure and trust risks caused by centralized servers to a certain extent. However, existing blockchain consensus mechanisms still face significant limitations in industrial applications. Traditional consensus algorithms, represented by Proof of Work (POW) and Proof of Stake (POS), typically require nodes to consume a large amount of computing resources or rely on single indicators such as computing power and funds for election. This leads to high energy consumption and operating costs in large-scale IIoT environments, especially posing a heavy burden on edge devices with limited computing power and energy consumption. In addition, existing consensus mechanisms focus more on node participation and the correctness of transaction verification in their design, while not giving sufficient consideration to factors such as device data quality and model training effectiveness. This makes it difficult to accurately reflect the true contributions of different devices in the federated learning process, thus affecting the quality of model aggregation and the overall performance of the system.

[0003] On the other hand, existing federated learning methods generally rely on deep neural network models with large parameter sizes. In the context of highly heterogeneous data in distributed industrial equipment, each device generates numerous local model updates during local training, a significant portion of which are redundant. These high-dimensional model parameters require frequent synchronization and storage via blockchain or other decentralized networks, significantly increasing the storage pressure on the blockchain and leading to a sharp rise in communication overhead and network load. This can easily create bandwidth and latency bottlenecks, thereby reducing system response speed and operational efficiency. These problems are particularly pronounced in edge computing and low-bandwidth industrial environments. Although existing federated learning has made some progress in distributed collaborative training, research on model lightweighting and resource optimization remains insufficient. Existing frameworks generally lack the systematic introduction of compression techniques such as model pruning, quantization, or knowledge distillation, making it difficult to efficiently deploy models on resource-constrained industrial equipment.

[0004] Due to the rapid growth in the number and types of distributed industrial equipment and their information systems, the Industrial Internet faces higher requirements in terms of cloud platform availability, system reliability, and large-scale data processing. Data privacy protection and resource utilization efficiency are gradually becoming key factors restricting its intelligent development. Therefore, building anomaly detection systems for distributed industrial equipment is considered an effective way to improve the security and stability of equipment clusters. Industrial equipment is affected by various factors such as environmental changes, user operations, and inter-equipment interactions during operation, resulting in highly dynamic status and critical operational information. The integration of federated learning and blockchain provides a new technical path for achieving cross-equipment collaborative modeling and security protection while protecting equipment data privacy. To address the aforementioned needs, existing technical solutions have proposed combining blockchain with federated learning or equipment anomaly detection. For example, the invention "A Blockchain-Based Federated Learning System and Method" (application number: CN202311008916.3) records the model parameter update and verification process using blockchain and utilizes smart contracts to ensure the credibility of model training and data privacy security. The invention "A Blockchain-Based Equipment Anomaly Detection System" (application number: CN202311029035.4) utilizes the immutability of blockchain to store and manage equipment logs and anomaly information, thereby improving the authenticity of anomaly information. However, these solutions mainly focus on storing model parameters or recording anomaly information and have not yet systematically optimized aspects such as equipment data quality, model training contribution, and model size and communication overhead in resource-constrained scenarios. They are therefore unable to simultaneously meet the real-time requirements of fair incentives, efficient collaboration, and industrial equipment anomaly detection. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention provides an industrial internet device anomaly detection method and system based on blockchain and federated learning. Through a decentralized parameter aggregation mechanism, a multi-dimensional contribution evaluation algorithm, and a lightweight model dynamic pruning method, a balance between data privacy protection and resource efficiency optimization is achieved.

[0006] This invention is achieved through the following technical solution: A method for detecting anomalies in industrial internet devices based on blockchain and federated learning, characterized by the following steps: Decentralized registration of industrial nodes is achieved using blockchain smart contracts, and the initial global model is published to the blockchain for all nodes to access; Each node uses local data to train the initial global model, and then performs lightweight processing on the trained local model to obtain a lightweight local model. The contribution score of each node is calculated based on a multi-dimensional contribution scoring mechanism. The multi-dimensional contribution score includes at least: training quality score based on local model prediction error, data scale score based on local training data volume, and node computing resource score. Based on the contribution scores of each node, a committee node is elected. The committee node then performs weighted aggregation on the verified local models to generate an updated global model. Anomaly detection is performed on the log data of industrial nodes based on the updated global model.

[0007] Preferably, the step of using blockchain smart contracts to achieve decentralized registration of industrial nodes and publishing the initial global model to the blockchain for all nodes to obtain includes: All industrial equipment is registered through blockchain smart contracts, generating a unique digital identity.

[0008] The cloud layer publishes the initial global model to the blockchain, and each industrial node obtains the initial global model from the blockchain and deploys it locally.

[0009] Preferably, when each industrial node obtains the initial global model from the blockchain, it verifies the validity of the industrial node's version identifier and digital signature through a smart contract.

[0010] Preferably, the lightweighting process in step 2 includes at least one of model pruning, model quantization, or knowledge distillation.

[0011] Preferably, the method for lightweighting the local model through model pruning is as follows: The local model is pruned using the Drop-Connect method. The weight matrix of each layer in the local model is traversed, and connections with absolute weight values ​​less than a preset threshold are set to zero. The pruned local model is then fine-tuned to obtain a lightweight local model.

[0012] Preferably, the training quality score Calculation of mean absolute error based on the local model:

[0013] The data size score The calculation method is as follows:

[0014] The resources and consensus participate in the scoring. The calculation method is as follows:

[0015] in, As a smoothing factor, MAE The mean absolute error, For resource indicators.

[0016] Preferably, the step of electing a committee node based on the contribution scores of each node, and having the committee node perform weighted aggregation of the validated local models, specifically includes: In each iteration, the verified candidate nodes are ranked based on the contribution score of each node; The top K nodes with the highest contribution scores are selected to form the committee set for this round, where K is a preset committee size parameter; The nodes in the committee set are responsible for weighted aggregation of the validated local models to generate an updated global model; The committee set is only valid within the current t-th iteration and is re-elected in the next iteration based on the updated contribution score.

[0017] Preferably, after the committee node generates the updated global model, the following steps are further included: A digest hash calculation is performed on the updated global model, and the digital signature endorsement is jointly completed by committee members. The transaction record containing the digest hash, model version number, node identifiers participating in the aggregation, and their corresponding contribution scores is written into the blockchain ledger; The updated global model information written into the blockchain will serve as the global model that each node acquires and trains locally in the next round of federated learning iterations.

[0018] Preferably, the anomaly detection of the log data of industrial nodes based on the updated global model specifically includes: Extract text feature vectors from the log data; Based on the updated global model obtained from the blockchain, anomaly probability calculation and classification are performed on the text feature vector; When the probability of an anomaly exceeds a preset threshold, a real-time alarm is triggered.

[0019] An industrial internet device anomaly detection system based on blockchain and federated learning includes: The registration and initialization module is used to implement decentralized registration of industrial nodes using blockchain smart contracts, and publish the initial global model to the blockchain for all nodes to obtain; The local training and lightweight module is used by each node to perform initial global model training using local data, and to perform lightweight processing on the trained local model to obtain a lightweight local model. The contribution evaluation module is used to calculate the contribution score of each node based on a multi-dimensional contribution scoring mechanism. The multi-dimensional contribution score includes at least: training quality score based on local model prediction error, data scale score based on local training data volume, and node computing resource score. The committee election and aggregation module is used to elect committee nodes based on the contribution scores of each node. The committee nodes then perform weighted aggregation on the verified local models to generate an updated global model. An anomaly detection module is used to perform anomaly detection on the log data of industrial nodes based on the updated global model.

[0020] Compared with the prior art, the present invention has the following beneficial technical effects: This application provides an industrial internet device anomaly detection method combining blockchain and federated learning. Its technical principle lies in constructing a decentralized collaborative training and detection framework. First, the method uses blockchain smart contracts to achieve trusted registration of industrial nodes and on-chain publication of the initial global model, ensuring that each node securely obtains the baseline model without the need for a centralized server. Subsequently, each node trains the model based on local data and reduces model size and communication load through lightweight techniques such as model pruning. An innovative multi-dimensional contribution scoring mechanism is introduced, comprehensively considering factors such as training quality, data scale, and computing resources to quantitatively evaluate node contributions and dynamically elect committee nodes to perform model aggregation tasks, thereby achieving high-quality iterative updates of the global model while protecting data privacy. Finally, the updated global model is used for real-time anomaly detection and alerting on device logs. The main advantages of this scheme are: it achieves decentralized trust and audit trail through blockchain, effectively preventing single points of failure and data tampering; it adopts a multi-dimensional contribution evaluation and dynamic committee mechanism, which improves the fairness of participating nodes and the robustness of the system; combined with lightweight model processing, it significantly reduces the computing and communication overhead of edge devices, making them more suitable for resource-constrained industrial IoT environments; and overall, it achieves an effective balance in ensuring data privacy, improving model efficiency, and enhancing the real-time performance of anomaly detection.

[0021] This application also proposes an industrial internet device anomaly detection system based on blockchain and federated learning, an electronic device, and a computer storage medium, which possess all the advantages of the aforementioned industrial internet device anomaly detection methods based on blockchain and federated learning. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a layered architecture diagram of the distributed industrial internet service cloud platform of this invention; Figure 2 This is a flowchart illustrating the construction process of the industrial internet anomaly detection platform of the present invention. Figure 3 This is a flowchart illustrating the lightweighting process of the model in this invention. Figure 4 This is a flowchart illustrating the interaction between federated learning and blockchain in this invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0025] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0026] In distributed Industrial Internet of Things (IIoT) systems, issues such as data privacy leaks, inefficient models, and insufficient anomaly detection capabilities can lead to devices being driven into incompatible states due to malicious attacks or operational errors, resulting in significant losses.

[0027] An anomaly detection method for industrial internet devices based on blockchain and federated learning includes the following steps: Step 1: Implement decentralized registration of industrial nodes using blockchain smart contracts, and publish the initial global model to the blockchain for all nodes to obtain; Leveraging the distributed ledger and automated execution capabilities of smart contracts in blockchain, a decentralized and tamper-proof trusted infrastructure for device identity and model initialization is constructed. Smart contracts, acting as automatically executed rules, ensure that the registration information of each industrial node (such as digital identity and public key) is permanently and transparently recorded on the chain, eliminating the risk of forgery and repudiation from single-point registration servers. Simultaneously, the initial global model is published to the blockchain in the form of transactions, allowing all nodes to synchronously obtain the same baseline model from this trusted source, laying a unified and verifiable starting point for subsequent distributed federated learning. Its advantages lie in replacing traditional centralized trust institutions with technological means, establishing a foundation of mutual trust among participating nodes from the system startup phase, enhancing the system's resistance to attacks and transparency, and avoiding systemic risks that could result from single-point failure or malicious behavior of the central server.

[0028] Step 2: Each node uses local data to train the initial global model, and then performs lightweight processing on the trained local model to obtain a lightweight local model. Following the basic paradigm of federated learning, which involves using the industrial data of each node to perform personalized training and optimization of the global model without leaving the local machine, the system proactively performs lightweight processing (such as pruning and quantization) on the model after local training. This addresses the resource constraints of industrial IoT edge devices, seeking an optimal balance between model accuracy and computational, storage, and communication overhead. Lightweight processing significantly compresses the model size by removing redundant parameters or reducing numerical precision. Its advantages are twofold: first, it strictly protects the local data privacy of each node, eliminating the need to upload raw data; second, the generated lightweight local model greatly reduces the overhead of uploading model parameters, blockchain storage, and network transmission in subsequent steps, making the entire system more adaptable to low-bandwidth, high-latency, or computationally limited industrial environments.

[0029] Step 3: Calculate the contribution score of each node based on the multi-dimensional contribution scoring mechanism. The multi-dimensional contribution score includes at least: training quality score based on local model prediction error, data scale score based on local training data volume, and node computing resource score. A quantitative evaluation system comprehensively measures the true contribution of each node to the federated learning process. It integrates multiple dimensions, including training quality (reflecting model effectiveness), data scale (reflecting information contribution), and computing resources (reflecting system support), and fuses these heterogeneous indicators into a unified contribution score using mathematical methods (such as normalization and weighted summation). This effectively identifies and incentivizes high-quality nodes that provide high-quality data, train excellent models, or contribute stable computing power, while suppressing the negative impact of low-quality or malicious nodes. This mechanism guides nodes to not only pursue participation but also focus on the value and quality of their contributions, thereby optimizing the input sources for model aggregation at the system level. This provides an intrinsic driving force for producing a better global model and solves the incentive incompatibility problem of traditional consensus mechanisms in federated learning scenarios.

[0030] Step 4: Elect a committee node based on the contribution scores of each node. The committee node then performs weighted aggregation on the verified local models to generate an updated global model. A temporary committee is formed based on contribution scores, entrusting the crucial task of model aggregation to a group of trusted nodes that have made the most significant contributions in the current round. Committee nodes are responsible for weighted aggregation of validated local models; the weights are typically positively correlated with contribution scores, ensuring that high-quality contributions have a greater impact on the global model. The advantages are twofold: first, enhanced security, as critical operations are handled by a cluster of high-contribution, highly trustworthy nodes, reducing the risk of malicious nodes manipulating the aggregation process; second, a balance between efficiency and fairness, as dynamic election avoids power solidification, incentivizes nodes to continuously contribute to gain entry into the committee, and the controllable committee size reduces the complexity and overhead of direct communication between large numbers of nodes, making the model update process more efficient and controllable.

[0031] Step 5: Perform anomaly detection on the log data of industrial nodes based on the updated global model.

[0032] This model performs real-time or near real-time feature extraction and pattern recognition on log data generated during industrial equipment operation to determine whether it deviates from normal behavior patterns, thereby achieving anomaly detection. Its key advantages are: continuously evolving detection capabilities; due to the global model originating from distributed learning across numerous nodes, its generalization ability and potential for identifying novel anomalies are superior to models trained on a single device; high reliability of detection results; the model itself originates from an aggregation process verified and recorded by blockchain, ensuring traceability of its source and version, enhancing the reliability and auditability of the detection results; and ultimately, it achieves a complete closed loop from data privacy protection and collaborative model optimization to practical security protection, applying cutting-edge collaborative learning technology to real-world industrial equipment status monitoring and security assurance.

[0033] Example 1 This invention addresses the uncertainty of operational status and the complexity of industrial internet equipment application scenarios by proposing a lightweight federated learning system based on blockchain. It designs a blockchain-federated learning-based anomaly detection method for industrial internet equipment, stores industrial equipment training data in the blockchain, and performs federated learning through smart contract coordination. Machine learning and data mining algorithms are then used for hazard monitoring, effectively ensuring the security of equipment clusters during collaborative processes in the industrial internet. The distributed industrial internet service cloud platform's layered architecture is as follows: Figure 1As shown, the architecture is divided into four layers: cloud layer, intelligent consensus layer, edge layer, and local layer. The cloud layer comprises powerful computing, communication, and storage servers, responsible for supervising the task training process and delivering the global model to the task publisher when accuracy requirements are met. The intelligent consensus layer records the global model and edge models based on the PODQ consensus mechanism, supporting data isolation and privacy protection. Edge nodes are responsible for rapid consensus and data computation, reducing communication pressure on the cloud. The local layer consists of local devices with limited computing and communication capabilities, responsible for training local models and uploading them to the edge nodes.

[0034] See Figure 1-4 This application provides a method for detecting anomalies in industrial internet devices based on blockchain and federated learning, including the following steps: Step 1: Store the digital identity of each industrial device on the blockchain; Deploy the global model locally; The cloud publishes the initial global model to the blockchain, and each device retrieves the initial global model from the blockchain and deploys it locally.

[0035] like Figure 2 The diagram shows the construction process of an industrial internet anomaly detection platform. It achieves the sharing and collaboration of industrial equipment on a cloud platform through the integration of blockchain and federated learning, including the following steps: S1.1: Device registration.

[0036] All industrial equipment is registered through blockchain smart contracts, generating a unique digital identity.

[0037] Registration information includes device ID, public key, and initial computing power score, which are stored in the blockchain's "device registry".

[0038] S1.2: Global model initialization.

[0039] Cloud releases initial global model To the blockchain, each device obtains the initial global model from the blockchain. And deploy it locally.

[0040] Step 2: Each industrial device uses local data to iteratively train the initial global model, adjusts the model parameters by optimizing the loss function, obtains the trained initial model, and then sparsifies the initial model to obtain the local model.

[0041] S2.1: Local training.

[0042] See Figure 3 Each device in the first During each iteration, data is collected from sensors and equipment mounted on industrial devices. Data is acquired from sources such as GPS, PLC, instruments, and various controllers to form the global model. Perform personalized training to obtain a local initial model.

[0043] S2.2: Personalized local training.

[0044] equipment The parameters are obtained by solving the following optimization objective locally. :

[0045] in, Here, represents the task loss function; represents the personalization intensity coefficient. Used to balance "fitting local data" and "aligning with the global model".

[0046] S2.3: Model sparsification.

[0047] The Drop-Connect pruning method is used to prune the local initial model. The weight matrix of each layer in the local initial model is traversed, and the weights with an absolute value less than 0.01 are reset to 0 to make the weight connection matrix sparse. The same optimizer and loss function as the pre-training model are used to train the pruned local initial model in a small number of iterations, adjust the weights of the remaining connections, optimize the model performance, and obtain the local model.

[0048] For the local initial model Each layer of weight matrix Constructing pruning codes Threshold pruning is used:

[0049] in This is the pruning threshold. The weights after pruning are:

[0050] And define the sparsity rate of the model:

[0051] in Indicates the number of non-zero elements. Indicates the total number of parameters.

[0052] S2.4: Fine-tuning after pruning.

[0053] After performing Drop-Connect-based model pruning, the model structure becomes sparsified due to the zeroing of some weight connections, which may lead to a decrease in the expressive power of local features. To ensure the prediction accuracy and convergence stability of the pruned model in anomaly detection tasks, fine-tuning of the pruned model is necessary.

[0054] Specifically, the device uses the same optimizer type, learning rate strategy, and loss function as the pre-training stage before pruning to train the pruned local model. In local dataset Execution In each fine-tuning iteration, the backpropagation algorithm is used to update only the weight parameters corresponding to the preserved connections, gradually adapting the model to the sparse structure and restoring performance. The fine-tuning process can be represented as:

[0055] in Indicates the first Device in round iteration The final local upload model generated.

[0056] After fine-tuning, the device performs statistical analysis and evaluation of model performance and resource consumption, and generates corresponding model metadata.

[0057] Model metadata includes, but is not limited to: the number of local training samples. Model error metrics (such as mean absolute error (MAE)) and model pruning sparsity calculated based on local validation sets or sampled validation data. The model parameters and metadata include changes in their scale, as well as latency and energy consumption information during model training and fine-tuning. These model parameters and metadata will serve as inputs for subsequent model validation, contribution evaluation, and incentive mechanism calculations.

[0058] Step 3: The smart contract uploads the verified local model to the blockchain. The PODQ incentive mechanism is used to determine the node contribution score of each verified device. Based on all node contribution scores, a committee node is dynamically elected. This committee node securely aggregates the verified local models to generate an updated global model; details are as follows: S3.1: Model Upload and Validation.

[0059] See Figure 4 Industrial equipment uploads the pruned model and its metadata (data volume, MAE) to the edge layer. During model updates, each modification or optimization generates a unique hash value, which is generated from the model content using an encryption algorithm and represents the uniqueness of the current model. The smart contract verifies this hash value and the model's digital signature to confirm consistency with the stored hash value, thus eliminating any possibility of tampering or forgery. During transactions, each model update is marked as a "model update" transaction and is recorded in the blockchain's transaction log.

[0060] S3.2: Contribution score calculation.

[0061] To achieve a fair assessment of device node contributions in a federated learning and blockchain integration scenario, and to avoid the contribution imbalance problem caused by traditional consensus mechanisms that incentivize solely based on computing power or participation behavior, this invention proposes a multi-dimensional contribution scoring mechanism (PODQ) based on training quality scoring, data scale and effective training workload scoring, and resource and consensus participation scoring. In each round of federated learning iterations, for each node that passes on-chain verification... Calculate its score Furthermore, a normalized weighting method is used to uniformly quantify indicators with different dimensions to ensure the comparability and stability of the scoring results.

[0062] 1) Training quality score

[0063] Training quality measures the effectiveness of a node's local model in anomaly detection tasks. After completing local training and pruning fine-tuning, a node calculates a model prediction error metric, such as Mean Absolute Error (MAE), based on local validation data or a system-specified validation set. Since a smaller error metric indicates better model performance, to facilitate unified processing with other positive metrics, the error metric is linearly normalized and inversely mapped to a training quality score.

[0064] in, This is a smoothing factor used to prevent the denominator from being zero. By using the above method, the training quality score can be ensured to be within a certain range. The higher the model accuracy, the higher the score for nodes that vary within the range.

[0065] 2) Data size and effective training workload score

[0066] The data size reflects the number of effective training samples provided by each node during the federated learning process. The number of samples a node uses for training is based on its local data set. Construct a data size score and use maximum value normalization:

[0067] This rating is used to reflect the role of nodes in terms of data contribution, while avoiding the problem of relying solely on computing power and ignoring the actual supply of data.

[0068] 3) Resource and consensus participation scoring

[0069] Resource and consensus participation scores characterize the computing power and network resources provided by nodes during the blockchain consensus and model validation process. Node resource metrics. It can be determined by a combination of factors such as computing power level, bandwidth capacity, historical online rate, or number of consensus participations, and confirmed by on-chain rules or smart contracts. Its normalized form is:

[0070] By introducing this indicator, the contribution of nodes to system maintenance can be reasonably reflected while ensuring the security of blockchain operation.

[0071] 4) Calculation of overall PODQ score After obtaining the scores for each of the above dimensions, the overall contribution score of the node is calculated using a weighted summation method:

[0072] in, , , The weight coefficients are non-negative and satisfy the following conditions: Each weight can be preset or dynamically adjusted according to the needs of industrial application scenarios. The final result... This will serve as the core basis for committee node election, model aggregation weight allocation, and incentive distribution.

[0073] S3.3: Committee election.

[0074] In each iteration, the device with the highest score is elected as the committee node, responsible for model aggregation. In each iteration, the system evaluates all candidate nodes according to a certain scoring criterion (PODQ incentive mechanism) and elects the device with the highest score as the committee node. In federated learning or distributed computing, the committee node receives local models from other devices or nodes and performs weighted averaging or merging operations on these models to generate a global model. The committee node also needs to ensure the security and fairness of the aggregation process, preventing malicious behavior and data tampering.

[0075] In the In each round of federated learning iterations, the node comprehensive contribution score calculated in step S3.2 is used. The candidate nodes that have passed on-chain verification are sorted, and the top ones are selected from high to low scores. The following nodes constitute the committee set for this round:

[0076] in The preset committee size parameter is used to strike a balance between system security, aggregation efficiency, and communication overhead.

[0077] Within the committee nodes, the node with the highest contribution score can be selected as the committee leader for this round, responsible for coordinating model aggregation and block generation. Alternatively, committee nodes can determine the leader through on-chain voting or a rotation mechanism to further mitigate the security risks associated with long-term centralization. Committee nodes are only valid within the current iteration round and will be re-elected in the next iteration based on the latest PODQ score results, thus achieving dynamic updates to committee members.

[0078] The aforementioned dynamic election mechanism based on contribution scoring ensures that nodes with high data quality, good training results, sufficient resource contributions, and significant model lightweight effects participate in decision-making during model aggregation and block generation. This reduces the probability of malicious or low-quality nodes participating in the core consensus process at the system level, thereby improving the overall security and stability of the federated learning and blockchain integration system.

[0079] S3.4: Secure aggregation and global model update on-chain.

[0080] After the committee election is completed, the committee nodes in this round will receive the set of all local models that have passed on-chain verification and meet the participation conditions:

[0081] in, Indicates the first The set of valid nodes that pass identity verification, model integrity verification, and quality verification in the round.

[0082] Based on the PODQ comprehensive contribution score of each node, the committee nodes perform weighted safe aggregation on the local model to obtain the updated global model:

[0083] Among them, the weighting coefficient Defined as:

[0084] in, This is a smoothing factor used to avoid the denominator being zero.

[0085] The aforementioned weighted aggregation method gives greater weight to nodes with high model training quality, large data contribution, high participation in computation and consensus, and significant model lightweighting effect in global model updates. This ensures the convergence of federated learning while suppressing the negative impact of low-quality models or malicious updates on the global model.

[0086] S3.5: Generating a new global model Subsequently, committee nodes perform digest hash calculations on the model parameters, and committee members jointly complete digital signature endorsement. Then, transaction records containing the model digest hash, model version number, participating aggregation node identifiers, and corresponding PODQ scores are written to the blockchain ledger, achieving traceable evidence of the model update process. The global model information published on-chain will serve as input for the next round of federated learning iterations, enabling various industrial devices to obtain a trusted and up-to-date global model from the blockchain and continue local training.

[0087] Step 4: Extract text feature vectors from device logs using the TF-IDF method to construct a classifiable feature representation; then, use a trained CNN model to calculate and classify anomaly probabilities in real-time logs; when the anomaly probability exceeds a preset threshold, the system automatically triggers an alarm, achieving real-time identification and response to abnormal behavior. Details are as follows: S4.1: Log Feature Extraction. In the device log early warning detection process, the first step is to extract features from the raw log data that can be used for machine learning models. Logs typically contain a large amount of text data, including device operation records, error messages, warnings, system events, etc. For log data, we can use the TF-IDF method to transform each device log entry into a feature vector. The TF-IDF method calculates the weight of each word based on its frequency (TF) in the log and its rarity (IDF) across all logs. This effectively extracts key events and information from the logs.

[0088] S4.2: Anomaly Detection and Real-time Early Warning. During the actual operation of industrial equipment, equipment log data is continuously generated in a streaming manner. For newly generated log data, the system first converts the original log text into a corresponding feature vector representation according to the feature extraction method in step S4.1. Subsequently, the equipment or edge node pulls the latest global anomaly detection model generated and published in step S3.4 through the blockchain network. This global model is collaboratively trained by multiple nodes and verified by the committee before being written into the blockchain, possessing integrity verification and traceability.

[0089] After completing model retrieval and version verification, the device performs inference calculations on the current log feature vector based on the global model, uses a convolutional neural network to classify log behavior as abnormal, and outputs the corresponding abnormal probability value. When the abnormal probability exceeds a preset threshold, the system determines the current log event as an abnormal event and automatically triggers an alarm mechanism to report the abnormal information to the monitoring platform or alarm system, thereby achieving real-time identification and rapid response to abnormal behavior of industrial equipment.

[0090] This invention proposes a decentralized parameter aggregation mechanism based on blockchain, enabling distributed verification of model parameters while ensuring device data privacy, effectively eliminating the risk of central servers stealing or reverse-engineering sensitive data. Existing incentive mechanisms focus only on data volume or computing power, neglecting data quality and model diversity. This invention designs a multi-dimensional contribution evaluation algorithm, PODQ consensus mechanism, which constructs a dynamic weight allocation model based on device-local model parameter diversity, model quality, and model convergence contribution rate, and combines this with on-chain smart contracts to quantify contributions, thus solving the contribution distribution imbalance problem caused by traditional blockchain incentive mechanisms (such as POW). Due to the technical bottlenecks of high model parameter redundancy and excessive blockchain storage and communication load in federated learning, this invention proposes a lightweight model dynamic pruning method. Through channel pruning and knowledge distillation techniques, it compresses the model size, reduces communication overhead, and significantly improves computational efficiency by more than 40%. Combining the trusted evidence storage mechanism of blockchain with the distributed training of federated learning, this invention designs a decentralized contribution evaluation system, presenting a three-in-one architecture of "lightweight model + data anonymization + layered consensus," solving the problem of balancing privacy and efficiency in resource-constrained scenarios. This invention integrates blockchain and lightweight federated learning to propose a dynamic allocation mechanism for device contributions, a model pruning algorithm, and a multi-dimensional anomaly detection method, thereby achieving data privacy protection, efficient resource utilization, and accurate monitoring of device status.

[0091] Correspondingly, this application also provides an industrial internet equipment anomaly detection system based on blockchain and federated learning, including: The registration and initialization module is used to implement decentralized registration of industrial nodes using blockchain smart contracts, and publish the initial global model to the blockchain for all nodes to obtain; The local training and lightweight module is used by each node to perform initial global model training using local data, and to perform lightweight processing on the trained local model to obtain a lightweight local model. The contribution evaluation module is used to calculate the contribution score of each node based on a multi-dimensional contribution scoring mechanism. The multi-dimensional contribution score includes at least: training quality score based on local model prediction error, data scale score based on local training data volume, and node computing resource score. The committee election and aggregation module is used to elect committee nodes based on the contribution scores of each node. The committee nodes then perform weighted aggregation on the verified local models to generate an updated global model. An anomaly detection module is used to perform anomaly detection on the log data of industrial nodes based on the updated global model.

[0092] It should be noted that, in the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another device, or some features may be ignored or not executed. The modules described as separate components may or may not be physically separated. The components shown as modules may be one or more physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs.

[0093] Furthermore, in the various embodiments of the present invention, the modules can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.

[0094] An electronic device provided in this application includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the industrial internet device anomaly detection method based on blockchain and federated learning described in any of the above embodiments.

[0095] Another electronic device provided in this application embodiment may further include: an input port connected to a processor for transmitting multimodal data collected by an external acquisition device to the processor; a display unit connected to the processor for displaying the processor's processing results to the outside world; and a communication module connected to the processor for enabling communication between the electronic device and the outside world. The display unit may be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module includes, but is not limited to, Mobile High Definition Link (HML), Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), and wireless connection (including Wi-Fi, Bluetooth, Bluetooth Low Energy, and IEEE 802.11s-based communication technology).

[0096] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the industrial internet device anomaly detection method based on blockchain and federated learning described in any of the above embodiments.

[0097] For descriptions of relevant parts of the industrial internet device anomaly detection system, electronic device, and computer-readable storage medium based on blockchain and federated learning provided in this application's embodiments, please refer to the detailed descriptions of the corresponding parts in the industrial internet device anomaly detection method based on blockchain and federated learning provided in this application's embodiments; they will not be repeated here. Furthermore, parts of the technical solutions provided in this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.

[0098] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.

Claims

1. A blockchain and federated learning based industrial internet device anomaly detection method, characterized in that, The method comprises the following steps: The industrial nodes are registered in a decentralized manner by using a blockchain smart contract, and an initial global model is published to the blockchain for each node to obtain; Each node trains the initial global model using local data, and performs lightweight processing on the trained local model to obtain a lightweight local model; The contribution scores of the nodes are calculated based on a multi-dimensional contribution scoring mechanism, which at least includes a training quality score based on local model prediction error, a data size score based on local training data volume, and a node computing resource score; The committee nodes are elected according to the contribution scores of the nodes, and the validated local models are weighted and aggregated by the committee nodes to generate an updated global model; The log data of the industrial nodes are detected for abnormalities based on the updated global model. 2.The industrial internet device anomaly detection method based on blockchain and federated learning according to claim 1, characterized in that, The industrial nodes are registered in a decentralized manner by using a blockchain smart contract, and an initial global model is published to the blockchain for each node to obtain, which comprises: All industrial devices are registered by a blockchain smart contract to generate unique digital identities; The cloud layer publishes an initial global model to the blockchain, and each industrial node obtains the initial global model from the blockchain and deploys it locally. 3.The industrial internet device anomaly detection method based on blockchain and federated learning according to claim 1, characterized in that, When each industrial node obtains the initial global model from the blockchain, the validity of the version identifier and digital signature of the industrial node is verified by the smart contract. 4.The industrial internet device anomaly detection method based on blockchain and federated learning according to claim 1, characterized in that, The lightweight processing in step 2 includes at least one of model pruning, model quantization, or knowledge distillation.

5. The industrial internet device anomaly detection method based on blockchain and federated learning according to claim 4, characterized in that, The method for lightweight processing of the local model by model pruning is as follows: The Drop-Connect method is used to prune the local model, the connection with a weight absolute value less than a preset threshold is set to zero by traversing the weight matrix of each layer of the local model, and the pruned local model is fine-tuned to obtain a lightweight local model.

6. The industrial internet device anomaly detection method based on blockchain and federated learning according to claim 1, characterized in that, the training quality score local model based mean absolute error computation: The data size score The calculation method is as follows: The resource and the consensus participation score The calculation method is as follows: wherein, is a smoothing factor, MAE is a mean absolute error, is a resource index.

7. The industrial internet device anomaly detection method based on blockchain and federated learning according to claim 1, characterized in that, The committee nodes are elected according to the contribution scores of the nodes, and the validated local models are weighted and aggregated by the committee nodes, which specifically comprises: In each iteration, the validated candidate nodes are sorted based on the contribution scores of the nodes; The top K nodes with the highest contribution scores are selected to form a committee set for the current round, where K is a preset committee size parameter; The nodes in the committee set are responsible for weighted aggregation of the validated local models to generate an updated global model; The committee set is only valid in the current tthiteration, and is re-elected according to the updated contribution scores in the next iteration. 8.The industrial internet device anomaly detection method based on blockchain and federated learning of claim 1, wherein, After the committee nodes generate the updated global model, the following steps are further included: The updated global model is calculated by an abstract hash, and the committee members jointly complete digital signature endorsement; A transaction record containing the abstract hash, model version number, node identifier participating in aggregation, and corresponding contribution score is written into a blockchain ledger; The updated global model information written into the blockchain will be used as the global model obtained by each node for local training in the next round of federated learning iteration. 9.The industrial internet device anomaly detection method based on blockchain and federated learning of claim 1, wherein, The log data of the industrial nodes are detected for abnormalities based on the updated global model, which specifically comprises: Text feature vectors are extracted from the log data; performing anomaly probability calculation and classification on the text feature vector based on the updated global model obtained from the blockchain; triggering real-time alarm when the anomaly probability exceeds a preset threshold. 10.A blockchain and federated learning based industrial internet device anomaly detection system, comprising: The method comprises the following steps: a registration and initialization module is configured to realize decentralized registration of industrial nodes by using a blockchain smart contract, and to publish an initial global model to the blockchain for acquisition by each node; a local training and lightweight module is configured to train the initial global model by using local data by each node, and to perform lightweight processing on the trained local model to obtain a lightweight local model; a contribution evaluation module is configured to calculate a contribution score of each node based on a multi-dimensional contribution scoring mechanism, wherein the multi-dimensional contribution scoring mechanism at least comprises a training quality score based on a local model prediction error, a data size score based on a local training data volume, and a node computing resource score; a committee election and aggregation module is configured to elect committee nodes according to the contribution scores of the nodes, to perform weighted aggregation on the verified local models by the committee nodes, and to generate an updated global model; an anomaly detection module is configured to perform anomaly detection on log data of the industrial nodes based on the updated global model.

Citation Information

Patent Citations

  • Combustion chamber outlet non-cooling flue gas sampling rake

    CN116878974A