Joint learning method and joint learning device based on blockchain network
By establishing a state channel between the application server node and the device, the combination of joint learning and high TPS of blockchain technology is achieved, and the problems of insufficient transaction throughput and data privacy in the existing technology are solved, and efficient training results sharing and Data protection.
Patent Information
- Application Number
- CN201980007212.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-16
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2039-04-16
AI Technical Summary
The existing blockchain architecture cannot meet the high transaction throughput (TPS) requirements when combined with joint learning and blockchain technology. At the same time, there is a problem that training results are shared at various nodes of the blockchain network, affecting data privacy.
By establishing a state channel between the application server node and the device participating in joint learning, off-chain sharing of training results is achieved, and sharing is avoided at multiple nodes of the blockchain network, thereby meeting the requirements of high TPS and protecting data privacy.
The need for high TPS in the scenario of combining joint learning and blockchain technology is realized, while ensuring the data privacy of training results and avoiding sharing of various nodes in the blockchain network.
Smart Images

Figure CN112166445B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and more specifically, to a joint learning method and a joint learning device based on a blockchain network. Background Art
[0002] The introduction of the federated learning solution makes it possible to share models on mobile devices. Federated learning refers to storing all training data on the mobile terminal, decoupling the model training and cloud storage processes of machine learning. This makes it possible to train and evolve models on the mobile terminal, solving the problem that the trained models could only be sent to the cloud and could not be trained locally. In modern society, the privacy of personal data is becoming increasingly important, and training data is a necessary element in supervised learning.
[0003] In order to automate the process of federated learning and provide incentives for devices participating in federated learning, the industry has considered combining federated learning technology with blockchain technology. However, the method of combining federated learning technology with blockchain technology requires data sharing of the training results of federated learning at any node in the blockchain. If multiple mobile devices participate in federated learning, each training result needs to be shared at each node in the blockchain, which will cause the existing blockchain architecture to be unable to meet the transaction throughput (transactions per second, TPS) requirements. Summary of the invention
[0004] The present application provides a joint learning method and a joint learning device based on a blockchain network. The method provides feedback on the training results of the joint learning through a state channel, which can meet the high TPS requirements of the combination of joint learning and blockchain technology.
[0005] In a first aspect, a joint learning method based on a blockchain network is provided, comprising: obtaining initial model parameters, wherein the initial model parameters are parameters used by devices participating in the joint learning to establish an initial model; training the initial model parameters to generate training results for updating the initial model parameters; and sending the training results to an application server node through a state channel, wherein the state channel is an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network.
[0006] The joint learning method provided by the present application allows the device to send the training results of the joint learning through the state channel, that is, a state channel can be established between the application server node and the device participating in the joint learning, so that the training results obtained after the device participates in the joint learning for local training do not need to be shared at multiple nodes of the blockchain network, which can meet the high TPS requirements of the combination of joint learning and blockchain technology. In addition, sending the training results through the state channel can avoid the problem of sharing the training results among various nodes of the blockchain network, and ensure the data privacy of the training results.
[0007] It should be understood that the State Channel is an "off-chain" technology for executing transactions and other state updates, that is, the State Channel can refer to the off-chain channel of the blockchain. The data or information sent through the off-chain channel does not need to be shared among the nodes of the blockchain. The off-chain channel can be an off-chain channel established between two nodes.
[0008] For example, the state channel can be a one-way off-chain payment channel. For example, a one-way off-chain payment channel can be established between the application server node and the device participating in federated learning. The one-way off-chain payment channel is used for the application server node to pay digital currency to the terminal device after receiving the training results of the device participating in federated learning.
[0009] For example, the state channel can be a two-way off-chain channel, such as a two-way off-chain channel established between an application server node and a device participating in federated learning. The device can send local training results of participating in federated learning to the application server node through the two-way off-chain channel, and the application server node can pay digital currency to the device after receiving the training results sent by the device.
[0010] It should be noted that the initial model may be a machine learning model or a computer algorithm model. For example, the initial model may be a neural network model used in machine learning. When the initial model is a neural network model, the initial parameters may be weight values used to establish the neural network model. When the initial model is a computer algorithm model, the initial parameters may be parameters required to establish the algorithm model. The above is for illustration only and does not limit the present application in any way.
[0011] In combination with the first aspect, in some implementations of the first aspect, the method further includes: receiving channel address information sent by the application server node, where the channel address information is used to identify the status channel.
[0012] In combination with the first aspect, in some implementations of the first aspect, the method further includes: obtaining a joint learning smart contract, wherein the joint learning smart contract includes a training logic instruction of the initial model parameters;
[0013] The training of the initial model parameters and generating training results for updating the initial model parameters includes: running the joint learning smart contract to train the initial model parameters and generating the training results.
[0014] In one possible implementation, the joint learning smart contract may include the data information required for joint learning, the content requirements of the training results fed back by the device to the application server, and the corresponding fee information for the training results fed back by the device.
[0015] In combination with the first aspect, in certain implementations of the first aspect, obtaining the federated learning smart contract includes: obtaining the federated learning smart contract through the blockchain network, wherein the federated learning smart contract is an off-chain smart contract, and the execution environment of the off-chain smart contract does not belong to the smart contract of the blockchain network.
[0016] In the present application, the joint learning smart contract can be a smart contract that is formed by deploying an off-chain smart contract on the blockchain network, wherein the off-chain smart contract refers to a smart contract whose execution environment does not belong to the blockchain network. Deploying the off-chain smart contract on the blockchain network can ensure the credibility of the joint smart contract.
[0017] In combination with the first aspect, in some implementations of the first aspect, running the federated learning smart contract includes: running the federated learning smart contract in a federated learning application.
[0018] For example, devices participating in federated learning can install a federated learning application, and the application server node will be able to publish the address of the federated learning smart contract to the federated learning application. Devices participating in federated learning can download and run the federated learning smart contract in the federated learning application.
[0019] In combination with the first aspect, in certain implementations of the first aspect, running the federated learning smart contract in the federated learning application to train the initial model parameters includes: running the federated learning smart contract in a trusted execution environment TEE to train the initial model parameters.
[0020] In this application, the device can run a joint learning smart contract in a trusted execution environment, thereby ensuring the security of running the joint smart contract.
[0021] For example, the device can provide a three-layer hardware security system based on the system on chip (SoC) hardware, including a rich execution environment (REE), a trusted execution environment (TEE) and a secure execution environment (SEE). Among them, TEE can run security-sensitive programs and store security-sensitive data.
[0022] For example, the federated learning smart contract may be run in a federated learning application under a trusted execution environment TEE to train the initial model parameters.
[0023] In combination with the first aspect, in certain implementations of the first aspect, after sending the training result to the application server node through the state channel, the method further includes: receiving digital currency paid by the application server node through the state channel.
[0024] In combination with the first aspect, in some implementations of the first aspect, the method further includes: sending a first message to the application server node, the first message being used to instruct the device to participate in joint learning, the first message including a digital currency wallet address of the device.
[0025] In the present application, the device may send a message to the application server node indicating participation in joint learning and sending information about the digital currency wallet address, so as to obtain the corresponding digital currency after sending the training results to the application server node.
[0026] It should be understood that the digital currency wallet address can be used to identify the device. When multiple devices participate in joint learning, the application server node distinguishes different devices according to the digital currency wallet addresses of the multiple devices, and then pays digital currency to the multiple devices respectively after receiving the training results of the joint learning sent by the multiple devices.
[0027] In combination with the first aspect, in certain implementations of the first aspect, the receiving of the digital currency paid by the application server node through the state channel includes: receiving the digital currency paid by the application server node through the state channel under a trusted execution environment TEE.
[0028] In combination with the first aspect, in some implementations of the first aspect, the method further includes: determining that the joint learning is ended; and sending a first transaction to the blockchain network, wherein the first transaction is used to indicate the closing of the status channel.
[0029] It should be understood that the device can receive many transactions sent by the application server node, so the digital currency of the device in the state channel is constantly increasing, and only the latest transaction needs to be maintained. When the device decides to close the state channel, it can sign the latest transaction, send it to the blockchain network, and take out the digital currency belonging to the device.
[0030] In a second aspect, a joint learning method based on a blockchain network is provided, comprising: sending initial model parameters to a device, wherein the initial model parameters are parameters used by the device to establish an initial model participating in joint learning; receiving training results for updating the initial model parameters through a state channel, wherein the state channel is an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network.
[0031] The blockchain network-based federated learning method provided in the present application can enable an application server node to receive training results sent by devices participating in federated learning through a state channel, that is, a state channel can be established between the application server node and the devices participating in federated learning, thereby eliminating the need to share the training results obtained after the devices participate in federated learning and perform local training at multiple nodes in the blockchain network, thereby meeting the high TPS requirements of the combination of federated learning and blockchain technology.
[0032] It should be understood that the State Channel is an "off-chain" technology for executing transactions and other state updates, that is, the State Channel can refer to the off-chain channel of the blockchain. The data or information sent through the off-chain channel does not need to be shared among the nodes of the blockchain. The off-chain channel can be an off-chain channel established between two nodes.
[0033] For example, the state channel can be a one-way off-chain payment channel. For example, a one-way off-chain payment channel can be established between the application server node and the device participating in the federated learning. The one-way off-chain payment channel is used for the application server node to pay digital currency to the device participating in the federated learning after receiving the training results of the federated learning sent by the terminal device.
[0034] For example, the state channel can be a two-way off-chain channel, such as a two-way off-chain channel established between an application server node and a device participating in federated learning. The device can send local training results of participating in federated learning to the application server node through the two-way off-chain channel, and the application server node can pay digital currency to the device after receiving the training results sent by the device.
[0035] In combination with the second aspect, in some implementations of the second aspect, the method further includes: receiving channel address information sent by the blockchain network, wherein the channel address information is used to identify the status channel; and sending the channel address information to the device.
[0036] In combination with the second aspect, in certain implementations of the second aspect, before receiving the channel address information sent by the blockchain network, the method also includes: sending a second transaction to the blockchain network, where the second transaction is used to deploy the state channel.
[0037] In this application, the application server node can send transactions to the off-chain channel between the devices participating in the joint learning, so as to receive the training results of updating the initial model parameters sent by the device through the off-chain channel. It can not only meet the TPS requirements, but also protect the data privacy of the training results.
[0038] In combination with the second aspect, in certain implementations of the second aspect, the method further includes: sending a third transaction to the blockchain network, the third transaction being used to deploy a federated learning smart contract on the blockchain network, the federated learning smart contract being an off-chain smart contract, the execution environment of the off-chain smart contract not belonging to the blockchain network, and the federated learning smart contract including training logic instructions for the initial model parameters.
[0039] In this application, the application server node can deploy the off-chain smart contract to the smart contract of the blockchain network, wherein the off-chain smart contract refers to the smart contract whose execution environment does not belong to the blockchain network. Deploying the off-chain smart contract to the blockchain network can ensure the credibility of the joint smart contract.
[0040] In combination with the second aspect, in some implementations of the second aspect, after receiving the training result through the state channel, the method further includes: paying digital currency to the device through the state channel.
[0041] In combination with the second aspect, in certain implementations of the second aspect, before paying digital currency to the device through the state channel, the method also includes: receiving a first message sent by the device, the first message is used to indicate that the device participates in joint learning, and the first message includes the digital currency wallet address of the device.
[0042] It should be understood that the digital currency wallet address can be used to identify the device. When multiple devices participate in joint learning, the application server node distinguishes different devices according to the digital currency wallet addresses of the multiple devices, and then pays digital currency to the multiple devices respectively after receiving the training results of the joint learning sent by the multiple devices.
[0043] In a third aspect, a joint learning device is provided, including: a receiving unit, used to receive initial parameters sent by an application server node, the initial model parameters are parameters used by the devices participating in the joint learning to establish the initial model; a processing unit, used to train the initial parameters and generate training results for updating the initial parameters; a sending unit, used to send the training results to the application server node through a state channel, the state channel is an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network.
[0044] In combination with the third aspect, in some implementations of the third aspect, the receiving unit is further used to: receive channel address information sent by the application server node, where the channel address information is used to identify the status channel.
[0045] In combination with the third aspect, in certain implementations of the third aspect, the receiving unit is also used to: obtain a joint learning smart contract, which includes training logic instructions for the initial model parameters; the processing unit is specifically used to: run the joint learning smart contract to train the initial model parameters, and generate training results for updating the initial model parameters.
[0046] In combination with the third aspect, in certain implementations of the third aspect, the receiving unit is specifically used to: obtain the joint learning smart contract through the blockchain network, wherein the joint learning smart contract is an off-chain smart contract, and the execution environment of the off-chain smart contract does not belong to the blockchain network.
[0047] In combination with the third aspect, in certain implementations of the third aspect, the processing unit is specifically used to: the device runs the federated learning smart contract in a federated learning application.
[0048] In combination with the third aspect, in certain implementations of the third aspect, the processing unit is specifically used to: run the joint learning smart contract under the trusted execution environment TEE to train the initial model parameters.
[0049] In combination with the third aspect, in certain implementations of the third aspect, the receiving unit is further used to: receive digital currency paid by the application server node through the state channel.
[0050] In combination with the third aspect, in certain implementations of the third aspect, the sending unit is also used to: send a first message to the application server node, the first message is used to indicate that the device participates in joint learning, and the first message includes a digital currency wallet address of the device.
[0051] In combination with the third aspect, in certain implementations of the third aspect, the receiving unit is specifically used to: receive the digital currency paid by the application server node through the state channel under the trusted execution environment TEE.
[0052] In combination with the third aspect, in certain implementations of the third aspect, the processing unit is further used to: determine that the training task of the joint learning is completed; the sending unit is further used to: send a first transaction to the blockchain network, and the first transaction is used to indicate the closing of the status channel.
[0053] In a fourth aspect, a joint learning device is provided, comprising: a sending unit for sending initial model parameters to the device, wherein the initial model parameters are parameters used by the device to establish an initial model participating in joint learning; a receiving unit for receiving training results for updating the initial model parameters through a state channel, wherein the state channel is an off-chain channel between the device and an application server node, and the off-chain channel is located outside the blockchain network.
[0054] In combination with the fourth aspect, in certain implementations of the fourth aspect, the receiving unit is further used to: receive channel address information sent by the blockchain network, wherein the channel address information is used to identify the status channel; and the sending unit is further used to: send the channel address information to the device.
[0055] In combination with the fourth aspect, in some implementations of the fourth aspect, the sending unit is further used to: send a second transaction to the blockchain network, and the second transaction is used to deploy the state channel.
[0056] In combination with the fourth aspect, in certain implementations of the fourth aspect, the sending unit is further used to: send a third transaction to the blockchain network, the third transaction is used to deploy the joint learning smart contract on the blockchain network, the joint learning smart contract is an off-chain smart contract, the execution environment of the off-chain smart contract does not belong to the blockchain network, and the joint learning smart contract includes training logic instructions for the initial model parameters.
[0057] In combination with the fourth aspect, in certain implementations of the fourth aspect, the sending unit is further used to: pay digital currency to the device through the state channel.
[0058] In combination with the fourth aspect, in certain implementations of the fourth aspect, the receiving unit is also used to: receive a first message sent by the device, the first message is used to indicate that the terminal device participates in joint learning, and the first message includes information about the digital currency wallet address of the terminal device.
[0059] In a fifth aspect, a joint learning device is provided, comprising: a processor, a memory, the memory being used to store a computer program, the processor being used to call and run the computer program from the memory, so that the joint learning device executes the joint learning method in the first aspect and its various possible implementation methods.
[0060] For example, the joint learning device may be a terminal device.
[0061] Optionally, the number of the processors is one or more, and the number of the memories is one or more.
[0062] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0063] In a sixth aspect, a joint learning device is provided, comprising: a processor, a memory, the memory being used to store a computer program, the processor being used to call and run the computer program from the memory, so that the joint learning device executes the joint learning method in the second aspect and its various possible implementation methods.
[0064] For example, the federated learning device may be an application server node.
[0065] Optionally, the number of the processors is one or more, and the number of the memories is one or more.
[0066] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0067] In a seventh aspect, a computer program product is provided, comprising: a computer program (also referred to as code, or instruction), which, when executed, enables a computer or any at least one processor to execute the method in the above-mentioned first aspect and its various implementation methods.
[0068] In an eighth aspect, a computer program product is provided, comprising: a computer program (also referred to as code, or instruction), which, when executed, enables a computer or at least one processor to execute the method in the second aspect and its various implementations.
[0069] In a ninth aspect, a computer-readable medium is provided, wherein the computer-readable medium stores a computer program (also referred to as code or instruction), which when executed on a computer or at least one processor enables the computer or the processor to execute the method in the first aspect and its various implementations.
[0070] In the tenth aspect, a computer-readable medium is provided, which stores a computer program (also referred to as code, or instructions) which, when executed on a computer or at least one processor, enables the computer or the processor to execute the method in the above-mentioned second aspect and its various implementation methods.
[0071] In an eleventh aspect, a chip system is provided, which includes a processor for supporting a server in a computer to implement the functions involved in the above-mentioned first aspect and its various implementation methods.
[0072] In a twelfth aspect, a chip system is provided, which includes a processor for supporting a server in a computer to implement the functions involved in the above-mentioned second aspect and its various implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 is an exemplary flow chart of the joint learning technology in the prior art;
[0074] Figure 2 is a schematic flow chart of a joint learning method provided according to an embodiment of the present application;
[0075] Figure 3 is a schematic flow chart of a joint learning method provided according to another embodiment of the present application;
[0076] Figure 4 is a structural schematic diagram of a joint learning device provided according to an embodiment of the present application;
[0077] Figure 5 is a structural schematic diagram of a joint learning device provided according to another embodiment of the present application;
[0078] Figure 6 is a structural schematic diagram of a joint learning device provided according to an embodiment of the present application;
[0079] Figure 7 is a structural schematic diagram of a joint learning device provided according to another embodiment of the present application;
[0080] Figure 8 It is a structural schematic diagram of a joint learning device provided according to another embodiment of the present application. DETAILED DESCRIPTION
[0081] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0082] First, the concepts of blockchain technology, smart contracts, and federated learning involved in the embodiments of the present application are briefly introduced.
[0083] 1. Smart Contracts
[0084] A smart contract is a collection of code and data, and can also be called a "programmable contract". Generally speaking, a smart contract is defined by program code and has preset operating conditions; when the operating conditions are triggered, the behavior is executed. The "intelligence" here refers to the intelligence in execution, that is, if a certain preset condition is met, the contract will automatically run.
[0085] 2. Federated Learning
[0086] like Figure 1 , which is a schematic flowchart of joint learning, including steps 110 to 140.
[0087] 110. The model demand direction sends initial parameters to one or more devices participating in the joint learning, where the initial parameters are used to provide an initial model participating in the joint learning to the one or more devices.
[0088] It should be understood that the initial model can be a machine learning model or a computer algorithm model. For example, the initial model can be a neural network model used in machine learning. When the initial model is a neural network model, the initial parameters can be weight values used to establish the neural network model. When the initial model is a computer algorithm model, the initial parameters can be parameters required to establish the algorithm model. The above is for illustration only and does not limit the present application in any way.
[0089] It should be understood that the model demander can be an application server node or an application APP in the application server node. The device can be a terminal device, for example, a user device, a mobile device, a user terminal, a terminal, a wireless communication device or a user device. The above is for illustration only and does not limit the present application in any way.
[0090] 120. The devices participating in the joint learning perform local training based on the acquired initial model parameters to obtain training results for updating the initial model parameters.
[0091] 130. The devices participating in the joint learning feed back the training results to the model demander.
[0092] It should be noted that the training result can be to improve the initial model by learning based on the privacy data of users using the device, and then compress the changed part of the initial model into a small update package for feedback.
[0093] For example, when the initial model is a neural network model, the changed part of the initial model may be a changed part of the network weight value of the initial model.
[0094] 140. The model demander adjusts the model parameters according to the training results fed back by one or more devices participating in the joint learning.
[0095] In other words, in a federated learning scenario, the devices participating in the federated learning can download the latest initial model, perform local training on the latest initial model to improve the initial model, and then compress the changed part of the initial model into a small update package. The updated part of the model is sent to the model demander using an encrypted communication method. The model demander averages the model update parts received from the devices participating in the federated learning to improve the initial model. In this way, all training data is on the devices participating in the federated learning, and the user's personal privacy data used for local training in the device will not be sent to the model demander. Only the changed part of the model is sent.
[0096] 3. Off-chain payment channel technology
[0097] The blockchain off-chain payment channel is one of the technical routes for off-chain expansion, that is, a general technical solution for updating some transaction-related states in the blockchain outside the blockchain. The core idea is that the parties involved in a transaction establish an off-chain communication channel so that both parties can perform interactive behaviors in the off-chain channel. During this period, the status update is not submitted to the main chain miners. When the status channel needs to be closed, the final status is submitted to the main chain through the "Close Channel Transaction" and synchronized to the main chain ledger. Since the intermediate process does not interact with the main chain, the status channel has a very high execution efficiency.
[0098] 4. Blockchain technology
[0099] Blockchain technology implements a chain data structure that connects data and information blocks in a sequential manner in chronological order, and uses cryptography to ensure that they are tamper-proof and unforgeable. In general, the data and information in the blockchain are called "transactions".
[0100] Blockchain technology is not a single technology, but a system that integrates peer-to-peer transmission, consensus mechanism, distributed data storage and cryptographic principles. The system has the technical characteristics of full disclosure and tamper-proof.
[0101] First, peer-to-peer transmission: The nodes participating in the blockchain are independent and peer-to-peer, and the nodes synchronize data and information through peer-to-peer transmission technology. The nodes can be different physical machines or different instances in the cloud.
[0102] Second, consensus mechanism: The consensus mechanism of blockchain refers to the process in which multiple participating nodes reach consensus on specific data and information through interaction between nodes under preset logical rules. The consensus mechanism needs to rely on well-designed algorithms, so there are certain differences in the performance of different consensus mechanisms (such as TPS), the delay in reaching consensus, the consumed computing resources, the consumed transmission resources, etc.).
[0103] Third, distributed data storage: Distributed storage in blockchain means that each node participating in the blockchain stores independent and complete data, ensuring that data storage is fully open between nodes. Unlike traditional distributed data storage, which divides data into multiple copies for backup or synchronous storage according to certain rules, blockchain distributed data storage relies on the consensus between equal and independent nodes in the blockchain to achieve highly consistent data storage.
[0104] Fourth, cryptographic principles: Blockchain is usually based on asymmetric encryption technology to achieve trusted information dissemination, verification, etc.
[0105] The concept of "block" is to organize one or more data records in the form of "blocks", and the size of the "block" can be customized according to the actual application scenario; and "chain" is a data structure that connects the "blocks" storing data records in chronological order and using hashing (HASH) technology. In the blockchain, each "block" contains two parts: the "block header" and the "block body", where the "block body" contains the transaction records packaged into the "block"; the "block header" contains the root HASH of all transactions in the "block" and the HASH of the previous "block". The data structure of the blockchain ensures that the data stored on the blockchain has the characteristics of being tamper-proof.
[0106] In the existing blockchain and federated learning combination solution, the training results of each device training are sent to the nodes in the blockchain network for processing. That is, the training results of each device participating in federated learning and performing local training need to be shared at multiple nodes in the blockchain. Each training is uploaded to the chain. When the devices are tens of millions of mobile phones, there is a high demand for transaction throughput (transactions per second, TPS), and the existing blockchain architecture cannot meet the high TPS requirements.
[0107] In view of this, the present application proposes a method combining blockchain and federated learning, which can send the training results of devices participating in federated learning to the model demander through a state channel, that is, state channels can be established between the application server node and the devices participating in federated learning respectively, so that the training results obtained after the devices participating in federated learning are not required to be shared at multiple nodes of the blockchain network after local training, which can meet the high TPS requirements of the combination of federated learning and blockchain technology.
[0108] In the present application, a device may be a terminal device, for example, a user device, a mobile device, a user terminal, a terminal, a wireless communication device or a user apparatus. The terminal device may also be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a future 5G network or a terminal device in a future evolved public land mobile communication network (PLMN), etc., and the embodiments of the present application are not limited to this.
[0109] Combine the following Figure 2 The method 200 for combining blockchain and joint learning provided in an embodiment of the present application is introduced. Figure 2 A schematic flow chart of a method 200 for combining blockchain and joint learning provided in an embodiment of the present application is shown, and the method includes steps 210 to 230.
[0110] Step 210: The device receives initial model parameters sent by the application server node, where the initial model parameters are parameters used by the devices participating in the joint learning to establish the initial model.
[0111] It should be noted that the initial model may be a machine learning model or a computer algorithm model. For example, the initial model may be a neural network model used in machine learning. When the initial model is a neural network model, the initial parameters may be weight values used to establish the neural network model. When the initial model is a computer algorithm model, the initial parameters may be parameters required to establish the algorithm model. The above is for illustration only and does not limit the present application in any way.
[0112] It should be understood that in the present application, the application server node can be Figure 1The demand side of the model shown, for example, an application server node can be a server, a device for providing computing services. Alternatively, the application server node can also be an application APP in the application server node.
[0113] It should be understood that in the embodiments of the present application, the device and application server nodes can be light nodes, that is, nodes that have transaction data related to themselves. For the blockchain network, if the full node, that is, the node that has all the transaction data of the entire network, is regarded as a node in the blockchain network, then the device and application server nodes do not belong to the blockchain network; if both the full node and the light node are regarded as nodes in the blockchain network, then the device and application server nodes belong to the blockchain network.
[0114] Step 220: The device trains the initial model parameters and generates training results for updating the initial model parameters.
[0115] The training result may be data information generated by the device improving the initial model by learning based on the privacy data and then compressing the changed part of the initial model.
[0116] For example, when the initial model is a neural network model, the training result can be the changed part of the neural network weight value, that is, assuming that the initial parameter is the weight value W1 of the neural network model, the devices participating in the joint learning can train the neural network locally, and the weight value of the neural network model obtained by training is W2, then the training result can be the difference between W1 and W2.
[0117] In one example, the device participating in the joint learning can obtain the joint learning smart contract, which can include the training logic instructions of the initial model parameters; the device can train the initial model parameters according to the obtained joint learning smart contract to generate training results. The structural design of the joint learning smart contract can be shown in Table 1.
[0118] Table 1
[0119]
[0120] As shown in Table 1, the joint learning smart contract may include the data information required for joint learning, the content requirements of the training results fed back by the devices participating in the joint learning to the application server node, and the corresponding fee information of the training results fed back by the devices participating in the joint learning.
[0121] It should be understood that the initial model can be a machine learning model, for example, the initial model can be a neural network model used in machine learning. When the initial model is a neural network model, the initial parameters can be weight values used to establish the neural network model, and the training logic instructions of the initial model included in the smart contract can be executing a gradient descent algorithm.
[0122] It should be understood that the initial model can be a computer algorithm model. For example, when the initial model is a computer algorithm model, the initial parameters can be the parameters required to establish the algorithm model, and the training logic instructions of the initial model included in the smart contract can be the algorithm required for the computer to perform a model calculation. The above is an example and does not limit the present application in any way. In an embodiment of the present application, a joint learning smart contract can be a smart contract that deploys an off-chain smart contract on the blockchain network, wherein the off-chain smart contract refers to a smart contract whose execution environment does not belong to the blockchain network.
[0123] For example, the application server node can obtain a smart contract that redesigns the structure of the off-chain smart contract. The redesigned off-chain smart contract can meet the needs of joint learning, that is, the smart contract can be used as a carrier of the joint learning program. For example, joint learning can be a piece of code encapsulated in the smart contract, and the redesigned off-chain smart contract can be regarded as a joint learning smart contract. The application server node can send a transaction (e.g., a third transaction) to the blockchain network, which can be used to deploy the off-chain smart contract on the blockchain network.
[0124] Furthermore, the application server node can also publish the address of the joint learning smart contract for a third-party organization to review the joint learning program, thereby ensuring that the joint learning program is credible. It should be understood that the address of the joint smart contract can be the hash value of the joint smart contract, and the third-party organization can find the joint learning smart contract in the blockchain network according to the hash value of the joint smart contract. The information published by the application server node can be shown in Table 2.
[0125] Table 2
[0126]
[0127] In one example, a device participating in federated learning may obtain a federated learning smart contract through a blockchain network, wherein the federated learning smart contract is a smart contract that an application server node deploys an off-chain smart contract on the blockchain network.
[0128] For example, devices participating in federated learning can install a federated learning application, and the application server node will be able to publish the address of the federated learning smart contract to the federated learning application, and devices participating in federated learning can download the federated learning smart contract in the federated learning application.
[0129] It should be understood that the federated learning smart contract deployed on the blockchain network is shared among the nodes of the blockchain network. Therefore, to a certain extent, it can prevent the federated learning smart contract from being maliciously tampered with, thus ensuring the credibility of the federated smart contract.
[0130] In one example, the device participating in the joint learning can also obtain the joint learning smart contract from the application server node. This application does not limit the specific source of the joint learning smart contract obtained by the device under the condition that the joint learning smart contract is ensured to be authentic.
[0131] In an embodiment of the present application, after the device obtains the federated learning smart contract, it can send a first message to the application server node. The first message is used to instruct the device to participate in the federated learning, that is, the device can indicate its participation in the federated learning by sending a first message to the application server node, wherein the first message also includes the digital currency wallet address of the device. After the device sends the local training results of the federated learning to the application server, the application server node can pay the digital currency according to the digital currency wallet address of the device.
[0132] It should be understood that the digital currency wallet address can be used to identify the device participating in the joint learning. When multiple devices participate in the joint learning, the application server node distinguishes different devices according to the digital currency wallet addresses of the multiple devices, and then pays digital currency to the multiple devices respectively after receiving the training results of the joint learning sent by the multiple devices.
[0133] In one example, after receiving the digital currency wallet address of the device, the application server node can publish a transaction (e.g., a second transaction) to the blockchain network, deploy an off-chain channel contract, and establish an off-chain channel between the application server node and the device, wherein the off-chain channel is located outside the blockchain network.
[0134] Furthermore, the blockchain network sends address information of the state channel to the application server, and the address information of the state channel is used to identify the state channel.
[0135] It should be noted that the channel address information may be an index value, and the application server node may search for the established state channel according to the index value. For example, the channel address information may be a hash value of the state channel.
[0136] It should be understood that the state channel is an "off-chain" technology for executing transactions and other state updates, that is, the state channel can refer to the off-chain channel of the blockchain network. The data or information sent through the off-chain channel does not need to be shared among the nodes of the blockchain. The off-chain channel can be an off-chain channel established between two nodes. For example, the state channel can be a one-way off-chain payment channel. For example, a one-way off-chain payment channel can be established between an application server node and a device. The one-way off-chain payment channel is used for the application server node to pay digital currency to the device after receiving the training results sent by the device for participating in joint learning.
[0137] For example, the state channel can be a two-way off-chain channel, such as a two-way off-chain channel established between an application server node and a device. The device can send local training results of participating in federated learning to the application server node through the two-way off-chain channel, and the application server node can pay digital currency to the device after receiving the training results sent by the device.
[0138] In an embodiment of the present application, the device is based on system on chip (SoC) hardware and can provide a three-layer hardware security system, including a rich execution environment (REE), a trusted execution environment (TEE) and a secure execution environment (SEE), wherein REE runs security-insensitive programs and saves security-insensitive data, TEE runs security-sensitive programs and saves security-sensitive data, and SEE runs high-security financial payment programs and saves high-security financial payment data.
[0139] As an example but not limitation, the SoC may provide at least one operating environment such as Trustzone, Bowmore, eSE, or inSE. The Trustzone or Bowmore operating environment may be referred to as TEE, and the eSE or inSE operating environment may be referred to as SEE.
[0140] For example, when the device is a smart phone, a SoC may be configured in the smart phone, and the smart phone provides operating environments such as Trustzone, Bowmore, eSE, and inSE through the SoC.
[0141] As an example but not limitation, the SoC may support running an instruction set based on an advanced RISC machine (ARM) architecture, and a SoC that supports running an instruction set based on the ARM architecture is referred to as an ARM-based SoC. For example, an ARM-based SoC may be configured on a device, thereby providing a three-layer hardware security system for the device.
[0142] In one example, under a trusted execution environment TEE, the federated learning smart contract is run to train the initial model parameters.
[0143] For example, the device can run a federated learning smart contract in a federated learning application under a trusted execution environment TEE to train the initial model parameters and generate training results for updating the initial model parameters.
[0144] Step 230: Send the training result to the application server node through the state channel, where the state channel refers to an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network.
[0145] For example, the state channel can be a one-way off-chain payment channel. For example, a one-way off-chain payment channel can be established between the application server node and the device. The one-way off-chain payment channel is used for the application server node to pay digital currency to the device after receiving the training results of participating in federated learning sent by the device.
[0146] It should be understood that in the embodiments of the present application, digital currency refers to electronic currency that is created, issued and circulated by relying on verification and cryptographic technology.
[0147] For example, the state channel can be a two-way off-chain channel, such as a two-way off-chain channel established between an application server node and a device of a federated learning device. The device can send local training results participating in federated learning to the device through the two-way off-chain channel, and the application server node can pay digital currency to the device after receiving the training results sent by the device.
[0148] The application server node can adjust the initial model parameters according to the training results received from the device. The device may refer to one or more devices participating in the joint learning.
[0149] In an embodiment of the present application, after the device sends the training result to the application server node through the state channel, the application server node can pay digital currency to the device according to the acquired digital currency wallet address of the device.
[0150] For example, the application server node can send a transaction to the device through a state channel (e.g., an off-chain payment channel), where the total digital currency in the channel can be S (A+B=S), the digital currency of the application server node is A, the digital currency of the device is B, and the cost of a single training is t. After this transaction, the digital currency of the application server node is At, and the digital currency of the device is B+t. In this transaction, the signature of the application server node is attached. After the device signs this transaction, it can send the transaction to the blockchain network.
[0151] In one example, in order to ensure that the environment for paying digital currency is secure and trustworthy, the device can receive digital currency paid by the application server node through the state channel under the trusted execution environment TEE.
[0152] In an embodiment of the present application, the device determines that the training task of the joint learning is completed; the device can send a transaction (for example, a first transaction) to the blockchain network, and the first transaction can be used to indicate the closing of the state channel.
[0153] It should be understood that the device can receive many transactions sent by the application server node, so the digital currency of the device in the state channel is constantly increasing, and only the latest transaction needs to be maintained. When the device decides to close the state channel, it can sign the latest transaction, send it to the blockchain network, and take out the digital currency belonging to the device.
[0154] In an embodiment of the present application, the training parameters generated after the device participates in joint learning and performs local training can be fed back to the application server node through the state channel. By using the state channel to send the training results, the high TPS requirements in the scenario of combining joint learning and blockchain can be met. At the same time, the training results of the device also have a certain degree of privacy. Sending the training results through the state channel can avoid sharing among various nodes in the blockchain network, and can protect the privacy of device data.
[0155] Combine the following Figure 3 , the specific process of the joint learning method in the embodiment of the present application is described.
[0156] Figure 3 A flowchart of the joint learning method provided in an embodiment of the present application. Figure 3 The method shown includes steps 301 to 314, and steps 301 to 314 are described in detail below.
[0157] It should be understood that Figure 3 The demand side of the model can be Figure 2The application server node shown, or, it may also be an application APP in the application server node. The device may be a terminal device, for example, a user device, a mobile device, a user terminal, a terminal, a wireless communication device or a user apparatus, etc. The above is for illustration only and does not limit the present application in any way.
[0158] Step 301: The device installs the joint learning APP locally.
[0159] Among them, the joint learning APP can collect different personal privacy data for each different joint learning smart contract to do data preprocessing. At the same time, it will receive the initialization model data w provided by the model demander.
[0160] In one example, if Figure 4 As shown in the figure, a three-layer hardware security system can be provided for the device based on ARM SoC. The federated learning app can ensure the security of the data processing process in the TEE trusted environment. After the device is installed with a reliable federated learning app, multiple federated learning smart contracts can be loaded at the same time to meet the needs of multiple model demanders.
[0161] For example, different personal privacy data collected by the joint learning APP can be stored in a local personal privacy data database. Among them, personal privacy data is stored in the TEE trusted environment, which can protect the security of personal privacy data and prevent it from being stolen by other malware; on the other hand, it can ensure that the personal privacy data provided to users of the device is credible and truly valuable to the model demander.
[0162] Step 302: The model demander deploys the off-chain smart contract to the chain and accepts audit to ensure credibility and traceability.
[0163] For example, the model demander deploys the off-chain smart contract on the chain through transactions. At the same time, the address of the off-chain smart contract can be published, for example, the address of the off-chain smart contract can be published to the joint learning APP. In this way, the joint learning program can be audited by a third-party organization to ensure credibility.
[0164] It should be understood that the address of the off-chain smart contract can refer to the hash value of the off-chain smart contract, and the off-chain smart contract can be found according to the address of the off-chain smart contract. It should be noted that, unlike ordinary smart contracts in the blockchain, the execution environment of the off-chain smart contract is not on the chain, but on the off-chain mobile phone. Federated learning can be combined with blockchain and off-chain smart contracts to ensure the credibility of the federated learning program. Among them, the structural design of the off-chain smart contract can be shown in Table 1.
[0165] Step 303: The device may receive a recommendation for a program for a joint learning smart contract and download an off-chain smart contract program deployed on a blockchain network.
[0166] Step 304: The device sends the digital currency wallet address to the model demander and indicates to the model demander that it participates in the joint learning process.
[0167] Step 305: The model demander publishes a transaction (e.g., a second transaction) to the blockchain network to deploy an off-chain channel contract and establish a state channel with the device (e.g., an off-chain payment channel).
[0168] Among them, the state channel established between the application server node and the device can be a one-way off-chain payment channel, which is used by the model demander to pay digital currency to the device; or, it can be a two-way off-chain channel for the device to send training results to the model demander and the model demander to pay digital currency to the device after receiving the training results sent by the device.
[0169] For example, the model demander deposits S in a one-way off-chain payment channel. The off-chain channel contract requires the transaction of the demander's signature SigA and the user's signature SigB to close the payment channel. The total amount of this transaction is S, the amount output to the demander's address is A, and the amount of the device address is B, where A+B=S.
[0170] Step 306: The model demander receives the channel address information sent by the blockchain network, where the channel address information is used to identify the state channel.
[0171] Step 307: The model requires the device to send channel address information.
[0172] It should be noted that in step 305, the model demander sends a transaction to the blockchain network, requesting to establish a state channel with the device; when the blockchain network receives the transaction, it deploys a state channel between the model demander and the device, that is, an off-chain channel outside the blockchain network, and sends the address information of the state channel to the model demander. After receiving the address information of the state channel, the model demander sends the address information of the state channel to the device so that the device can identify the established state channel.
[0173] Step 308: The model requester sends initial model parameters to the device.
[0174] For example, the model demand direction sends the initial model parameters of this joint learning to the device, and the initial parameters can be the value of the weight w of the neural network.
[0175] Step 309: The device executes the smart contract and performs single-step training locally, where the local single-step training can be a stochastic gradient descent optimization algorithm to update the parameter w value.
[0176] In one example, if Figure 4 As shown in Figure 1, the execution environment of the off-chain smart contract for federated learning is in a virtual machine (VM). The federated learning app can run in the off-chain smart contract VM for a certain federated learning contract, using the device's user data and initial model parameters. The execution environment of the off-chain smart contract can not only support the federated learning program, but also other off-chain smart contract programs.
[0177] Step 310: The model demander receives the training result sent by the device.
[0178] For example, the device may feed back the training results to the model demander through an off-chain channel established with the model demander.
[0179] Step 311: The model demander pays digital currency to the device through a state channel (e.g., an off-chain payment channel).
[0180] For example, through the state channel, the model demander sends a transaction to the device. At this time, the total assets in the channel are S, of which the demander has A, the device has B, and the cost of this single training is t. In the output of this transaction, the digital currency of the model demander is At, and the digital currency of the device is B+t, where A+B=S. In this transaction, the signature of the model demander is attached. When the device signs this transaction again, it can send the transaction to the blockchain network, close the channel, and withdraw the digital currency belonging to the device.
[0181] In one example, the state channel can run in a TEE environment, and the device can receive digital currency from the model demander and send model data updates to the model demander in a secure environment. To spend digital currency, you need to sign with the private key in the digital currency wallet in the SEE environment.
[0182] Step 312: The model demander receives the training results fed back by the devices participating in the joint learning, averages them, obtains the latest model parameters, returns to step 306, and then sends them to the devices participating in the joint learning.
[0183] Step 313: The device can view the on-chain digital currency and off-chain digital currency belonging to the device at any time.
[0184] The device can receive many transactions sent by the model demander. Therefore, the digital currency of the device in the state channel is incremental, and only the latest transaction needs to be maintained.
[0185] Step 314: When the joint learning is completed and the device decides to close the channel, it signs the latest transaction, sends it to the blockchain network, and takes out the digital currency belonging to the device.
[0186] It should be noted that Figure 3 The examples are only intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific scenarios illustrated. Figure 3 It is obvious that various equivalent modifications or changes can be made, and such modifications or changes also fall within the scope of the embodiments of the present application.
[0187] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0188] The above describes in detail the joint learning method according to the embodiment of the present application. In the embodiment of the present application, the training parameters generated after the devices participating in the joint learning are trained locally can be fed back to the application server node through the state channel. By using the state channel to send the training results, the high TPS requirements in the scenario of joint learning and blockchain can be met. At the same time, the training results of the device also have a certain degree of privacy. The training results are sent through the state channel to avoid sharing of various nodes in the blockchain network, and the privacy of the device data can be protected. It should be understood that the joint learning device of the embodiment of the present application can execute the various methods of the aforementioned embodiments of the present application, that is, the specific working process of the following various products can refer to the corresponding process in the aforementioned method embodiment.
[0189] Figure 5 is a schematic block diagram of a joint learning device 500 provided in an embodiment of the present application. It should be understood that the joint learning device 500 is capable of executing Figure 2 or Figure 3 The steps performed by the device in the method are not described in detail here to avoid repetition. The joint learning device 500 includes: a receiving unit 510, a processing unit 520 and a sending unit 530.
[0190] Among them, the receiving unit 510 is used to receive the initial model parameters sent by the application server node, and the initial model parameters are the parameters used by the devices participating in the joint learning to establish the initial model; the processing unit 520 is used to train the initial model parameters and generate training results for updating the initial model parameters; the sending unit 530 is used to send the training results to the application server node through the state channel, and the state channel is an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network.
[0191] Optionally, as an embodiment, the receiving unit 510 is further used to: receive channel address information sent by the application server node, where the channel address information is used to identify the status channel.
[0192] Optionally, as an embodiment, the receiving unit 510 is also used to: obtain a joint learning smart contract, which includes training logic instructions for the initial model parameters; the processing unit 520 is specifically used to: run the joint learning smart contract to train the initial model parameters, and generate training results for updating the initial model parameters.
[0193] Optionally, as an embodiment, the receiving unit 510 is further specifically used to: obtain the joint learning smart contract through the blockchain network, wherein the joint learning smart contract is an off-chain smart contract part, and the execution environment of the off-chain smart contract does not belong to the smart contract of the blockchain network.
[0194] Optionally, as an embodiment, the processing unit 520 is specifically used to: run the federated learning smart contract in a federated learning application to train the initial model parameters.
[0195] Optionally, as an embodiment, the processing unit 520 is specifically used to: run the joint learning smart contract under a trusted execution environment TEE to train the initial model parameters.
[0196] Optionally, as an embodiment, the receiving unit 510 is specifically used to: receive digital currency paid by the application server node through the state channel.
[0197] Optionally, as an embodiment, the receiving unit 510 is specifically used to: receive digital currency paid by the application server node through the state channel under the trusted execution environment TEE.
[0198] Optionally, as an embodiment, the sending unit 530 is further used to: send a first message to the application server node, the first message is used to instruct the device to participate in joint learning, and the first message includes a digital currency wallet address of the device.
[0199] Optionally, as an embodiment, the processing unit 520 is further used to: determine that the training task of the joint learning is completed; the sending unit 530 is further used to: send a first transaction to the blockchain network, and the first transaction is used to indicate the closing of the status channel.
[0200] It should be understood that the joint learning device 500 here is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this. For example, a "unit" can be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit, and / or other suitable components that support the described functions. Therefore, the units of each example described in the embodiments of the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0201] Figure 6 FIG. 6 is a schematic block diagram of a joint learning device 600 provided in an embodiment of the present application. It should be understood that the joint learning device 600 may be an application server node capable of executing Figure 2 or Figure 3 In order to avoid repetition, the steps performed by the application server node in the method are not described in detail here. The joint learning device 600 includes: a sending unit 610 and a receiving unit 620.
[0202] The sending unit 610 is used to send initial model parameters to the device, where the initial model parameters are parameters used by the device to establish an initial model participating in joint learning; the receiving unit 620 is used to receive training results for updating the initial model parameters through a state channel, where the state channel is an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network.
[0203] It should be understood that the application server node 600 may further include a processing unit, and the processing unit may be used to control the receiving unit 620 and the sending unit 610 to perform related steps.
[0204] Optionally, as an embodiment, the receiving unit 620 is further used to: receive channel address information sent by the blockchain network, wherein the channel address information is used to identify the status channel; the sending unit 610 is also used to send the channel address information to the device.
[0205] Optionally, as an embodiment, the sending unit 610 is further used to: send a second transaction to the blockchain network, where the second transaction is used to deploy the state channel.
[0206] Optionally, as an embodiment, the sending unit 610 is also used to: send a third transaction to the blockchain network, the third transaction is used to deploy the joint learning smart contract on the blockchain network, the joint learning smart contract is an off-chain smart contract, the execution environment of the off-chain smart contract does not belong to the blockchain network, and the joint learning smart contract includes training logic instructions for the initial model parameters.
[0207] Optionally, as an embodiment, the sending unit 610 is further used to: pay digital currency to the device through the state channel.
[0208] Optionally, as an embodiment, the receiving unit 620 is further used to: receive a first message sent by the device, the first message is used to indicate that the device participates in joint learning, and the first message includes a digital currency wallet address of the device.
[0209] It should be understood that the joint learning device 600 here is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this. For example, a "unit" can be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit, and / or other suitable components that support the described functions. Therefore, the units of each example described in the embodiments of the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0210] Figure 7 FIG. 8 is a schematic block diagram of a joint learning device 700 according to another embodiment of the present invention. The joint learning device 700 may be a terminal device, such as Figure 7As shown, the joint learning device 700 includes a processor 720, a memory 760, a communication interface 740 and a bus 750. The processor 720, the memory 760 and the communication interface 740 communicate through the bus 750, and can also communicate through other means such as wireless transmission. The memory 760 is used to store instructions, and the processor 720 is used to execute the instructions stored in the memory 760. The memory 760 stores program code 711, and the processor 720 can call the program code 711 stored in the memory 760 to execute Figure 2 or Figure 3 The joint learning method shown.
[0211] For example, the processor 720 may be used to execute the above Figure 2 220 in which the model parameters are trained to generate training results; or Figure 3 307 in executes the smart contract and performs local training.
[0212] The memory 760 may include a read-only memory and a random access memory, and provide instructions and data to the processor 720. The memory 760 may also include a non-volatile random access memory. The memory 760 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0213] In addition to the data bus, the bus 750 may also include a power bus, a control bus, and a status signal bus. Figure 7 Various buses are labeled as bus 750.
[0214] It should be understood that Figure 7 The joint learning device 700 shown can achieve Figure 2 as well as Figure 3 The various processes performed by the device in the method embodiment shown. The operations and / or functions of each module in the joint learning device 700 are respectively to implement the corresponding processes of the device in the above method embodiment. For details, please refer to the description in the above method embodiment. To avoid repetition, the detailed description is appropriately omitted here.
[0215] Figure 8 FIG. 8 is a schematic block diagram of a joint learning device 800 according to another embodiment of the present invention. The joint learning device 800 may be an application server node, such as Figure 8 As shown, the joint learning device 800 includes a processor 820, a memory 860, a communication interface 840 and a bus 850. The processor 820, the memory 860 and the communication interface 840 communicate through the bus 850, and can also communicate through other means such as wireless transmission. The memory 860 is used to store instructions, and the processor 820 is used to execute the instructions stored in the memory 860. The memory 860 stores program code 811, and the processor 820 can call the program code 811 stored in the memory 860 to execute Figure 2 or Figure 3 The joint learning method shown.
[0216] Among them, Figure 8 The communication interface 840 can be used with Figure 6 The receiving unit 620 and the sending unit 610 in the terminal device shown correspond to each other.
[0217] The memory 820 may include a read-only memory and a random access memory, and provide instructions and data to the processor 820. The memory 860 may also include a non-volatile random access memory. The memory 860 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0218] In addition to the data bus, the bus 850 may also include a power bus, a control bus, and a status signal bus. Figure 8 Various buses are labeled as bus 850.
[0219] It should be understood that Figure 8 The joint learning device 800 shown can achieve Figure 2 as well as Figure 3 The various processes performed by the application server node in the method embodiment shown. The operations and / or functions of the various modules in the joint learning device 800 are respectively to implement the corresponding processes of the application server node in the above method embodiment. For details, please refer to the description in the above method embodiment. To avoid repetition, the detailed description is appropriately omitted here.
[0220] The present application also provides a computer-readable storage medium in which instructions are stored. When the instructions are executed on a computer, the computer executes the above-mentioned Figure 2 , Figure 3The individual steps in the joint learning method shown.
[0221] The present application also provides a computer program product comprising instructions, which, when executed on a computer or any at least one processor, enables the computer to execute the following Figure 2 , Figure 3 The individual steps in the joint learning method shown.
[0222] The present application also provides a chip, including a processor. The processor is used to read and run a computer program stored in a memory to execute corresponding operations and / or processes performed by the method for waking up the screen provided in the present application.
[0223] Optionally, the chip also includes a memory, which is connected to the processor via a circuit or wire, and the processor is used to read and execute the computer program in the memory. Further optionally, the chip also includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive data and / or information to be processed, and the processor obtains the data and / or information from the communication interface and processes the data and / or information. The communication interface can be an input and output interface.
[0224] In the above embodiments, the processor involved may include, for example, a central processing unit (CPU), a microprocessor, a microcontroller or a digital signal processor, and may also include a GPU, an NPU and an ISP. The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as application-specific integrated circuits (ASICs), or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a memory.
[0225] The memory may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.
[0226] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0227] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0228] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0229] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0230] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A joint learning method based on blockchain network, characterized in that: include: Receiving initial model parameters sent by the application server node, where the initial model parameters are parameters used by the devices participating in the joint learning to establish the initial model; Training the initial model parameters and generating training results for updating the initial model parameters; Sending the training result to the application server node through a state channel, where the state channel is an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network; Obtaining a joint learning smart contract, wherein the joint learning smart contract includes training logic instructions for the initial model parameters; The joint learning smart contract includes data information required for joint learning, content requirements of the training results fed back by the device to the application server, and fee information corresponding to the training results fed back by the device; The training of the initial model parameters to generate training results for updating the initial model parameters includes: The joint learning smart contract is run to train the initial model parameters and generate training results for updating the initial model parameters.
2. The method according to claim 1, characterized in that The method further comprises: Receive channel address information sent by the application server node, where the channel address information is used to identify the status channel.
3. The method according to claim 1 or 2, characterized in that The obtaining of the joint learning smart contract includes: The federated learning smart contract is obtained through the blockchain network, wherein the federated learning smart contract is an off-chain smart contract, and the execution environment of the off-chain smart contract does not belong to the blockchain network.
4. The method according to claim 1, characterized in that The running of the joint learning smart contract to train the initial model parameters includes: Under the trusted execution environment TEE, the federated learning smart contract is run to train the initial model parameters.
5. The method according to claim 1 or 2, characterized in that: After sending the training result to the application server node through the state channel, the method further includes: Receive digital currency paid by the application server node through the state channel.
6. The method according to claim 5, characterized in that Before receiving the digital currency paid by the application server node through the state channel, the method further includes: A first message is sent to the application server node, where the first message is used to instruct the device to participate in joint learning, and the first message includes a digital currency wallet address of the device.
7. The method according to claim 5, characterized in that The receiving the digital currency paid by the application server node through the state channel includes: In the trusted execution environment TEE, the digital currency paid by the application server node through the state channel is received.
8. The method according to claim 1 or 2, characterized in that: The method further comprises: Determine that the training task of joint learning is completed; Sending a first transaction to the blockchain network, where the first transaction is used to indicate closing the state channel.
9. A joint learning method based on blockchain network, characterized in that: include: Sending initial model parameters to the device, where the initial model parameters are parameters used by the device to establish an initial model participating in joint learning; Receiving a training result for updating the initial model parameters through a state channel, wherein the state channel is an off-chain channel between the device and an application server node, and the off-chain channel is located outside the blockchain network; A third transaction is sent to the blockchain network, wherein the third transaction is used to deploy a joint learning smart contract on the blockchain network, wherein the joint learning smart contract is an off-chain smart contract, and the execution environment of the off-chain smart contract does not belong to the blockchain network. The joint learning smart contract includes training logic instructions for the initial model parameters, and the joint learning smart contract also includes data information required for joint learning, content requirements for the training results fed back by the device to the application server, and fee information corresponding to the training results fed back by the device.
10. The method according to claim 9, characterized in that The method further comprises: Receiving channel address information sent by the blockchain network, where the channel address information is used to identify the state channel; The channel address information is sent to the device.
11. The method according to claim 10, characterized in that Before receiving the channel address information sent by the blockchain network, the method further includes: Sending a second transaction to the blockchain network, where the second transaction is used to deploy the state channel.
12. The method according to any one of claims 9 to 11, characterized in that After receiving the training result for updating the initial model parameters through the state channel, the method further includes: The digital currency is paid to the device through the state channel.
13. The method according to claim 12, characterized in that Before paying digital currency to the device through the state channel, the method further includes: A first message sent by the device is received, where the first message is used to instruct the device to participate in joint learning, and the first message includes a digital currency wallet address of the device.
14. A joint learning device, characterized in that: The system comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory to execute the method according to any one of claims 1 to 8.
15. A joint learning device, characterized in that: The system comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory to execute the method according to any one of claims 9 to 13.
Citation Information
Patent Citations
Cross data segmentation federation learning model method, server and medium
CN109189825A
Providing data provenance, permissioning, compliance, and access control for data storage systems using an immutable ledger overlay network
US20180285839A1