A method and device for secure and reliable data sharing based on federated learning
Through the data security and trusted sharing method based on federated learning, the data model is trained and shared by the license chain architecture, and the problems of data security and control rights in the traditional data sharing method are solved, and decentralized secure data sharing and Efficient data utilization.
Patent Information
- Application Number
- CN202011439695.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-07
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2040-12-07
AI Technical Summary
The traditional data sharing method has a centralized structure that can easily lead to single point failure and insufficient data security, and the data provider loses control over the data, which has hit the enthusiasm for data sharing.
Adopt a data security and trustworthy sharing method based on federated learning. Through the two-layer endogenous trustworthy sharing architecture of the license chain, the device nodes are connected to the license chain nodes to train and share the data model, avoiding direct transmission of original data and ensuring data Privacy and security.
A decentralized trusted transaction environment is realized, third-party intervention is avoided, transaction data is recorded through the license chain, data traceability is ensured, user data privacy protection is enhanced, and data sharing is finally realized, and data sharing is improved. positivity.
Smart Images

Figure CN112632013B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for secure and trusted data sharing based on federated learning. Background Art
[0002] With the development of the Internet of Things and big data, more and more raw data has been poured into the network. According to the forecast of the 2019 Global Internet Trends Report, the annual amount of new data will be close to 200ZB in 2025. If we only focus on the data of each subject without sharing data, data islands will be formed, which will not only fail to achieve data reuse and reduce data collection costs, but also limit the scope of data use and hinder data from creating greater benefits. Therefore, the demand for data sharing is increasing.
[0003] However, the traditional data sharing method adopts a centralized structure, where the two parties involved in data sharing transfer the original data through a dedicated data center, and the benefits generated by data sharing are distributed by a third party. This method has many disadvantages:
[0004] First, the centralized structure is prone to single point failures, and the security of user data cannot be guaranteed; second, the data sharing process is not transparent to both parties involved, and the data provider loses ownership of the data and cannot directly control the right to use the data. The existence of these problems has dampened the enthusiasm of nodes to participate in data sharing. Summary of the invention
[0005] The present invention provides a method and apparatus for secure and reliable data sharing based on federated learning, a computing device and a storage medium, so as to solve the technical defects existing in the prior art.
[0006] The present invention provides a data security trusted sharing method based on federated learning, which is used for a two-layer endogenous trusted sharing architecture based on a permission chain, including a permission chain layer and a device layer, wherein the permission chain layer includes a plurality of permission chain nodes forming a permission chain, and the device layer includes a plurality of device nodes;
[0007] Each device node is connected to the corresponding permission chain node;
[0008] The method comprises:
[0009] Send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the data sharing request includes the data type requirement and task indicator requirement of this data sharing task;
[0010] The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain and determines the device nodes participating in this data sharing task as federated learning nodes;
[0011] Each federated learning node is trained based on local relevant data to obtain a local data model, and sends the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model.
[0012] The global data model is sent to the data requesting node.
[0013] According to a method for secure and trusted data sharing based on federated learning provided by the present invention, a permission chain node that receives a data sharing request searches for relevant nodes through the permission chain, and determines the device nodes participating in this data sharing task as federated learning nodes, including:
[0014] The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain to obtain a set of device nodes related to this data sharing task;
[0015] Screening the device node set according to the reputation value, determining the device nodes whose reputation value is greater than or equal to the reputation threshold, and forming a high reputation value node set;
[0016] Screening is performed based on the quotation of each device node in the high reputation value node set and the requirements of the data request node for the diversity of data sources, and the device nodes with lower quotations are obtained as the federated learning nodes.
[0017] According to a method for secure and trusted data sharing based on federated learning provided by the present invention, after the federated learning is completed, the method further includes:
[0018] Updating the reputation value of each of the federated learning nodes and giving rewards to each of the federated learning nodes;
[0019] The rewards include basic rewards and additional reward rewards.
[0020] According to a method for secure and trusted data sharing based on federated learning provided by the present invention, the reputation value of each federated learning node is updated, including:
[0021] Each federated learning node tests the local data models received from other federated learning nodes and obtains corresponding scores;
[0022] Based on the score, a change in the reputation value of the federated learning node at the current stage is obtained;
[0023] Based on the reputation value of the federated learning node in the previous stage and the change in the reputation value in the current stage, the reputation value of the federated learning node in the current stage is obtained.
[0024] According to a method for secure and trusted data sharing based on federated learning provided by the present invention, each federated learning node is given an additional reward, including:
[0025] Determine the additional reward given to each federated learning node based on the work quality of each federated learning node, the sum of the basic rewards of the nodes, and the ratio of the sum of the additional reward rewards to the sum of the basic rewards;
[0026] The working quality of the federated learning node includes the model quality trained by the federated learning node and the data model training time of the federated learning node.
[0027] According to a method for secure and trusted data sharing based on federated learning provided by the present invention, the method further comprises: determining a plurality of device nodes that execute a consensus process, and selecting one of the device nodes as a leader node based on the reputation value;
[0028] The leader node collects transaction records and writes the transaction records into a temporary block;
[0029] The leader node broadcasts the temporary block to other device nodes that execute the consensus process, so that the other device nodes verify the transaction records in the temporary block;
[0030] If the ratio of device nodes that have passed the verification to the device nodes that execute the consensus process is higher than the threshold, the leader node will send a temporary block carrying its signature information to all other device nodes and record the temporary block in the blockchain.
[0031] According to a method for secure and trusted data sharing based on federated learning provided by the present invention, one of the device nodes is selected as a leader node based on the reputation value, including:
[0032] If there is a device node with the highest reputation value, the device node is used as the leader node;
[0033] When there are multiple device nodes with the highest reputation value, one of them is selected as the leader node.
[0034] The present invention also provides a data security trusted sharing device based on federated learning, which is arranged in a two-layer endogenous trusted sharing architecture based on a permission chain, including a permission chain layer and a device layer, wherein the permission chain layer includes a plurality of permission chain nodes forming a permission chain, and the device layer includes a plurality of device nodes, each device node is connected to a corresponding permission chain node;
[0035] The device comprises:
[0036] A request sending module, used to send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the data sharing request includes the data type requirement and task indicator requirement of this data sharing task;
[0037] The node determination module is used for the permission chain node that receives the data sharing request to search for relevant nodes through the permission chain and determine the device node participating in this data sharing task as the federated learning node;
[0038] A node training module is used for each federated learning node to train based on local relevant data to obtain a local data model, and send the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model;
[0039] The data return module is used to send the global data model to the data requesting node.
[0040] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described methods for secure and trusted data sharing based on federated learning are implemented.
[0041] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for secure and trusted data sharing based on federated learning.
[0042] The method and device for secure and trusted data sharing based on federated learning provided by the present invention establish a decentralized trusted transaction environment, avoid the intervention of a third party, and also record data through a permission chain to achieve traceability of transaction data; through the federated learning technology of the present invention, a local data model is used to participate in sharing instead of the original data, further strengthening the protection of user data privacy, and ultimately obtaining a global data model to achieve secure data sharing.
[0043] Secondly, through the reputation evaluation method of the device node, the working performance of all aspects of the node is comprehensively considered, the credibility of the node is measured more objectively, and a certain reference is provided for the prediction of the future behavior of the node.
[0044] Thirdly, by providing a reverse auction incentive mechanism that rewards each federated learning node, the interests of both parties involved in data sharing are guaranteed, the enthusiasm of device nodes to participate in data sharing is increased, and nodes are encouraged to contribute higher work quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 is a schematic diagram of the endogenous trusted sharing architecture provided by the present invention;
[0047] Figure 2 This is one of the flow charts of the data security and trustworthy sharing method based on federated learning provided by the present invention;
[0048] Figure 3 This is the second flow chart of the data security and trustworthy sharing method based on federated learning provided by the present invention;
[0049] Figure 4 This is the third structural diagram of the data security and trustworthy sharing device based on federated learning provided by the present invention;
[0050] Figure 5 It is a schematic diagram of a scenario use case of the data security and trustworthy sharing method based on federated learning provided by the present invention;
[0051] Figure 6 It is a structural diagram of a data security and trustworthy sharing device based on federated learning provided by the present invention;
[0052] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] First, the intrinsic trusted sharing architecture involved in the embodiment of the present invention is schematically described.
[0055] like Figure 1As shown, in order to realize data transactions and resource management in the network, a two-layer endogenous trusted sharing architecture based on the permission chain is constructed, including a permission chain layer and a device layer. The permission chain layer includes multiple permission chain nodes forming a permission chain, and the device layer includes multiple device nodes.
[0056] The high level is the permission chain layer, which is composed of permission chain nodes. Permission chain nodes are usually devices such as base stations with unlimited computing power and storage space. They only store permission chains, not raw data, and will not directly participate in data sharing or conduct federated learning. Two types of transactions are stored on the permission chain, one records the registration information of device nodes, and the other records the transaction information generated by each step of data sharing. Permission chain nodes are selected when the system is initialized. In subsequent work, they will maintain a relatively stable state and will not exit at will, so they are considered to be trustworthy.
[0057] The lower layer is the device layer, which is composed of device nodes. In general, device nodes store certain types of data locally, do not store permission chains, and cannot retrieve permission chains. Device nodes can be divided into data request nodes and data provider nodes according to their different demands in data sharing tasks. The role of device nodes may change in different tasks. The registration information includes the data information owned by the node, the name of the node, and the address of the node. This information will be recorded on the blockchain for retrieval for specific data sharing requests. The data information includes data type, data name, data introduction, etc.
[0058] The embodiment of the present invention discloses a data security and trustworthy sharing method based on federated learning, see Figure 2 , including the following steps 201 to 204:
[0059] 201. Send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the data sharing request includes the data type requirement and task indicator requirement of this data sharing task.
[0060] Among them, the task indicator requirements include the diversity of data sources, the training time of local data models, etc.
[0061] It should be noted that by avoiding direct transmission of original data, the device node as the data provider firmly grasps the ownership of the data. Take a system with N data provider nodes as an example, and assume that the number of data provider nodes in the system is large enough. Each data provider node P i Each has a local dataset D i , and all agree to participate in data sharing for a fee without disclosing their own data.
[0062] The permission chain node that receives the data sharing request will enter the multi-party data retrieval process.
[0063] 202. The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain, and determines the device nodes that participate in this data sharing task as federated learning nodes.
[0064] Specifically, step 202 includes:
[0065] S221: The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain to obtain a device node set T related to this data sharing task. r .
[0066] For example, the permission chain nodes include B1, B2, B3, B4 and B5, the permission chain node B1 is connected to the device nodes A1, A2, A3, the permission chain node B2 is connected to the device nodes A4, A5, A6, the permission chain node B3 is connected to the device nodes A7 and A8, the permission chain node B4 is connected to the device node A9, and the permission chain node B5 is connected to the device node A10. Device node A1 is used as a data request node, and the device nodes related to this data sharing task are determined to be device nodes A4, A6, A8 and A9 as the device node set T r .
[0067] S222, screening the device node set according to the reputation value, and determining the device nodes whose reputation values are greater than or equal to the reputation threshold as the high reputation value node set;
[0068] S223, screening is performed according to the quotation of each device node in the high reputation value node set and the requirement of the data request node for data source diversity, and the device node with the lower quotation is obtained as the federated learning node T f .
[0069] The reputation value of a node is a long-term observation indicator that can reflect the past behavior of the device node and predict the future performance of the device node to a certain extent. It is accumulated by the work quality of the device node in each data sharing task.
[0070] Still using the above example, device nodes A4, A6, A8 and A9 are screened according to their reputation values. Assuming that the reputation value of device node A4 is 0.5, the reputation value of device node A6 is 0.46, the reputation value of device node A8 is 0.68, the reputation value of device node A9 is 0.88, and the reputation threshold is 0.5, then device nodes A4, A8 and A9 are considered as a high reputation node set.
[0071] Using the reverse auction mechanism, we select device nodes A4, A8, and A9 based on their bids and the data request node’s requirements for data source diversity, and select device nodes A4 and A8 with lower bids as federated learning nodes T. f .
[0072] In a specific data sharing task, the data requesting node will send a data sharing request to its superior permission chain node, which includes requirements for the diversity of data sources.
[0073] Through the multi-party data retrieval process, the device node set T related to this data sharing task can be obtained r , the device node set T r The available device nodes in are divided into two groups according to their reputation values, namely, a high reputation value node set H and a low reputation value node set L. See the following formula (1):
[0074]
[0075]
[0076] Among them, r i m-1 For device node P i The reputation value of the previous stage;
[0077] r med is the reputation threshold, here we take r med =0.5;
[0078] r inv is the unavailable reputation threshold, where r med =0.2, the credibility value is lower than r inv The device node is an unavailable node;
[0079] D is the data requester’s requirement for data source diversity, L′ is each DH node randomly selected from the low reputation value node set, T f is a set of federated learning nodes, only T f The nodes in will receive this data sharing request.
[0080] The device node that receives the data sharing request chooses whether to participate in the data sharing according to the specific requirements of the task and its own situation. If it agrees to participate, it will make a quotation. The set of federated learning nodes participating in federated learning can be screened out based on the quotations of each device node and the requirements of the data request node for the diversity of data sources. f , and the basic cost of this data sharing task can also be calculated.
[0081] 203. Each federated learning node performs training based on local relevant data to obtain a local data model, and sends the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model.
[0082] The goal of federated learning is to obtain a global data model M for specific data sharing requests through training. The global data model M is obtained by the federated learning node through a certain machine learning algorithm based on the local data models obtained through training. M can not only respond to the original data sharing request, but also predict related issues to a certain extent.
[0083] The federated learning process will be carried out between the federated learning nodes. f Node P in i For example, the local data model can be trained through the following steps
[0084] 1) Select relevant data samples for training.
[0085] Federated learning node P i According to the requirements of the data sharing task, the local dataset D i Select the local relevant data subset d i .
[0086] 2) Data encryption based on differential privacy.
[0087] By adding Laplace noise, the locally correlated data subset Dd can be i Based on the encrypted local relevant data subset
[0088] 3) Local model training.
[0089] In the encrypted local data subset Using machine learning algorithms, we can get a local data model
[0090] The above training process is node P i After the training is completed, the node P i The local data model Send to other federated learning nodes. At the same time, node P i It will also receive other local data models with Train together until the local data models of all other federated learning nodes are received and the global data model M is trained.
[0091] It should be noted that when there are multiple federated learning nodes, it is not necessary for each federated learning node to obtain the global data model separately. Instead, after one of the federated learning nodes obtains the global data model, it notifies the other federated learning nodes to stop training.
[0092] For all federated learning nodes, you can perform quality tests on local models and upload model test results.
[0093] 204. Send the global data model to a data requesting node.
[0094] The method and device for secure and trusted data sharing based on federated learning provided by the present invention establish a decentralized trusted transaction environment, avoid the intervention of a third party, and also record data through a permission chain to achieve traceability of transaction data; through the federated learning technology of the present invention, a local data model is used to participate in sharing instead of the original data, further strengthening the protection of user data privacy, and ultimately obtaining a global data model to achieve secure data sharing.
[0095] The embodiment of the present invention also provides a data security and trustworthy sharing method based on federated learning, see Figure 3 , including steps 301 to 306:
[0096] 301. Send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the data sharing request includes the data type requirement and task indicator requirement of this data sharing task.
[0097] 302. The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain to obtain a set of device nodes related to the current data sharing task.
[0098] 303 . Screen the device node set according to the reputation value, and determine the device nodes whose reputation values are greater than or equal to the reputation threshold as the high reputation value node set.
[0099] 304. Screening is performed according to the quotation of each device node in the high reputation value node set and the requirement of the data request node for data source diversity, and the device node with a lower quotation is obtained as the federated learning node.
[0100] 305. Each federated learning node performs training based on local relevant data to obtain a local data model, and sends the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model.
[0101] 306. Send the global data model to the data requesting node.
[0102] For steps 301 to 306, the process of federated learning is completed. For specific explanations, please refer to the above embodiments, which will not be repeated here.
[0103] 307. Update the reputation value of each of the federated learning nodes, and give each of the federated learning nodes a reward.
[0104] The rewards include basic rewards and additional reward rewards.
[0105] Specifically, updating the reputation value of each of the federated learning nodes includes:
[0106] S371. Each federated learning node tests the local data models received from other federated learning nodes to obtain corresponding scores.
[0107] S372. Based on the score, obtain the change in the reputation value of the federated learning node at the current stage.
[0108] S373. Based on the reputation value of the federated learning node in the previous stage and the change in the reputation value in the current stage, obtain the reputation value of the federated learning node in the current stage.
[0109] In a data sharing task, node P i The amount of change in reputation depends on two factors:
[0110] 1) The quality of the data model trained by the node in this data sharing task q i ;
[0111] 2) The activity of nodes participating in data sharing tasks w i .
[0112] The evaluation results of the above two indicators are expressed as numerical values in the range of [0,1].
[0113] In this embodiment, the accuracy of the model prediction results is used to measure the quality of the model. For example, the mean absolute error (MAE) can be used to measure the training quality of the model for regression tasks.
[0114] In a specific data sharing task, a device node subset T can be obtained by searching f , is called the federated learning node set for this data sharing task. f Each node in the network will train the local data model and participate in the consensus process.
[0115] After the federated learning process is completed, node P i The local relevant data subset d i As a test set, the received local data model is tested and the model quality is scored based on the test results. i For example, for node P j Trained local data model Take the test and get the score q i,j Each federated learning node P i A model quality evaluation matrix Q will be obtained through testing i :
[0116]
[0117] Because the node cannot test the local data model trained by itself, let q i,i = 0. Based on the model quality evaluation matrix of each node, the average model quality q of each node can be calculated i , as the federated learning node P i The model quality score in this data sharing task is calculated as follows:
[0118]
[0119] Among them, n f Indicates the number of federated learning nodes for this data sharing task.
[0120] In a data sharing task, the federated learning node P i The change in the reputation value can be expressed as the following formula (4):
[0121]
[0122] Among them, w i For node P i activity level;
[0123] is the average activity of federated learning nodes in this data sharing task;
[0124] is the average model quality of the federated learning nodes in this data sharing task;
[0125] q e is the expected model quality of the data requester in this data sharing task.
[0126] To facilitate analysis and calculation, the node reputation value range is set to [0,1], where 0 represents absolute distrust, 1 represents absolute trust, and 0.5 is a neutral value. The reputation value of a newly added device node is set to 0.5 by default.
[0127] Federated learning node P i The reputation value update algorithm is as follows (5) to (7):
[0128] r i m =min(max(r i tmp +λ·r i f ,0),1) (5)
[0129]
[0130]
[0131] Among them, r i f is the federated learning node P i The change in reputation value, r i f The range of variation is (-1,1);
[0132] β is the reputation growth factor, and its variation range is [0,1]. Here, λ=0.1.
[0133] r i m is the federated learning node P i The current stage reputation value, r i m The range of variation is [0,1];
[0134] r i m-1 is the federated learning node P i The reputation value of the previous stage;
[0135] q i is the federated learning node P i Model quality score in this data sharing task.
[0136] After a data sharing task is completed, the federated learning node P i The reputation value r i mAffected by two factors: First, the federated learning node P i The reputation value r of the previous stage i m-1 , and the second is the federated learning node P i The change in reputation value in this data sharing task r i f .
[0137] Since data requesters generally hope that the reputation of good nodes accumulates slowly and the reputation of bad nodes decreases rapidly, the larger the node reputation, the smaller the impact of the node reputation change on the node reputation, and vice versa. That is, the reputation change of high-reputation nodes is smoother than that of low-reputation nodes.
[0138] Specifically, giving each of the federated learning nodes an additional reward return includes: determining the additional reward return given to each of the federated learning nodes according to the work quality of each of the federated learning nodes, the sum of the basic returns of the nodes, and the ratio of the sum of the additional reward returns to the sum of the basic returns;
[0139] The working quality of the federated learning node includes the model quality trained by the federated learning node and the data model training time of the federated learning node.
[0140] Federated learning node P i Participate in the data request node P r After publishing the data sharing task, you can get a reward c i .c i It consists of two parts: basic return and additional rewards That is, the following formula (8):
[0141]
[0142] Among them, the basic return is the node’s quote, which is available to all federated learning nodes participating in this work;
[0143] Additional Rewards It is a reward allocated to nodes based on the work quality of the federated learning nodes. Only federated learning nodes with high work quality can obtain it.
[0144] Rewards received by a federated learning node in a data sharing task It is related to the following three factors:
[0145] First, the federated learning node P i The quality of work done in this data sharing task;
[0146] The second is the total quote of the federated learning nodes in the high-reputation node set;
[0147] The third is the proportion of rewards in this data sharing task, which is the following formula (9):
[0148]
[0149] Take here That is, the ratio of the reward cost to the basic cost in this data sharing task is negatively correlated with the reputation value of the data requesting node. The higher the reputation value of the data requesting node, the lower the additional reward cost in this data sharing task, and vice versa, but it will not exceed the basic cost.
[0150] The distribution of node rewards is only related to the quality of the node's work in this data sharing task. The evaluation criteria for the node's work quality are determined by the specific requirements of the data request task. For example, the quality of the model trained by the node, the training time of the node's data model, etc. i The higher the quality of your work, the more rewards you get, and vice versa.
[0151] The data security and trusted sharing method based on federated learning provided in the embodiment of the present invention establishes a decentralized trusted transaction environment, avoids the intervention of a third party, and also records the data through a permission chain to achieve traceability of transaction data; through the federated learning technology of the present invention, the local data model is used to participate in sharing instead of the original data, further strengthening the protection of user data privacy, and finally obtaining a global data model to achieve secure data sharing.
[0152] Secondly, through the reputation evaluation method of the device node, the working performance of all aspects of the node is comprehensively considered, the credibility of the node is measured more objectively, and a certain reference is provided for the prediction of the future behavior of the node.
[0153] The embodiment of the present invention also provides a data security and trustworthy sharing method based on federated learning, see Figure 4 After executing the federated learning, the method further includes the following steps 401 to 404:
[0154] 401. Determine a plurality of device nodes that execute a consensus process, and select one of the device nodes as a leader node based on the reputation value.
[0155] Specifically, in the process of selecting a leader node in step 401, if there is one device node with the highest reputation value, the device node is used as the leader node.
[0156] Alternatively, when there are multiple device nodes with the highest reputation value, one of them is arbitrarily selected as the leader node.
[0157] 402. The leader node collects transaction records and writes the transaction records into a temporary block.
[0158] 403. The leader node broadcasts the temporary block to other device nodes that execute the consensus process, so that the other device nodes verify the transaction records in the temporary block.
[0159] Specifically, the leader node can first send the temporary block to its superior blockchain node, and then send it to other device nodes that execute the consensus process through blockchain broadcast.
[0160] The verification content includes not only the basic information of the transaction (such as the block header), but also the quality of the model (i.e. whether the difference between the local verification result and the record in the transaction is within a certain range).
[0161] 404. If the ratio of the device nodes that have passed the verification to the device nodes that execute the consensus process is higher than the threshold, the leader node sends the temporary block carrying its signature information to all other device nodes and records the temporary block in the blockchain.
[0162] For example, if the threshold is set to 2 / 3, then if more than 2 / 3 of the device nodes verify the transaction record in the temporary block, the transaction record is considered legal, and the temporary block can be broadcast to all other nodes and stored in the blockchain.
[0163] The method of this embodiment ensures the interests of both parties involved in data sharing through a reverse auction incentive mechanism that rewards each federated learning node, improves the enthusiasm of device nodes to participate in data sharing, and encourages nodes to contribute higher work quality.
[0164] In order to facilitate further understanding of the method of this embodiment, the method of this embodiment is schematically illustrated below using a specific example.
[0165] like Figure 5 As shown, the method use case disclosed in this embodiment is a scenario where enterprise A requests data of a specific type, and specifically includes the following steps:
[0166] Step 1: Enterprise B and Enterprise C register data information with the permission chain. The data information includes data type, data name and data introduction;
[0167] Step 2: Enterprise A publishes a data sharing task "X" to the permission chain. The data sharing task includes the data type requirements and task indicator requirements (such as data source diversity, model training time, etc.) of this data sharing task.
[0168] Step 3: Through the multi-party data retrieval process, retrieve the relevant nodes that meet the data type requirements in the data sharing task. Filter out the nodes with high reputation values from the relevant nodes and send data sharing requests to them, which are Enterprise B and Enterprise C in this example;
[0169] Step 4: After receiving the data sharing request "X", companies B and C submit bids for the task;
[0170] Step 5: Select a federated learning node based on the quotations from Enterprise B and Enterprise C;
[0171] Step 6: Enterprise B and Enterprise C train local data models based on local relevant data;
[0172] Step 7: After completing the training of the local data model, Enterprise B and Enterprise C upload the local data model to the permission chain;
[0173] Step 8: Enterprise B and Enterprise C download the local data models trained by other enterprises through the permission chain;
[0174] Step 9: Enterprise B and Enterprise C train the global model;
[0175] Step 10: The enterprise that completes global model training first uploads the global model to the permission chain. In this case, it is enterprise B.
[0176] Step 11: The permission chain sends a message to enterprise B, notifying enterprise B to stop global model training;
[0177] Step 12: Enterprise B and Enterprise C respectively conduct quality tests on the local models trained by other enterprises;
[0178] Step 13: Enterprises B and C upload the model test results to the permission chain;
[0179] Step 14: Enterprise A obtains the global data model through the permission chain;
[0180] Step 15: Enterprise A gives rewards to Enterprise B and Enterprise C for this data sharing task.
[0181] This embodiment meets the needs of enterprise A to obtain high-quality data at a lower price, and also enables enterprises B and C to make profits while ensuring data privacy and security. The data sharing process is recorded on the permission chain in the form of transactions, ensuring the traceability of data sharing information.
[0182] The following describes a data security and trusted sharing device based on federated learning provided by the present invention. The data security and trusted sharing device based on federated learning described below and the data security and trusted sharing method based on federated learning described above can refer to each other.
[0183] The present invention provides a data security trusted sharing device based on federated learning, which is arranged in a two-layer endogenous trusted sharing architecture based on a permission chain, including a permission chain layer and a device layer, wherein the permission chain layer includes a plurality of permission chain nodes forming a permission chain, and the device layer includes a plurality of device nodes, each device node is connected to a corresponding permission chain node;
[0184] See also Figure 6 , the device comprises:
[0185] The request sending module 601 is used to send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the data sharing request includes the data type requirement and task indicator requirement of this data sharing task;
[0186] Node determination module 602, configured to retrieve relevant nodes through the permission chain at the permission chain node that receives the data sharing request, and determine the device node that participates in the data sharing task as a federated learning node;
[0187] The node training module 603 is used for each federated learning node to perform training based on local relevant data to obtain a local data model, and send the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model.
[0188] The data return module 604 is used to send the global data model to the data requesting node.
[0189] Optionally, the node determination module 602 is specifically configured to:
[0190] The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain to obtain a set of device nodes related to this data sharing task;
[0191] Screening the device node set according to the reputation value, and determining the device nodes whose reputation values are greater than or equal to the reputation threshold as the high reputation value node set;
[0192] Screening is performed based on the quotation of each device node in the high reputation value node set and the requirements of the data request node for the diversity of data sources, and the device nodes with lower quotations are obtained as federated learning nodes.
[0193] Optionally, the device further comprises an update reward module, which is used to: update the reputation value of each of the federated learning nodes and give rewards to each of the federated learning nodes; wherein the rewards include basic rewards and additional reward rewards.
[0194] Optionally, the update reporting module is specifically used for: each federated learning node tests the local data model received from other federated learning nodes to obtain a corresponding score;
[0195] Based on the score, a change in the reputation value of the federated learning node at the current stage is obtained;
[0196] Based on the reputation value of the federated learning node in the previous stage and the change in the reputation value in the current stage, the reputation value of the federated learning node in the current stage is obtained.
[0197] Optionally, the update reward module is specifically used to: determine the additional reward reward given to each federated learning node according to the work quality of each federated learning node, the sum of the basic rewards of the nodes, and the ratio of the sum of the additional reward rewards to the sum of the basic rewards;
[0198] The working quality of the federated learning node includes the model quality trained by the federated learning node and the data model training time of the federated learning node.
[0199] Optionally, the device further comprises a consensus module, configured to:
[0200] Determine a plurality of device nodes that execute a consensus process, and select one of the device nodes as a leader node based on the reputation value;
[0201] The leader node collects transaction records and writes the transaction records into a temporary block;
[0202] The leader node broadcasts the temporary block to other device nodes that execute the consensus process, so that the other device nodes verify the transaction records in the temporary block;
[0203] If the ratio of device nodes that have passed the verification to the device nodes that execute the consensus process is higher than the threshold, the leader node will send a temporary block carrying its signature information to all other device nodes and record the temporary block in the blockchain.
[0204] Optionally, the consensus module is specifically used to: when there is one device node with the highest reputation value, use the device node as the leader node; when there are multiple device nodes with the highest reputation value, select one of them as the leader node.
[0205] The data security and trusted sharing device based on federated learning provided by the embodiment of the present invention establishes a decentralized trusted transaction environment, avoids the intervention of a third party, and also records data through a permission chain to achieve traceability of transaction data; through the federated learning technology of the present invention, a local data model is used to participate in sharing instead of the original data, further strengthening the protection of user data privacy, and ultimately obtaining a global data model to achieve secure data sharing.
[0206] Secondly, through the reputation evaluation method of the device node, the working performance of all aspects of the node is comprehensively considered, the credibility of the node is measured more objectively, and a certain reference is provided for the prediction of the future behavior of the node.
[0207] Thirdly, by providing a reverse auction incentive mechanism that rewards each federated learning node, the interests of both parties involved in data sharing are guaranteed, the enthusiasm of device nodes to participate in data sharing is increased, and nodes are encouraged to contribute higher work quality.
[0208] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a data security and trusted sharing method based on federated learning, including:
[0209] Send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the sharing request includes the data type requirement and task indicator requirement of this data sharing task;
[0210] The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain and determines the device nodes participating in this data sharing task as federated learning nodes;
[0211] Each federated learning node is trained based on local relevant data to obtain a local data model, and sends the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model.
[0212] The global data model is sent to the data requesting node.
[0213] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0214] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer can execute the data security and trusted sharing method based on federated learning provided by the above methods, including:
[0215] Send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the sharing request includes the data type requirement and task indicator requirement of this data sharing task;
[0216] The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain and determines the device nodes participating in this data sharing task as federated learning nodes;
[0217] Each federated learning node is trained based on local relevant data to obtain a local data model, and sends the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model.
[0218] The global data model is sent to the data requesting node.
[0219] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the above-mentioned data security and trusted sharing method based on federated learning, including:
[0220] Send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the sharing request includes the data type requirement and task indicator requirement of this data sharing task;
[0221] The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain and determines the device nodes participating in this data sharing task as federated learning nodes;
[0222] Each federated learning node is trained based on local relevant data to obtain a local data model, and sends the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model.
[0223] The global data model is sent to the data requesting node.
[0224] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0225] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0226] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data security and trustworthy sharing method based on federated learning, characterized in that: A two-layer endogenous trusted sharing architecture based on a permission chain, comprising a permission chain layer and a device layer, wherein the permission chain layer comprises a plurality of permission chain nodes forming a permission chain, and the device layer comprises a plurality of device nodes; Each device node is connected to the corresponding permission chain node; The method comprises: Send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the data sharing request includes the data type requirement and task indicator requirement of this data sharing task; The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain and determines the device nodes participating in this data sharing task as federated learning nodes; Each federated learning node is trained based on local relevant data to obtain a local data model, and sends the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model. sending the global data model to the data requesting node, Among them, the permission chain node that receives the data sharing request searches for relevant nodes through the permission chain and determines the device nodes participating in this data sharing task as federated learning nodes, including: The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain to obtain a set of device nodes related to this data sharing task; Screening the device node set according to the reputation value, and determining the device nodes whose reputation values are greater than or equal to the reputation threshold as the high reputation value node set, wherein the reputation value is determined based on the quality of the local data model trained in each data sharing task and the activity of participating in the data sharing task; Screening is performed based on the quotation of each device node in the high reputation value node set and the requirements of the data request node for the diversity of data sources, and the device nodes with lower quotations are obtained as the federated learning nodes.
2. The method for secure and reliable data sharing based on federated learning according to claim 1 is characterized in that: After the federated learning is completed, the method further includes: Updating the reputation value of each of the federated learning nodes and giving rewards to each of the federated learning nodes; The rewards include basic rewards and additional reward rewards.
3. The method for secure and reliable data sharing based on federated learning according to claim 2 is characterized in that: The reputation value of each of the federated learning nodes is updated, including: Each federated learning node tests the local data models received from other federated learning nodes and obtains corresponding scores; Based on the score, a change in the reputation value of the federated learning node at the current stage is obtained; Based on the reputation value of the federated learning node in the previous stage and the change in the reputation value in the current stage, the reputation value of the federated learning node in the current stage is obtained.
4. The method for secure and reliable data sharing based on federated learning according to claim 2 is characterized in that: Additional rewards are given to each federated learning node, including: Determine the additional reward given to each federated learning node based on the work quality of each federated learning node, the sum of the basic rewards of the nodes, and the ratio of the sum of the additional reward rewards to the sum of the basic rewards; The working quality of the federated learning node includes the model quality trained by the federated learning node and the data model training time of the federated learning node.
5. The method for secure and reliable data sharing based on federated learning according to claim 1 is characterized in that: The method further comprises: Determine a plurality of device nodes that execute a consensus process, and select one of the device nodes as a leader node based on the reputation value; The leader node collects transaction records and writes the transaction records into a temporary block; The leader node broadcasts the temporary block to other device nodes that execute the consensus process, so that the other device nodes verify the transaction records in the temporary block; If the ratio of device nodes that have passed the verification to the device nodes that execute the consensus process is higher than the threshold, the leader node will send a temporary block carrying its signature information to all other device nodes and record the temporary block in the blockchain.
6. The method for secure and trusted data sharing based on federated learning according to claim 5 is characterized in that: Selecting one of the device nodes as a leader node based on the reputation value includes: If there is a device node with the highest reputation value, the device node is used as the leader node; When there are multiple device nodes with the highest reputation value, one of them is selected as the leader node.
7. A data security and trustworthy sharing device based on federated learning, characterized in that: A two-layer endogenous trusted sharing architecture based on a permission chain is provided, including a permission chain layer and a device layer, the permission chain layer includes a plurality of permission chain nodes forming a permission chain, the device layer includes a plurality of device nodes, and each device node is connected to a corresponding permission chain node; The device comprises: A request sending module, used to send a data sharing request generated by any device node to its superior permission chain node, and use the device node as a data request node, wherein the data sharing request includes the data type requirement and task indicator requirement of this data sharing task; The node determination module is used for the permission chain node that receives the data sharing request to search for relevant nodes through the permission chain and determine the device node participating in this data sharing task as the federated learning node; A node training module is used for each federated learning node to train based on local relevant data to obtain a local data model, and send the local data model to other federated learning nodes after the training is completed. After receiving the local data models of other federated learning nodes, each of the federated learning nodes will train its own local data model together with the local data models of other federated learning nodes until one of the federated learning nodes receives the local data models of all other federated learning nodes for training to obtain a global data model; The data return module is used to send the global data model to the data request node, wherein the permission chain node that receives the data sharing request searches for relevant nodes through the permission chain and determines the device nodes participating in this data sharing task as the federated learning nodes, including: The permission chain node that receives the data sharing request searches for relevant nodes through the permission chain to obtain a set of device nodes related to this data sharing task; Screening the device node set according to the reputation value, and determining the device nodes whose reputation values are greater than or equal to the reputation threshold as the high reputation value node set, wherein the reputation value is determined based on the quality of the local data model trained in each data sharing task and the activity of participating in the data sharing task; Screening is performed based on the quotation of each device node in the high reputation value node set and the requirements of the data request node for the diversity of data sources, and the device nodes with lower quotations are obtained as the federated learning nodes.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for secure and trusted data sharing based on federated learning as described in any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for secure and trusted data sharing based on federated learning as described in any one of claims 1 to 6 are implemented.