Data sharing method and data sharing system based on block chain and federal learning
Through the combination of blockchain and federated learning, multiple interactions are used to maximize client utility value, and differentiated incentives are achieved, which solves the problems of low user participation and poor data sharing effect, and improves the fairness and security of data sharing .
Patent Information
- Application Number
- CN202310684705.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2024-12-10
AI Technical Summary
Users are less motivated to participate in federated learning due to data privacy issues, insufficient incentives and unfair participation, resulting in poor data sharing effects.
Through blockchain, a decentralized model aggregation mechanism and a fair and effective incentive mechanism are introduced, and multiple interactions between blockchain nodes and federated learning nodes are used to maximize the utility value of each client based on resource allocation information and training data volume. , realize differentiated data sharing incentives and improve user participation.
It improves users' enthusiasm for participating in federated learning, improves data sharing effect, ensures fair and reasonable incentives for the data sharing process, and enhances data security and storage scalability.
Smart Images

Figure CN119106016A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data sharing technology, and in particular to a data sharing method and a data sharing system based on blockchain and federated learning. Background Art
[0002] Federated learning is a machine learning method that involves multi-party collaborative computing. Each participant jointly trains the machine learning model by exchanging encrypted model parameters, so that data can be shared without leaving the local machine. However, users are often reluctant to participate in federated learning due to data privacy issues, insufficient incentives, and unfairness.
[0003] In related technologies, blockchain is combined with federated learning because of its openness, transparency, decentralization, and immutability. The encrypted model parameters exchanged by the participants each time, the trained machine learning model, and the rewards allocated to the participants according to the incentive mechanism are broadcast and recorded in blocks through blockchain, thereby introducing a decentralized model aggregation mechanism and a fair and effective incentive mechanism for federated learning.
[0004] However, in the above methods, incentives are usually only provided to participants with model training capabilities, and model training often consumes a lot of computing resources, resulting in low enthusiasm of users to participate in federated learning and poor data sharing effects. Summary of the invention
[0005] The embodiment of the present application provides a data sharing method and data sharing system based on blockchain and federated learning, which can effectively enhance the enthusiasm of users to participate in federated learning and improve the data sharing effect. The technical solution is as follows:
[0006] In a first aspect, a data sharing method based on blockchain and federated learning is provided, the method being applied to a data sharing system, the data sharing system comprising a blockchain node and a federated learning node, the blockchain node being configured with a blockchain, the method comprising:
[0007] The first client sends a sharing request to the blockchain node, wherein the sharing request indicates to perform shared training on the machine learning model through the federated learning node;
[0008] The blockchain node sends client information to the first client based on the sharing request, where the client information indicates a second client and a third client participating in the shared training, where the second client is used to provide local training data of the second client, and the third client is used to train the machine learning model based on the local training data of the third client, and send the trained machine learning model to the blockchain node;
[0009] The first client sends first resource allocation information to the second client and second resource allocation information to the third client through the blockchain node based on the client information, wherein the first resource allocation information indicates resources allocated to the second client and the second resource allocation information indicates resources allocated to the third client;
[0010] The federated learning node performs shared training on the machine learning model based on the local training data of the second client, and sends the trained machine learning model to the blockchain node;
[0011] The blockchain node publishes the trained machine learning model on the blockchain, so that the first client obtains the machine learning model from the blockchain.
[0012] In the above method, after the first client sends a sharing request for the machine learning model to the blockchain node, the blockchain node returns the client information participating in the shared training, so that the first client sends corresponding resource allocation information to the second client and the third client participating in the shared training, respectively, to encourage different types of clients to participate in data sharing and realize the federated learning process for the machine learning model. With this differentiated data sharing method, not only the second client that provides local training data to participate in shared training can obtain resources, but also the third client that provides both local training data and model training can obtain resources, thereby greatly enhancing the enthusiasm of users to participate in federated learning and improving the data sharing effect.
[0013] In some embodiments, the first client sends first resource allocation information to the second client and sends second resource allocation information to the third client through the blockchain node based on the client information, including:
[0014] The first client performs multiple interactions with the second client through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client for the second client and the amount of training data provided by the second client for the first client, so as to determine the first resource allocation information, and sends the first resource allocation information to the second client;
[0015] Based on the client information, the first client interacts multiple times with the third client through the blockchain node regarding the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, so as to determine the second resource allocation information, and send the second resource allocation information to the third client.
[0016] In some embodiments, the first client performs multiple interactions with the second client through the blockchain node based on the client information, with respect to resource allocation information provided by the first client to the second client and the amount of training data provided by the second client to the first client, to determine the first resource allocation information, including:
[0017] In any interaction, the first client sends resource allocation information provided for the second client in this interaction to the second client through the blockchain node based on the client information;
[0018] The second client determines, based on the resource allocation information of this interaction, the amount of training data provided for the first client in this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node;
[0019] The first client determines resource allocation information to be provided to the second client in a next interaction based on the amount of training data in the current interaction.
[0020] In some embodiments, the method further comprises:
[0021] If the first client determines that the current interaction satisfies the first condition based on the amount of training data of the current interaction, the first client stops interacting with the second client, determines the first resource allocation information based on the amount of training data of the current interaction, and sends the first resource allocation information to the second client through the blockchain node;
[0022] Among them, the first condition means that the utility value of the second client obtained based on the resource allocation information and the amount of training data of this interaction and the first utility value of the first client are maximized, the utility value of the second client indicates the satisfaction of the second client with participating in shared training, and the first utility value of the first client indicates the satisfaction of the first client with the participation of the second client in shared training.
[0023] In some embodiments, the first client performs multiple interactions with the third client through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, to determine the second resource allocation information, including:
[0024] In any interaction, the first client sends resource allocation information provided for the third client in this interaction to the third client through the blockchain node based on the client information;
[0025] The third client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node;
[0026] The first client determines resource allocation information provided to the third client in the next interaction based on the amount of training data in the current interaction.
[0027] In some embodiments, the method further comprises:
[0028] If the first client determines that the current interaction satisfies the second condition based on the amount of training data of the current interaction, the first client stops interacting with the third client, determines the second resource allocation information based on the amount of training data of the current interaction, and sends the second resource allocation information to the third client through the blockchain node;
[0029] Among them, the second condition means that the utility value of the third client obtained based on the resource allocation information and the amount of training data of this interaction and the second utility value of the first client are maximized, the utility value of the third client indicates the satisfaction of the third client with participating in the shared training, and the second utility value of the first client indicates the satisfaction of the first client with the participation of the third client in the shared training.
[0030] Through the above method, an incentive mechanism for the federated learning process is provided. Through multiple interactions between the first client and the second client and the third client regarding resource allocation information and the amount of training data, the utility value of each client is maximized, thereby achieving fair and reasonable incentives for the data sharing process.
[0031] In some embodiments, the method further comprises:
[0032] The second client stores the local training data of the second client in the cloud storage space of the data sharing system;
[0033] The blockchain node generates a data summary based on the storage location of the local training data of the second client in the cloud storage space, and publishes the data summary on the blockchain, so that the federated learning node obtains the local training data of the second client from the cloud storage space based on the data summary.
[0034] Through the above method, the client's local training data is stored in the cloud storage space, which improves the scalability of storage while ensuring data security.
[0035] In a second aspect, a data sharing system is provided, the system comprising a blockchain node and a federated learning node, wherein the blockchain node is configured with a blockchain;
[0036] The blockchain node is used to:
[0037] Receiving a sharing request sent by a first client, wherein the sharing request indicates to perform shared training of the machine learning model through the federated learning node;
[0038] Based on the sharing request, client information is sent to the first client, where the client information indicates a second client and a third client participating in the shared training, where the second client is used to provide local training data of the second client, and the third client is used to train the machine learning model based on the local training data of the third client, and the trained machine learning model is sent to the blockchain node;
[0039] Sending first resource allocation information provided by the first client based on the client information to the second client, and sending second resource allocation information provided by the first client based on the client information to the third client, wherein the first resource allocation information indicates resources allocated to the second client, and the second resource allocation information indicates resources allocated to the third client;
[0040] The federated learning node is used to: perform shared training on the machine learning model based on the local training data of the second client, and send the trained machine learning model to the blockchain node;
[0041] The blockchain node is also used to publish the trained machine learning model on the blockchain, so that the first client obtains the machine learning model from the blockchain.
[0042] In some embodiments, the process of determining the first resource allocation information includes: the first client interacts with the second client multiple times through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client to the second client and the amount of training data provided by the second client to the first client, so as to determine the first resource allocation information;
[0043] The process of determining the second resource allocation information includes: the first client, based on the client information, interacts multiple times with the third client through the blockchain node in response to the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, so as to determine the second resource allocation information.
[0044] In some embodiments, the process of determining the first resource allocation information includes:
[0045] In any interaction, the first client sends resource allocation information provided for the second client in this interaction to the second client through the blockchain node based on the client information;
[0046] The second client determines, based on the resource allocation information of this interaction, the amount of training data provided for the first client in this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node;
[0047] The first client determines resource allocation information to be provided to the second client in a next interaction based on the amount of training data in the current interaction.
[0048] In some embodiments, if the first client determines that the current interaction satisfies the first condition based on the amount of training data of the current interaction, the first client stops interacting with the second client, determines the first resource allocation information based on the amount of training data of the current interaction, and sends the first resource allocation information to the second client through the blockchain node;
[0049] Among them, the first condition means that the utility value of the second client obtained based on the resource allocation information and the amount of training data of this interaction and the first utility value of the first client are maximized, the utility value of the second client indicates the satisfaction of the second client with participating in shared training, and the first utility value of the first client indicates the satisfaction of the first client with the participation of the second client in shared training.
[0050] In some embodiments, the process of determining the second resource allocation information includes:
[0051] In any interaction, the first client sends resource allocation information provided for the third client in this interaction to the third client through the blockchain node based on the client information;
[0052] The third client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node;
[0053] The first client determines resource allocation information provided to the third client in the next interaction based on the amount of training data in the current interaction.
[0054] In some embodiments, if the first client determines that the current interaction satisfies the second condition based on the amount of training data of the current interaction, the first client stops interacting with the third client, determines the second resource allocation information based on the amount of training data of the current interaction, and sends the second resource allocation information to the third client through the blockchain node;
[0055] Among them, the second condition means that the utility value of the third client obtained based on the resource allocation information and the amount of training data of this interaction and the second utility value of the first client are maximized, the utility value of the third client indicates the satisfaction of the third client with participating in the shared training, and the second utility value of the first client indicates the satisfaction of the first client with the participation of the third client in the shared training.
[0056] In some embodiments, the blockchain node is also used to: generate a data summary based on the storage location of the local training data of the second client in the cloud storage space of the data sharing system, and publish the data summary on the blockchain, so that the federated learning node obtains the local training data of the second client from the cloud storage space based on the data summary.
[0057] In a third aspect, a data sharing device based on blockchain and federated learning is provided, wherein the device is configured on a blockchain node in a data sharing system, wherein the system also includes a federated learning node, and a blockchain is configured on the blockchain node. The device includes at least one functional module for executing a data sharing method based on blockchain and federated learning as provided in the first aspect or any possible implementation of the first aspect.
[0058] In a fourth aspect, a data sharing device based on blockchain and federated learning is provided, wherein the device is configured at a federated learning node in a data sharing system, wherein the system also includes a blockchain node on which a blockchain is configured, and wherein the device includes at least one functional module for executing a data sharing method based on blockchain and federated learning as provided in the first aspect or any possible implementation of the first aspect.
[0059] In a fifth aspect, a computing device cluster is provided, the computing device cluster comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the data sharing method based on blockchain and federated learning provided by the aforementioned first aspect or any possible implementation of the first aspect.
[0060] In a sixth aspect, a computer-readable storage medium is provided, comprising computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster executes a data sharing method based on blockchain and federated learning as provided in the aforementioned first aspect or any possible implementation of the first aspect. The storage medium includes but is not limited to a volatile memory, such as a random access memory, a non-volatile memory, such as a flash memory, a hard disk drive (HDD), and a solid state drive (SSD).
[0061] In a seventh aspect, a computer program product including instructions is provided, and when the instructions are executed by a computing device cluster, the computing device cluster executes a data sharing method based on blockchain and federated learning as provided in the aforementioned first aspect or any possible implementation of the first aspect. The computer program product may be a software installation package, and when the aforementioned method needs to be implemented, the computer program product may be downloaded and executed on a computing device. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0063] Figure 2 is a schematic diagram of another implementation environment provided by an embodiment of the present application;
[0064] Figure 3 is a schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application;
[0065] Figure 4 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0066] Figure 5 This is a schematic diagram of a connection method of a computing device cluster provided in an embodiment of the present application;
[0067] Figure 6 This is a flow chart of a data sharing method based on blockchain and federated learning provided in an embodiment of the present application;
[0068] Figure 7 It is a schematic diagram of a two-stage Stackelberg game provided in an embodiment of the present application;
[0069] Figure 8 It is a schematic diagram of a data sharing method based on blockchain and federated learning provided in an embodiment of the present application;
[0070] Fig. 9This is a schematic diagram of the effect of a data sharing method provided in an embodiment of the present application;
[0071] Fig.10 It is a schematic diagram of the effect of another data sharing method provided in an embodiment of the present application;
[0072] Fig.11 It is a structural diagram of a data sharing device based on blockchain and federated learning provided in an embodiment of the present application;
[0073] Fig.12 It is a structural diagram of another data sharing device based on blockchain and federated learning provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0075] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the training data, client information, etc. involved in this application are all obtained with full authorization.
[0076] For ease of understanding, the key terms and key concepts involved in this application are explained below.
[0077] Blockchain is a new distributed infrastructure and computing paradigm that uses a block chain data structure to verify and store data, a distributed node consensus algorithm to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script codes to program and operate data. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block.
[0078] A smart contract is a computer protocol designed to disseminate, verify or execute a contract in an information-based manner. It is reflected as an automatically executable computer program on a distributed ledger.
[0079] Federated learning (FL) is a machine learning method for multi-party collaborative computing, which is mainly used to solve the data island problem faced by artificial intelligence (AI) algorithms when they are implemented in industry. Each participant in federated learning can train their own models with the help of other parties' data (such as model parameters), that is, each participant jointly trains the machine learning model by exchanging encrypted model parameters, so that data can participate in multi-party collaborative modeling without leaving the local area, realizing data sharing.
[0080] The Stackelberg game model is a two-stage dynamic game model. Its main idea is that both parties choose their own strategies based on the other party's possible strategies to maximize their own interests under the other party's strategy, thereby achieving Nash equilibrium. In this game model, the party that makes the decision first is called the leader. After the leader, the remaining participants make decisions based on the leader's decision and are called followers. Then the leader adjusts his own decision based on the decision of the followers, and so on, until the Nash equilibrium is reached.
[0081] The utility function is usually used to express the quantitative relationship between the utility obtained by consumers in consumption and the combination of goods consumed, so as to measure the degree of satisfaction obtained by consumers from consuming a given combination of goods. In the embodiment of the present application, the utility function is used to reflect the satisfaction of each participant in the data sharing process with the data sharing process.
[0082] The application scenarios and implementation environment of this application are introduced below.
[0083] The technical solution provided in the embodiments of the present application can be applied to data sharing scenarios between multiple entities. For example, in a vehicle networking scenario, multiple vehicles can implement services such as traffic flow estimation and route selection through data sharing while ensuring that their respective driving data does not leave the local area. For another example, in a smart home scenario, multiple smart home devices can implement various home services such as automatic switching of home devices through data sharing while ensuring that their respective data does not leave the local area. For another example, in a medical scenario, multiple medical institutions can share medical experience through data sharing while ensuring the privacy of their respective medical data, thereby improving the performance of machine learning models run by their respective medical institutions, and so on. The present application does not limit the specific application fields of the data sharing scenarios.
[0084] Reference below Figure 1 , introduce the implementation environment of this application.
[0085] Figure 1 Schematic diagram of an implementation environment provided by the embodiment of the present application. Figure 1 As shown, the implementation environment includes a data sharing system 100, which includes a blockchain node 110 and a federated learning node 120, and a blockchain is configured on the blockchain node 110. The blockchain node 110 and the federated learning node 120 are directly or indirectly connected through a wired network or a wireless network. It should be noted that in the data sharing system 100, any form of computing device such as a server, a terminal, etc. can join the blockchain and become a node in the data sharing system 100. In addition, the present application does not limit the functions implemented by the computing device that joins the blockchain. For example, after the terminal joins the blockchain, it can be used as a blockchain node 110 to implement the corresponding function, or it can be used as a federated learning node 120 to implement the corresponding function.
[0086] The blockchain node 110 is configured with a blockchain, and the blockchain is maintained by a smart contract. In an embodiment of the present application, the blockchain node 110 can provide a data sharing service based on federated learning to the client based on a sharing request sent by the client, thereby realizing a decentralized model aggregation mechanism. In addition, the blockchain node 110 can also publish the interactive process between the clients for resource allocation information and training data volume in the form of a transaction on the blockchain, thereby realizing a fair and effective federated learning incentive mechanism. Schematically, a client is running on the terminal used by the user, and the user can operate on the terminal to trigger the client to send a registration request to the blockchain node 110, requesting to join the blockchain and become a participant in data sharing, so that the client can call the blockchain to complete related operations through the software development kit (SDK) / application programming interface (API) provided by the blockchain. For example, the terminal is a smart phone, a tablet computer, a car terminal, a handheld game console, etc., and the present application is not limited thereto.
[0087] Schematically, the blockchain node 110 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers. In some embodiments, the blockchain node 110 can also be deployed on a cloud platform to improve the scalability of data storage and computing in the data sharing system 100. Schematically, the cloud platform is the abbreviation of the cloud computing platform, which refers to a service based on hardware resources and software resources, providing computing, network and storage capabilities. Through the network "cloud", the huge data computing process is processed and analyzed at the remote end and returned to the user, which has the characteristics of large-scale, distributed, virtualized, high availability, scalability, on-demand service and security. The cloud platform can realize the rapid issuance and release of configurable computing resources with a small management cost or a low interaction complexity between users and service providers. Schematically, the cloud platform is a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. In some embodiments, the cloud platform can also be a virtual machine instance, a container instance, etc., and the present application is not limited thereto.
[0088] The federated learning node 120 has a model training function, and can perform shared training on the machine learning model based on the local training data provided by the client, and send the trained machine learning model to the blockchain node 110, which publishes the trained machine learning model on the blockchain. Schematically, the federated learning node 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a terminal with model training capabilities, but the present application is not limited thereto.
[0089] In some embodiments, the wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to any combination of local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, wired or wireless network, private network or virtual private network. In some implementations, the data exchanged through the network is represented by technology and / or format including hypertext markup language (HTML), extensible markup language (XML), etc. In addition, conventional encryption technologies such as secure socket layer (SSL), transport layer security (TLS), virtual private network (VPN), Internet protocol security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above data communication technology.
[0090] It should be understood that the above Figure 1 The content shown here introduces the data sharing system 100 from the perspective of logical architecture. Figure 2 , the data sharing system 100 is introduced from the perspective of physical architecture.
[0091] Figure 2 Schematic diagram of another implementation environment provided by the embodiment of the present application. Figure 2 As shown, the implementation environment includes a terminal layer 201, an edge layer 202, and a cloud layer 203, that is, Figure 2 The implementation environment shown is a data sharing system 100 deployed based on the end-edge-cloud model, wherein the edge layer 202 and the cloud layer 203 are configured with blockchain.
[0092] The terminal layer 201 includes multiple terminals, on which clients are running. Users trigger the clients to implement corresponding functions by performing various operations on the terminals. Schematically, taking a data sharing cycle (which starts from any client sending a sharing request to the completion of data sharing) as an example, the terminal with data sharing needs among multiple terminals can be called a data requester, and the remaining terminals can be called a data provider. In an embodiment of the present application, data providers are divided into model providers (model providers, MP) and original data providers (origin data providers, OP). Among them, the model provider refers to a terminal with a model training function. This type of terminal has sufficient computing power resources to locally train the machine learning model, thereby providing the local model parameters of the trained machine learning model for the entire data sharing process; the original data provider refers to a terminal that provides local training data. Due to insufficient computing power resources, this type of terminal trains the machine learning model on its behalf by providing local training data.
[0093] The edge layer 202 includes multiple edge servers. The edge server can serve as the blockchain node 110 of the data sharing system 100 to implement the functions of the blockchain node 110, or it can serve as the federated learning node 120 of the data sharing system 100 to implement the functions of the federated learning node 120. The present application is not limited to this.
[0094] The cloud layer 203 is also called a cloud platform, and includes multiple cloud servers, which are used to provide cloud storage space for the data sharing system 100. For example, the original data provider can upload local training data to the cloud layer 203, which ensures the security of the data on the one hand and improves the scalability of storage on the other hand. Of course, the cloud layer 203 can also realize other functions, such as realizing the consensus function of the blockchain, etc., and the present application is not limited thereto.
[0095] It should be noted that the above Figure 2 The deployment method shown is for illustrative purposes only. The deployment method of the data sharing system 100 may be determined based on the application scenario and computing resources of the computing device. For example, the above-mentioned data sharing system 100 may also be deployed only on the end or cloud, but the present application is not limited thereto.
[0096] The hardware structure involved in the above implementation environment is introduced below.
[0097] An embodiment of the present application provides a computing device that can be configured as any node in the above-mentioned data sharing system 100.
[0098] refer to Figure 3 , Figure 3 Schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application. Figure 3As shown, the computing device 300 includes a memory 301, a processor 302, a communication interface 303 and a bus 304. The memory 301, the processor 302 and the communication interface 303 are connected to each other through the bus 304.
[0099] The memory 301 may include a volatile memory, such as a random access memory (RAM). The processor 104 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD), but the present application is not limited thereto. Schematically, an executable program code is stored in the memory 301, and the processor 302 executes the executable program code to implement the data sharing method based on blockchain and federated learning provided in the present application. That is, instructions for executing a data sharing method based on blockchain and federated learning are stored on the memory 301.
[0100] The processor 302 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP). The processor 302 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The number of processors 302 may be one or more, and the present application is not limited thereto.
[0101] The memory 301 and the processor 302 may be provided separately or integrated together.
[0102] The communication interface 303 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 300 and other devices or a communication network. For example, data can be obtained through the communication interface 303 .
[0103] The bus 304 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The bus 304 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 304 may include a path for transmitting information between various components of the computing device 300 (eg, the memory 301, the processor 302, and the communication interface 303).
[0104] The present application also provides a computing device cluster, which includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone. Figure 4 , Figure 4 Schematic diagram of a computing device cluster provided in an embodiment of the present application. Figure 4 As shown, the computing device cluster includes at least one computing device 300. The memory 301 in one or more computing devices 300 in the computing device cluster may store the same instructions for executing the data sharing method based on blockchain and federated learning. In some embodiments, the memory 301 of one or more computing devices 300 in the computing device cluster may also store partial instructions for executing the data sharing method based on blockchain and federated learning respectively. In other words, the combination of one or more computing devices 300 can jointly execute the instructions of the data sharing method based on blockchain and federated learning.
[0105] In some embodiments, one or more computing devices 300 in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 5 Schematic diagram of a connection method of a computing device cluster provided in an embodiment of the present application. Figure 5 As shown, two computing devices 300 are connected via a network. Specifically, the network is connected via the communication interface 303 in each computing device 300. It should be understood that Figure 5 The functionality of the computing device 300 shown in FIG. 3 may also be performed by multiple computing devices 300 .
[0106] Based on the above introduction to the implementation environment of this application, the data sharing method based on blockchain and federated learning provided by this application is introduced below.
[0107] refer to Figure 6 , Figure 6 : is a flow chart of a data sharing method based on blockchain and federated learning provided in an embodiment of the present application. Figure 6 As shown, this method is applied to Figure 1 The data sharing system 100 shown is introduced as an example. The data sharing system includes a blockchain node and a federated learning node. The blockchain node is configured with a blockchain. The interaction between each node in the data sharing system and the client running on the terminal is introduced as an example. The method includes the following steps 601 to 610.
[0108] 601. Multiple clients send registration requests to the blockchain node respectively, and the registration requests indicate that the clients request to register for the data sharing service.
[0109] In the embodiment of the present application, taking any client as an example, the client is running on the terminal, and the user triggers the client to send a registration request to the blockchain node by operating the terminal to request to join the blockchain and register for the data sharing service. Schematically, the registration request sent by the client carries the registration information of the client, for example, the registration information includes at least one of the following: client identification, client name, client address, and the amount of local training data, etc., but the present application is not limited thereto. This process can also be understood as the client requesting identity registration for the data sharing service on the blockchain node.
[0110] Data sharing service refers to shared training for machine learning models. After the client successfully registers the data sharing service on the blockchain, it can participate in the shared training for the machine learning model. Schematically, the present application involves two ways of participating in shared training: the first is that the client acts as the original data provider (ie, OP), provides the client's local training data, and the federated learning node of the data sharing system trains the machine learning model on its behalf; the second is that the client acts as a model provider (ie, MP), and performs local training on the machine learning model based on the client's own local training data. In this step, any of the multiple clients has local training data. After successfully registering the data sharing service on the blockchain, these clients can decide which of the above methods to use to participate in shared training based on their own computing resources, or they can act as data requesters to initiate sharing requests for machine learning models. The present application is not limited to this.
[0111] 602. The blockchain node receives the registration request sent by each client, verifies the identity of each client, and returns a notification message to each client if the verification passes. The notification message indicates that the client has registered for the data sharing service.
[0112] In an embodiment of the present application, taking a registration request sent by any client as an example, the blockchain node receives the registration request, verifies the identity of the client based on the registration information carried by the registration request, and returns a notification message to the client if the verification passes. For example, the blockchain node performs a format check on each item in the registration information to determine whether the format of each item meets the requirements. If it does, the verification passes. In schematic form, if the verification passes, the blockchain node generates an identity certificate for the client and stores the identity certificate, which indicates the client's public key, private key, account address, etc., but the present application is not limited thereto. In some embodiments, the notification message sent by the blockchain node to the client includes the client's identity certificate, that is, the blockchain node sends the client's identity certificate directly to the client as a response to the registration request. In other embodiments, the blockchain node sends the serial number of the identity certificate to the client as a response to the registration request, and the client downloads the identity certificate according to its own needs, but the present application is not limited thereto.
[0113] After the above steps 601 and 602, multiple clients successfully register the data sharing service on the blockchain through the blockchain node. For any client, the client can publish its own way of participating in shared training on the blockchain through the blockchain node, or directly execute its own way of participating in shared training according to the sharing request of the data requester. The present application is not limited to this.
[0114] The following is an introduction to the implementation process of the data sharing service through steps 603 to 610, taking any client (hereinafter referred to as the first client) initiating a sharing request for a machine learning model as an example.
[0115] 603. A first client among multiple clients sends a sharing request to a blockchain node, where the sharing request indicates to perform shared training on the machine learning model through a federated learning node.
[0116] In an embodiment of the present application, the first client refers to a client with a data sharing demand, which may also be referred to as a data requester. The first client sends a sharing request to the blockchain node to request shared training of the machine learning model through the federated learning node of the data sharing system. Among them, this application does not limit the specific implementation function of the machine learning model. For example, in the Internet of Vehicles scenario, the machine learning model is used to predict the vehicle's driving path based on the vehicle's historical driving data, or the machine learning model is used to predict the vehicle's traffic through a designated intersection based on the vehicle's historical driving data. For another example, in a medical scenario, the machine learning model is used to output image analysis results based on medical images, and so on.
[0117] In addition, this application does not limit the specific form of the sharing request, that is, the sharing request can request shared training of an existing machine learning model, such as a machine learning model provided by the first client, or a machine learning model that has been published on the blockchain. The sharing request can also request a computing task to be completed by a machine learning model. For example, in the Internet of Vehicles scenario, the first client sends a sharing request to the blockchain node to request the computing task of predicting the vehicle's driving path. Based on the sharing request, the blockchain node shares and trains a machine learning model that can achieve the computing task through the federated learning node.
[0118] 604. The blockchain node receives the sharing request.
[0119] 605. The blockchain node sends client information to the first client based on the sharing request, where the client information indicates the second client and the third client participating in the shared training.
[0120] In an embodiment of the present application, the blockchain node determines the second client and the third client participating in the shared training from multiple clients registered for the data sharing service based on the sharing request, and sends the corresponding client information to the first client, and the client information includes, for example, the client identification, the client address, etc. Among them, the second client is used to provide the local training data of the second client, and the second client is also called the original data provider (i.e., OP); the third client is used to train the machine learning model based on the local training data of the third client, and send the trained machine learning model to the blockchain node, and the third client is also called the model provider (i.e., MP). It should be noted that this application does not limit the number of second clients and the number of third clients.
[0121] In some embodiments, the blockchain node determines the second client and the third client from multiple clients registered for the data sharing service based on cluster sampling. Schematically, the blockchain node classifies multiple clients based on multiple target distributions to obtain client sets corresponding to each target distribution. For any target distribution, based on the sampling probability of each client in the client set corresponding to the target distribution, the client participating in the shared training is determined from the client set. That is, the blockchain node determines a client from the client set corresponding to each target distribution, and then determines multiple clients participating in the shared training, and the multiple clients participating in the shared training include the second client and the third client.
[0122] For example, taking the local training data of any client including multiple samples as an example, the number of samples of the client is represented as b i , i is a positive integer, representing the i-th client, and multiple target distributions are represented as Where k is a positive integer, representing the kth target distribution, m is a positive integer, representing the number of target distributions, and t is a positive integer, representing any iteration of shared training. Each target distribution includes M samples. The number of samples of each client actually participating in shared training is represented as b i =mb i ,but Based on this, the samples of each client are classified into the client sets corresponding to the m target distributions according to a preset order (which can be set according to needs), and according to the sampling probability of each client (which can be set according to needs), a client is extracted from the client set corresponding to each target distribution, and then the m clients participating in the shared training are determined.
[0123] It should be understood that the above-mentioned cluster sampling-based method is only for illustration, and the present application does not limit the method by which the blockchain node determines the clients participating in the shared training. That is, the blockchain node may use multiple clients registered for the data sharing service as clients participating in the shared training, or it may randomly sample from multiple clients registered for the data sharing service, and so on.
[0124] It should be noted that, based on the above introduction, for clients that have registered for the data sharing service, the way they participate in shared training can be published on the blockchain through the blockchain node. Accordingly, in this step, the blockchain node obtains the way the client participates in shared training from the blockchain based on the multiple clients determined to participate in the shared training, thereby determining the second client and the third client, and sending the corresponding client information to the first client. Of course, the blockchain node can also send a request to the client participating in the shared training to determine whether it belongs to the second client or the third client. Alternatively, the blockchain node can also determine whether the client participating in the shared training belongs to the second client or the third client based on whether the client has uploaded the local training data to the data sharing system. This application does not limit the specific implementation method of the blockchain node to determine the client information.
[0125] 606. The first client sends the first resource allocation information to the second client and sends the second resource allocation information to the third client through the blockchain node based on the client information.
[0126] In an embodiment of the present application, the first resource allocation information indicates the resources allocated to the second client, and the second resource allocation information indicates the resources allocated to the third client. It should be understood that participating in shared training will cause the client to consume computing resources, occupy network bandwidth, and shorten battery life, etc. Therefore, giving sufficient rewards to these clients participating in shared training can motivate them to tolerate these costs and make contributions. It can be seen from the aforementioned step 605 that the second client and the third client participate in shared training in different ways. Therefore, the costs paid by these two clients to participate in shared training are also different. Based on this, the present application provides a differentiated data sharing incentive mechanism, which encourages different types of clients to participate in shared training by allocating different resources to these two clients, thereby enhancing the enthusiasm of users to participate in federated learning, and thus improving the data sharing effect. Schematically, the resources allocated to the client are, for example, blockchain assets, services provided by the first client, etc., and the present application is not limited to this.
[0127] In some embodiments, the first resource allocation information and the second resource allocation information are pre-set allocation information. For example, the first resource allocation information indicates that the amount of resources allocated to the second client is 10, and the second resource allocation information indicates that the amount of resources allocated to the second client is 20. It should be understood that this is only an example and does not constitute a limitation of the present application.
[0128] In other embodiments, the first resource allocation information is determined based on multiple interactions between the first client and the second client, and the second resource allocation information is determined based on multiple interactions between the first client and the third client. The blockchain node publishes the interaction process between the first client and the second client and the interaction process between the first client and the third client in the form of a transaction on the blockchain, thereby ensuring the security and fairness of the entire interaction process.
[0129] Illustratively, the present application provides a data sharing incentive mechanism based on the Stackelberg game model, which models the data sharing incentive mechanism as a two-stage Stackelberg game with a single leader and multiple followers (also called a two-stage Stackelberg game with one master and multiple followers) to maximize the utility value of the leader and followers (the utility value is used to indicate the satisfaction of both parties in the Stackelberg game) until a Nash equilibrium is reached, thereby determining the first resource allocation information sent to the second client and the second resource allocation information sent to the third client.
[0130] refer to Figure 7 , Figure 7 Schematic diagram of a two-stage Stackelberg game provided in the embodiment of the present application. Figure 7As shown in the figure, the number of clients participating in the shared training is defined as S, the first client (i.e., the data requester) is the leader, the second client and the third client (i.e., the data provider) are followers, and in the first stage, the data requester gives each data provider the price of the training data (i.e., the resource allocation information, expressed as {β1, β2, β3, …, β S}), this stage is also called pricing strategy. In the second stage, each data provider gives the data requester the amount of training data provided (expressed as {d1 * , d2 * , d3 * , …, d S *}), this stage is also called the transaction strategy. In any interaction, the data requester and the data provider conduct the two-stage interaction shown above to maximize the utility value of both parties until the Nash equilibrium is reached.
[0131] The principle of the two-stage Stackelberg game with one master and multiple slaves provided by the present application is introduced below with reference to formula (1) to formula (10).
[0132] Based on the above introduction, it can be known that data providers include original data providers (OP) and model providers (MP). Therefore, this application defines a i To distinguish these two data providers, i is a positive integer, representing any client participating in shared training, a i As shown in the following formula (1):
[0133]
[0134] Among them, n i represents the i-th data provider (that is, any client participating in shared training), if node n i Provide model (if node n i provide model), then a i Equal to 1, if node n i Provides raw data (if node n i provide data), then a i is equal to 0.
[0135] The following is an introduction to the two-stage Stackelberg game provided by this application, taking any interaction between a data requester and a data provider as an example:
[0136] Phase 1
[0137] The data requester gives each data provider a price for training data (i.e., resource allocation information). It should be understood that the data requester's income depends on the performance of the machine learning model obtained after shared training, and more and higher-quality training data generally means better model performance. Therefore, the utility value of the data requester is defined as the difference between income and cost (i.e., the resources allocated to the data provider, or the price paid), where both income and cost are defined based on the amount of training data. Schematically, the utility value of the data requester is determined by the utility function shown in the following formula (2):
[0138]
[0139] Among them, V l represents the utility function of the data requester, ω represents the conversion parameter from model performance to profit, and β i represents the price per unit of training data (that is, resource allocation information), R represents the total number of iterations of the machine learning model, and d i represents the amount of training data provided by the i-th data provider, It represents the maximum value between the amount of training data required for shared training and the amount of training data provided by the data provider, ε represents the satisfaction coefficient, and λ is the fixed coefficient of the model provider’s income.
[0140] It should be understood that based on the above formula (1), it can be known that i To distinguish between the two data providers, therefore, if the data provider is a model provider, then a i is equal to 1, then the above formula (2) can be simplified to the following formula (3):
[0141]
[0142] Among them, formula (3) is the utility function of the data requester when the data provider is the model provider, represents the income of the data requester, It represents the cost of the data requester, that is, the cost paid by the data requester to the model provider is related to the data requester's satisfaction with the training data provided by the model provider.
[0143] If the data provider is the original data provider, then a i is equal to 0, then the above formula (2) can be simplified to the following formula (4):
[0144]
[0145] Among them, formula (4) is the utility function of the data requester when the data provider is the original data provider, represents the income of the data requester, Rβi d i Represents the cost to the data requester.
[0146] Phase II
[0147] The data provider gives the data requester the amount of training data provided. It should be understood that the income of the data provider depends on the cost paid by the data requester, and the costs paid by different types of data providers are different. Schematically, the utility value of the data provider is determined by the utility function shown in the following formula (5):
[0148]
[0149] Among them, V f represents the utility function of the data provider, β i represents the price per unit of training data (that is, resource allocation information), R represents the total number of iterations of the machine learning model, and d i represents the amount of training data provided by the i-th data provider, represents the maximum value between the amount of training data required for shared training and the amount of training data provided by the data provider, ε represents the satisfaction coefficient, and γ i represents the effective capacitance coefficient of the computing chipset, N represents the number of local iterations based on local training data in a global iteration of federated learning, K represents the cost of uploading data by the original data provider, represents the data cost of the model provider, represents the computational cost of training by the model provider, Represents the communication cost of the model provider uploading model parameters.
[0150] It should be understood that based on the above formula (1), it can be known that i To distinguish between the two data providers, therefore, if the data provider is a model provider, then a i is equal to 1, then the above formula (5) can be simplified to the following formula (6):
[0151]
[0152] Among them, formula (6) is the utility function of the model provider, represents the revenue of the model provider, which is also the cost of the data requester. represents the cost of the model provider, where the specific determination method of each cost is expressed by the following formula (7) to formula (9):
[0153]
[0154]
[0155]
[0156] In the above formulas (7) to (9), Represents the data cost of the model provider; It represents the computational cost of training by the model provider. It should be understood that the computational data is mainly performed by the CPU, so the cost of computing data is determined by the energy consumption of the CPU. i Indicates the number of CPU cycles required to execute a data sample when performing local iteration based on local training data. It is the number of CPU cycles required for a node to run a local iteration. i d i represents the number of CPU cycles required for local iteration based on local training data, f i represents the CPU cycle frequency when performing local iteration based on local training data, γ i It is the effective capacitance coefficient of the calculated chipset; represents the communication cost of the model provider uploading model parameters, where represents the data transmission rate of the model provider, W represents the transmission bandwidth, and ρ i represents the transmission power of the model provider, h i represents the channel gain between the model provider and the data requester, N0 represents the background noise, and ζ represents the size of the local model of the machine learning model trained by the model provider.
[0157] If the data provider is the original data provider, then a i is equal to 0, then the above formula (5) can be simplified to the following formula (10):
[0158] V f =Rβ i d i -(γ i N+β i Nd i +K) (10)
[0159] Among them, formula (10) is the utility function of the original data provider, Rβ i d i represents the income of the original data provider, that is, the cost of the data requester, (γ i N+β i Nd i +K) represents the cost of the original data provider, where γ i N represents the computational cost of the original data provider, β i Nd i represents the data cost of the original data provider, and K represents the cost of uploading data by the original data provider.
[0160] It should be noted that in the above formulas (1) to (10), except for the resource allocation information β i and the amount of training data d i All other parameters are preset parameters and can be set according to needs. Resource allocation information β i and the amount of training data d i It is continuously updated through multiple interactions between data requesters and data providers until a Nash equilibrium is reached.
[0161] Based on the above Figure 7 As well as the contents shown in formula (1) to formula (10), the principle of the two-stage Stackelberg game provided by the present application is introduced. Based on the above principle, the implementation method of this step 606 is introduced below. Schematically, this step 606 includes the following steps A and B:
[0162] Step A: For the second client, the first client interacts with the second client multiple times through the blockchain node based on the client information, regarding the resource allocation information provided by the first client to the second client and the amount of training data provided by the second client to the first client, so as to determine the first resource allocation information and send the first resource allocation information to the second client.
[0163] Among them, the present application adopts the reverse induction method based on gradient descent to process the two-stage Stackelberg game, that is, in any interaction, the first client sends the resource allocation information provided for the second client in this interaction to the second client through the blockchain node based on the client information; the second client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node; the first client determines the resource allocation information provided for the second client in the next interaction based on the amount of training data in this interaction.
[0164] In schematic form, it can be seen from the above formulas (1) to (10) that since the second client is the original data provider, the resource allocation information β based on this interaction is i , through formula (4), we can get d i The expression of , and then based on formula (10), the amount of training data for this interaction is determined by maximizing the utility value of the second client. For example, let β i =1, then the utility function shown in formula (4) is reduced to a quadratic function. The symmetry axis η and interval D of the quadratic function are calculated. If 0≤η≤interval D is satisfied, then we can get Will Substituting into formula (10), the training data volume of this interaction is obtained. Further, after the second client sends the training data volume of this interaction to the first client, the first client uses the gradient descent method to determine the resource allocation information provided to the second client in the next interaction.
[0165] In some embodiments, if the first client determines that the interaction satisfies the first condition based on the amount of training data in this interaction, it stops interacting with the second client, determines the first resource allocation information based on the amount of training data in this interaction, and sends the first resource allocation information to the second client through the blockchain node; wherein the first condition refers to the maximization of the utility value of the second client and the first utility value of the first client obtained based on the resource allocation information and the amount of training data in this interaction, and the utility value of the second client indicates the satisfaction of the second client with participating in the shared training, refer to the aforementioned formula (10), and the first utility value of the first client indicates the satisfaction of the first client with the participation of the second client in the shared training, refer to the aforementioned formula (4). Schematically, the first condition is that the utility value of the second client and the first utility value of the first client reach a Nash equilibrium, at which time the resource allocation information and the amount of training data in this interaction are called the Nash equilibrium point. In other words, the first client and the second client continuously update the resource allocation information β through multiple interactions. i and the amount of training data d i , until the first client determines that the gradient change of the current interaction is less than the preset threshold, proving that the Nash equilibrium is reached.
[0166] Step B: For the third client, the first client interacts with the third client multiple times through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, so as to determine the second resource allocation information, and send the second resource allocation information to the third client.
[0167] This step B is similar to the aforementioned step A, that is, the two-stage Stackelberg game is processed by using the reverse induction method based on gradient descent. In any interaction, the first client sends the resource allocation information provided for the third client in this interaction to the third client through the blockchain node based on the client information; the third client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node; the first client determines the resource allocation information provided for the third client in the next interaction based on the amount of training data in this interaction.
[0168] In schematic form, combining the above formulas (1) to (10), it can be seen that since the third client is the model provider, the resource allocation information β based on this interaction i , through formula (3), we can get d i The expression of , and then based on formula (6), the amount of training data for this interaction is determined by maximizing the utility value of the third client. For example, if satisfy At this time, through the utility function shown in formula (3), we can get Will Substituting into formula (6), the training data volume of this interaction is obtained. Further, after the third client sends the training data volume of this interaction to the first client, the first client uses the gradient descent method to determine the resource allocation information provided to the third client in the next interaction.
[0169] In some embodiments, if the first client determines that the current interaction satisfies the second condition based on the amount of training data in this interaction, it stops interacting with the third client, determines the second resource allocation information based on the amount of training data in this interaction, and sends the second resource allocation information to the third client through the blockchain node; wherein the second condition refers to the maximization of the utility value of the third client and the second utility value of the first client obtained based on the resource allocation information and the amount of training data in this interaction, and the utility value of the third client indicates the satisfaction of the third client with participating in the shared training, refer to the aforementioned formula (6), and the second utility value of the first client indicates the satisfaction of the first client with the participation of the third client in the shared training, refer to the aforementioned formula (3). Schematically, the second condition is that the utility value of the third client and the second utility value of the first client reach a Nash equilibrium, at which time the resource allocation information and the amount of training data in this interaction are called the Nash equilibrium point. In other words, the first client and the third client continuously update the resource allocation information β through multiple interactions. i and the amount of training data d i , until the first client determines that the gradient change of the current interaction is less than the preset threshold, proving that the Nash equilibrium is reached.
[0170] It should be noted that the above introduction to step A and step B is to distinguish different data providers. This application does not limit the execution timing of step A and step B. The first client can interact with the second client and the third client synchronously, or it can interact with the third client first and then interact with the second client, and so on.
[0171] After the above step 606, the first client sends corresponding resource allocation information to the second client and the third client respectively, so that the second client and the third client can participate in the shared training in different ways.
[0172] The following introduces the shared training process based on federated learning through steps 607 to 609.
[0173] 607. The second client uploads the local training data of the second client to the data sharing system.
[0174] In an embodiment of the present application, the second client stores the local training data of the second client in the cloud storage space of the data sharing system. Based on this, the blockchain node generates a data summary based on the storage location of the local training data of the second client in the cloud storage space, and publishes the data summary on the blockchain, thereby improving the scalability of storage while ensuring data security. For example, the data summary includes: data identification, keywords, data size, hash value, mode of participating in shared training (also called sharing type), storage location in the cloud storage space, timestamp, etc., and the present application is not limited thereto.
[0175] It should be noted that the present application does not limit the timing of the second client uploading local training data. In some embodiments, after step 602, when the second client successfully registers for the data sharing service, the second client uploads the local training data to the data sharing system.
[0176] 608. The federated learning node performs shared training on the machine learning model based on the local training data of the second client, and sends the trained machine learning model to the blockchain node.
[0177] In the embodiment of the present application, since the second client has insufficient computing resources, the federated learning node performs training on its behalf by providing local training data. In schematic form, if the second client stores the local training data in the cloud storage space, the federated learning node obtains the local training data of the second client from the cloud storage space based on the data summary published on the blockchain, and performs shared training on the machine learning model based on the local training data of the second client, obtains the local model parameters of the machine learning model, and sends the local model parameters to the blockchain node, so that the second client participates in the shared training as the original data provider.
[0178] 609. The third client trains the machine learning model based on the local training data of the third client, and sends the trained machine learning model to the blockchain node.
[0179] In an embodiment of the present application, the third client has sufficient computing resources to train the machine learning model. Therefore, the third client can train the machine learning model locally, that is, the third client locally trains the machine learning model based on the local training data of the third client, obtains local model parameters of the machine learning model, and sends the local model parameters to the blockchain node, thereby participating in the shared training as a model provider.
[0180] It should be noted that the present application does not limit the execution order of the above steps 608 and 609.
[0181] 610. The blockchain node publishes the trained machine learning model on the blockchain, so that the first client obtains the machine learning model from the blockchain.
[0182] In an embodiment of the present application, a blockchain node receives local model parameters of a machine learning model sent by a federated learning node, receives local model parameters of a machine learning model sent by a third client, aggregates the received local model parameters to obtain global model parameters of the machine learning model, and publishes the global model parameters on the blockchain, so that the first client obtains the global model parameters of the machine learning model from the blockchain.
[0183] It should be understood that the above steps 608 to 610 are also a kind of federated learning process based on blockchain. Taking any global iteration of the machine learning model as an example, after the federated learning node and the third client train the machine learning model respectively, the local model parameters obtained by training are sent to the blockchain node for verification. The blockchain node verifies the signatures of the federated learning node and the third client to ensure that the local model parameters have not been tampered with during the transmission process. If the verification is passed, the blockchain node aggregates the local model parameters (for example, using the federated average algorithm for aggregation), and publishes the aggregated global model parameters on the blockchain, so that the federated learning node and the third client can obtain the latest global model parameters from the blockchain, enter the next global iteration, and repeat the above process until the training cutoff condition of the machine learning model is met, and the trained machine learning model is obtained.
[0184] Schematically, the following reference Figure 8 , the above steps 601 to 610 are illustrated by examples. Figure 8 Schematic diagram of a data sharing method based on blockchain and federated learning provided in an embodiment of the present application. Figure 8 As shown, taking any client as an example, the data sharing method includes the following steps:
[0185] Step 1: The client registers the data sharing service on the blockchain. After successful registration, it receives a notification message from the registered data sharing service, which includes the client's identity certificate. This process is also called the client initialization process.
[0186] Step 2: The client chooses a method to participate in shared training based on its own computing resources. If the computing resources are sufficient, the client acts as a model provider and performs training locally based on local training data. If the computing resources are insufficient, the client stores the local training data in the cloud storage space of the data sharing system, publishes the data summary on the blockchain, and the federated learning node participates in shared training on its behalf.
[0187] The implementation process of the above steps 1 and 2 refers to the above steps 601 and 602, which will not be repeated here.
[0188] Step 3: As a data requester, the client initiates a sharing request for the machine learning model to the blockchain according to its own needs. The blockchain node determines the data providers participating in the shared training based on the sharing request.
[0189] Step 4: The client, as a data requester, interacts with different types of data providers through blockchain nodes multiple times to determine the resources allocated to each data provider. That is, the data requester provides a price for training data to each data provider based on the sharing type and the amount of training data, and each data provider decides the amount of training data it will share. In this process, the utility value of the data provider and the data requester is maximized through a two-stage Stackelberg game. Schematically, this process is also called a participant incentive process.
[0190] The implementation process of the above steps 3 and 4 refers to the above steps 603 to 606, which will not be repeated here.
[0191] Step 5: The model provider trains the machine learning model based on the local training data. The original data provider trains the machine learning model through the federated learning node. The local model parameters of the trained machine learning model are sent to the blockchain node. This process is also called local training, and the entity that performs local training is called a local training node.
[0192] Step 6: The blockchain node verifies the signature of the sender of the received local model parameters to ensure that the data has not been tampered with during transmission (the blockchain node used to perform verification is also called a verification node). If the verification is successful, the mean absolute error is calculated based on the received local model parameters to achieve model evaluation.
[0193] Step 7: The blockchain node aggregates the received local model parameters (for example, using the federated average algorithm) to obtain the aggregated global model parameters (the blockchain node used to perform aggregation is also called an aggregation node). The global model parameters are packaged and broadcast to other blockchain nodes for consensus. If the consensus is successful, the global model parameters are published on the blockchain.
[0194] Step 8: The local training node obtains the latest global model parameters from the blockchain, enters the next global iteration based on its own local training data, and repeats the above process until the training cutoff condition of the machine learning model is met.
[0195] The implementation process of the above steps 5 to 8 refers to the above steps 608 to 610, which will not be repeated here.
[0196] In summary, the present application provides a data sharing method based on blockchain and federated learning, which is applied to a data sharing system, wherein the system includes a federated learning node and a blockchain node configured with a blockchain, wherein after the first client sends a sharing request for a machine learning model to the blockchain node, the blockchain node returns information about clients participating in shared training, so that the first client sends corresponding resource allocation information to the second client and the third client participating in shared training, respectively, to encourage different types of clients to participate in data sharing, and realize the federated learning process for machine learning models. By adopting this differentiated data sharing method, not only the second client that provides local training data to participate in shared training can obtain resources, but also the third client that provides both local training data and model training can obtain resources, thereby greatly enhancing the enthusiasm of users to participate in federated learning, and thus improving the data sharing effect.
[0197] Moreover, in the above data sharing method, by modeling the data sharing incentive process based on federated learning as a two-stage Stackelberg game model with one master and multiple slaves, a fair and reasonable incentive for the data sharing process is achieved. Fig. 9 , Fig. 9 Schematic diagram of the effect of a data sharing method provided by an embodiment of the present application. Fig. 9 As shown, the data sharing method provided in this application is called a differentiated data sharing scheme (DASC), the related scheme 1 is called a simple shared model scheme (SMC), and the related scheme 2 is called a simple shared data scheme (SDC). Fig. 9As shown in Figures (a) and (b), when the number of clients registered for data sharing services in the data sharing system is small, the DASC scheme is more suitable than the SMC scheme and the SDC scheme. Moreover, as the number of clients increases, the utility of the data provider under the DASC scheme increases. This means that the more clients there are, the more utility the data provider obtains. Similarly, the utility of the data requester increases as the number of clients increases. It can be seen that the data sharing scheme provided in this application can be applied to the data sharing process of large-scale nodes.
[0198] Furthermore, in the two-stage Stackelberg game process, the present application adopts the reverse induction method based on gradient descent to solve the Nash equilibrium point, which can effectively motivate data requesters and data providers and reduce time overhead. Fig.10 , Fig.10 Schematic diagram of another data sharing method provided by the embodiment of the present application. Fig.10 As shown, the Nash equilibrium solution method provided in this application is called the gradient descent method, and related schemes include the Newton method and the Jacobi method, such as Fig.10 As shown in Figure (a), as the number of clients registered for data sharing services in the data sharing system increases, the utility of the data provider in the scheme provided by this application is higher than that of the Newton method and the Jacobi method. Moreover, as the number of clients increases, the increase in the benefits of the data provider shows an increasing trend. Fig.10 As shown in Figure (b), as the number of clients increases, the increase in the utility of the data requester in the scheme provided by this application is higher than that of the Newton method and the Jacobi method. This shows that the scheme provided by this application can motivate more clients to participate in the data sharing process. Fig.10 As shown in Figure (c), compared with Newton's method and Jacobi's method, the time cost of the solution provided by this application is also the lowest, indicating that the solution provided by this application can reduce the response time. Therefore, compared with Newton's method and Jacobi's method, the solution provided by this application can not only effectively motivate data requesters and data providers, but also reduce time overhead.
[0199] Fig.11 Schematic diagram of a data sharing device based on blockchain and federated learning provided in an embodiment of the present application. The device can realize part or all of the functions of a blockchain node in the aforementioned data sharing system through software, hardware, or a combination of both. Fig.11 As shown, the device is configured in a blockchain node of a data sharing system, the system also includes a federated learning node, and a blockchain is configured on the blockchain node. The device includes: a receiving module 1101, a sending module 1102 and a publishing module 1103.
[0200] A receiving module 1101 is used to receive a sharing request sent by a first client, where the sharing request indicates to perform shared training on a machine learning model through a federated learning node;
[0201] The sending module 1102 is used to:
[0202] Based on the sharing request, client information is sent to the first client, where the client information indicates the second client and the third client participating in the shared training, where the second client is used to provide local training data of the second client, and the third client is used to train the machine learning model based on the local training data of the third client, and the trained machine learning model is sent to the blockchain node;
[0203] Sending first resource allocation information provided by the first client based on the client information to the second client, and sending second resource allocation information provided by the first client based on the client information to the third client, wherein the first resource allocation information indicates resources allocated to the second client, and the second resource allocation information indicates resources allocated to the third client;
[0204] The receiving module 1101 is further used to receive a machine learning model obtained by the federated learning node through shared training of the machine learning model based on the local training data of the second client;
[0205] The publishing module 1103 is used to publish the trained machine learning model on the blockchain so that the first client can obtain the machine learning model from the blockchain.
[0206] In some embodiments, the process of determining the first resource allocation information includes: the first client interacts with the second client multiple times through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client for the second client and the amount of training data provided by the second client for the first client, to determine the first resource allocation information;
[0207] The process of determining the second resource allocation information includes: based on the client information, the first client interacts multiple times with the third client through the blockchain node for the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, so as to determine the second resource allocation information.
[0208] In some embodiments, the process of determining the first resource allocation information includes:
[0209] In any interaction, the first client sends the resource allocation information provided for the second client in this interaction to the second client through the blockchain node based on the client information;
[0210] The second client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node;
[0211] The first client determines resource allocation information to be provided to the second client in the next interaction based on the amount of training data in the current interaction.
[0212] In some embodiments, if the first client determines that the current interaction satisfies the first condition based on the amount of training data of the current interaction, the first client stops interacting with the second client, determines the first resource allocation information based on the amount of training data of the current interaction, and sends the first resource allocation information to the second client through the blockchain node;
[0213] Among them, the first condition means that the utility value of the second client obtained based on the resource allocation information and the amount of training data of this interaction and the first utility value of the first client are maximized, the utility value of the second client indicates the satisfaction of the second client with participating in the shared training, and the first utility value of the first client indicates the satisfaction of the first client with the participation of the second client in the shared training.
[0214] In some embodiments, the process of determining the second resource allocation information includes:
[0215] In any interaction, the first client sends resource allocation information provided for the third client in this interaction to the third client through the blockchain node based on the client information;
[0216] The third client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node;
[0217] The first client determines resource allocation information provided to the third client in the next interaction based on the amount of training data in the current interaction.
[0218] In some embodiments, if the first client determines that the current interaction satisfies the second condition based on the amount of training data of the current interaction, the first client stops interacting with the third client, determines the second resource allocation information based on the amount of training data of the current interaction, and sends the second resource allocation information to the third client through the blockchain node;
[0219] Among them, the second condition means that the utility value of the third client obtained based on the resource allocation information and the amount of training data of this interaction and the second utility value of the first client are maximized, the utility value of the third client indicates the satisfaction of the third client with participating in the shared training, and the second utility value of the first client indicates the satisfaction of the first client with the participation of the third client in the shared training.
[0220] In some embodiments, the publishing module 1103 is also used to generate a data summary based on the storage location of the local training data of the second client in the cloud storage space of the data sharing system, and publish the data summary on the blockchain, so that the federated learning node obtains the local training data of the second client from the cloud storage space based on the data summary.
[0221] In addition, in the above-mentioned data sharing device based on blockchain and federated learning, the receiving module 1101, the sending module 1102 and the publishing module 1103 can be implemented by software or by hardware. Exemplarily, the implementation of the receiving module 1101 is introduced below by taking the receiving module 1101 as an example. Similarly, the implementation of other modules can refer to the implementation of the receiving module 1101.
[0222] As an example of a software functional unit, the receiving module 1101 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the receiving module 1101 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0223] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0224] As an example of a hardware functional unit, the receiving module 1101 may include at least one computing device. Alternatively, the receiving module 1101 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0225] The multiple computing devices included in the receiving module 1101 can be distributed in the same region or in different regions. The multiple computing devices included in the receiving module 1101 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the receiving module 1101 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0226] It should be noted that: the data sharing device based on blockchain and federated learning provided in the above embodiment only uses the division of the above functional modules as an example when sharing data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data sharing device based on blockchain and federated learning provided in the above embodiment belongs to the same concept as the data sharing method embodiment based on blockchain and federated learning. The specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0227] Fig.12 1 is a schematic diagram of another data sharing device based on blockchain and federated learning provided in an embodiment of the present application. The device can realize part or all of the functions of a federated learning node in the aforementioned data sharing system through software, hardware, or a combination of both. Fig.12 As shown, the device is configured in a federated learning node of a data sharing system, and the system also includes a blockchain node, on which a blockchain is configured, such as Fig.12 As shown, the device includes an acquisition module 1201 and a training module 1202.
[0228] The acquisition module 1201 is used to: acquire local training data of the second client, wherein the blockchain node is used to receive a sharing request sent by the first client, the sharing request indicating that the machine learning model is shared and trained through the federated learning node; based on the sharing request, client information is sent to the first client, the client information indicates the second client and the third client participating in the shared training, the second client is used to provide the local training data of the second client, the third client is used to train the machine learning model based on the local training data of the third client, and the trained machine learning model is sent to the blockchain node; first resource allocation information provided by the first client based on the client information is sent to the second client, and second resource allocation information provided by the first client based on the client information is sent to the third client, the first resource allocation information indicating the resources allocated to the second client, and the second resource allocation information indicating the resources allocated to the third client;
[0229] The training module 1202 is used to: perform shared training on the machine learning model based on the local training data of the second client, and send the trained machine learning model to the blockchain node, wherein the blockchain node is also used to publish the trained machine learning model on the blockchain so that the first client can obtain the machine learning model from the blockchain.
[0230] It should be noted that: the data sharing device based on blockchain and federated learning provided in the above embodiment only uses the division of the above functional modules as an example when sharing data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data sharing device based on blockchain and federated learning provided in the above embodiment belongs to the same concept as the data sharing method embodiment based on blockchain and federated learning. The specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0231] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is the quantity and execution order limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, the first client may be referred to as the second client, and similarly, the second client may be referred to as the first client. Both the first client and the second client may be clients, and in some cases, may be separate and different clients.
[0232] In the present application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple clients means two or more clients.
[0233] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0234] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of program structure information. The program structure information includes one or more program instructions. When the program instructions are loaded and executed on a computing device, all or part of the processes or functions in the embodiments of the present application are generated.
[0235] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0236] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application 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 cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data sharing method based on blockchain and federated learning, characterized in that: The method is applied to a data sharing system, the data sharing system includes a blockchain node and a federated learning node, the blockchain node is configured with a blockchain, and the method includes: The first client sends a sharing request to the blockchain node, wherein the sharing request indicates to perform shared training on the machine learning model through the federated learning node; The blockchain node sends client information to the first client based on the sharing request, where the client information indicates a second client and a third client participating in the shared training, where the second client is used to provide local training data of the second client, and the third client is used to train the machine learning model based on the local training data of the third client, and send the trained machine learning model to the blockchain node; The first client sends first resource allocation information to the second client and second resource allocation information to the third client through the blockchain node based on the client information, wherein the first resource allocation information indicates resources allocated to the second client and the second resource allocation information indicates resources allocated to the third client; The federated learning node performs shared training on the machine learning model based on the local training data of the second client, and sends the trained machine learning model to the blockchain node; The blockchain node publishes the trained machine learning model on the blockchain, so that the first client obtains the machine learning model from the blockchain.
2. The method according to claim 1, characterized in that The first client sends first resource allocation information to the second client and sends second resource allocation information to the third client through the blockchain node based on the client information, including: The first client performs multiple interactions with the second client through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client for the second client and the amount of training data provided by the second client for the first client, so as to determine the first resource allocation information, and sends the first resource allocation information to the second client; Based on the client information, the first client interacts multiple times with the third client through the blockchain node regarding the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, so as to determine the second resource allocation information, and send the second resource allocation information to the third client.
3. The method according to claim 2, characterized in that The first client performs multiple interactions with the second client through the blockchain node based on the client information, with respect to resource allocation information provided by the first client to the second client and the amount of training data provided by the second client to the first client, to determine the first resource allocation information, including: In any interaction, the first client sends resource allocation information provided for the second client in this interaction to the second client through the blockchain node based on the client information; The second client determines, based on the resource allocation information of this interaction, the amount of training data provided for the first client in this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node; The first client determines resource allocation information to be provided to the second client in a next interaction based on the amount of training data in the current interaction.
4. The method according to claim 3, characterized in that The method further comprises: If the first client determines that the current interaction satisfies the first condition based on the amount of training data of the current interaction, the first client stops interacting with the second client, determines the first resource allocation information based on the amount of training data of the current interaction, and sends the first resource allocation information to the second client through the blockchain node; Among them, the first condition means that the utility value of the second client obtained based on the resource allocation information and the amount of training data of this interaction and the first utility value of the first client are maximized, the utility value of the second client indicates the satisfaction of the second client with participating in shared training, and the first utility value of the first client indicates the satisfaction of the first client with the participation of the second client in shared training.
5. The method according to claim 2, characterized in that: The first client performs multiple interactions with the third client through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, to determine the second resource allocation information, including: In any interaction, the first client sends resource allocation information provided for the third client in this interaction to the third client through the blockchain node based on the client information; The third client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node; The first client determines resource allocation information provided to the third client in the next interaction based on the amount of training data in the current interaction.
6. The method according to claim 5, characterized in that The method further comprises: If the first client determines that the current interaction satisfies the second condition based on the amount of training data of the current interaction, the first client stops interacting with the third client, determines the second resource allocation information based on the amount of training data of the current interaction, and sends the second resource allocation information to the third client through the blockchain node; Among them, the second condition means that the utility value of the third client obtained based on the resource allocation information and the amount of training data of this interaction and the second utility value of the first client are maximized, the utility value of the third client indicates the satisfaction of the third client with participating in the shared training, and the second utility value of the first client indicates the satisfaction of the first client with the participation of the third client in the shared training.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The second client stores the local training data of the second client in the cloud storage space of the data sharing system; The blockchain node generates a data summary based on the storage location of the local training data of the second client in the cloud storage space, and publishes the data summary on the blockchain, so that the federated learning node obtains the local training data of the second client from the cloud storage space based on the data summary.
8. A data sharing system, characterized in that: The system includes a blockchain node and a federated learning node, and the blockchain node is configured with a blockchain; The blockchain node is used to: Receiving a sharing request sent by a first client, wherein the sharing request indicates to perform shared training of the machine learning model through the federated learning node; Based on the sharing request, client information is sent to the first client, where the client information indicates a second client and a third client participating in the shared training, where the second client is used to provide local training data of the second client, and the third client is used to train the machine learning model based on the local training data of the third client, and the trained machine learning model is sent to the blockchain node; Sending first resource allocation information provided by the first client based on the client information to the second client, and sending second resource allocation information provided by the first client based on the client information to the third client, wherein the first resource allocation information indicates resources allocated to the second client, and the second resource allocation information indicates resources allocated to the third client; The federated learning node is used to: perform shared training on the machine learning model based on the local training data of the second client, and send the trained machine learning model to the blockchain node; The blockchain node is also used to publish the trained machine learning model on the blockchain, so that the first client obtains the machine learning model from the blockchain.
9. The system according to claim 8, characterized in that The process of determining the first resource allocation information includes: the first client interacts with the second client multiple times through the blockchain node based on the client information, with respect to the resource allocation information provided by the first client to the second client and the amount of training data provided by the second client to the first client, so as to determine the first resource allocation information; The process of determining the second resource allocation information includes: the first client, based on the client information, interacts multiple times with the third client through the blockchain node in response to the resource allocation information provided by the first client to the third client and the amount of training data provided by the third client to the first client, so as to determine the second resource allocation information.
10. The system according to claim 9, characterized in that The process of determining the first resource allocation information includes: In any interaction, the first client sends resource allocation information provided for the second client in this interaction to the second client through the blockchain node based on the client information; The second client determines, based on the resource allocation information of this interaction, the amount of training data provided for the first client in this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node; The first client determines resource allocation information to be provided to the second client in a next interaction based on the amount of training data in the current interaction.
11. The system according to claim 10, characterized in that If the first client determines that the current interaction satisfies the first condition based on the amount of training data of the current interaction, the first client stops interacting with the second client, determines the first resource allocation information based on the amount of training data of the current interaction, and sends the first resource allocation information to the second client through the blockchain node; Among them, the first condition means that the utility value of the second client obtained based on the resource allocation information and the amount of training data of this interaction and the first utility value of the first client are maximized, the utility value of the second client indicates the satisfaction of the second client with participating in shared training, and the first utility value of the first client indicates the satisfaction of the first client with the participation of the second client in shared training.
12. The system according to claim 9, characterized in that The process of determining the second resource allocation information includes: In any interaction, the first client sends resource allocation information provided for the third client in this interaction to the third client through the blockchain node based on the client information; The third client determines the amount of training data provided for the first client in this interaction based on the resource allocation information of this interaction, and sends the amount of training data for this interaction to the first client through the blockchain node; The first client determines resource allocation information provided to the third client in the next interaction based on the amount of training data in the current interaction.
13. The system according to claim 12, characterized in that If the first client determines that the current interaction satisfies the second condition based on the amount of training data of the current interaction, the first client stops interacting with the third client, determines the second resource allocation information based on the amount of training data of the current interaction, and sends the second resource allocation information to the third client through the blockchain node; Among them, the second condition means that the utility value of the third client obtained based on the resource allocation information and the amount of training data of this interaction and the second utility value of the first client are maximized, the utility value of the third client indicates the satisfaction of the third client with participating in the shared training, and the second utility value of the first client indicates the satisfaction of the first client with the participation of the third client in the shared training.
14. The system according to any one of claims 8 to 13, characterized in that The blockchain node is also used to: generate a data summary based on the storage location of the local training data of the second client in the cloud storage space of the data sharing system, and publish the data summary on the blockchain, so that the federated learning node obtains the local training data of the second client from the cloud storage space based on the data summary.
15. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the data sharing method based on blockchain and federated learning as described in any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the data sharing method based on blockchain and federated learning as described in any one of claims 1 to 7.
17. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the data sharing method based on blockchain and federated learning as described in any one of claims 1 to 7.
