A data sharing method based on blockchain and federated learning

By adopting the data sharing method of blockchain and federated learning in the Internet of Things, a trusted blockchain node team is formed, a team that meets the credit rating requirements is selected for model training, and the Internet of Things is solved through a consensus algorithm and credit reward mechanism. It solves the trust and privacy protection issues in data sharing and achieves high-quality and reliable data sharing.

CN114417398BActive Publication Date: 2024-09-17FUJIAN NORMAL UNIV

Patent Information

Application Number
CN202111543907.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-16
Publication Date
2024-09-17
Estimated Expiration
2041-12-16

AI Technical Summary

Technical Problem

Data sharing in the Internet of Things faces trust issues and privacy leakage issues, making it difficult to achieve reliability and privacy protection of data sharing.

Method used

Adopting a data sharing method based on blockchain and federated learning, by forming mutually trusting blockchain nodes into teams, selecting teams that meet credit rating requirements for model training, and using the consensus algorithm contributed by nodes to create a consensus among blockchain nodes. A consensus is reached, each training process is recorded, and credit rewards and penalties are carried out to ensure the privacy of data providers and the reliability of data sharing.

Benefits of technology

It achieves privacy protection and credit rating reliability in the data sharing process in the Internet of Things, ensuring that data providers provide high-quality data, reducing the risk of data leakage, and improving the reliability of data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114417398B
    Figure CN114417398B
Patent Text Reader

Abstract

The present invention discloses a data sharing method based on blockchain and federated learning. The method forms mutually trusted blockchain nodes into a team, selects a team that meets the credit rating requirements to respond to the request task after receiving a request task; uses nodes in the team that meets the credit rating requirements to train a verification model after receiving a data sharing task, until the verification model reaches a preset accuracy or reaches a maximum training time, thereby realizing model sharing to protect the privacy of data providers; packages the model training process locally, reaches a consensus among blockchain nodes based on a consensus algorithm based on node contribution, and gives credit rewards to the team that meets the credit rating requirements. Therefore, each training process in the data sharing process is recorded to ensure that the data provider provides high-quality data, and gives credit rewards after reaching a consensus. The credit rating can be updated in a timely manner, thereby ensuring the reliability of the credit rating and alleviating the problem of data privacy protection in the Internet of Things.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things data sharing, and in particular to a data sharing method based on blockchain and federated learning. Background Art

[0002] With the development of Internet technology, the Internet of Things (IoT) has been widely used in various industries. Sensors are an important part of the IoT and the most important data source of the IoT system. The perception data collected by a single sensor often cannot meet the needs of users. The real value of the IoT lies in the comprehensive utilization and sharing of various data and information. For example, in the field of healthcare, data sharing can provide valuable health records, including treatment information and physical examination information, which can provide targeted treatment to patients. In the tourism industry, by analyzing the collected data, data sharing can accurately understand tourists' preferences and predict future tourist hotspots, thereby improving service quality. However, data sharing in the IoT may face the following problems: first, it is difficult for each organization to establish mutual trust, so they are unlikely to share reliable local data; second, data privacy has become a big problem that hinders data sharing because data owners suffer privacy leaks. Therefore, it is a challenge to achieve effective data sharing, especially when these two problems have not been solved.

[0003] Machine learning technology is widely used in data sharing. Traditional machine learning technology first collects data and then focuses on model training. However, large-scale data collection is often difficult to achieve because data owners are worried about privacy leakage. Federated learning is a distributed machine learning framework. It not only reduces the computational burden of centralized devices by aggregating local training models of data owners instead of raw data, but also protects the data privacy of data owners. As a distributed shared ledger and database, blockchain has the characteristics of decentralization, non-tampering, traceability, collective maintenance, openness and transparency, and can provide reliable technical support for privacy protection of data sharing. For example, blockchain can record the sharing behavior of each participant who provides a data model, thereby forcing participants to provide reliable data models.

[0004] Secure data sharing in the Internet of Things has received increasing attention, and a large number of data sharing mechanisms based on blockchain and federated learning have been proposed: Y. Gao et al. (Blockchain based secure IoT data sharing framework for SDN-enabled smart communities) proposed a secure data sharing framework using blockchain and proxy re-encryption technology; H. Xu et al. (BDSS-FA: A Blockchain-based Data Security Sharing Platform With Fine Grained Access Control) proposed a new encryption algorithm based on hierarchical attributes, which assigns attributes to authorization centers based on blockchain to achieve secure data sharing; I. Makhdoom et al. (Privy Sharing: A blockchain-based framework for privacy preserving and secure data sharing in smart cities) embedded access control rules in smart contracts to control user access to data, and divided the blockchain into multiple channels to protect the privacy and security of data; K.-P. Yu et al. (Blockchain-Enhanced Data Sharing with Traceable and Direct Revocation in IIoT) proposed an efficient and secure data sharing model based on attribute encryption, which can resist multiple attacks; M. Hao et al. (Efficient and Privacy-Enhanced Federated Learning for Industrial Artificial Intelligence proposed an efficient federated learning model to ensure data privacy. This scheme can resist collusion attacks in a distributed environment while preventing personal data leakage; F. Sattler et al. (Robust and Communication-EfficientFederated Learning From Non-iidData) proposed a sparse compression framework suitable for broadband-constrained environments to solve the communication overhead in model training; A. Imteaj and MHAmini (Distributed Sensing Using Smart End-User Devices: Pathway to Federated Learning for Autonomous IoT) improves federated learning by evaluating the model feedback of participants and the updating method of participant weights; Y. Lu et al. (Blockchain and Federated Learning for Privacy-Preserved Data Sharing in Industrial IoT) combine data sharing, machine learning, blockchain and federated learning to jointly solve the privacy protection problem in data sharing; L. Yin et al. (A Privacy Preserving Federated Learning for Multiparty Data Sharing in Social IoTs) combine federated learning and cryptography to protect the data privacy of data sharing participants in social IoT, and use sparse differential gradients to improve data transmission and storage efficiency; H. Chai et al. (A Hierarchical Blockchain-Enabled Federated Learning Algorithm for Knowledge Sharing in Internet of Vehicles) construct a secure hierarchical federated learning scheme to protect the privacy of local data models and solve the security problem of resource sharing in the Internet of Vehicles environment. .

[0005] Although the above work has made positive contributions to privacy protection, how to ensure the reliability of the data sharing process requires further research. Therefore, in order to achieve secure and reliable trustless data sharing, this paper proposes a data sharing mechanism based on federated learning. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide a data sharing method based on blockchain and federated learning, which can effectively alleviate the privacy protection problem of data in the Internet of Things.

[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0008] A data sharing method based on blockchain and federated learning, comprising the steps of:

[0009] Form a team of mutually trusted blockchain nodes;

[0010] Receive a request task, and select a team that meets the credit rating requirements to respond to the request task;

[0011] Receive a data sharing task, and use the nodes in the team that meets the credit rating requirements to train a verification model until the verification model reaches a preset accuracy or reaches a maximum training time;

[0012] The model training process is packaged locally, and a consensus algorithm based on node contribution is used to reach a consensus among blockchain nodes and provide credit rewards to the team that meets the credit rating requirements.

[0013] The beneficial effects of the present invention are as follows: mutually trusted blockchain nodes are organized into a team, and after receiving a request task, a team that meets the credit rating requirements is selected to respond to the request task; after receiving a data sharing task, the nodes in the team that meets the credit rating requirements are used to train the verification model until the verification model reaches a preset accuracy or reaches the maximum training time, thereby realizing model sharing to protect the privacy of data providers; the model training process is packaged locally, and a consensus algorithm based on node contribution is used to reach a consensus among blockchain nodes and credit rewards are given to the team that meets the credit rating requirements. Therefore, each training process in the data sharing process is recorded to ensure that the data provider provides high-quality data, and credit rewards are given after consensus is reached. The credit rating can be updated in a timely manner, thereby ensuring the reliability of the credit rating and effectively alleviating the privacy protection problem of data in the Internet of Things. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is an overall flow chart of a data sharing strategy based on federated learning in an embodiment of the present invention;

[0015] Figure 2 A schematic diagram of a framework of a data sharing strategy based on federated learning according to an embodiment of the present invention;

[0016] Figure 3 This is a specific flow chart of a data sharing strategy based on federated learning in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0018] Please refer to Figures 1 to 3 , an embodiment of the present invention provides a data sharing method based on blockchain and federated learning, comprising the steps of:

[0019] Form a team of mutually trusted blockchain nodes;

[0020] Receive a request task, and select a team that meets the credit rating requirements to respond to the request task;

[0021] Receive a data sharing task, and use the nodes in the team that meets the credit rating requirements to train a verification model until the verification model reaches a preset accuracy or reaches a maximum training time;

[0022] The model training process is packaged locally, and a consensus algorithm based on node contribution is used to reach a consensus among blockchain nodes and provide credit rewards to the team that meets the credit rating requirements.

[0023] From the above description, it can be seen that the beneficial effects of the present invention are: mutually trusted blockchain nodes are organized into a team, and after receiving a request task, a team that meets the credit rating requirements is selected to respond to the request task; after receiving a data sharing task, the nodes in the team that meets the credit rating requirements are used to train the verification model until the verification model reaches a preset accuracy or reaches the maximum training time, thereby realizing model sharing to protect the privacy of the data provider; the model training process is packaged locally, and a consensus algorithm based on node contribution is used to reach a consensus between blockchain nodes and credit rewards are given to the team that meets the credit rating requirements. Therefore, every training process in the data sharing process is recorded to ensure that the data provider provides high-quality data, and credit rewards are given after consensus is reached. The credit rating can be updated in a timely manner, thereby ensuring the reliability of the credit rating and effectively alleviating the privacy protection of data in the Internet of Things.

[0024] Furthermore, the process of forming a team of mutually trusted blockchain nodes includes:

[0025] Provide a preset amount of collateral when forming a team and calculate the penalty coefficient k for bad behavior nodes:

[0026]

[0027] In the formula, v represents the total number of work rounds that the node completes the collaborative task, p represents the number of times the node temporarily exits, and q represents the number of times the node is lazy;

[0028] Calculate the penalty value of nodes in the team:

[0029]

[0030] In the formula, is the mortgage of node i;

[0031] Calculate the compensation value C1 of non-bad behavior nodes in the team:

[0032]

[0033] Where N represents the total number of nodes in the team.

[0034] From the above description, it can be seen that when forming a team, a preset amount of collateral is provided, the penalty coefficient of nodes with bad behavior is calculated, and the penalty value of the nodes in the team is calculated based on the penalty coefficient of the node, and then the compensation value of each node in the team is calculated; therefore, in response to possible bad behaviors of nodes, a team management mechanism based on "collateral-penalty" is designed to compensate for the losses of other nodes. Each team can further manage and supervise members so that data sharing tasks can be completed efficiently and reliably.

[0035] Furthermore, the step of forming a team of mutually trusted blockchain nodes further includes:

[0036] Set the original credit of the leader node or each member node in the team to zero;

[0037] Calculate the reward value of the leader node in the team:

[0038]

[0039] In the formula, C redit represents the credit reward provided by the task publisher, W k Represents the contribution of the weight ratio data node to the global model;

[0040] Calculate the reward value for each member node:

[0041]

[0042] Calculate the credit value C2 of each node:

[0043] C2=C base +C obtain ;

[0044] In the formula, C base Indicates the original credit accumulation value of the node.

[0045] From the above description, it can be seen that in order to promote the honest and effective training of nodes, a credit rating mechanism is introduced to reward or punish nodes according to their contributions, thereby ensuring the accuracy of credit ratings.

[0046] Furthermore, the data sharing task includes an ID of a task requester, a requested task category, a timestamp, and a task level.

[0047] From the above description, it can be seen that the task requester's ID, the requested task category, timestamp and task level included in the data sharing task facilitate the subsequent team to complete the corresponding tasks and train the corresponding data model normally.

[0048] Furthermore, the task of selecting a team that meets the credit rating requirements to respond to the request includes:

[0049] Verifying an identification of the requested task based on a node connected to the requested task;

[0050] It is determined according to the identifier whether the requested task has been processed. If so, the processing result queried in the blockchain is directly returned. Otherwise, the requested task is broadcast on the blockchain, and a team that meets the credit rating requirements is selected to respond to the requested task.

[0051] From the above description, it can be seen that after receiving the request task, it is necessary to verify the identifier of the request task according to the node connected to the request task. If the identifier is found in the blockchain, it means that the request task has been processed and the query result can be returned. Otherwise, the request task is broadcast and a team that meets the credit rating requirements is selected to respond to the request task, thereby ensuring that the request task is not executed repeatedly.

[0052] Further, using the nodes in the team that meets the credit rating requirements to train the verification model until the verification model reaches a preset accuracy or reaches a maximum training time includes:

[0053] Using a node in the team that meets the credit rating requirements to train a verification model locally, and performing a private key signing on model parameters of the verification model;

[0054] Send the signed model parameters to an unused node in the team that meets the credit rating requirements, and update the model parameters of the unused node;

[0055] The updated model parameters are sent to another unused node in the team that meets the credit rating requirements until the verification model reaches a preset accuracy or reaches a maximum training time.

[0056] From the above description, it can be seen that when training the data model, a verification model is generated, and then the model parameters are signed with a private key; the signed model parameters are randomly sent to the next unused node, and the next unused node updates the model parameters based on local data, and then randomly sent to another unused node, and this process is repeated until the verification model reaches the preset accuracy or the maximum training time is reached; therefore, the nodes in the team train the global model through federated learning, which can reduce the computing burden of centralized devices and protect the data privacy of data owners.

[0057] Furthermore, using the nodes in the team that meets the credit rating requirements to train the verification model also includes:

[0058] Based on a random algorithm and two adjacent data sets with at most one different record, calculate the probability that the random algorithm will get the same result after removing the two data sets in a row:

[0059] Pr[G(D)∈0]≤exp(ε)·Pr[G(D′)∈0];

[0060] In the formula, G represents the random algorithm, ε represents the privacy budget, which is usually a small constant, and D represents the dataset;

[0061] Calculate sensitivity:

[0062] Δf=max D,D ,||G(D)-G(G′)||;

[0063] Compute the Laplace mechanism applied to the global model based on the sensitivity:

[0064] G=G m +Lap(Δf / ε);

[0065] Among them, G m is the global model for training.

[0066] From the above description, it can be seen that by adding Laplace noise to the global data sharing model, differential privacy is applied to data sharing, thereby preventing reasoning attacks initiated by data requesters and providing further privacy protection for the data.

[0067] Furthermore, packaging the model training process locally includes:

[0068] All shared records between data requesters and data nodes are treated as shared transactions;

[0069] The shared transaction is packaged into blocks through the transaction recording node and saved locally.

[0070] From the above description, it can be seen that all shared records between data requesters and data nodes are packaged into blocks through transaction recording nodes, so blockchain is introduced into the data sharing process, and each training process is recorded to ensure that data providers provide high-quality data.

[0071] Furthermore, the consensus algorithm based on node contribution reaches a consensus among blockchain nodes and provides credit rewards to the team that meets the credit rating requirements, including:

[0072] The consensus process is performed by nodes that perform data sharing tasks, and each node competes for the opportunity to write transaction records into the block through a work contribution mechanism;

[0073] The authorized node broadcasts the corresponding block to other nodes for verification. After the verification is passed, the corresponding block is added to the blockchain for audit.

[0074] From the above description, it can be seen that by executing the consensus process, each node competes for the opportunity to write transaction records into the block through the work contribution mechanism. Therefore, writing transactions based on contributions can reduce the computing burden of the device.

[0075] Furthermore, the consensus algorithm based on node contribution includes the steps of:

[0076] Calculate the contribution of each node based on cosine similarity:

[0077]

[0078] in represents the actual updated gradient k of the node, represents the local update gradient of the kth node, represents the model gradient before data node k is updated, represents the gradient of the global model;

[0079] Implement a reward mechanism based on contribution weight ratio;

[0080] Calculate the contribution value through the mapping function:

[0081]

[0082] Use the soft-max function to calculate the weight ratio of the node's contribution to the global model;

[0083] Calculate the soft-max function value:

[0084]

[0085] From the above description, it can be seen that the contribution value of the node is accurately calculated according to the cosine value, and a consensus algorithm based on the contribution of the data node is used to reach a consensus among the blockchain nodes, so as to facilitate the subsequent credit rewards.

[0086] The data sharing method based on blockchain and federated learning of the present invention is applicable to the Internet of Things context, and uses peer-to-peer federated learning to achieve model sharing to protect the privacy of data providers. The following is an explanation through specific implementation methods:

[0087] Embodiment 1

[0088] Please refer to Figures 1 to 3 , a data sharing method based on blockchain and federated learning, comprising the steps of:

[0089] S1. Organize mutually trusted blockchain nodes into a team.

[0090] Among them, each team has a team leader who is responsible for receiving data sharing tasks, supervising the joint learning process in data sharing, and sending the global model with differential privacy to the task publisher.

[0091] The data nodes in step S1 may have selfish behavior. To solve this problem, an internal team management mechanism based on "mortgage-penalty" is designed, which includes the following steps:

[0092] S11. Provide a preset amount of collateral when forming a team and calculate the penalty coefficient k for bad behavior nodes:

[0093]

[0094] In the formula, v represents the total number of work rounds that the node completes the collaborative task, p represents the number of times the node temporarily exits, and q represents the number of times the node is lazy.

[0095] S12. Calculate the penalty value of the nodes in the team:

[0096]

[0097] In the formula, is the mortgage of node i.

[0098] S13. Calculate the compensation value C1 of the non-bad behavior nodes in the team:

[0099]

[0100] Where N represents the total number of nodes in the team.

[0101] Furthermore, in order to promote the honest and effective training of data nodes in step S1, we introduced a credit rating mechanism to reward or punish data nodes according to their contributions. The specific steps are as follows:

[0102] S14. Set the original credit of the leader node or each member node in the team to zero.

[0103] S15. Calculate the reward value of the leader node in the team:

[0104]

[0105] In the formula, C redit represents the credit reward provided by the task publisher, W k Represents the weight ratio data node's contribution to the global model.

[0106] S16. Calculate the reward value of each member node:

[0107]

[0108] S17. Calculate the credit value C2 of each node:

[0109] C2=C base +C obtain .

[0110] In the formula, C base Indicates the original credit accumulation value of the node.

[0111] S2. Receive a request task, and select a team that meets the credit rating requirements to respond to the request task.

[0112] Specifically, step S2 also includes: Federated learning is a distributed machine learning framework that not only reduces the computational burden of centralized devices by aggregating local training models of data owners (instead of original data), but also protects the data privacy of data owners.

[0113] S21. Initiate a data sharing request task: The data requester initiates a data sharing request. The task contains the requester's ID, the requested task category, timestamp and task level, and is signed by its private key.

[0114] S22. Team response task: After the data requester publishes the request task, the node connected to it will first verify its identity and then search the blockchain to determine whether the request has been processed before. If there is a cache record, the query result is returned directly. If it is a new request, the task will be broadcast on the blockchain, and the data team that meets the credit requirements will respond to the task.

[0115] S3. Receive a data sharing task, and use the nodes in the team that meets the credit rating requirements to train the verification model until the verification model reaches a preset accuracy or reaches a maximum training time.

[0116] The data sharing task includes the ID of the task requester, the requested task category, the timestamp and the task level.

[0117] S31. Use a node in the team that meets the credit rating requirements to locally train a verification model, and perform a private key signature on the model parameters of the verification model.

[0118] S32. Send the signed model parameters to an unused node in the team that meets the credit rating requirements, and update the model parameters of the unused node.

[0119] S33. Send the updated model parameters to another unused node in the team that meets the credit rating requirements until the verification model reaches a preset accuracy or reaches a maximum training time.

[0120] S4. Package the model training process locally, reach a consensus among blockchain nodes based on the consensus algorithm of node contribution, and provide credit rewards to the team that meets the credit rating requirements.

[0121] Specifically, blockchain, as a distributed shared ledger and database, has the characteristics of decentralization, non-tampering, tracking, collective maintenance, openness and transparency, and can provide reliable technical support for privacy protection of data sharing.

[0122] S41. All shared records between the data requester and the data node are regarded as shared transactions.

[0123] S42: Pack the shared transaction into blocks through the transaction recording node and save them locally.

[0124] S43. The consensus process is performed by nodes that perform data sharing tasks, and each node competes for the opportunity to write transaction records into blocks through a work contribution mechanism.

[0125] S44. The node with authority broadcasts the corresponding block to other nodes for verification. After the verification is passed, the corresponding block is added to the blockchain for audit.

[0126] Therefore, in this embodiment, the combination of blockchain and federated learning not only solves the privacy and security issues of data sharing in distributed scenarios, but also improves the quality of shared data. The shared records of each participant can be tracked, which makes security auditing possible.

[0127] Embodiment 2

[0128] Please refer to Figures 1 to 3 The difference between this embodiment and the first embodiment is that the privacy difference is further limited to be applied to data sharing. Specifically, considering that malicious data requesters may launch attacks, the team leader should add interference to the model and use a model protection method based on differential privacy, which specifically includes the following steps:

[0129] Given a random algorithm G, two adjacent data sets D1 and D2 with at most one different record;

[0130] After removing two data sets in a row, the probability of the random algorithm G obtaining the same result is calculated according to formula (7):

[0131] Pr[G(D)∈0]≤exp(ε)·Pr[G(D′)∈0];

[0132] In the formula, G represents the random algorithm, ε represents the privacy budget, which is usually a small constant, and D represents the dataset;

[0133] Calculate sensitivity:

[0134] Δf=max D,D ,||G(D)-G(G′)||;

[0135] Compute the Laplace mechanism applied to the global model based on the sensitivity:

[0136] G=G m +Lap(Δf / ε);

[0137] Among them, G m is the global model for training.

[0138] Embodiment 3

[0139] Please refer to Figures 1 to 3 The difference between this embodiment and the first and second embodiments is that the steps of the consensus algorithm based on node contribution are further defined, specifically:

[0140] Calculate the contribution of each node based on cosine similarity:

[0141]

[0142] in represents the actual updated gradient k of the node, represents the local update gradient of the kth node, represents the model gradient before data node k is updated, represents the gradient of the global model;

[0143] Implement a reward mechanism based on contribution weight ratio;

[0144] Calculate the contribution value through the mapping function:

[0145]

[0146] Use the soft-max function to calculate the weight ratio of the node's contribution to the global model;

[0147] Calculate the soft-max function value:

[0148]

[0149] Therefore, the advantage of the consensus mechanism in this embodiment is that it can prevent the lazy behavior of nodes. Because in the process of multi-party collaborative training model, some lazy nodes may directly copy the previous model parameters to the next data node.

[0150] In summary, the data sharing method based on blockchain and federated learning provided by the present invention has the following beneficial effects: (1) Analysis from the perspective of data sharing: The present invention proposes a data sharing mechanism based on federated learning, which transforms the data sharing problem into a model sharing problem and realizes team-based data sharing. In addition, a reward and punishment mechanism is introduced. Specifically, the data requester will reward or punish each team based on the results of data sharing, so that team members can complete data sharing with high quality and high reliability. In addition, in order to further punish members who provide unreliable data, a "mortgage-penalty" mechanism is introduced. Therefore, each team can further manage and supervise members so that they can complete data sharing tasks efficiently and reliably. (2) Analysis from the perspective of privacy protection: In the present invention, differential privacy is applied to data sharing by adding Laplace noise to the global data sharing model, thereby preventing reasoning attacks initiated by data requesters and providing further privacy protection for the data.

[0151] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A data sharing method based on blockchain and federated learning, characterized in that: Includes steps: Form a team of mutually trusted blockchain nodes; Provide a preset amount of collateral when forming a team and calculate the penalty coefficient k for bad behavior nodes: In the formula, v represents the total number of work rounds that the node completes the collaborative task, p represents the number of times the node temporarily exits, and q represents the number of times the node is lazy; Calculate the penalty value of nodes in the team: In the formula, is the mortgage of node i; Calculate the compensation value C1 of non-bad behavior nodes in the team: In the formula, N represents the total number of nodes in the team; Set the original credit of the leader node or each member node in the team to zero; Calculate the reward value of the leader node in the team: In the formula, C redit represents the credit reward provided by the task publisher, W i Represents the weight ratio of the data node's contribution to the global model; Calculate the reward value for each member node: Calculate the credit value C2 of each node: C2=C base +C obtain ; In the formula, C base Indicates the original credit accumulation value of the node; Receive a request task, and select a team that meets the credit rating requirements to respond to the request task; Receive a data sharing task, and use the nodes in the team that meets the credit rating requirements to train a verification model until the verification model reaches a preset accuracy or reaches a maximum training time; The model training process is packaged locally, and a consensus algorithm based on node contribution is used to reach a consensus among blockchain nodes and to provide credit rewards to the team that meets the credit rating requirements: The consensus process is performed by nodes that perform data sharing tasks, and each node competes for the opportunity to write transaction records into the block through a work contribution mechanism; The node with authority will broadcast the corresponding block to other nodes for verification. After verification, the corresponding block will be added to the blockchain for audit; The consensus algorithm based on node contribution includes the following steps: Calculate the contribution of each node based on cosine similarity: in represents the actual updated gradient of node i, represents the local update gradient of the i-th node, represents the model gradient before data node i is updated, represents the gradient of the global model; Implement a reward mechanism based on contribution weight ratio; Calculate the contribution value through the mapping function: Use the soft-max function to calculate the weight ratio of the node's contribution to the global model; Calculate the soft-max function value:

2. According to claim 1, a data sharing method based on blockchain and federated learning is characterized in that: The data sharing task includes the ID of the task requester, the requested task category, a timestamp and a task level.

3. According to claim 1, a data sharing method based on blockchain and federated learning is characterized in that: The task of selecting a team that meets the credit rating requirements to respond to the request includes: Verifying an identification of the requested task based on a node connected to the requested task; It is determined according to the identifier whether the requested task has been processed. If so, the processing result queried in the blockchain is directly returned. Otherwise, the requested task is broadcast on the blockchain, and a team that meets the credit rating requirements is selected to respond to the requested task.

4. According to claim 1, a data sharing method based on blockchain and federated learning is characterized in that: Using the nodes in the team that meets the credit rating requirements to train the verification model until the verification model reaches a preset accuracy or reaches a maximum training time includes: Using a node in the team that meets the credit rating requirements to train a verification model locally, and performing a private key signing on model parameters of the verification model; Send the signed model parameters to an unused node in the team that meets the credit rating requirements, and update the model parameters of the unused node; The updated model parameters are sent to another unused node in the team that meets the credit rating requirements until the verification model reaches a preset accuracy or reaches a maximum training time.

5. According to claim 1, a data sharing method based on blockchain and federated learning is characterized in that: The training of the verification model using the nodes in the team that meets the credit rating requirements also includes: Based on a random algorithm and two adjacent data sets with at most one different record, calculate the probability that the random algorithm will get the same result after removing the two data sets in a row: Pr[G(D)∈O]≤exp(ε)·Pr[G(D′)∈O]; In the formula, G represents the random algorithm, ε represents the privacy budget, and D represents the data set; Calculate sensitivity: Compute the Laplace mechanism applied to the global model based on the sensitivity: Among them, G m is the global model for training.

6. A data sharing method based on blockchain and federated learning according to claim 1, characterized in that: The packaging of the model training process locally includes: All shared records between data requesters and data nodes are treated as shared transactions; The shared transaction is packaged into blocks through the transaction recording node and saved locally.

Citation Information

Patent Citations

  • Distributed machine learning system based on block chain

    CN110490330A

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

    CN112348204A

  • Federated learning-based data security and credibility sharing method and device

    CN112632013A

  • Block chain-based participant-trusted federal learning method and device

    CN113467927A

  • Auditable privacy protection deep learning platform construction method based on block chain incentive mechanism

    US20200193292A1

Cited By

  • Privacy protection distributed collaborative auditing system and method based on block chain and federated map neural network

    CN122174261A