Aggregate Verification Method for Internet of Things Privacy Protection

By adopting a hierarchical aggregation mechanism and a node selection strategy based on model performance in the Internet of Things system, and combining blockchain technology to cluster and verify model parameters, the problems of excessive computing burden and insufficient data privacy in the Internet of Things system are solved, and efficient and secure model aggregation is achieved.

CN115987659BActive Publication Date: 2025-08-01宁波市镇海区科技服务中心
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211698410.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2025-08-01
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

The existing Internet of Things systems have problems such as excessive computing burden, large delay and insufficient data privacy in federated learning. Especially when there are many terminals within the base station coverage, the base station performs model aggregation tasks and will cause large delays, and there are security risks in node selection methods.

Method used

The hierarchical aggregation mechanism and a node selection strategy based on model performance are adopted, and the model parameters are clustered and verified by building an edge blockchain network, and the node selection is optimized using a deep reinforcement learning algorithm, and the model performance verification is combined with blockchain technology to ensure security and efficiency.

Benefits of technology

It effectively alleviates the load pressure of servers, reduces the computational volume of model aggregation tasks, improves system efficiency and data privacy, and ensures the security and fairness of model aggregation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115987659B_ABST
    Figure CN115987659B_ABST
Patent Text Reader

Abstract

The present invention discloses an aggregation verification method for Internet of Things privacy protection, including: Step 1, constructing an Internet of Things system; Step 2, clustering Internet of Things terminals, where each cluster contains an Internet of Things first terminal, several Internet of Things second terminals, and several Internet of Things third terminals; Step 3, modeling malicious nodes to affect the security and efficiency of the Internet of Things system; Step 4, the Internet of Things second terminal adds the collected data to its local dataset and performs local model training, and the Internet of Things second terminal uploads the local model parameters to the Internet of Things first terminal to participate in model aggregation. The method avoids the upload of specific data by the layer-by-layer transmission of model parameters, protecting data privacy; alleviates the load pressure on the server caused by model aggregation through hierarchical aggregation and the way of selecting nodes to participate in aggregation, and ensures the security of aggregation through verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Internet of Things (IoT) data privacy protection, and particularly relates to an aggregation verification method for IoT privacy protection. Background Art

[0002] The IoT technology uses a variety of sensor devices to connect various items to the Internet according to protocols for information exchange and communication to achieve the interconnection of all things. In essence, it is a microcomputer control system integrating a variety of modern information technologies and physical infrastructures. The traditional IoT system architecture mainly consists of three parts: IoT terminals, gateways, and servers. IoT terminals are responsible for collecting and reporting IoT data, gateways are responsible for forwarding data, and servers are responsible for data storage and data analysis. With the development of IoT technology and the continuous increase of life demands, various IoT applications and IoT terminals are increasing continuously, generating a large amount of IoT data that needs to be stored in the server. Although traditional database technologies can complete the classified storage of data, they cannot meet the growing data privacy requirements and emerging security problems.

[0003] The proposal of federated learning has put forward a new idea for data privacy protection. As an emerging distributed machine learning technology, the design goal of federated learning is to carry out efficient machine learning among multiple participants or multiple computing nodes on the premise of ensuring information security during big data exchange and protecting terminal data and personal data privacy. The learning framework of federated learning is as follows:

[0004] After determining the training participants, federated learning first deploys a global model in the server and deploys the same machine learning model in each participant to form a unique training group, enabling each participant to cooperate in training the machine learning model while keeping the data local.

[0005] In each round of training, the server deploying the global model shares the global model parameters with each participant. Each participant trains the local model based on its local dataset and sends the trained local model parameters back to the server.

[0006] The server aggregates all the received local models according to the aggregation rules preset in the training group.

[0007] Based on the different data distributions among multiple participants, federated learning is divided into three categories: horizontal federated learning, vertical federated learning, and federated transfer learning. Horizontal federated learning is applicable to situations where the data features of the participants in federated learning overlap, but the data sample spaces are different. In horizontal federated learning, the data features overlap in many dimensions, and alignment is performed based on the overlapping dimensions. The parts of the participants' data with the same features but different users are taken out for joint training. Vertical federated learning is applicable to situations where the training data of the participants in federated learning have overlapping data samples, but the data features are different. Federated transfer learning is applicable to situations where the data samples and data features of the participants have little overlap.

[0008] At the same time, with the introduction and development of Bitcoin, blockchain technology, which serves as its underlying support, is regarded as one of the important IoT data security solutions. As a distributed data storage solution, blockchain technology's decentralized and tamper-proof characteristics basically match the data storage needs of the IoT system. The basic data structure of blockchain technology is a series of data records called "blocks" linked together by cryptography to form a ledger. Each "block" contains part of the information of the previous "block". Blockchain technology forms a blockchain network by deploying blockchain nodes on various devices. Each node in the blockchain network jointly maintains the blockchain ledger to maintain data consistency between nodes.

[0009] In recent years, with the development of federated learning, applying it to IoT systems has become one of the important methods for protecting data privacy in IoT systems. In existing research, local models and global models are usually deployed on IoT terminals and servers respectively, so that each IoT terminal constitutes a federated learning training group. However, deploying federated learning models imposes a large computational burden on IoT systems. According to the federated learning algorithm process, all participants in the training group participate in the aggregation of the federated learning model. IoT systems are generally populated with a large number of IoT terminals. If all of them participate in model aggregation, it will place a heavy load on the server, affecting the system efficiency and even the normal operation of the IoT system. The current purpose of combining IoT systems with blockchain technology is to ensure the security of IoT data while providing data traceability. The common practice in existing research is to deploy blockchain nodes on IoT servers, with each server forming a blockchain network. Although this solution can ensure the secure storage of IoT data, it will further increase the load pressure on the server and have adverse effects on some latency-sensitive IoT applications. At the same time, centralizing IoT data on the chain cannot meet the data privacy storage needs of some users.

[0010] In the traditional federated learning algorithm process, the local model is first trained according to the local dataset, and the local model parameters are uploaded to the global model for model aggregation. To alleviate the load on the Internet of Things (IoT) module that deploys the global model during the execution of the aggregation task, in the existing research on federated learning for IoT, researchers have combined the concept of edge computing and adopted a hierarchical aggregation method to implement federated learning model aggregation, that is, the base station and the server perform model aggregation twice respectively during the federated learning model aggregation.

[0011] The purpose of adopting hierarchical aggregation is to make full use of the computing resources of the edge layer modules in the IoT system, such as the base station, which undertakes part of the aggregation task. However, at the same time, as the number of IoT terminals in the system increases, the load pressure borne by the base station as an edge server also increases, and the limited hardware resources of the base station may become one of the factors restricting the system efficiency. In addition to using hierarchical aggregation to disperse the aggregation task, some research designs a node selection mechanism in the system to select some IoT terminals to participate in model aggregation to reduce the amount of computation required to complete the model aggregation task, thereby improving the efficiency of federated learning and alleviating the server load pressure. The existing selection methods in the research are mainly based on the resources available at the terminal or the performance of the local model parameters reported by the terminal.

[0012] For example, a prior art discloses a method for selecting federated learning participating nodes based on blockchain. This method for selecting federated learning participating nodes is used for an IoT system including terminal devices and a base station. The method for selecting federated learning participating nodes includes: obtaining the number of interactions and distances between each terminal device and the base station and other terminal devices within a preset time, determining the activity density of each terminal device according to the preset truncation distance, the number of data interactions, and the distance between the terminal device and other terminal devices, selecting target terminal devices according to the size of the activity density, calculating the offset distance from the terminal device to the target terminal device, determining the clustering center point of the terminal device according to the activity density and the offset distance, and transmitting the data of the corresponding clustering model of the second IoT terminal device to the base station through the terminal device passing through the clustering center point. This method reduces the transmission time of model parameters in the IoT system during model aggregation through the above steps, reducing the overall latency of federated learning.

[0013] Another example, another prior art discloses a method for selecting nodes for IoT edge-cloud collaborative federated learning based on reputation. This method includes: constructing an IoT edge-cloud collaborative federated learning architecture based on reputation, and selecting nodes participating in federated learning model aggregation using a reputation scoring method based on a multi-weight subjective logic model according to the constructed IoT edge-cloud collaborative federated learning architecture based on reputation to obtain an optimal node combination; the invention uses a multi-weight subjective logic model to calculate the reputation value of each participating node, aiming to improve the accuracy and training speed of federated learning.

[0014] However, the above-mentioned existing technologies have the following technical problems in the actual use process:

[0015] When there are Internet of Things terminals beyond its processing capacity within the coverage area of the base station, the base station's execution of the model aggregation task will cause a large delay and affect the normal operation of the system;

[0016] In the existing node selection methods, generally, the base station or the server collects the terminal information or model information of the Internet of Things terminals deployed with local models for node selection. The Internet of Things terminals hijacked by malicious attackers may submit fictitious relevant information to be selected as aggregation nodes, thereby affecting model aggregation through the above methods. Therefore, the node selection method based on node information has security problems.

[0017] Based on the above technical problems existing in the existing technologies, the present invention proposes an aggregation verification method for Internet of Things privacy protection. Summary of the Invention

[0018] The object of the present invention is to provide an aggregation verification method for Internet of Things privacy protection in view of the deficiencies of the existing technologies, including:

[0019] Step 1, construct an Internet of Things system, which includes a server, a base station, and Internet of Things terminals. Among them, the Internet of Things terminals include the first Internet of Things terminal, the second Internet of Things terminal, and the third Internet of Things terminal. The third Internet of Things terminal is used to collect Internet of Things data and report it to the nearest second Internet of Things terminal. The second Internet of Things terminal is used to deploy a federated learning local model, collect the data reported by the third Internet of Things terminal, and train the local model. The first Internet of Things terminal is used to deploy a clustering model, collect the local model parameters of the second Internet of Things terminal, and perform model aggregation. The server is used to deploy a global model to perform global model aggregation. Construct an edge blockchain network composed of the first Internet of Things terminal and the base station to realize the trusted storage of information in the Internet of Things system. The edge blockchain network uses RAFT+ as the consensus mechanism;

[0020] Step 2, cluster the Internet of Things terminals. Each cluster contains a first Internet of Things terminal, several second Internet of Things terminals, and several third Internet of Things terminals. The first Internet of Things terminal and the second Internet of Things terminal in each cluster jointly maintain a local blockchain network. The second Internet of Things terminals in the local blockchain network perform mutual verification of model performance and store the verification results. The local blockchain network uses RAFT+ as the consensus mechanism. The base station selects a Leader node among the first Internet of Things terminals in the edge blockchain network. The selected Leader node packages data blocks and dominates block consensus. The remaining first Internet of Things terminals are Follower nodes and participate in block consensus;

[0021] Step 3, model malicious nodes to affect the security and efficiency of the IoT system;

[0022] Step 4, the third IoT terminal collects IoT data according to the set collection interval and reports it to the nearest second IoT terminal. The second IoT terminal adds the collected data to its local dataset and performs local model training. The second IoT terminal uploads the local model parameters to the first IoT terminal to participate in model aggregation. After the first IoT terminal, the base station, and the server respectively perform model aggregation, the global model parameters will be synchronized to all the federated learning models in the IoT system. On the one hand, the upload of specific data is avoided through the layer-by-layer transfer of model parameters, protecting data privacy; on the other hand, the load pressure on the server caused by model aggregation is alleviated through hierarchical aggregation and the method of selecting nodes to participate in aggregation, and the security of aggregation is ensured through verification.

[0023] Further, Step 4 includes:

[0024] Step 4.1, at the beginning of each round of training, the third IoT terminal selects the Leader node and aggregation nodes participating in this model aggregation according to the aggregation node selection mechanism based on model performance. The third IoT terminal collects IoT perception data according to its preset type and reports it to the nearest second IoT terminal. The second IoT terminal collects the IoT data reported by the third IoT terminal and adds it to the local dataset. The second IoT terminal trains the local model deployed on the second IoT terminal according to the preset time.

[0025] Step 4.2, after the local training of the second IoT terminal is completed, the local model parameters are uploaded to the first IoT terminal within the cluster. After the second IoT terminal collects the local model parameters of all the second IoT terminals within the cluster, it performs cluster model aggregation. The time delay for the first IoT terminal i to collect local model parameters and perform cluster model aggregation is represented by ;

[0026] Step 4.3, the first IoT terminal assigns verification nodes to each second IoT terminal within the cluster and generates intra-cluster verification tasks, and packages the verification tasks into verification blocks for broadcasting within the local blockchain network, and mutual verification is performed by the second IoT terminals within the cluster;

[0027] Step 4.4, the first IoT terminal selected as an aggregation node by the base station through the aggregation node selection mechanism reports its cluster model parameters to participate in edge model aggregation. The first IoT terminal not selected as an aggregation node will be used as a verification node in the aggregation verification method in this model aggregation. After the base station collects the cluster model parameters reported by all aggregation nodes, it performs edge model aggregation. The base station collecting aggregation node model parameters and performing edge model aggregation is represented as

[0028] Step 4.5, the base station generates a verification task according to the set of aggregation nodes. The verification task will be packaged to generate a verification task block. After the verification task block is generated, it is synchronized to each first IoT terminal in the edge blockchain network. The first IoT terminals that act as verification nodes in this edge aggregation execute the verification tasks assigned to them in the verification task block and send the verification results to the Leader node in the response. When the verification results collected by the Leader node meet the requirements of the blockchain-based model performance verification mechanism, the verification process is completed. The Leader node calculates the model accuracy of each aggregation node according to the performance verification mechanism, and the verification delay is expressed as

[0029] Step 4.6, the Leader node packages the model accuracies and verification results of each node in the form of a transaction to generate a verification result block and conducts block consensus in the edge blockchain network. Each first IoT terminal checks the correspondence between the model accuracy of each aggregation node and the verification task and verification result, and sends a confirmation response to the Leader node. The generation delay and consensus delay of the verification result block are respectively expressed as and After the block is legally generated, the base station updates the selection strategy in the aggregation node selection mechanism based on model performance according to the edge model accuracy and the cluster model accuracy of each aggregation node included in the block, and sends the aggregated edge model parameters to the server;

[0030] Step 4.7, the server performs global model aggregation and synchronizes the global model parameters to the edge model, cluster model, and local model in sequence, and the delay is expressed as

[0031] Step 4.8, the total delay required to complete one round of federated learning model training in the aggregation verification method for IoT privacy protection is expressed as:

[0032]

[0033] Repeat steps 4.1 - 4.7 until the federated learning global model converges.

[0034] Furthermore, step 4 also includes the step of clustering IoT terminals:

[0035] Determine the number of clusters according to the number of first IoT terminals within the coverage of the base station in the IoT system, and establish N S clusters with the first IoT terminal as the cluster head;

[0036] Each second IoT terminal determines the cluster it joins according to the distance between the second IoT terminal and each cluster head. To balance the computing tasks among clusters, the number of second IoT terminals within each cluster satisfies where N M is the number of second IoT terminals in the IoT system;

[0037] After each second IoT terminal determines the cluster it joins, the third IoT terminal determines the target for reporting data by the third IoT terminal according to the distance between the third IoT terminal and each second IoT terminal. To confirm the cluster the third IoT terminal joins, after each third IoT terminal determines the cluster it joins, the terminal clustering is completed.

[0038] Furthermore, the step 4 further includes the step of hierarchical aggregation of federated learning:

[0039] After the IoT terminal clustering is completed, the server, base station, first IoT terminal, and second IoT terminal in the system participate in hierarchical model aggregation through the deployed global model, edge model, cluster model, and local model, so as to achieve load balancing of the IoT modules in the system. In the hierarchical aggregation, three model aggregations are respectively performed through the global model, edge model, and cluster model to disperse the model aggregation tasks.

[0040] Furthermore, the step 4 further includes the step of selecting aggregation nodes for model performance:

[0041] Step 421, at the beginning of node selection, the base station collects the number of times each first IoT terminal participates in aggregation, the computing resources of the first IoT terminal, and the system communication environment information. The node with the most participation times becomes the new Leader. During the aggregation node selection process, determine the number of first IoT terminals participating in model aggregation and sort the first IoT terminals participating in the previous model aggregation according to model accuracy. The top 50% of the first IoT terminals continue to participate in model aggregation and are added to the aggregation node set W. The remaining first IoT terminals participating in the previous model aggregation are used as verification nodes for this model aggregation. The number of first IoT terminals participating in this model aggregation is determined according to determined, where N I is the number of first IoT terminals in the system. Based on N c and the Deep Deterministic Policy Gradient (DDPG) algorithm, select nodes to join W according to the aggregation node policy;

[0042] Step 422, in order to establish a Markov decision model and solve the optimization problem, it is necessary to first define the system state. The state S ∈ S is composed of the states of each first IoT terminal within the coverage area of the base station, and the definition is as follows:

[0043] S=(ξ,ρ,μ,η),

[0044] Where ξ represents the index of the Leader in the network;

[0045]

[0046] ρ i Indicates the number of times the first IoT terminal i in the system participates in model aggregation; μ i represents the signal-to-noise ratio between the leader and the first IoT terminal i during data transmission, η represents the node status of the leader, η = 0 means the leader is in normal working state, otherwise η = 1;

[0047] In step 423, to simulate the operation of the system, after establishing the system state, corresponding actions are taken to simulate node selection and perform model aggregation, and the resulting aggregated node set is selected as the system action; a mapping relationship between specific actions and action indexes is established through an action list. The selected action A∈A is defined as the index corresponding to the specific node set. The action is represented as follows:

[0048]

[0049] Among them, a i Represents the node state of the first IoT terminal i. Node states include leader, aggregation node, and verification node. All possible actions constitute the action set A;

[0050] In step 424, after establishing the state and action, the state transition after taking the action in the state is determined. The function of the state-action pair (S, A) is used to describe the process of the model transitioning to the new state S′ after taking action A in the current state S. The update of the system state μ in period τ+1 is based on the signal-to-noise ratio value, which is expressed as:

[0051]

[0052] Assume that the action in period τ is A τ , the state transition function of the system state ξ is obtained according to the system state η and is expressed as:

[0053]

[0054] Based on the aggregated node set W in each cycle, ρ in cycle τ+1 i Expressed as:

[0055]

[0056] As the system runs, state transitions are performed according to step 424 until the system reaches its preset operating cycle;

[0057] Step 425, in order to evaluate the benefits brought to the overall system by taking system actions in the system state, a system reward function R is established. The reward R(S,A) is a real-valued function of the state S and the action A, reflecting the pros and cons of the current A. The definition of the reward is consistent with the optimization goal and is defined as the product of the global model accuracy obtained within the period τ and the reciprocal of the time delay required to complete one round of federated learning model training. The shorter the time delay required to complete one round of training and the higher the global model accuracy, the better the policy. The reward function is defined as follows:

[0058]

[0059] Step 426, after obtaining the complete Markov decision process model, it is necessary to solve it based on the DDPG algorithm to obtain the optimal aggregation node selection strategy; solving the MDP problem is to find an optimal policy π to maximize the expectation of the long-term cumulative reward average Let be denoted as the actor network with parameter θ π , be denoted as the critic network with parameter θ Q . All layers in the neural network are fully connected. The parameters θ π ' and θ Q ' of the target actor network and the target critic network are updated regularly by the Exponential Moving Average (EMA):

[0060] θ Q ' = κθ Q ' + (1 - κ)θ Q , θ π ' = κθ π ' + (1 - κ)θ π ,

[0061] The loss J(θ π ) of the actor network is defined as the estimated value of Q calculated by the critic network. The loss L(θ Q ) of the critic network is defined as the mean square error between Q and the target value y, which is defined as follows:

[0062]

[0063] where y = R + γQ', and γ is the discount factor.

[0064] Furthermore, step 4.3 includes:

[0065] Step 4.31: Assign verification tasks. The first IoT terminal within the cluster collects the parameters of each local model to perform in-cluster model aggregation, generates model verification tasks, and assigns N E verification nodes to each second IoT terminal. The first IoT terminal packages the verification tasks to generate a new block and broadcasts it in the local blockchain network.

[0066] Step 4.32: Execute verification tasks. The second IoT terminal executes the verification tasks in the block, evaluates the model accuracy of the remaining second IoT terminals within the cluster based on the local dataset as the verification result. After completing the verification, the second IoT terminal sends the verification result to the first IoT terminal in the cluster.

[0067] Step 4.33: Calculate model accuracy. The second IoT terminal whose model accuracy is lower than a certain value (an empirical value) for a long time will be regarded as a malicious node. When calculating the model accuracy, the first IoT terminal selects some verification results for mean calculation to offset the negative impact of malicious nodes and at the same time consider the long-term change of the accuracy rate. After receiving the verification results sent by all second IoT terminals within the cluster, the first IoT terminal calculates the model accuracy of each second IoT terminal. Each verification result and the calculated local model accuracy will be packaged by the first IoT terminal to generate a new block, and the new block will be broadcast in the blockchain network.

[0068] Furthermore, Step 4.5 includes:

[0069] Step 4.51: In the stage of assigning verification tasks, the base station assigns N E verification nodes to each aggregation node. At the same time, the base station packages the assignment result as a verification task to generate block m and broadcasts it in the edge blockchain network. Each verification node can execute at most N Q verification tasks.

[0070] Step 4.52: Execute verification results. In the stage of executing verification tasks, after each node in the edge blockchain network receives block m, it uses the local dataset as the verification dataset and executes the verification tasks included in the block.

[0071] Step 4.53: Collect verification results stage. In the stage of collecting verification results, the Leader selects N E verification results from the N G verification nodes assigned to each aggregation node. The Leader regards the arrival of the verification result for any aggregation node as a time series queue. At the same time, each time series queue is divided into a threshold queue and a verification queue to determine the selected verification results. The lengths of the threshold queue and the verification queue are N R and N E -N R, the verification result with the highest accuracy in the threshold queue will be used as the selection threshold for the verification queue. In the verification queue, the verification results that meet the selection threshold will be selected to calculate the model accuracy until the number of selected verification results reaches N. G , if there are not enough verification results in the verification queue that meet the selection threshold, then the last several verification results in the verification queue will be selected for supplementation until the number of selected results reaches N. G After that, the subsequent arriving verification results will be ignored.

[0072] Step 4.54, calculate the model accuracy. In the stage of calculating the model accuracy, the Leader calculates the model accuracy of each aggregation node based on the selected verification results. The calculated model accuracy will be provided to the aggregation node selection mechanism based on model performance for aggregation node selection. When the model accuracy of all aggregation nodes has been calculated, the Leader packs the verification results and the calculated model accuracy to generate block n, and broadcasts the block in the blockchain network to achieve block consensus.

[0073] The beneficial effects of the present invention are:

[0074] 1. The aggregation verification method for Internet of Things privacy protection according to the present invention can maintain the efficiency of the federated learning algorithm and improve the efficiency of the Internet of Things system combined with federated learning on the premise of ensuring aggregation fairness.

[0075] 2. The aggregation verification method for Internet of Things privacy protection according to the present invention combines federated learning in the Internet of Things system. When data is transmitted, the upload of model parameters is used to replace the upload of specific Internet of Things data, thereby protecting the data privacy of the Internet of Things. Different levels of federated learning models are deployed according to module performance in various Internet of Things modules to maintain the stable operation of various Internet of Things modules in the system.

[0076] 3. The aggregation verification method for Internet of Things privacy protection according to the present invention clusters Internet of Things terminals and adopts a hierarchical aggregation mechanism based on the clustering of Internet of Things terminals for model aggregation. The method of terminal clustering can effectively disperse the federated learning model aggregation tasks. On this basis, hierarchical aggregation can make full use of the idle resources of various modules in the Internet of Things system to relieve the load pressure on the server and maintain the operation efficiency of the system.

[0077] 4. The aggregation verification method for Internet of Things privacy protection according to the present invention is an aggregation node selection mechanism based on model performance. This mechanism selects some Internet of Things terminals to participate in model aggregation according to information such as Internet of Things terminal performance, system communication environment, and model accuracy, and obtains the optimal node selection strategy through the deep reinforcement learning method to reduce the computational amount required for executing model aggregation tasks and improve the model aggregation efficiency, thereby improving the operation efficiency of the Internet of Things system combined with federated learning.

[0078] 5. The aggregation verification method for Internet of Things privacy protection according to the present invention is based on a blockchain-based model performance verification mechanism, which provides a fairness proof for the selection of aggregation nodes. The performance verification mechanism realizes the synchronization of verification tasks and the collection of verification results based on the blockchain network, thereby realizing the mutual verification of model performance among Internet of Things terminals and the trustworthy deposit of the verification process, and providing verified model information for the selection of aggregation nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 It is a schematic flowchart of the aggregation verification method for Internet of Things privacy protection in an embodiment of the present invention;

[0080] Figure 2 It is a schematic diagram of hierarchical aggregation of Internet of Things terminal clustering in an embodiment of the present invention;

[0081] Figure 3 It is a schematic diagram of the process of selecting inter-cluster verification results in an embodiment of the present invention;

[0082] Figure 4 It is a schematic comparison diagram of the convergence of the federated learning model under different aggregation schemes in an embodiment of the present invention;

[0083] Figure 5 It is a schematic comparison diagram of the accuracy of the federated learning model under different aggregation schemes in an embodiment of the present invention;

[0084] Figure 6 It is a schematic comparison diagram of the total training delay of the federated learning under different schemes in an embodiment of the present invention;

[0085] Figure 7 It is a schematic comparison diagram of the total training delay of the federated learning under the performance verification mechanism in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0086] In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.

[0087] Embodiment

[0088] The present invention aims to solve the privacy problems existing in the existing Internet of Things (IoT) systems, as well as the subsequent system efficiency and fairness problems. To this end, in this embodiment, an aggregation verification method for federated learning oriented to the characteristics of IoT systems is designed. The method ensures the privacy of IoT data by using federated learning in the IoT system. The method adopts a hierarchical aggregation mechanism to disperse the model aggregation task to relieve the load pressure on the IoT modules deploying the global model. To further relieve the load caused by the edge IoT modules performing model aggregation, the method selects nodes to participate in model aggregation based on information such as the communication environment and the quality of local model parameters, and obtains the optimal node selection strategy through a deep reinforcement learning algorithm. To achieve fair aggregation node selection, the method forms a blockchain network by IoT terminals without introducing a third party to realize the mutual verification of local model parameters, and at the same time stores the verification results in the blockchain ledger in the network to provide the traceability of verification, so as to solve problems such as privacy, system efficiency, and fairness.

[0089] As Figure 1 shown, the basis for applying this aggregation verification method is to establish an IoT system using federated learning, deploy corresponding federated learning models according to the characteristics of various IoT modules, and avoid the public transmission and storage of specific IoT data by combining the federated learning algorithm during system operation. The aggregation verification method proposed in this embodiment includes three mechanisms: a hierarchical aggregation mechanism based on clustering of IoT terminals, an aggregation node selection mechanism based on model performance, and a model performance verification mechanism based on blockchain. Among them:

[0090] The hierarchical aggregation mechanism based on clustering of IoT terminals and the aggregation node selection mechanism based on model performance aim to solve the efficiency problems of the IoT system after using federated learning through different methods. The hierarchical aggregation mechanism aims to disperse the model task to relieve the load pressure on the server. The specific approach is to use the available computing resources of each IoT terminal to execute part of the model aggregation task;

[0091] The aggregation node selection mechanism aims to reduce the total amount of model aggregation tasks by reducing the number of nodes participating in model aggregation. This mechanism obtains the optimal aggregation node selection strategy through a deep reinforcement learning method to reduce the system delay while ensuring the federated learning aggregation efficiency;

[0092] To ensure the security in the node selection mechanism, the model performance verification mechanism based on blockchain realizes the mutual verification of model performance between nodes and provides a credible selection certificate. Specifically, the method includes: constructing an IoT system applying the aggregation verification method; aggregation verification for IoT privacy protection; hierarchical aggregation of IoT terminal clustering; aggregation node selection of model performance; model performance verification of blockchain.

[0093] The Internet of Things system for constructing an application aggregation verification method includes:

[0094] Step 1, construction of the Internet of Things system structure. In the Internet of Things system using this embodiment, there are three types of nodes, namely servers, base stations, and Internet of Things terminals. The above nodes follow the module task division of the traditional Internet of Things system. The Internet of Things terminals are divided into the first Internet of Things terminal, the second Internet of Things terminal, and the third Internet of Things terminal according to their performance. The third Internet of Things terminal collects Internet of Things data and reports it to the nearest second Internet of Things terminal; the second Internet of Things terminal deploys a federated learning local model, collects the data reported by the third Internet of Things terminal, and trains the local model; the first Internet of Things terminal deploys a clustering model, collects the local model parameters of the second Internet of Things terminal, and performs model aggregation. The number of the first Internet of Things terminal is represented by i, where i ∈ {1, 2,..., N S}, N S is the number of the first Internet of Things terminals existing in the scenario; the base station deploys an edge model as an edge server, collects the clustering model parameters of the first Internet of Things terminal, and performs model aggregation. To ensure the trustworthy storage of information in the system, an edge blockchain network composed of the first Internet of Things terminal and the base station is constructed in the system. This blockchain network uses RAFT+ as the consensus mechanism. The server deploys a global model to perform global model aggregation. Among them, the first Internet of Things terminal, as an Internet of Things terminal with strong sensing and computing capabilities, can handle most computing tasks, but there are performance differences compared with the base station, and it is generally a large intelligent terminal; the second Internet of Things terminal, as an Internet of Things terminal with certain sensing and computing capabilities, can handle a small part of computing tasks, and is generally a mobile intelligent terminal; the third Internet of Things terminal is only responsible for sensing tasks in the system, and is generally a sensor terminal;

[0095] Step 2, clustering the Internet of Things terminals. In the Internet of Things system established in Step 1, the Internet of Things terminals are divided into multiple clusters. Each cluster contains a first Internet of Things terminal, several second Internet of Things terminals, and third Internet of Things terminals. The cluster containing the first Internet of Things terminal i is represented by C i denoted as C i The number of the second Internet of Things terminals in C i is represented by N

[0096] Step 3: Model malicious nodes. In the IoT system, malicious attackers conduct data poisoning attacks by hijacking IoT terminals, which affects the security and efficiency of the system. The hijacked IoT terminals are regarded as malicious nodes and affect model aggregation in the following ways:

[0097] The hijacked second IoT terminal provides untrained local model parameters to affect the initial model aggregation;

[0098] The hijacked first IoT terminal reports forged model information to be selected as an aggregation node by the base station and provides untrained model parameters to affect model aggregation. At the same time, the hijacked first IoT terminal provides incorrect verification results to mislead the selection of aggregation nodes;

[0099] Step 4: Transmission of model parameters and model training. After establishing the IoT system according to the above steps, the third IoT terminal collects IoT data at the set collection interval and reports it to the second IoT terminal closest to it. The second IoT terminal adds the collected data to its local dataset and conducts local model training. The second IoT terminal uploads the local model parameters to the first IoT terminal to participate in model aggregation. After the first IoT terminal, the base station, and the server respectively perform model aggregation, the global model parameters will be synchronized to all federated learning models in the system;

[0100] As Figure 2 shown, the aggregation verification method refers to the basic structure of the federated learning algorithm and combines with the actual operation process of the IoT system. Based on the characteristics of the IoT system, three mechanisms are designed in this embodiment: a hierarchical aggregation mechanism based on IoT terminal clustering, an aggregation node selection mechanism based on model performance, and a model performance verification mechanism based on blockchain. The process of establishing a Markov model includes establishing states, establishing actions, establishing state transition functions, and establishing reward functions. The aggregation verification for IoT privacy protection specifically includes:

[0101] Step 4.1: At the beginning of each round of training, the base station selects the Leader node and aggregation nodes participating in this model aggregation according to the aggregation node selection mechanism based on model performance. The third IoT terminal collects IoT perception data according to its preset type and reports it to the second IoT terminal closest to it. The second IoT terminal collects the IoT data reported by the third IoT terminal and adds it to its local dataset. The second IoT terminal trains the local model deployed on the second IoT terminal at the preset time;

[0102] Step 4.2, after the local training of the second IoT terminal ends, the local model parameters are uploaded to the first IoT terminal within the cluster. After the first IoT terminal in the cluster collects the local model parameters of all the second IoT terminals within the cluster, it performs cluster model aggregation. The delay for the first IoT terminal i to collect the local model parameters and perform cluster model aggregation is represented by ;

[0103] Step 4.3, the first IoT terminal in the cluster assigns verification nodes to each second IoT terminal in the cluster and generates in-cluster verification tasks, and packs the verification tasks into verification blocks for broadcasting within the local blockchain network, and the second IoT terminals within the cluster perform mutual verification;

[0104] Step 4.4, the first IoT terminal selected as the aggregation node by the base station through the aggregation node selection mechanism reports its cluster model parameters to participate in the edge model aggregation. The first IoT terminal not selected as the aggregation node will be used as the verification node in the aggregation verification method in this model aggregation. After the base station collects the cluster model parameters reported by all the aggregation nodes, it performs edge model aggregation. The delay for the base station to collect the aggregation node model parameters and perform edge model aggregation is represented as

[0105] Step 4.5, the base station generates verification tasks according to the aggregation node set. The verification tasks will be packed into verification task blocks. After the verification task blocks are generated, they will be synchronized to each first IoT terminal within the edge blockchain network. The first IoT terminal used as the verification node in this edge aggregation will execute the verification tasks assigned to it in the verification task blocks and send the verification results included in the response to the Leader node. When the verification results collected by the Leader node meet the requirements of the blockchain-based model performance verification mechanism, the verification process is completed. The Leader node calculates the model accuracy of each aggregation node according to the performance verification mechanism. The verification delay is represented as

[0106] Step 4.6, the Leader node packs the model accuracies and verification results of each into a verification result block in the form of a transaction and performs block consensus within the edge blockchain network. Each first IoT terminal checks the correspondence between the model accuracy of each aggregation node and the verification tasks and verification results, and sends a confirmation response to the Leader node. The generation delay and consensus delay of the verification result block are represented as and After the block is legally generated, the base station updates the selection strategy in the aggregation node selection mechanism based on model performance according to the edge model accuracy and the cluster model accuracy of each aggregation node included in the block, and sends the aggregated edge model parameters to the server;

[0107] Step 4.7, the server performs global model aggregation and synchronizes the global model parameters to the edge model, the clustered model, and the local model in sequence. The time delay is expressed as

[0108] In summary, in the aggregation verification method for Internet of Things privacy protection proposed in this embodiment, the total time delay required to complete one round of federated learning model training is expressed as:

[0109]

[0110] Steps 4.1 to 4.7 will be repeated until the federated learning global model converges.

[0111] The hierarchical aggregation of Internet of Things terminal clustering specifically includes:

[0112] Step A1, after establishing the Internet of Things system, cluster the Internet of Things terminals. First, determine the number of clusters according to the number of the first Internet of Things terminals within the coverage of the base station in the system, and establish N S clusters with the first Internet of Things terminal as the cluster head. Secondly, each second Internet of Things terminal confirms the cluster it joins according to its distance from each cluster head. To balance the computing tasks between clusters, there is a limit on the number of second Internet of Things terminals within each cluster, that is where N M is the total number of second Internet of Things terminals in the system. After each second Internet of Things terminal confirms the cluster it joins, the third Internet of Things terminal determines the target of the data it reports according to its distance from each second Internet of Things terminal, so as to confirm the cluster it joins. After each third Internet of Things terminal confirms the cluster it joins, the terminal clustering is completed;

[0113] Step A2, federated learning hierarchical aggregation. After the Internet of Things terminal clustering is completed, the server, base station, first Internet of Things terminal, and second Internet of Things terminal in the system participate in hierarchical model aggregation through the deployed global model, edge model, clustered model, and local model, so as to achieve load balancing of the Internet of Things modules in the system. In the hierarchical aggregation mechanism, three model aggregations need to be performed through the global model, edge model, and clustered model respectively to disperse the model aggregation tasks. The model aggregations performed by the first Internet of Things terminal, base station, and server correspond to steps 4.2, 4.4, and 4.7 of the aggregation verification method respectively. The hierarchical aggregation mechanism based on Internet of Things terminal clustering included in this embodiment is as Figure 2 shown.

[0114] The selection of aggregation nodes for model performance specifically includes:

[0115] Step B1: The aggregation node selection mechanism based on model performance can be divided into two parts, namely Leader selection and aggregation node selection. For Leader selection, referring to RAFT+, at the beginning of node selection, the base station collects the number of times each IoT first terminal participates in aggregation, the computing resources of the IoT first terminal, and the system communication environment information. The node with the most participation times becomes the new Leader. During the aggregation node selection process, first determine the number of IoT first terminals participating in model aggregation and sort the IoT first terminals participating in the previous model aggregation according to model accuracy. The top 50% of the IoT first terminals continue to participate in model aggregation and are added to the aggregation node set W. The remaining IoT first terminals participating in the previous model aggregation serve as the verification nodes for this model aggregation. The number of IoT first terminals participating in this model aggregation is determined according to determined, where N I is the number of IoT first terminals in the system. Finally, based on N c and the aggregation node policy obtained by the Deep Deterministic Policy Gradient (DDPG) algorithm, select nodes to join W;

[0116] Step B2: The distribution state of each IoT first terminal. The state S ∈ S is composed of the states of each IoT first terminal within the coverage of the base station and is defined as follows:

[0117] S = (ξ, ρ, μ, η),

[0118] where ξ represents the index of the Leader in the network;

[0119]

[0120] ρ i represents the number of times the IoT first terminal i in the system participates in model aggregation;

[0121]

[0122] μ i represents the signal-to-noise ratio between the Leader and the IoT first terminal i during data transmission, and η represents the node state of the Leader. η = 0 indicates that the leader is in normal working condition, otherwise η = 1;

[0123] Step B3: Aggregation node set selection action. To simplify the specific decision-making, a mapping relationship between specific actions and action indices is established through an action list. The selected action A ∈ A is defined as the index corresponding to a specific node set, and the action is represented as follows:

[0124]

[0125] Among them, a i represents the node state of the first Internet of Things terminal i. The node states include Leader, aggregation node, and verification node. All possible actions constitute the action set A;

[0126] Step B4, the state transition, which is a function of the state-action pair (S, A), is used to describe the process of the model transferring to a new state S' after performing action A in the current state S; the update of the system state μ at cycle τ + 1 is based on the signal-to-noise ratio and is expressed as:

[0127]

[0128] Assume that the action at cycle τ is A τ , and the state transition function of the system state ξ can be obtained according to the system state η, and is specifically expressed as:

[0129]

[0130] Based on the aggregation node set W in each cycle, ρ at cycle τ + 1 i can be expressed as:

[0131]

[0132] As the system runs, state transitions are performed according to step B4 until the system reaches its preset operating cycle;

[0133] Step B5, reward; each state transition generates a certain reward. The reward R(S, A) is a real-valued function of the state S and the action A, reflecting the quality of the current A. The definition of the reward is consistent with the optimization goal and is defined as the product of the global model accuracy obtained within cycle τ and the reciprocal of the time delay required to complete one round of federated learning model training. The shorter the time delay required to complete one round of training and the higher the global model accuracy, the better the policy. The specific reward function is as follows:

[0134]

[0135] Step B6, the aggregation node selection strategy based on DDPG; solving the MDP problem is to find an optimal policy π to maximize the expectation of the long-term cumulative reward average:

[0136]

[0137] In the process of aggregating node selection, as the number of terminals increases, the dimensions of the action space and the state space will exceed the limits of general deep reinforcement learning methods, and there is continuity between different actions. Therefore, this mechanism selects the DDPG algorithm to solve the optimal strategy. In the DDPG algorithm, there are four neural networks, namely the actor network, the target actor network, the critic network, and the target critic network. Let be denoted as the actor network with parameters θ π . be denoted as the critic network with parameters θ Q . All layers in the neural network are fully connected. The parameters θ π ' and θ Q ' of the target actor network and the target critic network are updated regularly by the Exponential Moving Average (EMA):

[0138] θ Q ' = κθ Q ' + (1 - κ)θ Q , θ π ' = κθ π ' + (1 - κ)θ π .

[0139] The loss J(θ π ) of the actor network is defined as the estimated value of Q calculated by the critic network. The loss L(θ Q ) of the critic network is defined as the mean squared error between Q and the target value y, and its definition is as follows:

[0140]

[0141] where y = R + γQ', and γ is the discount factor.

[0142] The model performance verification of the blockchain specifically includes:

[0143] Step C1, intra-cluster verification. In each round of federated learning training, after the second IoT terminal finishes local training, it broadcasts the local model parameters within the cluster. Intra-cluster verification is the mutual verification carried out by the second IoT terminal under the leadership of the first IoT terminal within the cluster, corresponding to step 4.3 of the aggregation verification method. Intra-cluster verification is mainly divided into three parts: allocating verification tasks, executing verification tasks, and calculating the model accuracy;

[0144] Step C1.1, allocating verification tasks. The first IoT terminal within the cluster collects the parameters of each local model to perform intra-cluster model aggregation and generates model verification tasks, and assigns N to each second IoT terminal EA verification node, the first IoT terminal packages the verification task to generate a new block and broadcasts it in the local blockchain network;

[0145] Step C1.2, execute the verification task. The second IoT terminal executes the verification task in the block, evaluates the model accuracy of the remaining second IoT terminals in the cluster according to the local dataset as the verification result. After completing the verification, the second IoT terminal sends the verification result to the first IoT terminal in the cluster;

[0146] Step C1.3, calculate the model accuracy. When the second IoT terminal is hijacked, it may report untrained model parameters and inaccurate verification results. In the model performance verification mechanism of the blockchain, the second IoT terminal with a model accuracy lower than a certain value (this value can be determined according to experience) for a long time will be regarded as a malicious node. When calculating the model accuracy, the first IoT terminal selects some verification results for mean calculation to offset the negative impact of malicious nodes and at the same time considers the long-term change of the accuracy rate. After receiving the verification results sent by all the second IoT terminals in the cluster, the first IoT terminal calculates the model accuracy of each second IoT terminal. Each verification result and the calculated local model accuracy will be packaged by the first IoT terminal to generate a new block, and the new block will be broadcast in the blockchain network;

[0147] Step C2, inter-cluster verification. In inter-cluster verification, the accuracy of each cluster model is evaluated through mutual verification among the first IoT terminals, providing a reliable proof of model accuracy for the aggregation scheme. Corresponding to step 4.5 of the aggregation verification method, inter-cluster verification is mainly divided into four parts, namely, allocate verification tasks, execute verification tasks, collect verification results, and calculate model accuracy;

[0148] Step C2.1, in the stage of allocating verification tasks, the base station allocates N E verification nodes to each aggregation node. At the same time, the base station packages the allocation result as a verification task to generate block m and broadcasts it in the edge blockchain network. The above allocation is completely random to avoid private communication between nodes. Due to the resource limitation of the first IoT terminal, each verification node can execute at most N Q verification tasks;

[0149] Step C2.2, execute the verification result. In the stage of executing verification tasks, after each node in the edge blockchain network receives block m, it uses the local dataset as the verification dataset and executes the verification tasks included in the block;

[0150] Step C2.3, in the stage of collecting verification results, the Leader selects N E from the N GFor the verification results, based on the optimal stopping theory, the Leader regards the arrival of the verification results for any aggregation node as a time series queue. At the same time, each time series queue is divided into a threshold queue and a verification queue to determine the selected verification results. The lengths of the threshold queue and the verification queue are N R and N E -N R , the verification result with the highest accuracy in the threshold queue will be used as the selection threshold for the verification queue. In the verification queue, the verification results that meet the selection threshold will be selected to calculate the model accuracy until the number of selected verification results reaches N G . If there are not enough verification results in the verification queue that meet the selection threshold, the last several verification results in the verification queue will be selected for supplementation. After the number of selected results reaches N G , the subsequent arriving verification results will be ignored. The specific selection process is as shown in Figure 3 In Figure 3 , N R =2, N G =2, the selection threshold is 0.93. In the verification queue, T5 and T8 are selected;

[0151] Step C2.4, calculate the model accuracy. In the stage of calculating the model accuracy, the Leader calculates the model accuracy of each aggregation node according to the selected verification results. The calculated model accuracy will be provided to the aggregation node selection mechanism based on model performance for aggregation node selection. After calculating the model accuracy of all aggregation nodes, the Leader packs the verification results and the calculated model accuracy to generate block n, and broadcasts the block in the blockchain network to reach block consensus.

[0152] To further verify the superior technical effects of the proposed aggregation verification method for Internet of Things privacy protection, this embodiment is based on a Python-based simulation platform to evaluate the performance of the method proposed in the present invention. The platform is deployed on a server with a server processor model of Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz, a memory of 32GB, and an Ubuntu 16.04.3 LTS system. In this platform, an Internet of Things system combined with federated learning is established based on the system architecture. In this system, there is a server, a base station, and several Internet of Things terminals. Each Internet of Things terminal is randomly distributed within the coverage area of the base station and is assumed to be directly connected to a power source. Corresponding federated learning models are deployed on each terminal according to the system architecture. The number of the first Internet of Things terminal in the system is determined by specific configuration. The number of the second Internet of Things terminal increases as the number of the first Internet of Things terminal increases. The number of the third Internet of Things terminal is the same as that of the second Internet of Things terminal. The second Internet of Things terminal collects data from the third Internet of Things terminal and adds the data to the local data set. Wireless transmission is used for data transmission between Internet of Things terminals and between Internet of Things terminals and the base station within the system. Only large-scale fading including path loss and shadow fading is considered. A wired transmission data transmission method is used between the base station and the server.

[0153] To comprehensively analyze the advantages of the method proposed in the present invention compared with the prior art, three tests are specifically carried out in the embodiment, namely, the accuracy test of the federated learning model under different aggregation schemes, the convergence efficiency test of the federated learning model, and the system efficiency test. During the test process, the maximum tolerable delay for each data communication is 300 seconds. In addition, a handwritten dataset is used as the Internet of Things data to train the federated learning local model in the test. During the simulation process, the handwritten data is sent from the third Internet of Things terminal to the second Internet of Things terminal according to the preset Internet of Things data sending interval (5 minutes) and added to the local data set of the corresponding terminal. At the same time, to test the resistance of the method proposed in this embodiment to malicious node attacks, at most 1 / 3 of the Internet of Things terminals in the system are hijacked and become malicious nodes. The specific parameters are shown in Table 1:

[0154] Table 1 System simulation parameter configuration

[0155]

[0156] Figure 4It shows the convergence of the clustered models and the global model with the increase of the training rounds under the native federated learning aggregation scheme and the aggregation verification method proposed in this embodiment. Among them, the convergence of the model is represented by the Loss value of the model. By calculating the mean value of the Loss values of the clustered models, the Loss value curve of the clustered models in the figure is obtained. At the same training round, the Loss values of the global and clustered models under the aggregation verification method proposed in this embodiment are higher than those of the model under the native federated learning aggregation scheme. Since in each round of model training, the aggregation verification scheme selects a subset of nodes to participate in the edge model aggregation through the aggregation node selection mechanism, the Loss values of the clustered models that do not participate in the model aggregation result in a higher average Loss value of the clustered models. At the same time, since only some of the clustered models participate in the model aggregation, the global model needs more training rounds to learn all the features of the data. When the training round reaches 1200, the global models under both schemes and the clustered models under the native federated learning aggregation scheme converge. When the training round reaches 1200, the clustered models under the aggregation verification method proposed in this embodiment converge. In summary, the aggregation verification method proposed in this embodiment can ensure the learning efficiency of the global model in federated learning;

[0157] Figure 5 It shows the change of the accuracy of the clustered models and the global model with the increase of the training rounds under the native federated learning aggregation scheme and the aggregation verification method proposed in this embodiment. With the increase of the training rounds, under the native federated learning aggregation scheme and the aggregation verification method proposed in this embodiment, the average accuracy of the clustered models and the accuracy of the global model both increase. At the beginning of the system operation, at the same training round, the accuracy of the clustered models under the native federated learning aggregation scheme is higher. Since the aggregation scheme selects a subset of nodes to participate in the edge model aggregation, after synchronizing the global model parameters, the accuracy of the clustered models that do not participate in the model aggregation is low, resulting in a low average model accuracy. When the training rounds reach 1200 and 1800, the model accuracies under the native federated learning aggregation scheme and the aggregation verification method proposed in this embodiment reach stable values respectively;

[0158] Figure 6 and Figure 7 It shows the influence of the native federated learning aggregation scheme and the aggregation verification method proposed in this embodiment on the time delay required to complete one round of federated learning model training under different numbers of the first IoT terminals. The simulation results without using the blockchain-based model performance verification mechanism are as Figure 6As shown, the number of the first IoT terminals increases from 7 to 16. In the clustering model aggregation, the number of model parameters increases with the increase in the number of the second IoT terminals within each cluster, resulting in an increase in the clustering aggregation delay. Since the computing resources of the first IoT terminals are independently configured, this directly leads to fluctuations in the block packaging delay when different first IoT terminals act as Leader nodes, thus affecting the delay required to complete one round of federated learning model training. Compared with the native federated learning aggregation scheme, only adopting the hierarchical aggregation mechanism proposed in this embodiment will increase the total training delay by about 10%. This is because there are significant performance differences between IoT modules such as IoT terminals and base stations and the server, and dispersing the aggregation tasks causes an increase in delay. However, when the aggregation task volume reaches a higher level, the hierarchical aggregation mechanism will have a positive impact on the delay. Only adopting the aggregation verification method proposed in the method of this embodiment can reduce the total training delay by about 12% when the number of terminals is large. Adopting both the hierarchical aggregation mechanism and the aggregation node selection mechanism can reduce the total training delay by about 6%. However, since the selection of aggregation nodes in the aggregation node selection mechanism takes into account the influence of long-term factors, there are certain limitations in the performance improvement. The simulation results of adopting the complete aggregation verification method are as Figure 7 shown. Adopting the model performance verification mechanism based on blockchain will increase the delay to a certain extent. According to the performance verification mechanism, during the model aggregation process, the verification nodes that do not participate in the edge model aggregation need to execute the model verification tasks assigned by the base station during the block consensus process, which causes an increase in the block consensus delay. At the same time, setting the stop condition according to the optimal stopping theory in the performance verification mechanism can reduce the total training delay by about 13% on the premise of ensuring fairness, thus maintaining the system operation efficiency as much as possible. In summary, adopting the aggregation verification method proposed in this embodiment can maintain the efficiency of the federated learning algorithm and improve the efficiency of the IoT system combined with federated learning while ensuring the fairness of aggregation.

[0159] The present invention is not limited by the above embodiments. What is described in the above embodiments and the specification is only to illustrate the principle of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims.

Claims

1. An aggregation verification method for Internet of Things privacy protection, characterized in that Including: Step 1: Build an Internet of Things (IoT) system. The IoT system includes a server, a base station, and IoT terminals. Among them, the IoT terminals include the first IoT terminal, the second IoT terminal, and the third IoT terminal. The third IoT terminal is used to collect IoT data and report it to the nearest second IoT terminal. The second IoT terminal is used to deploy a federated learning local model, collect the data reported by the third IoT terminal, and train the local model. The first IoT terminal is used to deploy a clustering model, collect the local model parameters of the second IoT terminal, and perform model aggregation. The server is used to deploy a global model and perform global model aggregation, and build an edge blockchain network composed of the first IoT terminal and the base station to achieve trusted storage of information in the IoT system. The edge blockchain network uses RAFT+ as the consensus mechanism; Step 2: Cluster the IoT terminals. Each cluster contains a first IoT terminal, several second IoT terminals, and several third IoT terminals. The first IoT terminal and the second IoT terminals in each cluster jointly maintain a local blockchain network. The second IoT terminals within the local blockchain network perform mutual verification of model performance and store the verification results. The local blockchain network uses RAFT+ as the consensus mechanism. The base station selects a Leader node among the first IoT terminals in the edge blockchain network. The selected Leader node packages data blocks and leads block consensus. The remaining first IoT terminals are Follower nodes and participate in block consensus; Step 3: Model malicious nodes to affect the security and efficiency of the IoT system; Step 4: The third IoT terminal collects IoT data according to the set collection interval and reports it to the nearest second IoT terminal. The second IoT terminal adds the collected data to its local dataset and performs local model training. The second IoT terminal uploads the local model parameters to the first IoT terminal to participate in model aggregation. After the first IoT terminal, the base station, and the server respectively perform model aggregation, the global model parameters are synchronized to all federated learning models in the IoT system.

2. The aggregation verification method for Internet of Things privacy protection according to claim 1, wherein Step 4 includes: Step 4.1: At the beginning of each round of training, the third IoT terminal selects the Leader node and aggregation nodes participating in this model aggregation according to the aggregation node selection mechanism based on model performance. The third IoT terminal collects IoT sensing data according to its preset type and reports it to the nearest second IoT terminal. The second IoT terminal collects the IoT data reported by the third IoT terminal and adds it to the local dataset. The second IoT terminal trains the local model deployed on the second IoT terminal according to the preset time; Step 4.2, after the local training of the second IoT terminal ends, the local model parameters are uploaded to the first IoT terminal within the cluster. After the second IoT terminal collects the local model parameters of all the second IoT terminals within the cluster, it performs cluster model aggregation. The delay for the first IoT terminal i to collect the local model parameters and perform cluster model aggregation is represented by ; Step 4.3: The first IoT terminal assigns verification nodes to each second IoT terminal within the cluster and generates in-cluster verification tasks, and packages the verification tasks into verification blocks and broadcasts them within the local blockchain network for mutual verification by the second IoT terminals within the cluster; Step 4.4, the first IoT terminal selected as an aggregation node by the base station through the aggregation node selection mechanism reports its cluster model parameters to participate in edge model aggregation. The first IoT terminal not selected as an aggregation node serves as a verification node in the aggregation verification method in this model aggregation. After the base station collects the cluster model parameters reported by all aggregation nodes, it performs edge model aggregation. The base station collecting the model parameters of the aggregation nodes and performing edge model aggregation is represented as Step 4.5, the base station generates a verification task according to the set of aggregation nodes. The verification task is packaged to generate a verification task block. After the verification task block is generated, it is synchronized to each IoT first terminal in the edge blockchain network. The IoT first terminal that serves as a verification node in this edge aggregation executes the verification task assigned to it in the verification task block and sends the verification result to the Leader node in the response. When the verification results collected by the Leader node meet the requirements of the blockchain-based model performance verification mechanism, the verification process is completed. The Leader node calculates the model accuracy of each aggregation node according to the performance verification mechanism. The verification delay is expressed as Step 4.6, the Leader node packages each model accuracy and the verification result in the form of a transaction to generate a verification result block and conducts block consensus within the edge blockchain network. Each IoT first terminal checks the correspondence between the model accuracy of each aggregation node and the verification task and the verification result, and sends an acknowledgement response to the Leader node. The generation delay and consensus delay of the verification result block are respectively expressed as and After the block is legally generated, the base station updates the selection strategy in the aggregation node selection mechanism based on model performance according to the edge model accuracy and the cluster model accuracy of each aggregation node included in the block, and sends the aggregated edge model parameters to the server; Step 4.7, the server performs global model aggregation and synchronizes the global model parameters to the edge model, the clustered model, and the local model in sequence, and the time delay is expressed as Step 4.8: In the aggregation verification method for IoT privacy protection, the total delay required to complete one round of federated learning model training is expressed as Repeat steps 4.1 - 4.7 until the global model of federated learning converges.

3. The aggregation verification method for Internet of Things privacy protection according to claim 1, wherein Step 4 also includes the step of clustering IoT terminals: Determine the number of clusters according to the number of the first IoT terminals within the coverage of the base station in the IoT system, and establish N S clusters with the first IoT terminals as the cluster heads of the clusters; Each second IoT terminal confirms the sub-cluster to which it joins according to the distance between the second IoT terminal and each cluster head. To balance the computing tasks among sub-clusters, the number of second IoT terminals within each sub-cluster satisfies where N M is the number of second IoT terminals in the IoT system; After each IoT secondary terminal confirms the cluster it joins, the IoT tertiary terminal determines the target for reporting data by the IoT tertiary terminal based on the distances between the IoT tertiary terminal and each IoT secondary terminal, so as to confirm the cluster the IoT tertiary terminal joins. After each IoT tertiary terminal confirms the cluster it joins, the terminal clustering is completed.

4. The aggregation verification method for Internet of Things privacy protection according to claim 1, characterized in that Step 4 also includes the step of hierarchical aggregation in federated learning: After the clustering of IoT terminals is completed, the server, base station, IoT primary terminal, and IoT secondary terminal in the system participate in hierarchical model aggregation through the deployed global model, edge model, cluster model, and local model, so as to achieve load balancing of the IoT modules in the system. In hierarchical aggregation, three model aggregations are respectively performed through the global model, edge model, and cluster model to disperse the model aggregation tasks.

5. The aggregation verification method for Internet of Things privacy protection according to claim 1, wherein Step 4 also includes the step of selecting aggregation nodes for model performance: Step 421, at the beginning of node selection, the base station collects the number of times each IoT first terminal participates in aggregation, the computing resources of the IoT first terminal, and the system communication environment information. The node with the most participation times becomes the new Leader. During the aggregation node selection process, determine the number of IoT first terminals participating in model aggregation and sort the IoT first terminals participating in the previous model aggregation according to model accuracy. The top 50% of the IoT first terminals continue to participate in model aggregation and are added to the aggregation node set W. The remaining IoT first terminals participating in the previous model aggregation are used as verification nodes for this model aggregation. The number of IoT first terminals participating in this model aggregation is determined according to determined, where N I is the number of IoT first terminals in the system. Based on N c and the aggregation node policy obtained by the deep deterministic policy gradient algorithm, select nodes to join W; Step 422, define the system state. The state S ∈ S is composed of the states of each IoT primary terminal within the coverage of the base station, and the definition is as follows: S = (ξ, ρ, μ, η), where ξ represents the index of the Leader in the network; ρ = (ρ1, ρ2,..., ρχ i ,..., ρχ NS ), i ∈ {1, 2,..., N S}, ρ i Indicates the number of times the first IoT terminal i in the system participates in model aggregation; μ i Indicates the signal-to-noise ratio between the Leader and the first IoT terminal i during data transmission. η represents the node state of the Leader. η = 0 indicates that the leader is in normal working condition, otherwise η = 1; Step 423, select nodes for action simulation and perform model aggregation, and use the obtained set of aggregation nodes as the system action; establish a mapping relationship between specific actions and action indices through an action list. The selected action A ∈ A is defined as the index corresponding to the specific node set, and the action is expressed as follows: where a i represents the node state of the first IoT terminal i. The node states include Leader, aggregation node, and verification node. All possible actions constitute the action set A; Step 424, determine the state transition situation after taking the action in the state, and use the function of the state - action pair (S, A) to describe the process of the model transferring to the new state S′ after executing the action A in the current state S; the update of the system state μ in the period τ + 1 is based on the signal - to - noise ratio, expressed as: Suppose the action in period τ is A τ , the state transition function of the system state ξ can be obtained from the system state η, expressed as: Based on the set of aggregation nodes \(W\) in each period, \(\rho\) in period \(\tau + 1\) i can be expressed as: As the system runs, perform state transition according to step 424 until the system reaches its preset operating period; Step 425, establish the system reward function R. The reward R(S, A) is a real - valued function of the state S and the action A, reflecting the quality of the current A. The definition of the reward is consistent with the optimization goal and is defined as the product of the global model accuracy obtained in the period τ and the reciprocal of the time delay required to complete one round of federated learning model training. The shorter the time delay required to complete one round of training and the higher the global model accuracy, the better the policy. The reward function is defined as follows: Step 426: Solve based on the DDPG algorithm to obtain the optimal aggregation node selection strategy. Solving the MDP problem is to find an optimal policy π to maximize the expected value of the long-term cumulative reward average Let be represented as the actor network with parameter θ π and be represented as the critic network with parameter θ Q . All layers in the neural network are fully connected. The parameters θ π ' and θ Q ' of the target actor network and the target critic network are updated periodically by the exponential moving average method: θ Q ′ = κθ Q ′ + (1 - κ)θ Q , θ π ′ = κθ π ′ + (1 - κ)θ π , The loss J(θ of the actor network π ) is defined as the estimated value of Q calculated by the critic network, and the loss L(θ of the critic network Q ) is defined as the mean squared error between Q and the target value y, which is defined as follows: where y = R + γQ′, and γ is the discount factor.

6. The aggregation verification method for Internet of Things privacy protection according to claim 2, characterized in that Step 4.3 includes: Step 4.31, allocate verification tasks. The first IoT terminal within the cluster collects the parameters of each local model to perform in-cluster model aggregation, generates model verification tasks, and allocates N E verification nodes to each second IoT terminal. The first IoT terminal packages the verification tasks to generate new blocks and broadcasts them in the local blockchain network; Step 4.32, execute the verification task. The IoT secondary terminal executes the verification task in the block, evaluates the model accuracy of the remaining IoT secondary terminals in the cluster based on the local dataset as the verification result. After completing the verification, the IoT secondary terminal sends the verification result to the IoT primary terminal in the cluster; Step 4.33: Calculate the model accuracy. An IoT secondary terminal with a long-term model accuracy lower than a certain value is regarded as a malicious node. When calculating the model accuracy, the IoT primary terminal selects some verification results for mean calculation to offset the negative impact of malicious nodes and at the same time considers the long-term change of the accuracy rate. After receiving the verification results sent by all IoT secondary terminals within the cluster, the IoT primary terminal calculates the model accuracy of each IoT primary terminal. Each verification result and the calculated local model accuracies are packaged by the IoT primary terminal to generate a new block, and the new block will be broadcast in the blockchain network.

7. The aggregation verification method for Internet of Things privacy protection according to claim 2 or 6, characterized in that Step 4.5 includes: Step 4.51, in the stage of allocating verification tasks, the base station allocates N E verification nodes to each aggregation node. At the same time, the base station packages the allocation result as a verification task to generate block m and broadcasts it in the edge blockchain network. Each verification node can execute at most N Q verification tasks; Step 4.52: Execute the verification results. In the verification task execution phase, after each node in the edge blockchain network receives block m, it uses the local dataset as the verification dataset and executes the verification tasks included in the block. Step 4.53, the stage of collecting verification results. In the stage of collecting verification results, the Leader selects N verification results from the N verification nodes assigned to each aggregation node. The Leader regards the arrival of the verification results for any aggregation node as a time series queue. At the same time, each time series queue is divided into a threshold queue and a verification queue to determine the selected verification results. The lengths of the threshold queue and the verification queue are N and N - N respectively. The verification result with the highest accuracy in the threshold queue is used as the selection threshold for the verification queue. In the verification queue, the verification results that meet the selection threshold are selected to calculate the model accuracy until the number of selected verification results reaches N. If there are not enough verification results in the verification queue that meet the selection threshold, the last several verification results in the verification queue are selected to make up the number. After the number of selected results reaches N, the subsequent arriving verification results are ignored; E verification results from the N G verification nodes assigned to each aggregation node. The Leader regards the arrival of the verification results for any aggregation node as a time series queue. At the same time, each time series queue is divided into a threshold queue and a verification queue to determine the selected verification results. The lengths of the threshold queue and the verification queue are N R and N E -N R . The verification result with the highest accuracy in the threshold queue is used as the selection threshold for the verification queue. In the verification queue, the verification results that meet the selection threshold are selected to calculate the model accuracy until the number of selected verification results reaches N G . If there are not enough verification results in the verification queue that meet the selection threshold, the last several verification results in the verification queue are selected to make up the number. After the number of selected results reaches N G , the subsequent arriving verification results are ignored; Step 4.54: Calculate the model accuracy. In the model accuracy calculation phase, the Leader calculates the model accuracy of each aggregation node based on the selected verification results. The calculated model accuracies are provided to the aggregation node selection mechanism based on model performance for aggregation node selection. After calculating the model accuracies of all aggregation nodes, the Leader packages the verification results and the calculated model accuracies to generate block n and broadcasts the block in the blockchain network to achieve block consensus.

Citation Information

Patent Citations

  • Distributed Internet of Things intrusion detection method and system based on block chain and federated learning

    CN113794675A

  • Method for carrying out trusted federal learning based on block chain

    CN114462624A