Node selection and aggregation optimization system and method for federated learning under microservice architecture

By building a credit chain and transaction chain under a microservice architecture, dividing node types according to node privacy requirements, and optimizing the model aggregation process, the problems of wasted computing resources and insufficient model accuracy caused by differences in privacy requirements in crowd intelligence perception are solved, achieving more efficient resource utilization and model accuracy.

CN114418109BActive Publication Date: 2025-10-03HENAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111006823.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2025-10-03
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

In the existing microservice architecture, crowd sensing fails to effectively consider the differences in privacy requirements of different participating nodes, resulting in wasted computing resources and insufficient model accuracy.

Method used

A node selection and aggregation optimization system is adopted to build a credit chain and transaction chain through blockchain technology. Nodes are divided into data nodes and model nodes according to their privacy protection requirements. The central party selects nodes participating in model aggregation based on the node's reputation and optimizes the model aggregation process through the FedAvg algorithm.

Benefits of technology

It achieves the reasonable utilization of the imbalance of node privacy requirements while ensuring the accuracy of the model, improves the stability and convergence speed of the system, and reduces the waste of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114418109B_ABST
    Figure CN114418109B_ABST
Patent Text Reader

Abstract

The present invention discloses a node selection and aggregation optimization system and method for federated learning under a microservices architecture. The system includes: a node classification module for classifying nodes into two categories: data nodes and model nodes based on specific privacy protection requirements; a node selection module for model aggregation, in which a central party selects model nodes participating in model aggregation and data nodes for verifying model parameters based on node reputation; node reputation is generated based on the quality of data or models transmitted by the sensing node and its historical reputation; and a credit chain and transaction chain construction module for establishing two blockchains, namely a credit chain and a transaction chain, which respectively record the reputation of the nodes and the categories of data or models exchanged between the central party and the nodes in each round of federated learning. The present invention constructs unique quality assessment and model aggregation methods to address the different privacy requirements of nodes, fully leveraging the advantages of federated learning in protecting node data privacy and the immutability and traceability of blockchains.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network privacy security technology, and in particular relates to a node selection and aggregation optimization system and method for federated learning under a microservice architecture. Background Art

[0002] Microservices architectures are highly scalable, allowing for easy addition, deletion, and modification of code. Technicians can use different stacks for different components, and components can be scaled independently, reducing the waste and cost of scaling the entire application. However, current microservices architectures are generally unstable.

[0003] Crowd perception is a microservice model that uses users and their smart terminals (such as mobile phones, wearable devices, and smart cars) as carriers (nodes) and is based on the participation of a large number of nodes. It uploads the collected large-scale data to the task processing platform, integrating data collection, analysis, and extraction of swarm intelligence. Crowd perception tasks generally include task allocation, quality assessment, incentive mechanisms, privacy protection, and swarm intelligence extraction. However, in the context of increasingly stringent privacy supervision and growing awareness of privacy protection, crowd perception has the problem of privacy leakage. The personal sensitive information data of participating nodes cannot be adequately protected. In addition, the central node of the traditional crowd perception model has absolute power and is vulnerable to single-point attacks.

[0004] Currently, researchers have used federated learning to address the challenges in crowd sensing scenarios. Ying et al. proposed using an incentivized federated learning method with differential privacy in a crowd sensing microservice system to perform double privacy protection to protect the bidding privacy of sensing users and the parameters of local training models. To solve the problem of insufficient data samples for model owners (Chenhao Ying, Haiming Jin, Xudong Wang, and Yuan Luo. Double insurance: Incentivized federated learning with differential privacy in mobile crowd sensing. In 2020 International Symposium on Reliable Distributed Systems (SRDS), pages 81–90, 2020.), Lim et al. proposed an incentive mechanism based on the privacy protection method of federated learning (FL) to address the incentive mismatch between workers and model owners, and between model owners. In order to find trustworthy and reliable participants for federated learning tasks (Wei Yang Bryan Lim, Zehui Xiong, Chunyan Miao, Dusit Niyato, Qiang Yang, Cyril Leung, and H. Vincent Poor. Hierarchical incentive mechanism design for federated machine learning in mobile networks. IEEE Internet of Things Journal, 7(10): 9575–9588, 2020.), Kang et al. proposed a reliable worker selection scheme suitable for federated learning tasks, using the non-repudiation and non-tamperability of the alliance chain to achieve efficient reputation management of participants. In order to solve the single point failure and poisoning attack problems of the central coordinator (Jiawen Kang, Zehui Xiong, Dusit Niyato, Yuze Zou, Yang Zhang, and Mohsen Guizani. Reliable federated learning for mobile networks. IEEE Wireless Communications, 27(2):72–80, 2020.), Qu et al. integrated federated learning and blockchain and designed a distributed big data-driven cognitive computing (D2C) architecture. Each time the model is aggregated, a node is temporarily selected as the central coordinator.The above schemes have applied federated learning technology to try to solve the privacy issues existing in crowd sensing (Youyang Qu, Shiva Raj Pokhrel, Sahil Garg, Longxiang Gao, and Yong Xiang. A blockchained federated learning framework for cognitive computing in industry 4.0 networks. IEEE Transactions on Industrial Informatics, 17(4): 2964–2973, 2021.). However, the above studies have overlooked a key situation in current crowd sensing: different participating nodes have different privacy requirements. Previous studies assumed that all participating nodes have high privacy protection requirements, but in real life, the privacy requirements of participating nodes vary. This causes a large amount of computing resources to be wasted on nodes with low privacy protection requirements when executing the above methods. At the same time, for the central party, with the permission of the participating nodes, real data is more conducive to improving the final accuracy of the crowd sensing task than the model. Summary of the Invention

[0005] In response to the widespread instability problem in current microservice architectures and the problem that existing federated learning methods for solving network privacy security in crowd sensing do not take into account the different privacy requirements of different participating nodes, the present invention proposes a node selection and aggregation optimization (OAFL) system and method for federated learning in a microservice architecture.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] On one hand, the present invention proposes a node selection and aggregation optimization system for federated learning under a microservice architecture, which has three roles: a task publisher, a central party, and a node. The task publisher submits task requirements to a crowd-sensing platform, uploads an initial data set to the central party as a test data set for the first round of sub-models, and uploads the selected initial model to the central party, while submitting incentives to the central party. The central party receives the task request, initializes the test data set and initial model, publishes the task to the node, selects nodes to participate in the task, receives data and sub-models uploaded by the node, evaluates the quality of the data and sub-models, generates node reputation, broadcasts it to the blockchain node and records it in the credit chain, performs local sub-model training and global model aggregation, and finally pays incentives to the node and returns the trained global model to the task publisher. Each node executes the task and chooses to upload data or sub-models based on its own privacy protection requirements. The model node uses the local data set to train the global model to generate sub-model parameters, obtains incentives based on the data or model quality uploaded to the central party, and records the information of obtaining the global model issued by the central party and the uploaded data or sub-model in the transaction chain. The system includes:

[0008] A node division module is used to divide nodes into two categories: data nodes and model nodes according to specific privacy protection requirements. The data nodes are used to transmit data, and the model nodes are used to transmit models.

[0009] The model aggregation node selection module is used by the central party to select model nodes participating in model aggregation and data nodes for verifying model parameters based on the node reputation; the node reputation is generated based on the quality of the data or model transmitted by the sensing node and its historical reputation;

[0010] The credit chain and transaction chain building modules are used to ensure that the node reputation cannot be tampered with and the data or model transmission information between the center and the nodes is traceable. In the system, two blockchains, namely the credit chain and the transaction chain, are established to record the node reputation and the types of data or models exchanged between the center and the nodes in each round of federated learning.

[0011] On the other hand, the present invention also proposes a node selection and aggregation optimization method for federated learning under a microservice architecture, including:

[0012] Based on specific privacy protection requirements, nodes are divided into two categories: data nodes and model nodes. The data nodes are used to transmit data, and the model nodes are used to transmit models.

[0013] The central party selects model nodes that participate in model aggregation and data nodes that verify model parameters based on node reputation; node reputation is generated based on the quality of the data or model transmitted by the sensing node and its historical reputation;

[0014] In order to ensure that the node reputation cannot be tampered with and that the data or model transmission information between the center and the nodes is traceable, the system establishes two blockchains, namely the credit chain and the transaction chain, to record the node reputation and the categories of data or models exchanged between the federated learning center and the nodes in each round.

[0015] Further, including:

[0016] The task publisher submits the task requirements to the crowdsensing platform, uploads the initial dataset to the center as the test dataset for the first round of sub-models, and uploads the selected initial model to the center, while submitting the incentive to the center.

[0017] The central party receives task requests, initializes the test dataset and initial model, issues tasks to nodes, selects participating nodes, receives data and sub-models uploaded by nodes, evaluates the quality of the data and sub-models, generates node reputation, broadcasts it to blockchain nodes and records it in the credit chain, trains local sub-models and aggregates the global model, and finally pays incentives to the nodes and returns the trained global model to the task publisher.

[0018] Each node performs tasks and chooses to upload data or sub-models based on its own privacy protection needs. The model node uses the local data set to train the global model to generate sub-model parameters, and obtains incentives based on the data or model quality uploaded to the central party. The information about the global model and uploaded data or sub-model issued by the central party is recorded in the transaction chain.

[0019] Furthermore, the model aggregation includes:

[0020] The center receives the sub-model parameters uploaded by the model nodes, evaluates the model quality, and updates the reputation of the model nodes. Based on the reputation of the model nodes, the center selects the sub-model parameters that will participate in the global model aggregation and adds them to the aggregation queue.

[0021] The central party calculates the weight of the sub-model parameters in the aggregation queue, that is, the total amount of training data is obtained by adding up the model nodes in the aggregation queue and the amount of data participating in the local training of the central party in the current round, and then calculates the weight of the training data of each model node. There are N models in the aggregation queue, 1 from the central party, generated according to the updated data set in this round, N-1 from the node, D i is the number of training data for the i-th sub-model node, D N is the number of training data of the center, The sum of the amount of training data for all models in the aggregated queue;

[0022] The central party will aggregate all sub-model parameters in the queue and execute the FedAvg algorithm to generate a new global model;

[0023] The central party broadcasts the new global model to all nodes and records transaction information in the transaction chain.

[0024] Furthermore, the process of model quality evaluation includes:

[0025] Taking the data owned by the central party as the test data set, testing the sub-model parameters uploaded by the model nodes, and judging the quality of the sub-model parameters by observing the accuracy of the test results;

[0026] Taking the data uploaded by the data nodes as the test data set, testing the global model of the previous round aggregated by the central party, and evaluating the quality of the data uploaded by the data nodes through the accuracy of the test results;

[0027] The central party takes the perception data uploaded by each data node as the test data set, and tests the global model aggregated in the previous round respectively, obtaining the data quality ACCi of each data node in this round, where i is the i-th data node. If ACCi > Mean(ACC), the central party believes that the data transmitted by this data node in this round is true and credible, and adds this data to the local data set of the central party to update the local data set; if ACCi < Mean(ACC), the central party believes that the perception data transmitted by this data node in this round is not credible, and thus discards this data.

[0028] Furthermore, the calculation process of the node credibility is as follows:

[0029] For data nodes, the calculation process of credibility is as follows:

[0030]

[0031] Where Ri k is the node credit value in this round, k is the current round, Ri k-1 is the credit value of the node in the k - 1 round, and the value of ri k is 0 or 1. When the data node is considered credible in this round, ri k is 1, and when the data node is considered not credible in this round, ri k is 0;

[0032] For model nodes, the central party uses local data as the test data set to test the sub-model uploaded by each model node, obtain the quality ACCi of each node sub-model, set the upper mean Mu = Max{Median(ACC), Mean(ACC)} and the lower mean Md = Min{Median(ACC), Mean(ACC)}, where Median(ACC) is the median value of the quality of each model node and the submitted sub-model and the quality of the central party's trained sub-model in this round, and Mean(ACC) is the average value of the quality of each sub-model in this round; then, the uploaded model nodes are divided into four categories:

[0033] Ⅰ. Model nodes whose sub-model quality ACCi is in the top 10% are considered secure and trusted nodes, and the central party adds the sub-model parameters to the aggregation queue;

[0034] Ⅱ. Sub-model quality ACCi>>Mu model nodes are relatively credible nodes, and the probability of entering the aggregation queue needs to be calculated additionally. That is, these nodes will have a probability of Pi being added to the aggregation queue, and a probability of 1-Pi not being added to the aggregation queue;

[0035] Nodes whose sub-model quality satisfies Mu>>ACCi>>Md are considered to have low sub-model quality and are not added to the aggregation queue;

[0036] IV. Nodes with sub-model quality Md>>ACCi are untrustworthy nodes;

[0037] After completing the sub-model quality assessment, according to the formula Generate the reputation of the model node:

[0038]

[0039] Furthermore, after the central party calculates the credibility of the data nodes and model nodes, it generates a new block with the credibility of all nodes, broadcasts the block and adds it to the credit chain. When all nodes in this round send the perception data or the local data trained to a converged model to the central party, the above process is recorded in the transaction chain and broadcast; the central party evaluates the data and model quality respectively.

[0040] Furthermore, the process of selecting the model nodes participating in model aggregation and the data nodes for verifying model parameters includes:

[0041] The data nodes are set to the top d% of the data nodes participating in this task in terms of credit value. The value of d is determined based on the number of participating nodes in different tasks, the specific magnitude of the data volume of the nodes in the task, and the real-time requirements of the task.

[0042] For model nodes, the chance of each node being selected in the current round is:

[0043] C=Ri k +αN+βACCi

[0044] The selection rate of each node in the current round is:

[0045]

[0046] Where C is the chance of selection, Ri k is the node’s credit value in the previous round. In normal cases, Ri k The most influential factor affecting whether a node can be selected is α and β, which are variable parameters determined by the specific task of crowdsensing. m is the total number of perception service nodes applying to participate in federated learning in this round, N is the number of times a node has not been selected since it was last selected, and ACCi is the quality of the sub-model in which the node participated in the aggregation in the previous round. According to the principle of locality, nodes that provided reliable services in the previous round will provide reliable services in the next round.

[0047] According to the selection rate of the node in the current round, relatively reliable nodes in this round are selected to participate in the execution of the perception task.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] To rationally utilize the imbalance in the privacy needs of participating nodes, this invention gives the power of choice to the participating nodes themselves, allowing them to ultimately choose whether to submit data or models based on their own privacy needs. For the central party, in addition to the aforementioned advantages, the data and models received in the same round can be mutually verified to achieve quality assessment of the data and models. Based on federated learning and blockchain technology, this invention constructs a unique quality assessment and model aggregation method based on the different privacy needs of nodes, fully leveraging the advantages of federated learning in protecting node data privacy and the immutability and traceability of blockchain:

[0050] 1. We propose a privacy and security architecture for distributed crowd-sensing networks. This innovatively transforms the aggregation process of federated learning. While the central party interacts with model training sub-nodes to determine model parameters, it also receives data to evaluate the sub-model quality and selects sub-model parameters with high accuracy for model aggregation.

[0051] 2. Based on the different privacy protection requirements of nodes, nodes are divided into data nodes (nodes that transmit data to the central party) and model nodes (nodes that transmit models to the central party). This allows the central party to have a real-time updated dataset for training sub-model parameters and verifying the quality of sub-models trained by model nodes.

[0052] 3. Establish a node reputation assessment mechanism based on the quality assessment mechanisms for data and sub-model parameters respectively;

[0053] 4. To ensure the traceability and non-tamperability of node reputation and the interaction information between the central party and nodes, and to resist malicious attacks, the present invention establishes a credit chain and a transaction chain to record node reputation and the interaction information between the central party and nodes respectively;

[0054] 5. Experimental analysis on the public dataset CREDIT-CARD shows that the present invention can have significantly better stability and convergence speed than FedAVG while ensuring model accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a schematic diagram of the architecture of a node selection and aggregation optimization system for federated learning under a microservice architecture according to an embodiment of the present invention;

[0056] Figure 2 Schematic diagram of the model aggregation process;

[0057] Figure 3 This is a schematic diagram of the blockchain structure;

[0058] Figure 4 This is the accuracy-training round curve of different methods on the CREDIT-CARD dataset;

[0059] Figure 5 This is a graph showing how the credit values ​​of different nodes on the CREDIT-CARD dataset change with the number of experimental rounds;

[0060] Figure 6 The convergence speed and model accuracy curves of OAFL and FedAVG under attack environment;

[0061] Figure 7 The following graphs show the convergence speed and model accuracy of OAFL and FedAVG when the trained models of participating nodes are not fully converged. DETAILED DESCRIPTION

[0062] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:

[0063] like Figure 1As shown, the present invention proposes a node selection and aggregation optimization (OAFL) system for federated learning under a microservice architecture, which has three roles: task publisher, central party and node; the task publisher submits the task requirement to the crowd intelligence perception platform, uploads the initial data set to the central party as the test data set of the first round of sub-models, and uploads the selected initial model to the central party, and submits incentives to the central party at the same time; the central party receives the task request, initializes the test data set and initial model, publishes the task to the node, selects the node participating in the task, receives the data and sub-model uploaded by the node, evaluates the quality of the data and sub-model, generates the node reputation, broadcasts it to the blockchain node and records it in the credit chain, and performs local sub-model Training and global model aggregation, finally incentivizing the nodes and returning the trained global model to the task publisher; each node executes the task and chooses to upload data or sub-models based on its own privacy protection requirements. The model node uses the local data set to train the global model to generate sub-model parameters (training with local data until the model converges), and obtains incentives based on the data or model quality uploaded to the central party. The information about obtaining the global model and uploaded data or sub-model issued by the central party is recorded in the transaction chain. When the node first participates in the perception task, the initial credibility is set to 0.5 (this value can be adjusted according to system requirements) to ensure that the newly joined node has a greater probability of participating in the execution of the perception task; the system includes:

[0064] A node division module is used to divide nodes into two categories: data nodes and model nodes according to specific privacy protection requirements. The data nodes are used to transmit data, and the model nodes are used to transmit models.

[0065] The model aggregation node selection module is used by the central party to select model nodes participating in model aggregation and data nodes for verifying model parameters based on the node reputation; the node reputation is generated based on the quality of the data or model transmitted by the sensing node and its historical reputation;

[0066] The credit chain and transaction chain building modules are used to ensure that the node reputation cannot be tampered with and the data or model transmission information between the center and the nodes is traceable. In the system, two blockchains, namely the credit chain and the transaction chain, are established to record the node reputation and the types of data or models exchanged between the center and the nodes in each round of federated learning.

[0067] (a) Model aggregation

[0068] In federated learning, privacy is protected between the central party and the training nodes by transmitting model parameters. The core work of the central party is to collect the sub-model parameters of the training nodes for aggregation to generate a new overall model. In order to optimize the efficiency of model aggregation, the OAFL system encourages nodes with low privacy protection requirements to upload collected data based on the different privacy protection requirements of the nodes. These data are used as test sets for sub-model quality assessment, and the training accuracy of the sub-model is added to the node reputation algorithm. The sub-model parameters of model nodes with high reputation are selected to participate in model aggregation. At the same time, the central party will perform quality assessment on the received data, and use the data sets provided by data nodes with high reputation as training data, which will participate in model aggregation after local sub-model training. The process of model aggregation is as follows: Figure 2 shown.

[0069] The OAFL system improves upon the classic FedAvg algorithm during model aggregation. The FedAvg algorithm was first proposed in [McMahan, Brendan, et al. "Communication-efficient learning of deep networks from decentralized data." Artificial intelligence and statistics. PMLR, 2017.] Its design principle is that the central server distributes the initial model to the model nodes. Each model node trains the model using gradient descent using local data and then uploads the trained sub-model parameters to the central server. The central server uses the amount of data each model node participated in training as a weight to perform a weighted average of the received sub-models. Since the central server receives both model parameters and data, it also participates in model training. After evaluating the quality of the received data, the central server uses data provided by highly reputable data nodes as training data for training its own sub-models. Therefore, before executing the FedAvg algorithm, the model aggregation process first evaluates model quality and then, based on the reputation of the model nodes, selects the sub-model parameters of the highly reputable model nodes for inclusion in the FedAvg algorithm.

[0070] The model aggregation steps of the OAFL system include:

[0071] 1. The central party receives the sub-model parameters uploaded by the model node, performs a quality assessment, and then updates the reputation of the model node according to the trusted node algorithm. Based on the reputation of the model node, the sub-model parameters participating in the global model aggregation are selected and added to the aggregation queue.

[0072] 2. The central party calculates the weight of the sub-model parameters in the aggregation queue, that is, the total amount of training data is obtained by adding up the model nodes in the aggregation queue and the amount of data participating in the local training of the central party in the current round, and then calculates the weight of the training data of each model node There are N models in the aggregation queue, 1 from the central party, generated according to the updated data set in this round, N-1 from the node, D i is the number of training data for the i-th sub-model node, D N is the number of training data of the center, The sum of the amount of training data for all models in the aggregation queue.

[0073] 3. The central party will execute the FedAvg algorithm on all sub-model parameters in the aggregation queue and generate a new global model.

[0074] 4. The central party broadcasts the new global model to all nodes and records the transaction information in the transaction chain.

[0075] (b) Quality Assessment and Node Reputation

[0076] In crowd sensing, the accuracy of quality assessments will, on the one hand, impact the quality of the final aggregated model. Obtaining a high-quality final model is the fundamental purpose of crowd sensing. Furthermore, the ability to accurately assess node services will impact the credibility of sensing nodes, which directly influences the motivation of participating nodes and, consequently, indirectly impacts future service quality. Key factors determining the quality of sensing tasks include the quality of data collected by nodes and the quality of sub-model parameters provided by model nodes for global model aggregation. Therefore, model and data quality assessments are pressing issues. Since federated learning models are trained using training data, and data beyond training data can verify model accuracy, the OAFL system leverages the relationship between model and data, building on the established trust mechanisms of the credit chain and transaction chain, to effectively improve the efficiency of intelligent extraction, reduce federated learning training cycles, and ensure system stability.

[0077] The process of model quality assessment is to use the high-quality data owned by the center as the test data set, test the sub-model parameters uploaded by the model node, and judge the quality of the sub-model parameters by observing the accuracy of the test results.

[0078] The data quality assessment process is to use the data uploaded by the data node as the test data set, test the global model of the previous round aggregated by the central party (the default global model is used when the data is uploaded for the first time), and evaluate the quality of the data uploaded by the data node through the accuracy of the test results.

[0079] When there are malicious attacks or hitchhiking situations among nodes, the quality assessment mechanism will filter out the data or models submitted by these nodes, thus accelerating the convergence speed of federated learning.

[0080] In the OAFL system, the node reputation depends on the quality of the data or model it submits, and whether it can participate in model aggregation depends on the node's reputation and the accuracy of the submitted sub-model. The specific process is as follows: for the sensed data uploaded by data transmission nodes, the central party uses the data uploaded by each data node as a test data set to test the global model aggregated in the previous round (the initial model is used in the first round), and obtains the data quality ACCi of each data node in this round, where i is the i-th data node, and the algorithm for giving ACC is provided. If ACCi > Mean(ACC), the central party believes that the data transmitted by this data node in this round is true and trustworthy, and adds this data to the local data set of the central party to update the local data set. If ACCi < Mean(ACC), the central party believes that the sensed data transmitted by this data node in this round is not trustworthy, and thus discards this data.

[0081] The calculation formula for the reputation of a data node is:

[0082]

[0083] Where Ri k is the node credit value in this round, k is the current round, Ri k-1 is the credit value of the node in the k - 1 round, and the value of ri k is 0 or 1. When the data node is considered trustworthy in this round, ri k is 1, and when the data node is considered untrustworthy in this round, ri k is 0.

[0084] For model nodes, the central party uses local data as a test data set to test the sub-models uploaded by each model node, and obtains the quality ACCi of each node's sub-model. Since the number of model nodes in the OAFL system is relatively large in the actual operating environment, in order to accurately evaluate the quality of its sub-models, improve the accuracy of model aggregation and reduce the number of communication rounds, the upper mean Mu = Max{Median(ACC), Mean(ACC)} and the lower mean Md = Min{Median(ACC), Mean(ACC)} are set, where Median(ACC) is the median value of the quality of each model node and the submitted sub-model and the quality of the central party's trained sub-model in this round, and Mean(ACC) is the average value of the quality of each sub-model in this round. Combining these two values ​​can avoid the situation where the accuracy of individual nodes in the current round is particularly low due to system misjudgment and the existence of malicious attack nodes. In the case of such extreme values, the average value will be greatly affected, making it impossible to filter out the model that is truly suitable for aggregation based on the average quality. Afterwards, we divide the model transmission nodes into four categories:

[0085] Ⅰ. Model nodes whose sub-model quality ACCi is in the top 10% are safe and trusted nodes, and the central party adds the sub-model parameters to the aggregation queue.

[0086] Ⅱ. Sub-model quality ACCi>>Mu model nodes are relatively credible nodes, and the probability of entering the aggregation queue needs to be calculated additionally. That is, these nodes will have a probability of Pi being added to the aggregation queue, and a probability of 1-Pi not being added to the aggregation queue.

[0087] Nodes whose sub-model quality satisfies Mu>>ACCi>>Md have low sub-model quality and are not added to the aggregation queue.

[0088] IV. Nodes with sub-model quality Md>>ACCi are untrustworthy nodes.

[0089] After completing the sub-model quality assessment, according to the formula Generate new reputation of model nodes,

[0090] After the central party calculates the reputation of the data nodes and model nodes, it generates a new block with the reputation of all nodes, broadcasts the block and adds it to the credit chain. The content of the block is as follows: Figure 3As shown, transaction information is placed in the underlying blocks of the Markle Tree. Each transaction contains three pieces of information: the model information sent by the server (central party) to the client (node) or the model information sent by the client to the server, i.e., the transaction information; the current time when the transaction occurred, i.e., the timestamp; and the proof value that satisfies the conditions for generating a block. The proof value is the value required to generate a new block in the blockchain and is the value found during the "proof of work" calculation process.

[0091] After all sensing service nodes in this round send their sensing data or trained local data to a converged model to the central authority, the OAFL system will record this process in the transaction chain and broadcast it throughout the system. The central authority will then evaluate the quality of both the data and the model. This step, leveraging the relationship between data and model described above, is the most critical step in the OAFL system.

[0092] (c) Participating Node Selection Mechanism

[0093] In the crowdsensing model, node selection for participating tasks involves the central party receiving a task request and then screening out nodes (users) likely to provide high-quality data or sub-models based on criteria such as node reputation, thereby cost-effectively generating a global model. An efficient and accurate participating node selection mechanism effectively selects nodes that are more likely to provide high-quality services, significantly improving the quality of the final aggregated model and the speed of convergence.

[0094] As users' attention to privacy and security continues to grow, the number of model nodes in real-world environments will far outnumber the number of data nodes. To ensure scalability, the OAFL system sets data nodes to the top d% of the credit rating of the data nodes participating in the task. The value of d is determined based on the number of participating nodes, the magnitude of the data volume involved in the task, and the real-time requirements of the task.

[0095] For the model nodes, the chance of each node being selected in the current round is C = Ri k +αN+βACCi, and the selection rate of each node in the current round is Where C is the chance of selection, Ri k is the credit value of the last round of the perception service node. In normal cases, Ri kThe most significant factor influencing a node's selection is α and β, which are variable parameters determined based on the specific crowdsensing task. m is the total number of perception service nodes applying to participate in federated learning in this round, and N is the number of times a node has been unselected since its last selection. Considering αN as a portion of a node's chance of selection in the current round is to avoid starvation of honest nodes due to errors in node joining time or quality assessment. ACCi is the quality of the sub-model in which the node participated in the aggregation in the previous round. Based on the principle of locality, nodes that provided reliable services in the previous round are more likely to provide reliable services in the next round than nodes that did not. Therefore, βACCi is also considered as part of the selection chance in the current round. This allows us to effectively select relatively reliable nodes for the current round's perception task execution based on the selection rate in the current round.

[0096] Based on the above embodiments, the present invention further proposes a node selection and aggregation optimization (OAFL) method for federated learning under a microservice architecture, including:

[0097] Based on specific privacy protection requirements, nodes are divided into two categories: data nodes and model nodes. The data nodes are used to transmit data, and the model nodes are used to transmit models.

[0098] The central party selects model nodes that participate in model aggregation and data nodes that verify model parameters based on node reputation; node reputation is generated based on the quality of the data or model transmitted by the sensing node and its historical reputation;

[0099] In order to ensure that the node reputation cannot be tampered with and that the data or model transmission information between the center and the nodes is traceable, the system establishes two blockchains, namely the credit chain and the transaction chain, to record the node reputation and the categories of data or models exchanged between the federated learning center and the nodes in each round.

[0100] Further, including:

[0101] The task publisher submits the task requirements to the crowdsensing platform, uploads the initial dataset to the center as the test dataset for the first round of sub-models, and uploads the selected initial model to the center, while submitting the incentive to the center.

[0102] The central party receives task requests, initializes the test dataset and initial model, issues tasks to nodes, selects participating nodes, receives data and sub-models uploaded by nodes, evaluates the quality of the data and sub-models, generates node reputation, broadcasts it to blockchain nodes and records it in the credit chain, trains local sub-models and aggregates the global model, and finally pays incentives to the nodes and returns the trained global model to the task publisher.

[0103] Each node performs tasks and chooses to upload data or sub-models based on its own privacy protection needs. The model node uses the local data set to train the global model to generate sub-model parameters, and obtains incentives based on the data or model quality uploaded to the central party. The information about the global model and uploaded data or sub-model issued by the central party is recorded in the transaction chain.

[0104] Furthermore, the model aggregation includes:

[0105] The center receives the sub-model parameters uploaded by the model nodes, evaluates the model quality, and updates the reputation of the model nodes. Based on the reputation of the model nodes, the center selects the sub-model parameters that will participate in the global model aggregation and adds them to the aggregation queue.

[0106] The central party calculates the weight of the sub-model parameters in the aggregation queue, that is, the total amount of training data is obtained by adding up the model nodes in the aggregation queue and the amount of data participating in the local training of the central party in the current round, and then calculates the weight of the training data of each model node. There are N models in the aggregation queue, 1 from the central party, generated according to the updated data set in this round, N-1 from the node, D i is the number of training data for the i-th sub-model node, D N is the number of training data of the center, The sum of the amount of training data for all models in the aggregated queue;

[0107] The central party will aggregate all sub-model parameters in the queue and execute the FedAvg algorithm to generate a new global model;

[0108] The central party broadcasts the new global model to all nodes and records transaction information in the transaction chain.

[0109] Furthermore, the process of model quality assessment includes:

[0110] The high-quality data owned by the center is used as a test data set to test the sub-model parameters uploaded by the model nodes. The quality of the sub-model parameters is judged by observing the accuracy of the test results.

[0111] The data uploaded by the data nodes is used as a test data set to test the global model aggregated by the central party in the previous round. The quality of the data uploaded by the data nodes is evaluated by the accuracy of the test results.

[0112] The central party uses the perception data uploaded by each data node as a test data set, and tests the global model aggregated in the previous round to obtain the data quality ACCi of each data node in this round, where i is the i-th data node. If ACCi > Mean(ACC), the central party considers that the data transmitted by this data node in this round is true and reliable, and adds this data to the local data set of the central party to update the local data set; if ACCi < Mean(ACC), the central party considers that the perception data transmitted by this data node in this round is not credible, and thus discards this data.

[0113] Furthermore, the calculation process of the node credibility is as follows:

[0114] For a data node, the calculation process of the credibility is as follows:

[0115]

[0116] Where Ri k is the node credit value in this round, k is the current round, Ri k-1 is the credit value of the node in the k - 1 round, and the value of ri k is 0 or 1. When the data node is considered credible in this round, ri k is 1, and when the data node is considered not credible in this round, ri k is 0;

[0117] For a model node, the central party uses the local data as a test data set to test the sub-models uploaded by each model node respectively, and obtains the quality ACCi of each node's sub-model. Set the upper mean Mu = Max{Median(ACC), Mean(ACC)} and the lower mean Md = Min{Median(ACC), Mean(ACC)}, where Median(ACC) is the median value of the quality of each model node and the submitted sub-model and the quality of the central party's trained sub-model in this round, and Mean(ACC) is the average value of the quality of each sub-model in this round; then, the model nodes are divided into four categories:

[0118] Ⅰ. Model nodes with sub-model quality ACCi in the top 10% are safe and reliable nodes, and the central party adds the sub-model parameters to the aggregation queue;

[0119] Ⅱ. Model nodes with sub-model quality ACCi >> Mu are relatively credible nodes, and the probability of entering the aggregation queue this time needs to be calculated additionally That is, these nodes will have a probability of Pi to be added to the aggregation queue, and at the same time, there is also a probability of 1 - Pi not to be added to the aggregation queue;

[0120] Ⅲ. Nodes with sub-model quality satisfying Mu >> ACCi >> Md have low sub-model quality and are not added to the aggregation queue;

[0121] IV. Nodes with sub-model quality Md>>ACCi are untrustworthy nodes;

[0122] After completing the sub-model quality assessment, according to the formula Generate the reputation of the model node:

[0123]

[0124] Furthermore, after the central party calculates the credibility of the data nodes and model nodes, it generates a new block with the credibility of all nodes, broadcasts the block and adds it to the credit chain. When all nodes in this round send the perception data or the local data trained to a converged model to the central party, the above process is recorded in the transaction chain and broadcast; the central party evaluates the data and model quality respectively.

[0125] Furthermore, the process of selecting the model nodes participating in model aggregation and the data nodes for verifying model parameters includes:

[0126] The data nodes are set to the top d% of the data nodes participating in this task in terms of credit value. The value of d is determined based on the number of participating nodes in different tasks, the specific magnitude of the data volume of the nodes in the task, and the real-time requirements of the task.

[0127] For model nodes, the chance of each node being selected in the current round is:

[0128] C=Ri k +αN+βACCi

[0129] The selection rate of each node in the current round is:

[0130]

[0131] Where C is the chance of selection, Ri k is the node’s credit value in the previous round. In normal cases, Ri k The most influential factor affecting whether a node can be selected is α and β, which are variable parameters determined by the specific task of crowdsensing. m is the total number of perception service nodes applying to participate in federated learning in this round, N is the number of times a node has not been selected since it was last selected, and ACCi is the quality of the sub-model in which the node participated in the aggregation in the previous round. According to the principle of locality, nodes that provided reliable services in the previous round will provide reliable services in the next round.

[0132] According to the selection rate of the node in the current round, relatively reliable nodes in this round are selected to participate in the execution of the perception task.

[0133] As an implementable approach, this paper introduces the specific workflow of the OAFL system, using the Internet of Vehicles (IoV) environment, a typical scenario in crowd intelligence perception, as an example. The Internet of Vehicles (IoV) is a controllable, manageable, operational, and trustworthy open, converged network system based on the collaboration of people, vehicles, and the environment. Through advanced information communication and processing technologies, IoV perceives, recognizes, and computes large-scale, complex static and dynamic information about environmental elements such as people, vehicles, network communications, and road traffic infrastructure. This addresses the computability, scalability, and sustainability issues of intelligent management and information services in ubiquitous heterogeneous mobile converged network environments, ultimately achieving a deep integration of people, vehicles, and the environment to enrich personal automotive life, improve transportation efficiency, enhance urban services, and reduce social operating costs.

[0134] As mentioned above, a typical OAFL system has three roles: task publisher, central party, and node. In the Internet of Vehicles scenario, task publishers are often scientific research institutions, navigation app developers, etc.; the central party usually refers to the central server that provides computing services for the OAFL system and performs crowd intelligence perception tasks; nodes usually refer to pedestrians and the electronic devices they carry that can perceive service data, smart cars, and road infrastructure (cameras, speedometers, etc.).

[0135] Let’s take the crowd sensing task of detecting the congestion of a certain road section in real time and predicting future congestion as an example. The task publisher sends a task request to the central server, and the (perception) nodes near the road section need to provide real-time road section photos.

[0136] Before a perception task begins, an initial dataset and an initial model must be created. The initial dataset is collected by the task issuer through methods such as taking photos on the road. This data is statistically processed to form an initial local dataset. The initial model is generated using training data from this initial local dataset.

[0137] The central server then issues tasks to each sensing node within the system. Nodes interested in receiving rewards for these tasks voluntarily apply for sensing tasks. The central server then roughly selects participating nodes based on their location information, which has been fuzzified by adding Gaussian noise. Following this, according to the present invention's node selection mechanism, the nodes are further screened based on historical data from sensing nodes within the OAFL system, ultimately confirming the nodes participating in this sensing service. The central server then sends the initial model to each participating node.

[0138] Selected (sensing) nodes (for example, pedestrians carrying sensing devices) will take photos of road conditions at various locations and angles along a designated road section, as required by the task. These photos become local data. Based on local privacy requirements, participating nodes will choose between data transmission nodes and model transmission nodes. Data transmission nodes directly submit local data to the central server. Model nodes use the model transmitted by the central server to train local image data and send the trained and converged model to the central server. This process is recorded in the transaction blockchain.

[0139] After receiving the data or model, the central party verifies the credibility of the data and model, respectively, based on the quality assessment and node reputation described in this invention. If the data is credible, it is added to the central party's local data set and the local dataset is updated. If the model is credible, it is added to the aggregation queue as required. Simultaneously, the above process updates the credit value of participating nodes based on the credibility of this round. The credit value of all participating nodes is recorded in the credit blockchain.

[0140] After the above process is complete, the central party uses the model generated in the previous round to train the updated dataset for this round, obtaining a newly generated local model for this round and adding this model to the aggregation queue. Finally, all models in the aggregation queue are aggregated, and the new aggregated model is sent to all participating nodes. This step is also recorded in the transaction blockchain.

[0141] Repeat the above process until the model converges. In this application example, the above process uses collected road image information as data. The model generated from this data can be used to predict real-time road congestion. If the collected data is video information, autonomous driving tests can also be performed on that road section. The OAFL system has a certain degree of universality. In specific crowd-sensing application scenarios, it can complete different perception data processing tasks based on the collected data and the created model.

[0142] In order to verify the effect of the present invention, the following experiments were performed:

[0143] To analyze the performance of the OAFL system (method), we established an experimental environment based on TensorFlow 2.0. The software environment was Python 3.8. The hardware environment consisted of a 3.60GHz AMD Ryzen 7 3700X 8-Core Processor CPU, 16.00GB RAM, and Windows 10 64-bit. The simulations strictly adhered to the protocols and patterns likely used in distributed mobile crowdsensing scenarios. The dataset used, parameter settings, and simulation results are presented.

[0144] The CREDIT_CARD dataset is selected as the experimental dataset to verify the performance and stability of the OAFL system. Before training the neural network model, we perform normalization on the CREDIT_CARD dataset.

[0145] We developed a lightweight blockchain generation library called Block. The two blockchains in the experimental part of this embodiment are both generated by calling the Block library. The functions implemented in this library are sufficient to meet our experimental requirements for the OAFL system. The Block library can create and initialize a blockchain, automatically generate the genesis block, add the newly generated blocks to the chain later, and complete consensus according to POW. According to the experimental environment, we set the computational difficulty of the proof-of-work to Hash.SHA256(Transaction+Proof)<Target='0x(1ff…ff)'. Based on the design concept of OAFL, we generate and deploy the credit chain and the transaction chain. The advantage of doing this is that, while ensuring low latency, the overhead of the proof-of-work calculation can be controlled, and more computing power resources can be provided for federated learning. The CREDIT_CARD dataset contains 284,807 rows and 31 columns of data. This dataset is for the credit situation of bank cards and performs binary classification of normal or abnormal for bank accounts based on 30 existing features. However, the results of this dataset are very imbalanced, and the data labeled as normal is much more than the abnormal data. Therefore, to achieve better experimental results, we need to ensure that each node gets enough data, especially the data labeled as abnormal. So, in our experiment, we omitted the process of selecting participating nodes. We randomly divided the dataset into 11 parts in different quantity ratios. One part is taken as the initial dataset of the central party locally, and the other 10 parts are randomly distributed to 10 nodes. Each node is assigned a different amount of data, but at least more than 800 pieces of data. We simulate these nodes as sensing nodes performing tasks. We build a 7-layer convolutional neural network model based on the initial dataset. After training converges, it is broadcast to the 10 nodes. Then, we use the trusted quality assessment mechanism and model aggregation implemented in the code to complete a task, and the central party sends the updated model to each node in broadcast form. Repeat the above process until the model finally converges.

[0146] For the experiment on the CREDIT_CARD dataset, we use centralized machine learning and FedAVG as the control groups of OAFL.

[0147] Experimental results

[0148] Figure 4A detailed plot of accuracy versus training rounds shows that for the CREDIT-CARD dataset, OAFL and FedAVG both achieve slightly lower convergence speed and post-convergence model accuracy than centralized machine learning. Therefore, federated learning inevitably suffers some loss in accuracy and convergence speed compared to centralized machine learning. OAFL achieves similar or even slightly better convergence speed and model accuracy than FedAVG, a widely used federated learning method, demonstrating the feasibility of OAFL.

[0149] In the absence of malicious node attacks, for the ten nodes participating in the CREDIT-CARD dataset experiment, we can Figure 5 , we can see how their credit values ​​change with the experimental rounds. We can see intuitively that: 1. The credit value update formula we designed is based more on the accuracy of the current round in the initial stage. As the rounds continue, when the rounds approach infinity, the credit value of the node in the current round will be almost equal to the credit value of the previous round, which is in line with the law of large numbers. 2. Due to the limitation of the number of nodes and the amount of data, the credit values ​​of different nodes have a similar hierarchical structure. Figure 5 The quality of the models transmitted by nodes can be visually categorized as good, medium, or poor. Through multiple experiments, we found that the quality of the initial model significantly impacted the credit value fluctuations of different nodes. After the dataset was shuffled, the data assigned to the central party varied significantly between experiments, leading to variations in the quality of the initial model and, in turn, to differences in model accuracy across different nodes. Furthermore, we found that nodes assigned larger amounts of data tended to achieve higher model accuracy, which is consistent with the general principle of machine learning: all else being equal, more data leads to better models.

[0150] The above experiments show that the OAFL system is inferior to centralized machine learning in terms of convergence speed and final accuracy. However, in practice, crowdsensing tasks are mostly distributed systems, making centralized machine learning difficult to use. While OAFL has some advantages over the FedAVG algorithm, the advantages are not significant. Both OAFL and FedAVG can be applied in real-world distributed crowdsensing tasks. Therefore, we will compare the performance of OAFL and FedAVG in real-world applications, introducing malicious attacks and lazy nodes.

[0151] We simulated an experimental environment with malicious attacks and an experimental link with lazy nodes, and compared OAFL with FedAVG.

[0152] The fake model uploaded by a malicious node may make it difficult for the final model aggregation to converge, which is also a major challenge currently faced by federated learning. Therefore, we designed the following experiment to simulate the existence of a malicious attack environment. We set a node as a malicious node, and in each round, there is a probability of p to send a normal training model to the central party, and a probability of 1-p to send an incorrect model to the central party. The experimental results are as follows: Figure 6 As shown in the figure, we can see that thanks to the evaluation of the model ACCi in the quality assessment environment, it is difficult for false models to enter the aggregation queue, so the OAFL system is almost unaffected, while the convergence speed and model accuracy of FedAVG are significantly affected.

[0153] Since there may be lazy nodes in the distributed mobile crowd-sensing tasks targeted by OAFL, they may cheat the rewards of the perception task by directly uploading the local model that has not reached convergence to the central party. In this experiment, we randomly selected nodes and reduced the number of rounds of their local training, causing some nodes to upload the model that has not been trained to convergence to the central party before. The specific results of the experiment are as follows: Figure 7 As shown in the figure, it can be seen that compared with the previous experiments, the convergence speed of OAFL has decreased slightly. This is due to the reduction in the number of credible models in the aggregation queue in this experimental environment. However, after convergence, it can still ensure no significant loss of accuracy. Although FedAVG can also converge in the end, the convergence speed and final model accuracy are significantly affected.

[0154] In summary, to rationally exploit the imbalance in privacy requirements among participating nodes, this invention delegates the power of choice to participating nodes themselves, allowing them to ultimately choose whether to submit data or models based on their own privacy needs. Furthermore, for the central party, in addition to the aforementioned advantages, data and models received in the same round can be mutually verified to achieve quality assessment of both data and models. Based on federated learning and blockchain technology, this invention constructs a unique quality assessment and model aggregation method tailored to the varying privacy requirements of nodes, leveraging the advantages of federated learning for node data privacy protection and blockchain's immutability and traceability.

[0155] 1. We propose a privacy and security architecture for distributed crowd-sensing networks. This innovatively transforms the aggregation process of federated learning. While the central party interacts with model training sub-nodes to determine model parameters, it also receives data to evaluate the sub-model quality and selects sub-model parameters with high accuracy for model aggregation.

[0156] 2. Based on the different privacy protection requirements of nodes, nodes are divided into data nodes (nodes that transmit data to the central party) and model nodes (nodes that transmit models to the central party). This allows the central party to have a real-time updated dataset for training sub-model parameters and verifying the quality of sub-models trained by model nodes.

[0157] 3. Establish a node reputation assessment mechanism based on the quality assessment mechanisms for data and sub-model parameters respectively;

[0158] 4. To ensure the traceability and non-tamperability of node reputation and the interaction information between the central party and nodes, and to resist malicious attacks, the present invention establishes a credit chain and a transaction chain to record node reputation and the interaction information between the central party and nodes respectively;

[0159] 5. Experimental analysis on the public dataset CREDIT-CARD shows that the present invention can have significantly better stability and convergence speed than FedAVG while ensuring model accuracy.

[0160] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A node selection and aggregation optimization system for federated learning under a microservice architecture, characterized by: The system has three roles: task publisher, central party, and node. The task publisher submits the task requirements to the crowd-sensing platform, uploads the initial dataset to the central party as the test dataset for the first round of sub-models, and uploads the selected initial model to the central party, and submits incentives to the central party. The central party receives task requests, initializes the test data set and initial model, issues tasks to nodes, selects nodes to participate in the task, receives data and sub-models uploaded by the nodes, evaluates the quality of the data and sub-models, generates node reputation, broadcasts it to blockchain nodes and records it in the credit chain, trains local sub-models and aggregates the global model, and finally incentivizes the nodes and returns the trained global model to the task publisher. Each node executes the task and chooses to upload data or sub-models based on its own privacy protection requirements. The model node uses the local data set to train the global model and generate sub-model parameters. It obtains incentives based on the data or model quality uploaded to the central party and records the information about the global model and uploaded data or sub-models issued by the central party in the transaction chain. The system includes: A node division module is used to divide nodes into two categories: data nodes and model nodes according to specific privacy protection requirements. The data nodes are used to transmit data, and the model nodes are used to transmit models. The model aggregation node selection module is used by the central party to select model nodes participating in model aggregation and data nodes for verifying model parameters based on the node reputation; the node reputation is generated based on the quality of the data or model transmitted by the sensing node and its historical reputation; The credit chain and transaction chain building modules are used to ensure that the node reputation cannot be tampered with and that the data or model information transmitted between the center and the nodes is traceable. By establishing two blockchains, namely the credit chain and the transaction chain, they respectively record the node reputation and the types of data or models exchanged between the center and the nodes in each round of federated learning. The calculation process of the node reputation is as follows: For data nodes, the reputation calculation process is: Among them, Ri k is the node credit value of this round, k is the current round, Ri k-1 is the credit value of the node in round k-1, ri k The value is 0 or 1. When the data node is considered to be trustworthy in this round, ri k is 1, when the data node is considered untrustworthy in this round k is 0; For model nodes, the central party uses local data as the test data set to test the sub-model uploaded by each model node, obtain the quality ACCi of each node sub-model, set the upper mean Mu = Max{Median(ACC), Mean(ACC)} and the lower mean Md = Min{Median(ACC), Mean(ACC)}, where Median(ACC) is the median value of the quality of each model node and the submitted sub-model and the quality of the central party's trained sub-model in this round, and Mean(ACC) is the average value of the quality of each sub-model in this round; then, the uploaded model nodes are divided into four categories: Ⅰ. Model nodes whose sub-model quality ACCi is in the top 10% are considered secure and trusted nodes, and the central party adds the sub-model parameters to the aggregation queue; Ⅱ. Sub-model quality ACCi>>Mu model nodes are relatively credible nodes, and the probability of entering the aggregation queue needs to be calculated additionally. That is, these nodes will have a probability of Pi being added to the aggregation queue, and a probability of 1-Pi not being added to the aggregation queue; Nodes whose sub-model quality satisfies Mu>>ACCi>>Md are considered to have low sub-model quality and are not added to the aggregation queue; IV. Nodes with sub-model quality Md>>ACCi are untrustworthy nodes; After completing the sub-model quality assessment, according to the formula Generate the reputation of the model node:

2. A node selection and aggregation optimization method for federated learning under a microservice architecture, characterized in that: The method is based on the node selection and aggregation optimization system for federated learning under a microservice architecture described in claim 1, comprising: Based on specific privacy protection requirements, nodes are divided into two categories: data nodes and model nodes. The data nodes are used to transmit data, and the model nodes are used to transmit models. The central party selects model nodes that participate in model aggregation and data nodes that verify model parameters based on node reputation; node reputation is generated based on the quality of the data or model transmitted by the sensing node and its historical reputation; In order to ensure that the node reputation cannot be tampered with and the data or model transmission information between the center and the nodes is traceable, two blockchains, namely the credit chain and the transaction chain, are established to record the node reputation and the categories of data or models exchanged between the federated learning center and the nodes in each round.

3. The node selection and aggregation optimization method for federated learning under the microservice architecture according to claim 2 is characterized in that: include: The task publisher submits the task requirements to the crowdsensing platform, uploads the initial dataset to the center as the test dataset for the first round of sub-models, and uploads the selected initial model to the center, while submitting the incentive to the center. The central party receives task requests, initializes the test dataset and initial model, issues tasks to nodes, selects participating nodes, receives data and sub-models uploaded by nodes, evaluates the quality of the data and sub-models, generates node reputation, broadcasts it to blockchain nodes and records it in the credit chain, trains local sub-models and aggregates the global model, and finally pays incentives to the nodes and returns the trained global model to the task publisher. Each node performs tasks and chooses to upload data or sub-models based on its own privacy protection needs. The model node uses the local data set to train the global model to generate sub-model parameters, and obtains incentives based on the data or model quality uploaded to the central party. The information about the global model and uploaded data or sub-model issued by the central party is recorded in the transaction chain.

4. The node selection and aggregation optimization method for federated learning under the microservice architecture according to claim 2 or 3, characterized in that: The model aggregation includes: The center receives the sub-model parameters uploaded by the model nodes, evaluates the model quality, and updates the reputation of the model nodes. Based on the reputation of the model nodes, the center selects the sub-model parameters that will participate in the global model aggregation and adds them to the aggregation queue. The central party calculates the weight of the sub-model parameters in the aggregation queue, that is, the total amount of training data is obtained by adding up the model nodes in the aggregation queue and the amount of data participating in the local training of the central party in the current round, and then calculates the weight of the training data of each model node. There are N models in the aggregation queue, 1 from the central party, generated according to the updated data set in this round, N-1 from the node, D i is the number of training data for the i-th sub-model node, D N is the number of training data of the center, The sum of the amount of training data for all models in the aggregated queue; The central party will aggregate all sub-model parameters in the queue and execute the FedAvg algorithm to generate a new global model; The central party broadcasts the new global model to all nodes and records transaction information in the transaction chain.

5. The node selection and aggregation optimization method for federated learning under the microservice architecture according to claim 4 is characterized in that: The model quality assessment process includes: The data owned by the center is used as a test data set to test the sub-model parameters uploaded by the model nodes. The quality of the sub-model parameters is judged by observing the accuracy of the test results. The data uploaded by the data nodes is used as a test data set to test the global model aggregated by the central party in the previous round. The quality of the data uploaded by the data nodes is evaluated by the accuracy of the test results. The central party uses the perception data uploaded by each data node as a test data set to test the global model aggregated in the previous round, and obtains the data quality ACCi of each data node in this round, where i is the i-th data node. If ACCi > Mean(ACC), the central party considers that the data transmitted by this data node in this round is true and credible, and adds this data to the local data set of the central party to update the local data set; if ACCi < Mean(ACC), the central party considers that the perception data transmitted by this data node in this round is not credible, and thus discards this data.

6. The node selection and aggregation optimization method for federated learning under the microservice architecture according to claim 5 is characterized in that: After the central party calculates the credibility of the data nodes and model nodes, a new block is generated with the credibility of all nodes, and this block is broadcast and added to the credit chain. When all nodes in this round have sent the perception data or the model trained from the local data to convergence to the central party, the above process is recorded in the transaction chain and broadcast; the central party evaluates the data and model quality respectively.

7. The node selection and aggregation optimization method for federated learning under the microservice architecture according to claim 5 is characterized in that: The selection process of the model nodes participating in model aggregation and the data nodes verifying model parameters includes: Set the data nodes as the nodes with the top d% of the credit values among the data nodes participating in this task. According to the number of participating nodes in different tasks, the specific order of magnitude of the data volume of the nodes in this task, and the requirements of task real-time performance, the value of d is finally determined; For model nodes, the chance of being selected in the current round of each node is: C=Ri k +αN+βACCi And the selection rate of each node in the current round is: Where C is the chance of selection, Ri k is the node’s credit value in the previous round. In normal cases, Ri k The most influential factor affecting whether a node can be selected is α and β, which are variable parameters determined by the specific task of crowdsensing. m is the total number of perception service nodes applying to participate in federated learning in this round, N is the number of times a node has not been selected since it was last selected, and ACCi is the quality of the sub-model in which the node participated in the aggregation in the previous round. According to the principle of locality, nodes that provided reliable services in the previous round will provide reliable services in the next round. Filter out the relatively reliable nodes in this round according to the selection rate of the nodes in the current round to participate in the execution of the perception task.

Citation Information

Patent Citations

  • Marine Internet of Things data security sharing method under edge computing framework based on federated learning and block chain technology

    CN112348204A

  • Industry Internet of Things data lightweight trusted sharing technology based on block chain

    CN112395640A