WO2020210979A1 - Blockchain-network-based joint learning method and joint learning device - Google Patents
Blockchain-network-based joint learning method and joint learning device Download PDFInfo
- Publication number
- WO2020210979A1 WO2020210979A1 PCT/CN2019/082865 CN2019082865W WO2020210979A1 WO 2020210979 A1 WO2020210979 A1 WO 2020210979A1 CN 2019082865 W CN2019082865 W CN 2019082865W WO 2020210979 A1 WO2020210979 A1 WO 2020210979A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- joint learning
- channel
- initial model
- smart contract
- application server
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N99/00—Subject matter not provided for in other groups of this subclass
Definitions
- This 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.
- Joint learning refers to storing all training data on the mobile terminal, decoupling the model training of machine learning and the cloud storage process. This makes it possible to perform model training and evolution on the mobile terminal, and solves the problem that the previous model could only deliver the trained model in the cloud instead of training locally.
- training data is a necessary element.
- the industry has considered the scheme of combining the joint learning technology and the blockchain technology, but the method of combining the joint learning technology and the blockchain technology , That is, the training results of joint learning need to be shared with any node in the blockchain. If multiple mobile devices participate in joint learning, each training result needs to be shared by each node in the blockchain, which will cause the existing blockchain architecture to fail to meet the transaction throughput (transactions per second, TPS) Needs.
- This application provides a joint learning method and a joint learning device based on a blockchain network.
- the method feeds back the training results of joint learning through a state channel, which can meet the high TPS requirements of the combination of joint learning and blockchain technology.
- a joint learning method based on a blockchain network including: obtaining initial model parameters, where the initial model parameters are parameters used by devices participating in the joint learning to establish an initial model; and training the initial model parameters , Generating a training result for updating the initial model parameters; sending the training result to an 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 The channel is outside the blockchain network.
- the device can send the training results of participating in 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 device does not need to participate in the joint learning for local training
- the training results obtained later are shared at multiple nodes of the blockchain network, which can meet the high TPS requirements of the combination of joint learning and blockchain technology.
- sending the training results through the state channel can avoid the problem of sharing the training results at each node of the blockchain network and ensure the data privacy of the training results.
- the State Channel is an "off-chain” technology used to execute transactions and other state updates. That is, the state channel can refer to the off-chain channel of the blockchain, through the off-chain channel. The data or information sent does not need to be shared among the nodes of the blockchain, and the off-chain channel can be an off-chain channel established between two nodes.
- the state channel can be a one-way off-chain payment channel.
- a one-way off-chain payment channel can be established between the application server node and the device participating in the joint learning.
- the one-way off-chain payment channel is used by the application server node to receive the device After sending the training result of participating in the joint learning, the terminal device is paid with digital currency.
- 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 joint learning, and the device can participate in the local training result of the joint learning to the application server node through the two-way off-chain channel.
- the application server node can pay the device with digital currency after receiving the training result sent by the device.
- the initial model can be a machine learning model or a computer algorithm model.
- the initial model can be a neural network model used in machine learning.
- the initial parameters can be used for Establish the weight value of the neural network model.
- the initial parameters may be the parameters required to establish the algorithm model.
- the method further includes: receiving channel address information sent by the application server node, where the channel address information is used to identify the state channel.
- the method further includes: obtaining a joint learning smart contract, where the joint learning smart contract includes training logic instructions for the initial model parameters;
- the training of the initial model parameters and generating a training result for updating the initial model parameters includes: running the joint learning smart contract to train the initial model parameters to generate the training result.
- the joint learning smart contract may include data information required for joint learning, content requirements for training results fed back by the device to the application server, and cost information corresponding to the training results fed back by the device.
- the obtaining a joint learning smart contract includes: obtaining the joint learning smart contract through the blockchain network, wherein 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 smart contract of the blockchain network.
- the joint learning smart contract can be a smart contract that deploys an off-chain smart contract on the blockchain network, where the off-chain smart contract means that the execution environment of the smart contract does not belong to the blockchain network Smart contract. Deploying the off-chain smart contract on the blockchain network can ensure the credibility of the joint smart contract.
- the running the joint learning smart contract includes: running the joint learning smart contract in a joint learning application.
- the equipment participating in the joint learning can install the joint learning application
- the application server node can publish the address of the joint learning smart contract to the joint learning application
- the equipment participating in the joint learning can download and run the joint learning application in the joint learning application. Learn smart contracts.
- the running the joint learning smart contract in a joint learning application to train the initial model parameters includes: running under a trusted execution environment TEE The joint learning smart contract is used to train the initial model parameters.
- the device can run the joint learning smart contract in a trusted execution environment, thereby ensuring the security of running the joint smart contract.
- equipment based on system-on-chip (SoC) hardware can provide a three-layer hardware security system, including rich execution environment (REE), trusted execution environment (TEE) and safe operation Environment (secure execution environment, SEE), in which TEE can run security-sensitive programs and store security-sensitive data.
- REE rich execution environment
- TEE trusted execution environment
- SEE safe operation Environment
- the joint learning smart contract may be run in a joint learning application under a trusted execution environment TEE to train the initial model parameters.
- the method further includes: receiving the application server node to pay through the state channel Digital currency.
- the method further includes: sending a first message to the application server node, where the first message is used to instruct the device to participate in joint learning, the The first message includes the digital currency wallet address of the device.
- the device can send a message to the application server node indicating that it participates in joint learning and sends the information of the digital currency wallet address, so as to obtain the corresponding digital currency after sending the training result to the application server node.
- the digital currency wallet address can be used to identify the device.
- the application server node distinguishes different devices according to the digital currency wallet addresses of multiple devices, so that after receiving the training results of joint learning sent by multiple devices, they pay digital currency to multiple devices respectively .
- the receiving the digital currency paid by the application server node through the state channel includes: receiving the application server node under a trusted execution environment TEE Digital currency paid through the state channel.
- the method further includes: determining the end of the joint learning; sending a first transaction to the blockchain network, the first transaction being used to instruct to close the Status channel.
- the device can receive many transactions sent by the application server node. Therefore, the digital currency of the device in the state channel is continuously increasing, and only the latest transactions need to be maintained.
- 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.
- a joint learning method based on a blockchain network including: sending an initial model parameter to a device, where the initial model parameter is a parameter used by the device to establish an initial model participating in joint learning;
- the channel receives the training result of updating the initial model parameters, 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.
- the application server node can receive the training result sent by the device participating in the joint learning through the state channel, that is, the state channel can be established between the application server node and the device participating in the joint learning, Therefore, it is not necessary to share the training results obtained after the device participates in joint learning for local training at multiple nodes of the blockchain network, which can meet the high TPS requirements of the combination of joint learning and blockchain technology.
- the State Channel is an "off-chain” technology used to execute transactions and other state updates. That is, the state channel can refer to the off-chain channel of the blockchain, through the off-chain channel. The data or information sent does not need to be shared among the nodes of the blockchain, and the off-chain channel can be an off-chain channel established between two nodes.
- the state channel can be a one-way off-chain payment channel.
- a one-way off-chain payment channel can be established between the application server node and the device participating in the joint learning.
- the one-way off-chain payment channel is used by the application server node to receive the terminal After the training result of participating in the joint learning sent by the device, the digital currency is paid to the participating device in the joint learning.
- 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 joint learning, and the device can participate in the local training result of the joint learning to the application server node through the two-way off-chain channel.
- the application server node can pay the device with digital currency after receiving the training result sent by the device.
- the method further includes: receiving channel address information sent by a blockchain network, where the channel address information is used to identify the state channel; Send the channel address information.
- the method before the receiving the channel address information sent by the blockchain network, the method further includes: sending a second transaction to the blockchain network, the second The transaction is used to deploy the state channel.
- the application server node may send transactions to be deployed in the off-chain channel between the devices participating in the joint learning, so as to receive the training result sent by the device to update the initial model parameters through the off-chain channel. It can not only meet the needs of TPS, but also protect the data privacy of training results.
- the method further includes: sending a third transaction to the blockchain network, where the third transaction is used to deploy a 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 the training of the initial model parameters Logic instructions.
- the application server node can deploy the off-chain smart contract in the smart contract of the blockchain network, where 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 on the blockchain network can ensure the credibility of the joint smart contract.
- the method further includes: paying digital currency to the device through the state channel.
- the method before the payment of digital currency to the device through the state channel, the method further includes: receiving a first message sent by the device, and The first message is used to instruct the device to participate in joint learning, and the first message includes the digital currency wallet address of the device.
- the digital currency wallet address can be used to identify the device.
- the application server node distinguishes different devices according to the digital currency wallet addresses of multiple devices, so that after receiving the training results of joint learning sent by multiple devices, they pay digital currency to multiple devices respectively .
- a joint learning device including: a receiving unit for receiving initial parameters sent by an application server node, where the initial model parameters are parameters used by devices participating in the joint learning to establish an 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, where the state channel is the device and the application server node The off-chain channel is located outside the blockchain network.
- the receiving unit is further configured to: receive channel address information sent by the application server node, where the channel address information is used to identify the state channel.
- the receiving unit is further configured to: obtain a joint learning smart contract, and the joint learning smart contract includes training logic instructions for the initial model parameters;
- the processing unit is specifically configured to: run the joint learning smart contract to train the initial model parameters, and generate training results for updating the initial model parameters.
- the receiving unit is specifically configured to: obtain the joint learning smart contract through the blockchain network, wherein the joint learning smart contract is off-chain Smart contract, the execution environment of the off-chain smart contract does not belong to the blockchain network.
- the processing unit is specifically configured to: the device runs the joint learning smart contract in a joint learning application.
- the processing unit is specifically configured to run the joint learning smart contract to train the initial model parameters in a trusted execution environment TEE.
- the receiving unit is further configured to: receive the digital currency paid by the application server node through the state channel.
- the sending unit is further configured to send a first message to the application server node, where the first message is used to instruct the device to participate in joint learning,
- the first message includes the digital currency wallet address of the device.
- the receiving unit is specifically configured to receive the digital currency paid by the application server node through the state channel under the trusted execution environment TEE.
- the processing unit is further configured to: determine the end of the training task of the joint learning; the sending unit is further configured to: send the first one to the blockchain network Transaction, the first transaction is used to instruct to close the state channel.
- a joint learning device including: a sending unit, configured 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; and a receiving unit, It is used to receive the 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 the application server node, and the off-chain channel is located in the blockchain network outer.
- the receiving unit is further configured to: receive channel address information sent by the blockchain network, where the channel address information is used to identify the state channel;
- the sending unit is further configured to send the channel address information to the device.
- the sending unit is further configured to send a second transaction to the blockchain network, and the second transaction is used to deploy the state channel.
- the sending unit is further configured to: send a third transaction to the blockchain network, and the third transaction is used to sign the joint learning smart contract on
- 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
- the joint learning smart contract includes the initial model parameters Training logic instructions.
- the sending unit is further configured to: pay digital currency to the device through the state channel.
- the receiving unit is further configured to: receive a first message sent by the device, where the first message is used to instruct the terminal device to participate in joint learning,
- the first message includes information of the digital currency wallet address of the terminal device.
- a joint learning device including: a processor, a memory, the memory is used to store a computer program, the processor is used to call and run the computer program from the memory, so that the joint learning device executes the first aspect And its various possible implementation methods of joint learning.
- the joint learning device may be a terminal device.
- processors there are one or more processors and one or more memories.
- the memory may be integrated with the processor, or the memory and the processor may be provided separately.
- a joint learning device including: a processor, a memory, the memory is used to store a computer program, the processor is used to call and run the computer program from the memory, so that the joint learning device executes the second aspect And its various possible implementation methods of joint learning.
- the joint learning device may be an application server node.
- processors there are one or more processors and one or more memories.
- the memory may be integrated with the processor, or the memory and the processor may be provided separately.
- a computer program product includes: a computer program (also referred to as code, or instruction) that, when the computer program is executed, causes a computer or any one of at least one processing
- the device executes the methods in the first aspect and its various implementations.
- a computer program product includes: a computer program (also called code, or instruction) that, when the computer program is executed, causes a computer or any one of at least one processing
- the device executes the methods in the second aspect and its various implementations.
- a computer-readable medium stores a computer program (also called code, or instruction) when it runs on a computer or any at least one processor, so that The computer or the processor executes the methods in the first aspect and various implementations thereof.
- a computer program also called code, or instruction
- a computer-readable medium stores a computer program (also called code, or instruction) when it runs on a computer or any at least one processor, so that The computer or the processor executes the methods in the second aspect and various implementations thereof.
- a computer program also called code, or instruction
- a chip system in an eleventh aspect, includes a processor for supporting a server in a computer to implement the functions involved in the first aspect and various implementations thereof.
- a chip system in a twelfth aspect, includes a processor for supporting a server in a computer to implement the functions involved in the second aspect and various implementation manners thereof.
- Figure 1 is an exemplary flow chart of a joint learning technology in the prior art
- Fig. 2 is a schematic flowchart of a joint learning method provided according to an embodiment of the present application
- FIG. 3 is a schematic flowchart of a joint learning method provided according to another embodiment of the present application.
- Fig. 4 is a schematic structural diagram of a joint learning device provided according to an embodiment of the present application.
- Fig. 5 is a schematic structural diagram of a joint learning device provided according to another embodiment of the present application.
- Fig. 6 is a schematic structural diagram of a joint learning device provided according to an embodiment of the present application.
- Fig. 7 is a schematic structural diagram of a joint learning device provided according to another embodiment of the present application.
- Fig. 8 is a schematic structural diagram of a joint learning device provided according to another embodiment of the present application.
- a smart contract is a collection of code and data, and can also be called a "programmable contract".
- smart contracts are defined by program coding and preset operating conditions; when the operating conditions are triggered, the behavior is executed.
- the "intelligence" is the execution intelligence, that is, if a certain preset condition is reached, the contract will run automatically.
- FIG. 1 it is a schematic flowchart of joint learning. Including step 110 to step 140.
- the model request sends initial parameters to one or more devices participating in the joint learning, where the initial parameters are used to provide the one or more devices with an initial model participating in the joint learning.
- the initial model can be a machine learning model or a computer algorithm model.
- the initial model can be a neural network model used in machine learning.
- the initial parameters can be used to establish neural networks.
- the initial parameters may be the parameters required to establish the algorithm model.
- the model requester can be an application server node or an application APP in an application server node.
- the device may be a terminal device, for example, it may be a user equipment, a mobile device, a user terminal, a terminal, a wireless communication device, or a user device. The above are examples and do not limit this application.
- the equipment participating in the joint learning performs local training according to the acquired initial model parameters, and obtains a training result for updating the initial model parameters.
- the equipment participating in the joint learning feeds back the training results to the model demander.
- the training result may be to improve the initial model by learning based on the private data of the user using the device, and then compress the changed part of the initial model into a small update package for feedback.
- the changed part of the initial model may be the changed part of the network weight value of the initial model.
- the model demander adjusts the model parameters according to the training results fed back by one or more devices participating in the joint learning.
- the devices participating in the joint learning can download the current 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, and the model demander averages the model update parts received from the feedback of the equipment participating in the joint learning to improve the initial model. Therefore, all the training data is on the equipment participating in the joint learning, and the personal privacy data of the user used for local training in the equipment is not sent to the model requester, only the changed part of the model is sent.
- the off-chain payment channel of the blockchain 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 a party involved in a transaction establishes an off-chain communication channel, so that both parties can perform interactive behaviors in the off-chain channel.
- state updates are not submitted to the main chain miners.
- the state channel needs to be closed, the final state is passed.
- "Close Channel Transaction" is submitted to the main chain and synchronized to the main chain ledger. Since the intermediate process does not interact with the main chain, the state channel has a very high execution efficiency.
- Blockchain technology realizes a chained data structure in which data and information blocks are sequentially connected in chronological order, and it is cryptographically guaranteed that cannot be tampered with and cannot be forged distributed storage.
- the data and information in the blockchain are called "transactions”.
- Blockchain technology is not a single technology, but as a system integrating point-to-point transmission, consensus mechanism, distributed data storage, and cryptographic principles.
- the system has the technical characteristics of full disclosure and tamper-proof.
- point-to-point transmission the nodes participating in the blockchain are independent and peer-to-peer, and the synchronization of data and information between nodes is achieved through point-to-point transmission technology.
- the nodes can be different physical machines or different instances of the cloud.
- the consensus mechanism of the blockchain refers to the process by which nodes participating in multiple parties achieve agreement on specific data and information through the interaction between nodes under preset logical rules. Consensus mechanisms need 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 a consensus, the cost of computing resources, and the cost of transmission resources.
- TPS consensus mechanism
- distributed data storage Distributed storage in the blockchain is that each node participating in the blockchain stores independent and complete data, which ensures that the data stored in the node is fully open. Different from traditional distributed data storage, traditional distributed data storage divides the data into multiple copies for backup or synchronous storage according to certain rules, while blockchain distributed data storage relies on the equivalent, location-based data storage in the blockchain. Consensus between independent nodes to achieve highly consistent data storage.
- Blockchain is usually based on asymmetric encryption technology to achieve credible information dissemination and verification.
- each "block” contains two parts: a “block header” and a “block body”.
- 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 is non-tamperable.
- the training results of each training of the device are sent to the nodes in the block chain network for processing. That is, the training results after each device participates in joint learning for local training need to be shared among multiple nodes in the blockchain. Every training is on the chain.
- the device is tens of millions of mobile phones, there is a high demand for transaction throughput (transactions per second, TPS).
- TPS transactions per second
- this application proposes a method that combines blockchain and joint learning.
- the training result of the device participating in the joint learning can be sent to the model requester through the state channel, that is, the application server node can be connected with the device participating in the joint learning State channels are established between them, so there is no need to share the training results obtained after the device participates in joint learning for local training at multiple nodes in the blockchain network, which can meet the high requirements of combining joint learning and blockchain technology. TPS requirements.
- the device may be a terminal device, for example, it may be a user equipment, a mobile device, a user terminal, a terminal, a wireless communication device, or a user device.
- the terminal device can 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), and a wireless communication Functional handheld devices, computing devices, or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, terminal devices in the future 5G network or future evolution of the public land mobile network (PLMN) Terminal equipment, etc., this embodiment of the present application does not limit this.
- SIP session initiation protocol
- WLL wireless local loop
- PDA personal digital assistant
- PLMN public land mobile network
- FIG. 2 shows a schematic flowchart of the method 200 for combining blockchain and joint learning provided by an embodiment of the present application.
- the method includes step 210 to step 230.
- Step 210 The device receives an initial model parameter sent by the application server node, where the initial model parameter is a parameter used by the device participating in the joint learning to establish an initial model.
- the initial model can be a machine learning model or a computer algorithm model.
- the initial model can be a neural network model used in machine learning.
- the initial parameters can be used for Establish the weight value of the neural network model.
- the initial parameters may be the parameters required to establish the algorithm model.
- the application server node may be a model demander as shown in FIG. 1, for example, the application server node may be a server, a device used to provide computing services. Alternatively, the application server node may also be an application program APP in the application server node.
- the device and application server nodes may be light nodes, that is, nodes that have transaction data related to themselves.
- the full node that is, the node that has all the transaction data of the entire network
- the equipment and application server nodes do not belong to the blockchain network; if the full node is Both and light nodes are regarded as nodes in the blockchain network, and the equipment and application server nodes belong to the blockchain network.
- Step 220 The device trains the initial model parameters, and generates a training result for updating the initial model parameters.
- the training result may be data information generated by the device learning according to the private data to improve the initial model, and then compressing the changed part of the initial 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 equipment participating in the joint learning can train the neural network locally.
- the weight value of the neural network model obtained by training is W2, and the training result may be the difference between W1 and W2.
- the device participating in the joint learning can obtain the joint learning smart contract, and the joint learning smart contract may include the training logic instructions of the initial model parameters; the device may train the initial model parameters according to the obtained joint learning smart contract, Generate training results.
- the structure design of the joint learning smart contract can be shown in Table 1.
- the joint learning smart contract can include the data information required for joint learning, the content requirements of the training results fed back to the application server node by the equipment participating in the joint learning, and the corresponding cost of the equipment participating in the joint learning feedback training result. information.
- the initial model can be a machine learning model.
- the initial model can be a neural network model used in machine learning.
- the initial parameters can be the weight values used to establish the neural network model.
- the training logic instruction of the initial model included in the DLL may be to execute a gradient descent algorithm.
- the initial model may be a computer algorithm model.
- the initial parameters may be the parameters required to establish the algorithm model, and the training logic instructions for the initial model included in the smart contract may be performed by the computer once. Algorithm required for model calculation.
- the joint learning smart contract may be a smart contract deployed by the off-chain smart contract on the blockchain network, where the off-chain smart contract means that the execution environment of the smart contract does not belong to the zone.
- the smart contract of the blockchain network may be a smart contract deployed by the off-chain smart contract on the blockchain network.
- 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 the carrier of the joint learning program, such as , Joint learning can be a piece of code encapsulated in a smart contract, and the redesigned off-chain smart contract can be regarded as a joint learning smart contract.
- the application server node may send a transaction (for example, a third transaction) to the blockchain network, and the transaction may be used to deploy an off-chain smart contract on the blockchain network.
- the application server node can also publish the address of the joint learning smart contract to accept the third-party organization to review the joint learning program, thereby ensuring the credibility of the joint learning program.
- the address of the joint smart contract may be the hash value of the joint smart contract
- the third-party organization may find the joint learning smart contract in the blockchain network according to the hash value of the joint smart contract.
- Table 2 The information published by the application server node can be shown in Table 2.
- Transaction ID Transaction ID
- Application server node address Demand-side Address
- Hash String The hash value encoded by the joint learning program Data: Joint learning of smart contract procedures
- the devices participating in the joint learning can obtain the joint learning smart contract through the blockchain network, where the joint learning smart contract is a smart contract that the application server node deploys the off-chain smart contract on the blockchain network.
- the devices participating in the joint learning can install the joint learning application, the application server node will publish the address of the joint learning smart contract to the joint learning application, and the devices participating in the joint learning can download the joint learning intelligence in the joint learning application contract.
- the joint learning smart contract deployed on the blockchain network is shared among all nodes of the blockchain network. Therefore, to a certain extent, the joint learning smart contract can be prevented from being maliciously tampered with, and the joint smart contract can be ensured Credibility.
- the device participating in the joint learning may also obtain the joint learning smart contract from the application server node.
- This application does not make any restrictions on the specific source of the joint learning smart contract acquired by the device while ensuring the authenticity of the joint learning smart contract.
- the device after the device obtains the joint 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 joint learning, that is, the device can indicate by sending the first message to the application server node Participate in joint learning, where the first message also includes the digital currency wallet address of the device.
- the application server node After the device sends the local training result of the joint learning to the application server, the application server node can pay digital currency according to the digital currency wallet address of the device.
- the digital currency wallet address can be used to identify devices participating in joint learning.
- the application server node distinguishes different devices according to the digital currency wallet addresses of multiple devices, so that after receiving the training results of joint learning sent by multiple devices, they pay digital currency to multiple devices respectively .
- the application server node can publish a transaction (for example, the second transaction) to the blockchain network, deploy an off-chain channel contract, and establish a connection between the application server node and the device The off-chain channel in between, where the off-chain channel is located outside the blockchain network.
- a transaction for example, the second transaction
- the blockchain network sends the 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.
- the channel address information may be an index value, and the application server node can find the established state channel according to the index value.
- the channel address information may be the hash value of the state channel.
- the State Channel is an "off-chain” technology used to execute 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 by the channel does not need to be shared among the nodes of the blockchain, and the off-chain channel can be an off-chain channel established between two nodes.
- the state channel can be a one-way off-chain payment channel.
- a one-way off-chain payment channel can be established between the application server node and the device, and the one-way off-chain payment channel is used for the application server node to participate in the alliance after receiving the device sent After learning the training results, the digital currency is paid to the device.
- 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 participate in the local training results of joint learning from the application server node through the two-way off-chain channel, and the application server node can After receiving the training result sent by the device, the digital currency is paid to the device.
- the device is based on system-on-chip (SoC) hardware, and can provide a three-layer hardware security system, including rich execution environment (REE) and trusted execution environment (REE) , TEE) and secure execution environment (secure execution environment, SEE).
- REE rich execution environment
- REE trusted execution environment
- TEE trusted execution environment
- SEE secure execution environment
- REE runs security-insensitive programs to save security-insensitive data
- TEE runs security-sensitive programs and saves security-sensitive data
- SEE runs financial payment high-security programs and saves High security data for financial payment.
- the SoC may provide at least one operating environment such as Trustzone, Bowmore, eSE, or inSE.
- the operating environment of Trustzone or Bowmore may be referred to as TEE, and the operating environment of eSE or inSE may be referred to as SEE.
- an SoC can be configured in the smart phone, and the smart phone provides operating environments such as Trustzone, Bowmore, eSE, and inSE through the SoC.
- the foregoing SoC may support running an instruction set based on an advanced RISC machine (ARM) architecture, and an SoC that supports running an instruction set based on the ARM architecture is called an ARM-based SoC.
- an ARM-based SoC can be configured on the device to provide a three-layer hardware security system for the device.
- the joint learning smart contract is run under the trusted execution environment TEE to train the initial model parameters.
- the device may run a joint learning smart contract in a joint learning application under a trusted execution environment TEE to train the initial model parameters and generate training results for updating the initial model parameters.
- TEE trusted execution environment
- Step 230 Send the training result to the application server node through a state channel.
- 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.
- the state channel can be a one-way off-chain payment channel.
- a one-way off-chain payment channel can be established between the application server node and the device, and the one-way off-chain payment channel is used for the application server node to participate in the alliance after receiving the device sent After learning the training results, the digital currency is paid to the device.
- digital currency refers to electronic currency that is created, issued, and circulated by relying on checksum encryption technology. Its characteristic is to use P2P peer-to-peer network technology to issue, manage and circulate currency.
- the state channel can be a two-way off-chain channel.
- the two-way off-chain channel established between the application server node and the device of the joint learning device.
- the device can send the local training results of the joint learning to the device through the two-way off-chain channel.
- the server node can pay digital currency to the device after receiving the training result sent by the device.
- the application server node can adjust the initial model parameters according to the received training result sent by the device.
- the device may refer to one or more devices participating in the joint learning.
- the application server node can pay the device with digital currency according to the acquired digital currency wallet address of the device.
- the digital currency of the application server node is At, and the digital currency of the device is B+t.
- the signature of the application server node is attached. After the device signs the transaction, it can send the transaction to the blockchain network.
- the device may receive the digital currency paid by the application server node through the state channel under the trusted execution environment TEE.
- the device determines that the training task of joint learning ends; the device may send a transaction (for example, the first transaction) to the blockchain network, and the first transaction may be used to instruct to close the state channel.
- a transaction for example, the first transaction
- the device can receive many transactions sent by the application server node. Therefore, the digital currency of the device in the state channel is continuously increasing, and only the latest transactions need to be maintained.
- 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.
- the training parameters generated after the device participates in the joint learning for local training can be fed back to the application server node through the state channel, and the training result can be sent to the application server node through the state channel to meet the high TPS in the joint learning and blockchain combination scenario
- the training results of the device also have a certain degree of privacy.
- the training results are sent through the state channel to avoid the sharing of each node in the blockchain network and protect the privacy of the device data.
- FIG. 3 is a schematic flowchart of a joint learning method provided by an embodiment of the application.
- the method shown in FIG. 3 includes steps 301 to 314, and steps 301 to 314 are respectively described in detail below.
- the model requester in FIG. 3 may be the application server node shown in FIG. 2, or may also be the application APP in the application server node.
- the device may be a terminal device, for example, it may be a user equipment, a mobile device, a user terminal, a terminal, a wireless communication device, or a user device. The above are examples and do not limit this application.
- Step 301 The device installs a joint learning APP locally.
- the joint learning APP can collect different personal privacy data for each different joint learning smart contract. Do data preprocessing. At the same time, the initialization model data w provided by the model requester will be received.
- an ARM-based SoC can provide a three-layer hardware security system for the device.
- the joint learning App can ensure the safety of the data processing process in the TEE trusted environment. After a reliable joint learning App is installed on the device, multiple joint learning smart contracts can be loaded at the same time to meet the needs of multiple model demanders.
- different personal privacy data collected by the United Learning APP can be stored in a local personal privacy data database.
- personal privacy data is stored in the trusted environment of TEE, which can protect the security of personal privacy data from other malicious software; on the other hand, it can ensure that the personal privacy data provided to users who use the device are trusted Yes, it is really valuable to the demand side of the model.
- Step 302 The model requester deploys the off-chain smart contract to the chain, and accepts audit to ensure credibility and traceability.
- the model demander deploys off-chain smart contracts on the chain through transactions.
- 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.
- the address of the off-chain smart contract may 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.
- the execution environment for smart contracts under the chain is not on the chain, but on the off-chain mobile phone.
- the joint learning can be combined with blockchain and off-chain smart contracts to ensure the credibility of the joint learning program.
- the structure design of the off-chain smart contract can be shown in Table 1.
- Step 303 The device may receive a recommendation of a program for joint learning of smart contracts, and download the off-chain smart contract program deployed on the blockchain network.
- Step 304 The device sends the digital currency wallet address to the model demander, and indicates to the model demander to participate in the joint learning process.
- Step 305 The model demander publishes a transaction (for example, a second transaction) to the blockchain network for deploying an off-chain channel contract and establishing a state channel with the device (for example, an off-chain payment channel).
- a transaction for example, a second transaction
- the blockchain network for deploying an off-chain channel contract and establishing a state channel with the device (for example, an off-chain payment channel).
- the state channel established by the application server node and the device can be a one-way off-chain payment channel for the model demander to pay digital currency to the device; or it can be a two-way off-chain channel for the device to train the model demander The result and the demand direction of the model pay digital currency to the device after receiving the training result sent by the device.
- the model demander deposits S in the one-way off-chain payment channel.
- the off-chain channel contract requires a transaction between the signature SigA of the demander and the signature SigB of the user to close the payment channel.
- the total amount of this transaction is S
- the amount output to the demander's address is A
- Step 306 The model requester receives the channel address information sent by the blockchain network, and the channel address information is used to identify the state channel.
- Step 307 The model request sends channel address information to the device.
- the model demand sends a transaction to the blockchain network, requesting the establishment of a state channel with the device; when the blockchain network receives the transaction, it deploys the model between the demander and the device
- the state channel is an off-chain channel located outside the blockchain network and sends the address information of the state channel to the model demander.
- 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 for the device to identify the established state channel.
- Step 308 The model requester sends initial model parameters to the device.
- the model request sends the initial model parameters of this joint learning to the device, and the initial parameters may be the value of the weight w of the neural network.
- Step 309 The device executes the smart contract and performs single-step training locally, where the local single-step training may be a stochastic gradient descent optimization algorithm, thereby updating the value of the parameter w.
- the execution environment of the smart contract under the joint learning chain is in a virtual machine (VM).
- the joint learning App uses the user data of the device and the initial model parameters for a certain joint learning contract to run in the off-chain smart contract VM.
- the execution environment of the off-chain smart contract can not only support the joint learning program, but also other off-chain smart contract programs.
- Step 310 The model requester receives the training result sent by the device.
- the device feeds back the training result to the model consumer through an off-chain channel established with the model consumer.
- Step 311 The model demander pays digital currency to the device through a state channel (for example, an off-chain payment channel).
- a state channel for example, an off-chain payment channel
- the model demander sends a transaction to the device.
- the total asset in the channel is S, where the demander has A and the device has B.
- the cost of this single training is t.
- the digital currency of the model demander is A-t
- the signature of the demander of the model is attached. After the device signs the transaction again, it can send the transaction to the blockchain network, close the channel, and withdraw the digital currency belonging to the device.
- the state channel can run in a TEE environment, and the device can be in a safe environment when receiving digital currency from the model demander and sending model data updates to the model demander.
- the device can be in a safe environment when receiving digital currency from the model demander and sending model data updates to the model demander.
- To spend digital currency you need to use the private key in the digital currency wallet to sign in the SEE environment.
- Step 312 The model requester receives the feedback training results of the equipment participating in the joint learning and performs averaging processing to obtain the latest model parameters, returning to step 306, and then delivering to the equipment participating in the joint learning.
- Step 313 The device can view the on-chain digital currency and off-chain digital currency belonging to the device at any time.
- the device can receive many transactions sent by the demand side of the model. Therefore, the digital currency of the device in the state channel is increasing, and only the latest transactions need to be maintained.
- Step 314 When the joint learning end 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.
- FIG. 3 is only to help those skilled in the art understand the embodiments of the present application, and is not intended to limit the embodiments of the present application to the specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the example of FIG. 3 given, and such modifications or changes also fall within the scope of the embodiments of the present application.
- the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, rather than corresponding to the embodiments of the present application.
- the implementation process constitutes any limitation.
- the training parameters generated after the device participating in the joint learning participates in the local training can be fed back to the application server node through the state channel.
- the state channel sending training results can meet the requirements of high TPS in the combined learning and block chain scenario.
- the training results of the device also have a certain degree of privacy.
- the training results can be sent through the state channel to avoid each node in the blockchain network. Sharing can protect the privacy of device data.
- the joint learning device of the embodiment of the present application can execute the various methods of the foregoing embodiment of the present application, that is, for the specific working processes of the following various products, refer to the corresponding process in the foregoing method embodiment.
- FIG. 5 is a schematic block diagram of a joint learning device 500 provided by an embodiment of the present application. It should be understood that the joint learning device 500 can execute each step performed by the device in the method of FIG. 2 or FIG. 3, and in order to avoid repetition, it will not be described in detail here.
- the joint learning device 500 includes: a receiving unit 510, a processing unit 520, and a sending unit 530.
- the receiving unit 510 is configured to receive the initial model parameters sent by the application server node, where the initial model parameters are parameters used by the equipment participating in the joint learning to establish the initial model;
- the processing unit 520 is configured to train the initial model parameters, Generate training results for updating the initial model parameters;
- sending unit 530 configured to send the training results to the application server node through a state channel, where the state channel is an off-chain connection between the device and the application server node Channel, the off-chain channel is located outside the blockchain network.
- the receiving unit 510 is further configured to: receive channel address information sent by the application server node, where the channel address information is used to identify the state channel.
- the receiving unit 510 is further configured to: obtain a joint learning smart contract, where the joint learning smart contract includes training logic instructions for the initial model parameters; the processing unit 520 is specifically configured to: run The joint learning smart contract is used to train the initial model parameters, and generate training results for updating the initial model parameters.
- the receiving unit 510 is specifically further configured to: obtain the joint learning smart contract through a blockchain network, where the joint learning smart contract is an off-chain smart contract department, and the chain The execution environment of the next smart contract does not belong to the smart contract of the blockchain network.
- the processing unit 520 is specifically configured to: run the joint learning smart contract in a joint learning application to train the initial model parameters.
- the processing unit 520 is specifically configured to: in a trusted execution environment TEE, run the joint learning smart contract to train the initial model parameters.
- the receiving unit 510 is specifically configured to: receive the digital currency paid by the application server node through the state channel.
- the receiving unit 510 is specifically configured to: in a trusted execution environment TEE, receive the digital currency paid by the application server node through the state channel.
- the sending unit 530 is further configured to send a first message to the application server node, where the first message is used to instruct the device to participate in joint learning, and the first message is Including the digital currency wallet address of the device.
- the processing unit 520 is further configured to: determine the end of the training task of joint learning; the sending unit 530 is further configured to: send the first transaction to the blockchain network, and the first transaction A transaction is used to instruct to close the state channel.
- the joint learning device 500 here is embodied in the form of a functional unit.
- the term "unit” herein can be implemented in the form of software and/or hardware, which is not specifically limited.
- a "unit” may be a software program, a hardware circuit, or a combination of the two that realize the above-mentioned functions.
- the hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor for executing one or more software or firmware programs (such as a shared processor, a dedicated processor, or a group processor). Etc.) and memory, merged logic circuits and/or other suitable components that support the described functions.
- the units of the examples described in the embodiments of the present application can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
- FIG. 6 is a schematic block diagram of a joint learning device 600 provided by an embodiment of the present application. It should be understood that the joint learning device 600 may be an application server node, which can execute each step performed by the application server node in the method of FIG. 2 or FIG. 3, and in order to avoid repetition, it will not be detailed here.
- the joint learning device 600 includes a sending unit 610 and a receiving unit 620.
- the sending unit 610 is configured to send initial model parameters to the device, and the initial model parameters are parameters used by the device to establish an initial model participating in joint learning;
- the receiving unit 620 is configured to receive through a state channel The training result used to update the initial model parameters, 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.
- 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.
- the receiving unit 620 is further configured to: receive channel address information sent by the blockchain network, where the channel address information is used to identify the status channel; the sending unit 610, It is also used to send the channel address information to the device.
- the sending unit 610 is further configured to send a second transaction to the blockchain network, where the second transaction is used to deploy the state channel.
- the sending unit 610 is further configured to send a third transaction to the blockchain network, and the third transaction is used to sign the joint learning smart contract on the blockchain network, so
- 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.
- the sending unit 610 is further configured to: pay digital currency to the device through the state channel.
- the receiving unit 620 is further configured to: receive a first message sent by the device, where the first message is used to instruct the device to participate in joint learning, and the first message includes The digital currency wallet address of the device.
- the joint learning device 600 here is embodied in the form of a functional unit.
- the term "unit” herein can be implemented in the form of software and/or hardware, which is not specifically limited.
- a "unit” may be a software program, a hardware circuit, or a combination of the two that realize the above-mentioned functions.
- the hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor for executing one or more software or firmware programs (such as a shared processor, a dedicated processor, or a group processor). Etc.) and memory, merged logic circuits and/or other suitable components that support the described functions.
- the units of the examples described in the embodiments of the present application can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
- FIG. 7 shows a schematic block diagram of a joint learning device 700 according to another embodiment of the present application.
- the joint learning device 700 may be a terminal device.
- 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 may 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 instructions stored in the memory 760.
- the memory 760 stores program codes 711, and the processor 720 can call the program codes 711 stored in the memory 760 to execute the joint learning method shown in FIG. 2 or FIG. 3.
- the processor 720 may be used to execute the training model parameters in 220 in FIG. 2 to generate training results; or 307 in FIG. 3 to execute a smart contract to perform local training.
- the memory 760 may include a read-only memory and a random access memory, and provides instructions and data to the processor 720.
- the memory 760 may also include a non-volatile random access memory.
- the memory 760 may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory.
- the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electronic Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
- the volatile memory may be random access memory (RAM), which is used as an external cache.
- RAM random access memory
- SRAM static random access memory
- DRAM dynamic random access memory
- SDRAM synchronous dynamic random access memory
- Double data rate synchronous dynamic random access memory double data date SDRAM, DDR SDRAM
- enhanced SDRAM enhanced synchronous dynamic random access memory
- SLDRAM synchronous connection dynamic random access memory
- direct rambus RAM direct rambus RAM
- the bus 750 may also include a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus 750 in FIG. 7.
- the joint learning device 700 shown in FIG. 7 can implement various processes performed by the device in the method embodiments shown in FIG. 2 and FIG. 3.
- the operations and/or functions of the various modules in the joint learning device 700 are to implement the corresponding procedures of the devices in the foregoing method embodiments.
- FIG. 8 shows a schematic block diagram of a joint learning device 800 according to another embodiment of the present application.
- the joint learning device 800 may be an application server node.
- 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 may 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 instructions stored in the memory 860.
- the memory 860 stores the program code 811, and the processor 820 can call the program code 811 stored in the memory 860 to execute the joint learning method shown in FIG. 2 or FIG. 3.
- the communication interface 840 shown in FIG. 8 may correspond to the receiving unit 620 and the sending unit 610 in the terminal device shown in FIG. 6.
- the memory 820 may include a read-only memory and a random access memory, and provides instructions and data to the processor 820.
- the memory 860 may also include a non-volatile random access memory.
- the memory 860 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
- the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electronic Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
- the volatile memory may be random access memory (RAM), which is used as an external cache.
- RAM random access memory
- SRAM static random access memory
- DRAM dynamic random access memory
- SDRAM synchronous dynamic random access memory
- Double data rate synchronous dynamic random access memory double data date SDRAM, DDR SDRAM
- enhanced SDRAM enhanced synchronous dynamic random access memory
- SLDRAM synchronous connection dynamic random access memory
- direct rambus RAM direct rambus RAM
- bus 850 may also include a power bus, a control bus, and a status signal bus.
- bus 850 may also include a power bus, a control bus, and a status signal bus.
- various buses are marked as bus 850 in FIG. 8.
- the joint learning device 800 shown in FIG. 8 can implement various processes performed by the application server node in the method embodiments shown in FIG. 2 and FIG. 3.
- the operations and/or functions of each module in the joint learning device 800 are used to implement the corresponding procedures of the application server nodes in the foregoing method embodiments.
- This application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium.
- the computer executes the joint learning methods shown in FIG. 2 and FIG. 3. The various steps.
- the present application also provides a computer program product containing instructions.
- the computer program product runs on a computer or any one of at least one processor, the computer executes the joint learning methods shown in FIG. 2 and FIG. 3 Various steps.
- This application also provides a chip including a processor.
- the processor is used to read and run the computer program stored in the memory to execute the corresponding operation and/or process performed by the method for waking up the screen provided in this application.
- the chip further includes a memory, the memory and the processor are connected to the memory through a circuit or a wire, and the processor is used to read and execute the computer program in the memory.
- the chip further includes a communication interface, and the processor is connected to the communication interface.
- the communication interface is used to receive data and/or information that needs 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.
- the processors involved may include, for example, a central processing unit (CPU), a microprocessor, a microcontroller, or a digital signal processor, and may also include GPU, NPU, and ISP.
- the processor may also include It may include necessary hardware accelerators or logic processing hardware circuits, such as application-specific integrated circuits (ASICs), or one or more integrated circuits used to control the execution of the technical solutions of this application.
- the processor may have a function of operating one or more software programs, and the software programs may be stored in the memory.
- the memory can be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions
- Dynamic storage devices can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical disc storage ( Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can Any other medium accessed by the computer, etc.
- EEPROM electrically erasable programmable read-only memory
- CD-ROM compact disc read-only memory
- optical disc storage Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.
- magnetic disk storage media or other magnetic storage devices or can be used to carry or store desired program codes in the form of instructions or data structures and can Any other medium
- At least one refers to one or more
- multiple refers to two or more.
- And/or describes the association relationship of the associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. Among them, A and B can be singular or plural.
- the character “/” generally indicates that the associated objects are in an “or” relationship.
- “The following at least one item” and similar expressions refer to any combination of these items, including any combination of single items or plural items.
- At least one of a, b, and c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
- 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.
- the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Telephonic Communication Services (AREA)
Abstract
Provided are a blockchain-network-based joint learning method and joint learning device. The method comprises: acquiring an initial model parameter, wherein the initial model parameter is a parameter, used for building an initial model, of a device participating in joint learning; training the initial model parameter, and generating a training result used to update the initial model parameter; and sending the training result to an application server node by means of 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 a blockchain network. According to the technical solution provided in the present application, the device participating in joint learning feeds back a training result of the joint learning by means of the state channel, and can meet the requirement for high transactions per second of a combination of the joint learning and blockchain technology.
Description
本申请涉及信息技术领域,并且更具体地,涉及一种基于区块链网络的联合学习方法和联合学习设备。This 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.
联合学习方案的提出,使得在移动设备上的模型共享成为可能。联合学习是指在移动端存储所有的训练数据,将机器学习的模型训练和云端存储过程解耦。这使得移动端进行模型训练和进化成为可能,解决了以前模型只能云端下发训练好的模型,而无法在本地训练的问题。现代社会中,个人数据的隐私性越来越重要,而在监督学习中,训练数据是必要元素。The proposed joint learning scheme makes it possible to share models on mobile devices. Joint learning refers to storing all training data on the mobile terminal, decoupling the model training of machine learning and the cloud storage process. This makes it possible to perform model training and evolution on the mobile terminal, and solves the problem that the previous model could only deliver the trained model in the cloud instead of training locally. In modern society, the privacy of personal data is becoming more and more important, and in supervised learning, training data is a necessary element.
为了实现联合学习方法的流程自动化以及为参与联合学习的设备提供激励机制,业界有考虑将联合学习技术和区块链技术进行结合的方案,但是将联合学习技术和区块链技术相结合的方法,即需要将联合学习的训练结果在区块链中的任意一个节点进行数据共享。若多个移动设备参与联合学习时,每一次训练结果均需要在区块链中的各个节点进行共享,从而会导致现有区块链的架构不能满足对交易吞吐量(transactions per second,TPS)的需要。In order to realize the process automation of the joint learning method and provide an incentive mechanism for the equipment participating in the joint learning, the industry has considered the scheme of combining the joint learning technology and the blockchain technology, but the method of combining the joint learning technology and the blockchain technology , That is, the training results of joint learning need to be shared with any node in the blockchain. If multiple mobile devices participate in joint learning, each training result needs to be shared by each node in the blockchain, which will cause the existing blockchain architecture to fail to meet the transaction throughput (transactions per second, TPS) Needs.
发明内容Summary of the invention
本申请提供一种基于区块链网络的联合学习方法和联合学习设备,该方法通过状态通道对联合学习的训练结果进行反馈,能够满足联合学习与区块链技术相结合的高TPS的要求。This application provides a joint learning method and a joint learning device based on a blockchain network. The method feeds back the training results of joint learning through a state channel, which can meet the high TPS requirements of the combination of joint learning and blockchain technology.
第一方面,提供了一种基于区块链网络的联合学习方法,包括:获取初始模型参数,所述初始模型参数为参与联合学习的设备用于建立初始模型的参数;训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果;通过状态通道向应用服务器节点发送所述训练结果,所述状态通道为所述设备与所述应用服务器节点的离链通道,所述离链通道位于区块链网络之外。In the first aspect, a joint learning method based on a blockchain network is provided, including: obtaining initial model parameters, where the initial model parameters are parameters used by devices participating in the joint learning to establish an initial model; and training the initial model parameters , Generating a training result for updating the initial model parameters; sending the training result to an 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 The channel is outside the blockchain network.
本申请提供的联合学习方法,设备可以通过状态通道发送参与联合学习的训练结果,即可以在应用服务器节点与参与联合学习的设备之间建立状态通道,从而不需要将设备参与联合学习进行本地训练后得到的训练结果在区块链网络的多个节点处实现共享,能够满足了联合学习与区块链技术相结合的高TPS的要求。此外,通过状态通道发送训练结果,可以避免训练结果在区块链网络的各个节点共享的问题,确保训练结果的数据隐私性。In the joint learning method provided by this application, the device can send the training results of participating in 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 device does not need to participate in the joint learning for local training The training results obtained later are 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 at each node of the blockchain network and ensure the data privacy of the training results.
应理解,状态通道(State Channel)是一种用于执行交易和其他状态更新的“链下(off-chain)”技术,即状态通道可以是指区块链的链下通道,通过链下通道发送的数据或者信息不需要在区块链各个节点进行共享,链下通道可以是两个节点之间建立的离链通 道。It should be understood that the State Channel is an "off-chain" technology used to execute transactions and other state updates. That is, the state channel can refer to the off-chain channel of the blockchain, through the off-chain channel. The data or information sent does not need to be shared among the nodes of the blockchain, and 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 the application server node and the device participating in the joint learning. The one-way off-chain payment channel is used by the application server node to receive the device After sending the training result of participating in the joint learning, the terminal device is paid with digital currency.
例如,状态通道可以是双向链下通道,比如,应用服务器节点和参与联合学习的设备之间建立的双向链下通道,设备可以通过双向链下通道向应用服务器节点参与联合学习的本地训练结果,应用服务器节点可以在接收到设备发送的训练结果后向设备支付数字货币。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 joint learning, and the device can participate in the local training result of the joint learning to the application server node through the two-way off-chain channel. The application server node can pay the device with digital currency after receiving the training result sent by the device.
需要说明的是,初始模型可以是机器学习模型或者还可以是计算机算法模型,例如,初始模型可以是机器学习中采用的神经网络模型,当初始模型是神经网络模型时,初始参数可以是用于建立神经网络模型的权重值。当初始模型是计算机算法模型时,初始参数可以是建立算法模型所需的参数。上述为举例说明,不对本申请作出任何限定。It should be noted 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 used for Establish the weight value of the neural network model. When the initial model is a computer algorithm model, the initial parameters may be the parameters required to establish the algorithm model. The above are examples and do not limit this application.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:接收所述应用服务器节点发送的通道地址信息,所述通道地址信息用于标识所述状态通道。With reference to 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 state channel.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:获取联合学习智能合约,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令;With reference to the first aspect, in some implementations of the first aspect, the method further includes: obtaining a joint learning smart contract, where the joint learning smart contract includes training logic instructions for the initial model parameters;
所述训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果,包括:运行所述联合学习智能合约以训练所述初始模型参数,生成所述训练结果。The training of the initial model parameters and generating a training result for updating the initial model parameters includes: running the joint learning smart contract to train the initial model parameters to generate the training result.
在一种可能的实现方式中,联合学习智能合约中可以包括进行联合学习所需的数据信息、设备向应用服务器反馈的训练结果的内容需求以及设备反馈训练结果相应的费用信息。In a possible implementation, the joint learning smart contract may include data information required for joint learning, content requirements for training results fed back by the device to the application server, and cost information corresponding to the training results fed back by the device.
结合第一方面,在第一方面的某些实现方式中,所述获取联合学习智能合约,包括:通过所述区块链网络获取所述联合学习智能合约,其中,所述联合学习智能合约为链下智能合约,所述链下智能合约的执行环境不属于所述区块链网络的智能合约。With reference to the first aspect, in some implementations of the first aspect, the obtaining a joint learning smart contract includes: obtaining the joint learning smart contract through the blockchain network, wherein 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 smart contract of the blockchain network.
在本申请中,联合学习智能合约可以是通过将链下智能合约部署于所述区块链网络的智能合约,其中,链下智能合约是指智能合约的执行环境不属于所述区块链网络的智能合约。将链下智能合约部署于区块链网络可以确保联合智能合约的可信性。In this application, the joint learning smart contract can be a smart contract that deploys an off-chain smart contract on the blockchain network, where the off-chain smart contract means that the execution environment of the smart contract does not belong to the blockchain network Smart contract. Deploying the off-chain smart contract on the blockchain network can ensure the credibility of the joint smart contract.
结合第一方面,在第一方面的某些实现方式中,所述运行所述联合学习智能合约,包括:在联合学习应用程序中运行所述联合学习智能合约。With reference to the first aspect, in some implementations of the first aspect, the running the joint learning smart contract includes: running the joint learning smart contract in a joint learning application.
例如,参与联合学习的设备可以安装联合学习应用程序,应用服务器节点将可以向联合学习智能合约的地址发布至联合学习应用程序中,参与联合学习的设备可以在联合学习应用程序中下载并运行联合学习智能合约。For example, the equipment participating in the joint learning can install the joint learning application, the application server node can publish the address of the joint learning smart contract to the joint learning application, and the equipment participating in the joint learning can download and run the joint learning application in the joint learning application. Learn smart contracts.
结合第一方面,在第一方面的某些实现方式中,所述在联合学习应用程序中运行所述联合学习智能合约以训练所述初始模型参数,包括:在可信执行环境TEE下,运行所述联合学习智能合约以训练所述初始模型参数。With reference to the first aspect, in some implementations of the first aspect, the running the joint learning smart contract in a joint learning application to train the initial model parameters includes: running under a trusted execution environment TEE The joint learning smart contract is used to train the initial model parameters.
在本申请中,设备可以在可信执行环境下运行联合学习智能合约,从而可以确保运行联合智能合约的安全性。In this application, the device can run the joint learning smart contract in a trusted execution environment, thereby ensuring the security of running the joint smart contract.
例如,设备基于片上系统(system on chip,SoC)的硬件,可以提供三层硬件安全体系,包括富运行环境(rich execution environment,REE)、可信运行环境(trusted execution environment,TEE)与安全运行环境(secure execution environment,SEE),其中,TEE可以运行安全敏感程序和保存安全敏感数据。For example, equipment based on system-on-chip (SoC) hardware can provide a three-layer hardware security system, including rich execution environment (REE), trusted execution environment (TEE) and safe operation Environment (secure execution environment, SEE), in which TEE can run security-sensitive programs and store security-sensitive data.
例如,可以是在可信执行环境TEE下,在联合学习应用程序中运行所述联合学习智能合约以训练所述初始模型参数。For example, the joint learning smart contract may be run in a joint learning application under a trusted execution environment TEE to train the initial model parameters.
结合第一方面,在第一方面的某些实现方式中,所述通过状态通道向应用服务器节点发送所述训练结果之后,所述方法还包括:接收所述应用服务器节点通过所述状态通道支付的数字货币。With reference to the first aspect, in some implementations of the first aspect, after the sending the training result to the application server node through the state channel, the method further includes: receiving the application server node to pay through the state channel Digital currency.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:向所述应用服务器节点发送第一消息,所述第一消息用于指示所述设备参与联合学习,所述第一消息中包括所述设备的数字货币钱包地址。With reference to the first aspect, in some implementations of the first aspect, the method further includes: sending a first message to the application server node, where the first message is used to instruct the device to participate in joint learning, the The first message includes the digital currency wallet address of the device.
在本申请中,设备可以向应用服务器节点发送消息表明参与联合学习以及发送数字货币钱包地址的信息,以便于向应用服务器节点发送训练结果后获取相应的数字货币。In this application, the device can send a message to the application server node indicating that it participates in joint learning and sends the information of the digital currency wallet address, so as to obtain the corresponding digital currency after sending the training result to the application server node.
应理解,数字货币钱包地址可以用于标识设备。当多个设备参与联合学习时,应用服务器节点根据多个设备的数字货币钱包地址区分不同的设备,从而在接收到多个设备发送的联合学习的训练结果后,分别向多个设备支付数字货币。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 multiple devices, so that after receiving the training results of joint learning sent by multiple devices, they pay digital currency to multiple devices respectively .
结合第一方面,在第一方面的某些实现方式中,所述接收所述应用服务器节点通过所述状态通道支付的数字货币,包括:在可信执行环境TEE下,接收所述应用服务器节点通过所述状态通道支付的数字货币。With reference to the first aspect, in some implementations of the first aspect, the receiving the digital currency paid by the application server node through the state channel includes: receiving the application server node under a trusted execution environment TEE Digital currency paid through the state channel.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:确定联合学习结束;向所述区块链网络发送第一交易,所述第一交易用于指示关闭所述状态通道。With reference to the first aspect, in some implementations of the first aspect, the method further includes: determining the end of the joint learning; sending a first transaction to the blockchain network, the first transaction being used to instruct to close the Status channel.
应理解,设备可以收到应用服务器节点发送的诸多交易,因此,设备的在状态通道中的数字货币是不断递增的,只需维护最新的交易。当设备决定关闭状态通道时,可以针对最新的交易做签名,发送给区块链网络,取出属于设备的数字货币。It should be understood that the device can receive many transactions sent by the application server node. Therefore, the digital currency of the device in the state channel is continuously increasing, and only the latest transactions need 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.
第二方面,提供了一种基于区块链网络的联合学习方法,包括:向设备发送初始模型参数,所述初始模型参数为所述设备用于建立参与联合学习的初始模型的参数;通过状态通道接收更新所述初始模型参数的训练结果,其中,所述状态通道为所述设备与所述应用服务器节点之间的离链通道,所述离链通道位于区块链网络之外。In a second aspect, a joint learning method based on a blockchain network is provided, including: sending an initial model parameter to a device, where the initial model parameter is a parameter used by the device to establish an initial model participating in joint learning; The channel receives the training result of updating the initial model parameters, 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.
本申请提供的基于区块链网络的联合学习方法,应用服务器节点可以通过状态通道接收参与联合学习的设备发送的训练结果,即可以在应用服务器节点与参与联合学习的设备之间建立状态通道,从而不需要将设备参与联合学习进行本地训练后得到的训练结果在区块链网络的多个节点处实现共享,能够满足了联合学习与区块链技术相结合的高TPS的要求。In the joint learning method based on the blockchain network provided in this application, the application server node can receive the training result sent by the device participating in the joint learning through the state channel, that is, the state channel can be established between the application server node and the device participating in the joint learning, Therefore, it is not necessary to share the training results obtained after the device participates in joint learning for local training at multiple nodes of the blockchain network, which can meet the high TPS requirements of the combination of joint learning and blockchain technology.
应理解,状态通道(State Channel)是一种用于执行交易和其他状态更新的“链下(off-chain)”技术,即状态通道可以是指区块链的链下通道,通过链下通道发送的数据或者信息不需要在区块链各个节点进行共享,链下通道可以是两个节点之间建立的离链通道。It should be understood that the State Channel is an "off-chain" technology used to execute transactions and other state updates. That is, the state channel can refer to the off-chain channel of the blockchain, through the off-chain channel. The data or information sent does not need to be shared among the nodes of the blockchain, and 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 the application server node and the device participating in the joint learning. The one-way off-chain payment channel is used by the application server node to receive the terminal After the training result of participating in the joint learning sent by the device, the digital currency is paid to the participating device in the joint learning.
例如,状态通道可以是双向链下通道,比如,应用服务器节点和参与联合学习的设备之间建立的双向链下通道,设备可以通过双向链下通道向应用服务器节点参与联合学习的本地训练结果,应用服务器节点可以在接收到设备发送的训练结果后向设备支付数字货币。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 joint learning, and the device can participate in the local training result of the joint learning to the application server node through the two-way off-chain channel. The application server node can pay the device with digital currency after receiving the training result sent by the device.
结合第二方面,在第二方面的某些实现方式中,所述方法还包括:接收区块链网络发送的通道地址信息,所述通道地址信息用于标识所述状态通道;向所述设备发送所述通道地址信息。With reference to the second aspect, in some implementations of the second aspect, the method further includes: receiving channel address information sent by a blockchain network, where the channel address information is used to identify the state channel; Send the channel address information.
结合第二方面,在第二方面的某些实现方式中,所述接收区块链网络发送的通道地址信息之前,所述方法还包括:向区块链网络发送第二交易,所述第二交易用于部署所述状态通道。With reference to the second aspect, in some implementations of the second aspect, before the receiving the channel address information sent by the blockchain network, the method further includes: sending a second transaction to the blockchain network, the second The transaction is used to deploy the state channel.
本申请中,应用服务器节点可以发送交易部署于参与联合学习的设备之间的链下通道,从而通过链下通道接收设备发送的更新所述初始模型参数的训练结果。不仅可以满足TPS的需求,同时可以保护训练结果的数据隐私性。In this application, the application server node may send transactions to be deployed in the off-chain channel between the devices participating in the joint learning, so as to receive the training result sent by the device to update the initial model parameters through the off-chain channel. It can not only meet the needs of TPS, but also protect the data privacy of training results.
结合第二方面,在第二方面的某些实现方式中,所述方法还包括:向所述区块链网络发送第三交易,所述第三交易用于将联合学习智能合约部署于所述区块链网络,所述联合学习智能合约是链下智能合约,所述链下智能合约的执行环境不属于所述区块链网络,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令。With reference to the second aspect, in some implementations of the second aspect, the method further includes: sending a third transaction to the blockchain network, where the third transaction is used to deploy a 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 the training of the initial model parameters Logic instructions.
在本申请中,应用服务器节点可以将链下智能合约部署于所述区块链网络的智能合约,其中,链下智能合约是指智能合约的执行环境不属于所述区块链网络的智能合约。将链下智能合约部署于区块链网络可以确保联合智能合约的可信性。In this application, the application server node can deploy the off-chain smart contract in the smart contract of the blockchain network, where 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 on the blockchain network can ensure the credibility of the joint smart contract.
结合第二方面,在第二方面的某些实现方式中,所述通过所述状态通道接收训练结果之后,所述方法还包括:通过所述状态通道向所述设备支付数字货币。With reference to 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.
结合第二方面,在第二方面的某些实现方式中,所述通过所述状态通道向所述设备支付数字货币之前,所述方法还包括:接收所述设备发送的第一消息,所述第一消息用于指示所述设备参与联合学习,所述第一消息中包括所述设备的数字货币钱包地址。With reference to the second aspect, in some implementations of the second aspect, before the payment of digital currency to the device through the state channel, the method further includes: receiving a first message sent by the device, and The first message is used to instruct the device to participate in joint learning, and the first message includes the digital currency wallet address of the device.
应理解,数字货币钱包地址可以用于标识设备。当多个设备参与联合学习时,应用服务器节点根据多个设备的数字货币钱包地址区分不同的设备,从而在接收到多个设备发送的联合学习的训练结果后,分别向多个设备支付数字货币。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 multiple devices, so that after receiving the training results of joint learning sent by multiple devices, they pay digital currency to multiple devices respectively .
第三方面,提供了一种联合学习设备,包括:接收单元,用于接收应用服务器节点发送的初始参数,所述初始模型参数为参与联合学习的设备用于建立初始模型的参数;处理单元,用于训练所述初始参数,生成更新所述初始参数的训练结果;发送单元,用于通过状态通道向应用服务器节点发送所述训练结果,所述状态通道为所述设备与所述应用服务器节点之间的离链通道,所述离链通道位于区块链网络之外。In a third aspect, a joint learning device is provided, including: a receiving unit for receiving initial parameters sent by an application server node, where the initial model parameters are parameters used by devices participating in the joint learning to establish an 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, where the state channel is the device and the application server node The off-chain channel is located outside the blockchain network.
结合第三方面,在第三方面的某些实现方式中,所述接收单元还用于:接收所述应用服务器节点发送的通道地址信息,所述通道地址信息用于标识所述状态通道。With reference to the third aspect, in some implementations of the third aspect, the receiving unit is further configured to: receive channel address information sent by the application server node, where the channel address information is used to identify the state channel.
结合第三方面,在第三方面的某些实现方式中,所述接收单元还用于:获取联合学习智能合约,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令;所述处理单元具体用于:运行所述联合学习智能合约以训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果。With reference to the third aspect, in some implementations of the third aspect, the receiving unit is further configured to: obtain a joint learning smart contract, and the joint learning smart contract includes training logic instructions for the initial model parameters; The processing unit is specifically configured to: run the joint learning smart contract to train the initial model parameters, and generate training results for updating the initial model parameters.
结合第三方面,在第三方面的某些实现方式中,所述接收单元具体用于:通过所述区块链网络获取所述联合学习智能合约,其中,所述联合学习智能合约为链下智能合约,所述链下智能合约的执行环境不属于所述区块链网络。With reference to the third aspect, in some implementations of the third aspect, the receiving unit is specifically configured to: obtain the joint learning smart contract through the blockchain network, wherein the joint learning smart contract is off-chain Smart contract, the execution environment of the off-chain smart contract does not belong to the blockchain network.
结合第三方面,在第三方面的某些实现方式中,所述处理单元具体用于:所述设备在联合学习应用程序中运行所述联合学习智能合约。With reference to the third aspect, in some implementations of the third aspect, the processing unit is specifically configured to: the device runs the joint learning smart contract in a joint learning application.
结合第三方面,在第三方面的某些实现方式中,所述处理单元具体用于:在可信执行环境TEE下,运行所述联合学习智能合约以训练所述初始模型参数。With reference to the third aspect, in some implementations of the third aspect, the processing unit is specifically configured to run the joint learning smart contract to train the initial model parameters in a trusted execution environment TEE.
结合第三方面,在第三方面的某些实现方式中,所述接收单元还用于:接收所述应用服务器节点通过所述状态通道支付的数字货币。With reference to the third aspect, in some implementation manners of the third aspect, the receiving unit is further configured to: receive the digital currency paid by the application server node through the state channel.
结合第三方面,在第三方面的某些实现方式中,所述发送单元还用于:向所述应用服务器节点发送第一消息,所述第一消息用于指示所述设备参与联合学习,所述第一消息中包括所述设备的数字货币钱包地址。With reference to the third aspect, in some implementations of the third aspect, the sending unit is further configured to send a first message to the application server node, where the first message is used to instruct the device to participate in joint learning, The first message includes the digital currency wallet address of the device.
结合第三方面,在第三方面的某些实现方式中,所述接收单元具体用于:在可信执行环境TEE下,接收所述应用服务器节点通过所述状态通道支付的数字货币。With reference to the third aspect, in some implementation manners of the third aspect, the receiving unit is specifically configured to receive the digital currency paid by the application server node through the state channel under the trusted execution environment TEE.
结合第三方面,在第三方面的某些实现方式中,所述处理单元还用于:确定联合学习的训练任务结束;所述发送单元还用于:向所述区块链网络发送第一交易,所述第一交易用于指示关闭所述状态通道。With reference to the third aspect, in some implementations of the third aspect, the processing unit is further configured to: determine the end of the training task of the joint learning; the sending unit is further configured to: send the first one to the blockchain network Transaction, the first transaction is used to instruct to close the state channel.
第四方面,提供了一种联合学习设备,包括:发送单元,用于向设备发送初始模型参数,所述初始模型参数为所述设备用于建立参与联合学习的初始模型的参数;接收单元,用于通过状态通道接收用于更新所述初始模型参数的训练结果,其中,所述状态通道为所述设备与应用服务器节点之间的离链通道,所述离链通道位于区块链网络之外。In a fourth aspect, a joint learning device is provided, including: a sending unit, configured 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; and a receiving unit, It is used to receive the 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 the application server node, and the off-chain channel is located in the blockchain network outer.
结合第四方面,在第四方面的某些实现方式中,所述接收单元还用于:接收所述区块链网络发送的通道地址信息,所述通道地址信息用于标识所述状态通道;所述发送单元还用于:向所述设备发送所述通道地址信息。With reference to the fourth aspect, in some implementations of the fourth aspect, the receiving unit is further configured to: receive channel address information sent by the blockchain network, where the channel address information is used to identify the state channel; The sending unit is further configured to send the channel address information to the device.
结合第四方面,在第四方面的某些实现方式中,所述发送单元还用于:向所述区块链网络发送第二交易,所述第二交易用于部署所述状态通道。With reference to the fourth aspect, in some implementations of the fourth aspect, the sending unit is further configured to send a second transaction to the blockchain network, and the second transaction is used to deploy the state channel.
结合第四方面,在第四方面的某些实现方式中,所述发送单元还用于:向所述区块链网络发送第三交易,所述第三交易用于将联合学习智能合约署于所述区块链网络,所述联合学习智能合约是链下智能合约,所述链下智能合约的执行环境不属于所述区块链网络,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令。With reference to the fourth aspect, in some implementations of the fourth aspect, the sending unit is further configured to: send a third transaction to the blockchain network, and the third transaction is used to sign the joint learning smart contract on In 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 the initial model parameters Training logic instructions.
结合第四方面,在第四方面的某些实现方式中,所述发送单元还用于:通过所述状态通道向所述设备支付数字货币。With reference to the fourth aspect, in some implementations of the fourth aspect, the sending unit is further configured to: pay digital currency to the device through the state channel.
结合第四方面,在第四方面的某些实现方式中,所述接收单元还用于:接收所述设备发送的第一消息,所述第一消息用于指示所述终端设备参与联合学习,所述第一消息中包括所述终端设备的数字货币钱包地址的信息。With reference to the fourth aspect, in some implementations of the fourth aspect, the receiving unit is further configured to: receive a first message sent by the device, where the first message is used to instruct the terminal device to participate in joint learning, The first message includes information of the digital currency wallet address of the terminal device.
第五方面,提供了一种联合学习设备,包括:处理器,存储器,该存储器用于存储计算机程序,该处理器用于从存储器中调用并运行该计算机程序,使得该联合学习设备执行第一方面及其各种可能实现方式中的联合学习方法。In a fifth aspect, a joint learning device is provided, including: a processor, a memory, the memory is used to store a computer program, the processor is used to call and run the computer program from the memory, so that the joint learning device executes the first aspect And its various possible implementation methods of joint learning.
例如,该联合学习设备可以是终端设备。For example, the joint learning device may be a terminal device.
可选地,所述处理器为一个或多个,所述存储器为一个或多个。Optionally, there are one or more processors and one or more memories.
可选地,所述存储器可以与所述处理器集成在一起,或者所述存储器与处理器分离设置。Optionally, the memory may be integrated with the processor, or the memory and the processor may be provided separately.
第六方面,提供了一种联合学习设备,包括:处理器,存储器,该存储器用于存储计算机程序,该处理器用于从存储器中调用并运行该计算机程序,使得该联合学习设备执行第二方面及其各种可能实现方式中的联合学习方法。In a sixth aspect, a joint learning device is provided, including: a processor, a memory, the memory is used to store a computer program, the processor is used to call and run the computer program from the memory, so that the joint learning device executes the second aspect And its various possible implementation methods of joint learning.
例如,该联合学习设备可以是应用服务器节点。For example, the joint learning device may be an application server node.
可选地,所述处理器为一个或多个,所述存储器为一个或多个。Optionally, there are one or more processors and one or more memories.
可选地,所述存储器可以与所述处理器集成在一起,或者所述存储器与处理器分离设置。Optionally, the memory may be integrated with the processor, or the memory and the processor may be provided separately.
第七方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序(也可以称为代码,或指令),当所述计算机程序被运行时,使得计算机或任一至少一种处理器执行上述第一方面及其各种实现方式中的方法。In a seventh aspect, a computer program product is provided. The computer program product includes: a computer program (also referred to as code, or instruction) that, when the computer program is executed, causes a computer or any one of at least one processing The device executes the methods in the first aspect and its various implementations.
第八方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序(也可以称为代码,或指令),当所述计算机程序被运行时,使得计算机或任一至少一种处理器执行上述第二方面及其各种实现方式中的方法。In an eighth aspect, a computer program product is provided. The computer program product includes: a computer program (also called code, or instruction) that, when the computer program is executed, causes a computer or any one of at least one processing The device executes the methods in the second aspect and its various implementations.
第九方面,提供了一种计算机可读介质,所述计算机可读介质存储有计算机程序(也可以称为代码,或指令)当其在计算机或任一至少一种处理器上运行时,使得计算机或该处理器执行上述第一方面及其各种实现方式中的方法。In a ninth aspect, a computer-readable medium is provided, and the computer-readable medium stores a computer program (also called code, or instruction) when it runs on a computer or any at least one processor, so that The computer or the processor executes the methods in the first aspect and various implementations thereof.
第十方面,提供了一种计算机可读介质,所述计算机可读介质存储有计算机程序(也可以称为代码,或指令)当其在计算机或任一至少一种处理器上运行时,使得计算机或该处理器执行上述第二方面及其各种实现方式中的方法。In a tenth aspect, a computer-readable medium is provided, and the computer-readable medium stores a computer program (also called code, or instruction) when it runs on a computer or any at least one processor, so that The computer or the processor executes the methods in the second aspect and various implementations thereof.
第十一方面,提供了一种芯片系统,该芯片系统包括处理器,用于支持计算机中的服务器实现上述第一方面及其各种实现方式中所涉及的功能。In an eleventh aspect, a chip system is provided. The chip system includes a processor for supporting a server in a computer to implement the functions involved in the first aspect and various implementations thereof.
第十二方面,提供了一种芯片系统,该芯片系统包括处理器,用于支持计算机中的服务器实现上述第二方面及其各种实现方式中所涉及的功能。In a twelfth aspect, a chip system is provided, and the chip system includes a processor for supporting a server in a computer to implement the functions involved in the second aspect and various implementation manners thereof.
图1是现有技术中联合学习技术的示例性流程图;Figure 1 is an exemplary flow chart of a joint learning technology in the prior art;
图2是根据本申请一实施例提供的联合学习方法的示意性流程图;Fig. 2 is a schematic flowchart of a joint learning method provided according to an embodiment of the present application;
图3是根据本申请另一实施例提供的联合学习方法的示意性流程图;FIG. 3 is a schematic flowchart of a joint learning method provided according to another embodiment of the present application;
图4是根据本申请一实施例提供的联合学习设备的结构性示意图;Fig. 4 is a schematic structural diagram of a joint learning device provided according to an embodiment of the present application;
图5是根据本申请另一实施例提供的联合学习设备的结构性示意图;Fig. 5 is a schematic structural diagram of a joint learning device provided according to another embodiment of the present application;
图6是根据本申请一实施例提供的联合学习设备的结构性示意图;Fig. 6 is a schematic structural diagram of a joint learning device provided according to an embodiment of the present application;
图7是根据本申请另一实施例提供的联合学习设备的结构性示意图;Fig. 7 is a schematic structural diagram of a joint learning device provided according to another embodiment of the present application;
图8是根据本申请另一实施例提供的联合学习设备的结构性示意图。Fig. 8 is a schematic structural diagram of a joint learning device provided according to another embodiment of the present application.
下面将结合附图,对本申请中的技术方案进行描述。The technical solution in this application will be described below in conjunction with the drawings.
首先介绍一下本申请实施例中涉及的区块链技、智能合约以及联合学习的概念进行简单的说明。First, introduce the concepts of blockchain technology, smart contracts, and joint learning involved in the embodiments of this application for a brief explanation.
1、智能合约1. Smart contract
智能合约是代码和数据的集合,也可以称为“可编程合约”。通常而言,智能合约是通过程序编码定义的,并且预设了运行条件;当触发运行条件时执行行为。其中的“智能”是执行上的智能,也就是说,如果达到某个预设条件,则合约自动运行。A smart contract is a collection of code and data, and can also be called a "programmable contract". Generally speaking, smart contracts are defined by program coding and preset operating conditions; when the operating conditions are triggered, the behavior is executed. The "intelligence" is the execution intelligence, that is, if a certain preset condition is reached, the contract will run automatically.
2、联合学习2. Joint learning
如图1所示,为联合学习的示意性流程图。包括步骤110至步骤140。As shown in Figure 1, it is a schematic flowchart of joint learning. Including step 110 to step 140.
110、模型需求方向一个或者多个参与联合学习的设备发送初始参数,该初始参数用于向一个或者多个设备提供参与联合学习的初始模型。110. The model request sends initial parameters to one or more devices participating in the joint learning, where the initial parameters are used to provide the one or more devices with an initial model participating in the joint learning.
应理解,初始模型可以是机器学习模型或者还可以是计算机算法模型,例如,初始模型可以是机器学习中采用的神经网络模型,当初始模型是神经网络模型时,初始参数可以是用于建立神经网络模型的权重值。当初始模型是计算机算法模型时,初始参数可以是建立算法模型所需的参数。上述为举例说明,不对本申请作出任何限定。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 used to establish neural networks. The weight value of the network model. When the initial model is a computer algorithm model, the initial parameters may be the parameters required to establish the algorithm model. The above are examples and do not limit this application.
应理解,模型需求方可以是应用服务器节点,也可以是应用服务器节点中的应用程序APP。设备可以是终端设备,例如,可以是用户设备、移动设备、用户终端、终端、无线通信设备或用户装置。上述为举例说明,不对本申请作出任何限定。It should be understood that the model requester can be an application server node or an application APP in an application server node. The device may be a terminal device, for example, it may be a user equipment, a mobile device, a user terminal, a terminal, a wireless communication device, or a user device. The above are examples and do not limit this application.
120、参与联合学习的设备根据获取的初始模型参数进行本地训练,得到更新初始模型参数的训练结果。120. The equipment participating in the joint learning performs local training according to the acquired initial model parameters, and obtains a training result for updating the initial model parameters.
130、参与联合学习的设备向模型需求方反馈训练结果。130. The equipment participating in the joint learning feeds back the training results to the model demander.
需要说明的是,训练结果可以是根据使用该设备的用户的隐私数据进行学习来改进初始模型,然后将初始模型的变化部分压缩为一个小型更新包,进行反馈。It should be noted that the training result may be to improve the initial model by learning based on the private data of the user using the device, and then compress the changed part of the initial model into a small update package for feedback.
例如,初始模型为神经网络模型时,初始模型的改变部分可以是初始模型的网络权重值的变化部分。For example, when the initial model is a neural network model, the changed part of the initial model may be the changed part of the network weight value of the initial model.
140、模型需求方根据参与联合学习的一个或者多个设备反馈的训练结果,调整模型参数。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.
换而言之,在联合学习场景中,参与联合学习的设备可以下载当前最新的初始模型,对最新的初始模型进行本地训练来改进这个初始模型,然后将初始模型的变化部分压缩为一个小型更新包。并将该模型的更新部分用加密通信方法发送至模型需求方,模型需求方将接收到的参与联合学习的设备反馈的模型更新部分进行平均,以改善初始模型。从而所有的训练数据都在参与联合学习的设备上,设备中进行本地训练所使用的用户的个人隐私数据并不会发送至模型需求方,仅仅发送的是模型的变更部分。In other words, in the joint learning scenario, the devices participating in the joint learning can download the current 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, and the model demander averages the model update parts received from the feedback of the equipment participating in the joint learning to improve the initial model. Therefore, all the training data is on the equipment participating in the joint learning, and the personal privacy data of the user used for local training in the equipment is not sent to the model requester, only the changed part of the model is sent.
3、链下支付通道技术3. Off-chain payment channel technology
区块链链下支付通道是链下扩容的技术路线之一,即一种将区块链中部分交易相关状态在区块链以外进行更新的通用技术方案。其核心思想是某交易相关方建立起链下的通信通道,使双方可在链下通道执行交互行为,期间状态的更新并不提交给主链矿工,当状态通道需要关闭时将最终状态通过“关闭通道交易(Close Channel Transaction)”提交至主链并同步到主链帐本。由于中间过程不与主链交互,因此状态通道有非常高的执行效率。The off-chain payment channel of the blockchain 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 a party involved in a transaction establishes an off-chain communication channel, so that both parties can perform interactive behaviors in the off-chain channel. During the period, state updates are not submitted to the main chain miners. When the state channel needs to be closed, the final state is passed. "Close Channel Transaction" is submitted to the main chain and synchronized to the main chain ledger. Since the intermediate process does not interact with the main chain, the state channel has a very high execution efficiency.
4、区块链技术4. Blockchain technology
区块链技术实现了一种按照时间顺序将数据和信息区块以顺序相连的方式组成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式存储。一般情况下,将区块链中的数据和信息称为“交易(Transaction)”。Blockchain technology realizes a chained data structure in which data and information blocks are sequentially connected in chronological order, and it is cryptographically guaranteed that cannot be tampered with and cannot be forged distributed storage. In general, the data and information in the blockchain are called "transactions".
区块链技术不是单项的技术,而是作为点对点传输、共识机制、分布式数据存储和密码学原理集成应用的系统,该系统具有全公开和防篡改的技术特性。Blockchain technology is not a single technology, but as a system integrating point-to-point transmission, consensus mechanism, distributed data storage, and cryptographic principles. The system has the technical characteristics of full disclosure and tamper-proof.
第一、点对点传输:参与区块链的节点是独立的、对等的,节点与节点之间通过点对点传输技术实现数据和信息的同步。节点可以是不同的物理机器,也可以是云端不同的实例。First, point-to-point transmission: the nodes participating in the blockchain are independent and peer-to-peer, and the synchronization of data and information between nodes is achieved through point-to-point transmission technology. The nodes can be different physical machines or different instances of the cloud.
第二、共识机制:区块链的共识机制是指多方参与的节点在预设的逻辑规则下,通过节点间的交互实现各节点对特定数据和信息达成一致的过程。共识机制需要依赖于良好设计的算法,因此不同的共识机制性能(如:TPS)、达成共识的时延、耗费的计算资源、耗费的传输资源等)存在一定的差异。Second, the consensus mechanism: The consensus mechanism of the blockchain refers to the process by which nodes participating in multiple parties achieve agreement on specific data and information through the interaction between nodes under preset logical rules. Consensus mechanisms need 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 a consensus, the cost of computing resources, and the cost of transmission resources.
第三、分布式数据存储:区块链中的分布式存储是参与该区块链的节点各自都存有独立的、完整的数据,保证了数据存储在节点间全公开。与传统的分布式数据存储不同,传统的分布式数据存储按照一定规则将数据分成多份进行备份或同步存储,而区块链分布式数据存储则依赖于区块链中各地位对等的、独立的节点间的共识来实现高一致性的数据存储。Third, distributed data storage: Distributed storage in the blockchain is that each node participating in the blockchain stores independent and complete data, which ensures that the data stored in the node is fully open. Different from traditional distributed data storage, traditional distributed data storage divides the data into multiple copies for backup or synchronous storage according to certain rules, while blockchain distributed data storage relies on the equivalent, location-based data storage in the blockchain. Consensus between independent nodes to achieve highly consistent data storage.
第四、密码学原理:区块链通常是基于非对称加密技术实现可信的信息传播、校验等。Fourth, the principle of cryptography: Blockchain is usually based on asymmetric encryption technology to achieve credible information dissemination and verification.
其中“区块”的概念是将一条或多条数据记录以“块”的形式组织,“区块”的大小可以根据实际应用场景自定义;而“链”是一种数据结构,该数据结构将存储数据记录的“区块”按照时间顺序并以哈希(HASH)技术相连。在区块链中,每个“区块”包含“区块头”和“区块体”两个部分,其中“区块体”包含打包进“区块”的交易记录;“区块头”包含“区块”中所有交易的根HASH和前一“区块”的HASH。区块链的数据结构保证了区块链上存储的数据具有不可篡改的特性。The concept of "block" is to organize one or more data records in the form of "blocks". The size of "blocks" can be customized according to actual application scenarios; and "chain" is a data structure, which The "blocks" storing data records are connected in chronological order and connected by HASH technology. In the blockchain, each "block" contains two parts: a "block header" and a "block body". 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 is non-tamperable.
在现有技术区块链和联合学习的结合方案中,设备每一次训练的训练结果都发送给区块链网络中的节点进行处理。即每个设备参与联合学习进行本地训练后的训练结果都需要在区块链中的多个节点处共享。每一次训练都上链,当设备是千万个手机端,对交易吞吐量(transactions per second,TPS)有较高的需求,现有的区块链架构无法满足高TPS的要求。In the existing technology block chain and joint learning combination scheme, the training results of each training of the device are sent to the nodes in the block chain network for processing. That is, the training results after each device participates in joint learning for local training need to be shared among multiple nodes in the blockchain. Every training is on the chain. When the device is tens of millions of mobile phones, there is a high demand for transaction throughput (transactions per second, TPS). The existing blockchain architecture cannot meet the requirements of high TPS.
有鉴于此,本申请提出了一种结合区块链和联合学习的方法,可以通过状态通道发送向模型需求方发送设备参与联合学习的训练结果,即可以在应用服务器节点与参与联合学习的设备之间分别建立状态通道,从而不需要将设备参与联合学习进行本地训练后得到的训练结果在区块链网络的多个节点处实现共享,能够满足了联合学习与区块链技术相结合的高TPS的要求。In view of this, this application proposes a method that combines blockchain and joint learning. The training result of the device participating in the joint learning can be sent to the model requester through the state channel, that is, the application server node can be connected with the device participating in the joint learning State channels are established between them, so there is no need to share the training results obtained after the device participates in joint learning for local training at multiple nodes in the blockchain network, which can meet the high requirements of combining joint learning and blockchain technology. TPS requirements.
在本申请中,设备可以是终端设备,例如,可以是用户设备、移动设备、用户终端、终端、无线通信设备或用户装置。终端设备还可以是蜂窝电话、无绳电话、会话启动协议(session initiation protocol,SIP)电话、无线本地环路(wireless local loop,WLL)站、个人数字助理(personal digital assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备,未来5G网络中的 终端设备或者未来演进的公用陆地移动通信网络(public land mobile network,PLMN)中的终端设备等,本申请实施例对此并不限定。In this application, the device may be a terminal device, for example, it may be a user equipment, a mobile device, a user terminal, a terminal, a wireless communication device, or a user device. The terminal device can 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), and a wireless communication Functional handheld devices, computing devices, or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, terminal devices in the future 5G network or future evolution of the public land mobile network (PLMN) Terminal equipment, etc., this embodiment of the present application does not limit this.
下面结合图2对本申请实施例提供的结合区块链和联合学习的方法200进行介绍,图2示出了本申请实施例提供的结合区块链和联合学习的方法200的示意性流程图,该方法包括步骤210至步骤230。The following describes the method 200 for combining blockchain and joint learning provided by an embodiment of the present application with reference to FIG. 2. FIG. 2 shows a schematic flowchart of the method 200 for combining blockchain and joint learning provided by an embodiment of the present application. The method includes step 210 to step 230.
步骤210、设备接收应用服务器节点发送的初始模型参数,所述初始模型参数为参与联合学习的设备用于建立初始模型的参数。Step 210: The device receives an initial model parameter sent by the application server node, where the initial model parameter is a parameter used by the device participating in the joint learning to establish an initial model.
需要说明的是,初始模型可以是机器学习模型或者还可以是计算机算法模型,例如,初始模型可以是机器学习中采用的神经网络模型,当初始模型是神经网络模型时,初始参数可以是用于建立神经网络模型的权重值。当初始模型是计算机算法模型时,初始参数可以是建立算法模型所需的参数。上述为举例说明,不对本申请作出任何限定。It should be noted 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 used for Establish the weight value of the neural network model. When the initial model is a computer algorithm model, the initial parameters may be the parameters required to establish the algorithm model. The above are examples and do not limit this application.
应理解,在本申请中,应用服务器节点可以是如图1所示的模型需求方,例如,应用服务器节点可以是服务器,用于提供计算服务的设备。或者,应用服务器节点还可以是应用服务器节点中的应用程序APP。It should be understood that, in this application, the application server node may be a model demander as shown in FIG. 1, for example, the application server node may be a server, a device used to provide computing services. Alternatively, the application server node may also be an application program APP in the application server node.
应理解,在本申请的实施例中,设备和应用服务器节点可以是轻节点,即拥有和自己相关的交易数据的节点。对于区块链网络而言,若是将全节点即拥有全网所有的交易数据的节点看作是区块链网络中的节点,则设备和应用服务器节点不属于区块链网络;若将全节点和轻节点均看作是区块链网络中的节点,则设备和应用服务器节点属于区块链网络。It should be understood that, in the embodiments of the present application, the device and application server nodes may 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, the equipment and application server nodes do not belong to the blockchain network; if the full node is Both and light nodes are regarded as nodes in the blockchain network, and the equipment and application server nodes belong to the blockchain network.
步骤220、设备训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果。Step 220: The device trains the initial model parameters, and generates a training result for updating the initial model parameters.
其中,训练结果可以是设备根据隐私数据进行学习来改进初始模型,然后将初始模型的变化部分进行压缩后生成的数据信息。Among them, the training result may be data information generated by the device learning according to the private data to improve the initial model, and then compressing the changed part of the initial model.
例如,当初始模型为神经网络模型时,训练结果可以是神经网络权重值的改变部分,即假设初始参数为神经网络模型的权重值W1,参与联合学习的设备可以在本地对神经网络进行训练,训练得到的神经网络模型的权重值为W2,则训练结果可以是W1与W2之间存在的差异部分。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 equipment participating in the joint learning can train the neural network locally. The weight value of the neural network model obtained by training is W2, and the training result may be the difference between W1 and W2.
在一个示例中,参与联合学习的设备可以获取联合学习智能合约,联合学习智能合约中可以包括所述初始模型参数的训练逻辑指令;设备可以根据获取的联合学习智能合约训练所述初始模型参数,生成训练结果。其中,联合学习智能合约的结构设计可以如表1所示。In one example, the device participating in the joint learning can obtain the joint learning smart contract, and the joint learning smart contract may include the training logic instructions of the initial model parameters; the device may train the initial model parameters according to the obtained joint learning smart contract, Generate training results. Among them, the structure design of the joint learning smart contract can be shown in Table 1.
表1Table 1
联合智能合约结构Joint smart contract structure |
1、对用户数据的需求,数据处理流程1. Demand for user data, data processing flow |
2、模型架构(DNN超参)2. Model architecture (DNN super parameter) |
3、模型训练逻辑3. Model training logic |
4、设备返回内容4. Device return content |
5、单次训练费用5. Single training cost |
如表1所示,联合学习智能合约中可以包括进行联合学习所需的数据信息、参与联合学习的设备向应用服务器节点反馈的训练结果的内容需求以及参与联合学习的设备反馈训练结果相应的费用信息。As shown in Table 1, the joint learning smart contract can include the data information required for joint learning, the content requirements of the training results fed back to the application server node by the equipment participating in the joint learning, and the corresponding cost of the equipment participating in the joint learning feedback training result. information.
应理解,初始模型可以是机器学习模型,比如初始模型可以是机器学习中采用的神经网络模型,当初始模型是神经网络模型时,初始参数可以是用于建立神经网络模型的权重值,智能合约中包括的初始模型的训练逻辑指令可以是执行一次梯度下降算法。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 the weight values used to establish the neural network model. Smart contract The training logic instruction of the initial model included in the DLL may be to execute a gradient descent algorithm.
应理解,初始模型可以是计算机算法模型,例如,当初始模型是计算机算法模型时,初始参数可以是建立算法模型所需的参数,智能合约中包括的初始模型的训练逻辑指令可以是计算机进行一次模型计算所需的算法。上述为举例说明,不对本申请做出任何限定。在本申请的实施例中,联合学习智能合约可以是通过将链下智能合约部署于所述区块链网络的智能合约,其中,链下智能合约是指智能合约的执行环境不属于所述区块链网络的智能合约。It should be understood that the initial model may be a computer algorithm model. For example, when the initial model is a computer algorithm model, the initial parameters may be the parameters required to establish the algorithm model, and the training logic instructions for the initial model included in the smart contract may be performed by the computer once. Algorithm required for model calculation. The above are examples and do not limit the application. In the embodiment of this application, the joint learning smart contract may be a smart contract deployed by the off-chain smart contract on the blockchain network, where the off-chain smart contract means that the execution environment of the smart contract does not belong to the zone. The smart contract of the blockchain network.
例如,应用服务器节点可以获取对链下智能合约的结构进行重新设计后的智能合约,该重新设计的链下智能合约可以满足联合学习的需求,即可以将智能合约作为联合学习程序的载体,例如,联合学习可以是封装在智能合约中的一段代码,则该重新设计后的链下智能合约可以看作是联合学习智能合约。应用服务器节点可以向区块链网络发送一个交易(例如,第三交易),该交易可以用于将链下智能合约部署于所述区块链网络。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 the carrier of the joint learning program, such as , Joint learning can be a piece of code encapsulated in a smart contract, and the redesigned off-chain smart contract can be regarded as a joint learning smart contract. The application server node may send a transaction (for example, a third transaction) to the blockchain network, and the transaction may be used to deploy an off-chain smart contract on the blockchain network.
进一步地,应用服务器节点还可以将联合学习智能合约的地址发布出来,用于接受第三方机构审核其中联合学习程序,从而确保联合学习程序可信。应理解,联合智能合约的地址可以是联合智能合约的哈希值,第三方机构可以根据联合智能合约的哈希值在区块链网络中查找到联合学习智能合约。应用服务器节点的发布出来的信息可以如表2所示。Further, the application server node can also publish the address of the joint learning smart contract to accept the third-party organization to review the joint learning program, thereby ensuring the credibility of the joint learning program. It should be understood that the address of the joint smart contract may be the hash value of the joint smart contract, and the third-party organization may 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.
表2Table 2
交易标识(Transaction ID)Transaction ID (Transaction ID) |
From:应用服务器节点地址(需求方Address)From: Application server node address (demand-side Address) |
哈希字符串(Hash String):联合学习程序编码的Hash值Hash String: The hash value encoded by the joint learning program |
数据(Data):联合学习智能合约程序Data: Joint learning of smart contract procedures |
在一个示例中,参与联合学习的设备可以通过区块链网络获取联合学习智能合约,其中,联合学习智能合约为应用服务器节点通过将链下智能合约部署于所述区块链网络的智能合约。In one example, the devices participating in the joint learning can obtain the joint learning smart contract through the blockchain network, where the joint learning smart contract is a smart contract that the application server node deploys the off-chain smart contract on the blockchain network.
例如,参与联合学习的设备可以安装联合学习应用程序,应用服务器节点将可以向联合学习智能合约的地址发布至联合学习应用程序中,参与联合学习的设备可以在联合学习应用程序中下载联合学习智能合约。For example, the devices participating in the joint learning can install the joint learning application, the application server node will publish the address of the joint learning smart contract to the joint learning application, and the devices participating in the joint learning can download the joint learning intelligence in the joint learning application contract.
应理解,部署于区块链网络的联合学习智能合约,其在区块链网络的各个节点中是共享的,因此,在一定程度上可以避免联合学习智能合约被恶意的篡改,确保联合智能合约的可信度。It should be understood that the joint learning smart contract deployed on the blockchain network is shared among all nodes of the blockchain network. Therefore, to a certain extent, the joint learning smart contract can be prevented from being maliciously tampered with, and the joint smart contract can be ensured Credibility.
在一个示例中,参与联合学习的设备也可以从应用服务器节点处获取联合学习智能合约。本申请对在确保联合学习智能合约真实可信情况下,对设备获取的联合学习智能合约的具体来源不作任何限定。In an example, the device participating in the joint learning may also obtain the joint learning smart contract from the application server node. This application does not make any restrictions on the specific source of the joint learning smart contract acquired by the device while ensuring the authenticity of the joint learning smart contract.
在本申请的实施例中,设备获取联合学习智能合约后,可以向应用服务器节点发送第一消息,第一消息用于指示设备参与联合学习,即设备可以通过向应用服务器节点发送第一消息表明参与联合学习,其中,第一消息中还包括设备的数字货币钱包地址,在设备向应用服务器发送联合学习的本地训练结果后,应用服务器节点可以根据设备的数字货币钱 包地址支付数字货币。In the embodiment of this application, after the device obtains the joint 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 joint learning, that is, the device can indicate by sending the first message to the application server node Participate in joint learning, where the first message also includes the digital currency wallet address of the device. After the device sends the local training result of the joint learning to the application server, the application server node can pay digital currency according to the digital currency wallet address of the device.
应理解,数字货币钱包地址可以用于标识参与联合学习的设备。当多个设备参与联合学习时,应用服务器节点根据多个设备的数字货币钱包地址区分不同的设备,从而在接收到多个设备发送的联合学习的训练结果后,分别向多个设备支付数字货币。It should be understood that the digital currency wallet address can be used to identify devices participating in joint learning. When multiple devices participate in joint learning, the application server node distinguishes different devices according to the digital currency wallet addresses of multiple devices, so that after receiving the training results of joint learning sent by multiple devices, they pay digital currency to multiple devices respectively .
在一个示例中,应用服务器节点在接收到设备的数字货币钱包地址后,可以发布一个交易(例如,第二交易)到区块链网路,部署离链通道合约,建立应用服务器节点与设备之间的离链通道,其中,离链通道位于区块链网络之外。In one example, after receiving the digital currency wallet address of the device, the application server node can publish a transaction (for example, the second transaction) to the blockchain network, deploy an off-chain channel contract, and establish a connection between the application server node and the device The off-chain channel in between, where the off-chain channel is located outside the blockchain network.
进一步地,区块链网络向应用服务器发送状态通道的地址信息,状态通道的地址信息用于标识所述状态通道。Further, the blockchain network sends the 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.
需要说明的是,通道地址信息可以是索引值,根据索引值可以使应用服务器节点查找到建立的状态通道。例如,通道地址信息可以是状态通道的哈希值。It should be noted that the channel address information may be an index value, and the application server node can find the established state channel according to the index value. For example, the channel address information may be the hash value of the state channel.
应理解,状态通道(State Channel)是一种用于执行交易和其他状态更新的“链下(off-chain)”技术,即状态通道可以是指区块链网络的链下通道,通过链下通道发送的数据或者信息不需要在区块链各个节点进行共享,链下通道可以是两个节点之间建立的离链通道。例如,状态通道可以是单向链下支付通道,比如,应用服务器节点和设备之间可以建立单向链下支付通道,单向链下支付通道用于应用服务器节点在接收到设备发送的参与联合学习的训练结果后向设备支付数字货币。It should be understood that the State Channel is an "off-chain" technology used to execute 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 by the channel does not need to be shared among the nodes of the blockchain, and 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 the application server node and the device, and the one-way off-chain payment channel is used for the application server node to participate in the alliance after receiving the device sent After learning the training results, the digital currency is paid to the device.
例如,状态通道可以是双向链下通道,比如,应用服务器节点和设备之间建立的双向链下通道,设备可以通过双向链下通道向应用服务器节点参与联合学习的本地训练结果,应用服务器节点可以在接收到设备发送的训练结果后向设备支付数字货币。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 participate in the local training results of joint learning from the application server node through the two-way off-chain channel, and the application server node can After receiving the training result sent by the device, the digital currency is paid to the device.
在本申请的实施例中,设备基于片上系统(system on chip,SoC)的硬件,可以提供三层硬件安全体系,包括富运行环境(rich execution environment,REE)、可信运行环境(trusted execution environment,TEE)与安全运行环境(secure execution environment,SEE),其中,REE运行安全不敏感的程序保存安全不敏感数据,TEE运行安全敏感程序和保存安全敏感数据,SEE运行金融支付高安全程序和保存金融支付高安全数据。In the 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 rich execution environment (REE) and trusted execution environment (REE) , TEE) and secure execution environment (secure execution environment, SEE). Among them, REE runs security-insensitive programs to save security-insensitive data, TEE runs security-sensitive programs and saves security-sensitive data, and SEE runs financial payment high-security programs and saves High security data for financial payment.
作为示例而非限定,该SoC可以提供Trustzone、Bowmore、eSE、或inSE等至少一个运行环境,可以将Trustzone、或Bowmore运行环境称为TEE,将eSE、或inSE运行环境称为SEE。As an example and not limitation, the SoC may provide at least one operating environment such as Trustzone, Bowmore, eSE, or inSE. The operating environment of Trustzone or Bowmore may be referred to as TEE, and the operating environment of eSE or inSE may be referred to as SEE.
例如,当设备为智能手机时,可以通过在智能手机中配置SoC,该智能手机通过该SoC提供Trustzone、Bowmore、eSE、和inSE等运行环境。For example, when the device is a smart phone, an SoC can be configured in the smart phone, and the smart phone provides operating environments such as Trustzone, Bowmore, eSE, and inSE through the SoC.
作为示例而非限定,上述SoC可以支持运行基于精简指令集机器(advanced risc machine,ARM)架构的指令集,将支持运行基于ARM架构的指令集的SoC称为基于ARM的SoC。例如,设备上可以配置基于ARM的SoC,从而为设备提供三层硬件安全体系。As an example and not a limitation, the foregoing SoC may support running an instruction set based on an advanced RISC machine (ARM) architecture, and an SoC that supports running an instruction set based on the ARM architecture is called an ARM-based SoC. For example, an ARM-based SoC can be configured on the device to provide a three-layer hardware security system for the device.
在一个示例中,在可信执行环境TEE下,运行所述联合学习智能合约以训练所述初始模型参数。In one example, the joint learning smart contract is run under the trusted execution environment TEE to train the initial model parameters.
例如,设备可以在可信执行环境TEE下,在联合学习应用程序中运行联合学习智能合约,以训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果。For example, the device may run a joint learning smart contract in a joint learning application under a trusted execution environment TEE to train the initial model parameters and generate training results for updating the initial model parameters.
步骤230、通过状态通道向应用服务器节点发送训练结果,该状态通道是指设备与应用服务器节点之间的离链通道,所述离链通道位于区块链网络之外。Step 230: Send the training result to the application server node through a state channel. 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.
例如,状态通道可以是单向链下支付通道,比如,应用服务器节点和设备之间可以建立单向链下支付通道,单向链下支付通道用于应用服务器节点在接收到设备发送的参与联合学习的训练结果后向设备支付数字货币。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, and the one-way off-chain payment channel is used for the application server node to participate in the alliance after receiving the device sent After learning the training results, the digital currency is paid to the device.
应理解,在本申请的实施例中,数字货币是指依靠校验和密码技术来创建、发行和流通的电子货币。其特点是运用P2P对等网络技术来发行、管理和流通货币。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 checksum encryption technology. Its characteristic is to use P2P peer-to-peer network technology to issue, manage and circulate currency.
例如,状态通道可以是双向链下通道,比如,应用服务器节点和联合学习设备的设备之间建立的双向链下通道,设备可以通过双向链下通道向设备发送参与联合学习的本地训练结果,应用服务器节点可以在接收到设备发送的训练结果后向设备支付数字货币。For example, the state channel can be a two-way off-chain channel. For example, the two-way off-chain channel established between the application server node and the device of the joint learning device. The device can send the local training results of the joint learning to the device through the two-way off-chain channel. The server node can pay digital currency to the device after receiving the training result sent by the device.
应用服务器节点可以根据接收到的设备发送的训练结果对初始模型参数进行调整。其中,设备可以是指参与联合学习的一个或者多个设备。The application server node can adjust the initial model parameters according to the received training result sent by the device. Among them, the device may refer to one or more devices participating in the joint learning.
在本申请的实施例中,当设备通过状态通道向应用服务器节点发送所述训练结果之后,应用服务器节点可以根据获取的设备的数字货币钱包地址向设备支付数字货币。In the 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 the device with digital currency according to the acquired digital currency wallet address of the device.
例如,应用服务器节点可以通过状态通道(例如,链下支付通道)向设备发送一个交易,其中,此时通道中的总数字货币可以为S(A+B=S),应用服务器节点的数字货币为A,设备的数字货币为B,单次训练的费用为t,则经过本次交易,应用服务器节点的数字货币为A-t,设备的数字货币为B+t。在本次交易中,附带应用服务器节点的签名。当设备对本次交易签名后,便可以向区块链网络发送交易。For example, an application server node can send a transaction to the device through a state channel (for example, an off-chain payment channel), where the total digital currency in the channel at this time 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 the transaction, it can send the transaction to the blockchain network.
在一个示例中,为了确保支付数字货币的环境安全可信,设备可以在可信执行环境TEE下,接收应用服务器节点通过状态通道支付的数字货币。In one example, in order to ensure the security and credibility of the payment environment for digital currency, the device may receive the digital currency paid by the application server node through the state channel under the trusted execution environment TEE.
在本申请的实施例中,设备确定联合学习的训练任务结束;设备可以向所述区块链网络发送一个交易(例如,第一交易),第一交易可以用于指示关闭所述状态通道。In the embodiment of the present application, the device determines that the training task of joint learning ends; the device may send a transaction (for example, the first transaction) to the blockchain network, and the first transaction may be used to instruct to close the state channel.
应理解,设备可以收到应用服务器节点发送的诸多交易,因此,设备的在状态通道中的数字货币是不断递增的,只需维护最新的交易。当设备决定关闭状态通道时,可以针对最新的交易做签名,发送给区块链网络,取出属于设备的数字货币。It should be understood that the device can receive many transactions sent by the application server node. Therefore, the digital currency of the device in the state channel is continuously increasing, and only the latest transactions need 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.
在本申请的实施例中,设备参与联合学习进行本地训练后生成的训练参数可以通过状态通道向应用服务器节点进行反馈,通过采用状态通道发送训练结果可以满足联合学习与区块链结合场景中高TPS的需求,同时,设备的训练结果也具有一定的隐私性,训练结果通过状态通道进行发送可以避免在区块链网络中各个节点的共享,可以保护设备数据的隐私性。In the embodiment of the present application, the training parameters generated after the device participates in the joint learning for local training can be fed back to the application server node through the state channel, and the training result can be sent to the application server node through the state channel to meet the high TPS in the joint learning and blockchain combination scenario 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 the sharing of each node in the blockchain network and protect the privacy of the device data.
下面结合图3,对本申请实施例中的联合学习方法的具体流程进行说明。The following describes the specific process of the joint learning method in the embodiment of the present application with reference to FIG. 3.
图3为本申请实施例提供的联合学习方法的流程示意图。图3所示的方法包括步骤301至步骤314,下面分别对步骤301至步骤314进行详细描述。FIG. 3 is a schematic flowchart of a joint learning method provided by an embodiment of the application. The method shown in FIG. 3 includes steps 301 to 314, and steps 301 to 314 are respectively described in detail below.
应理解,在图3中模型需求方可以是图2所示的应用服务器节点,或者,还可以是应用服务器节点中的应用程序APP。设备可以是终端设备,例如,可以是用户设备、移动设备、用户终端、终端、无线通信设备或用户装置等。上述为举例说明,不对本申请作出任何限定。It should be understood that the model requester in FIG. 3 may be the application server node shown in FIG. 2, or may also be the application APP in the application server node. The device may be a terminal device, for example, it may be a user equipment, a mobile device, a user terminal, a terminal, a wireless communication device, or a user device. The above are examples and do not limit this application.
步骤301、设备在本地安装联合学习APP。Step 301: The device installs a joint learning APP locally.
其中,联合学习APP可以为每个不同的联合学习智能合约收集不同的个人隐私数据。做数据预处理。同时,会接收模型需求方的提供的初始化模型数据w。Among them, the joint learning APP can collect different personal privacy data for each different joint learning smart contract. Do data preprocessing. At the same time, the initialization model data w provided by the model requester will be received.
在一个示例中,如图4所示,可以基于ARM的SoC为设备提供三层硬件安全体系。联合学习App可以在TEE可信环境中,确保数据处理过程的安全。设备安装可靠的联合学习App后,可以同时装载多个联合学习智能合约,满足多个模型需求方的需求。In an example, as shown in Figure 4, an ARM-based SoC can provide a three-layer hardware security system for the device. The joint learning App can ensure the safety of the data processing process in the TEE trusted environment. After a reliable joint learning App is installed on the device, multiple joint learning smart contracts can be loaded at the same time to meet the needs of multiple model demanders.
例如,联合学习APP收集到的不同的个人隐私数据可以存储于本地个人隐私数据的数据库。其中,个人隐私数据保存在TEE可信环境中,一方面可以保护个人隐私数据的安全,不被其他恶意软件盗取;另一方面,可以确保为使用设备的用户提供的个人隐私数据是可信的,对于模型需求方是真正有价值的。For example, different personal privacy data collected by the United Learning APP can be stored in a local personal privacy data database. Among them, personal privacy data is stored in the trusted environment of TEE, which can protect the security of personal privacy data from other malicious software; on the other hand, it can ensure that the personal privacy data provided to users who use the device are trusted Yes, it is really valuable to the demand side of the model.
步骤302、模型需求方部署链下智能合约到链上,接受审核,确保可信,可追踪。Step 302: The model requester deploys the off-chain smart contract to the chain, and accepts audit to ensure credibility and traceability.
例如,模型需求方通过交易,将链下智能合约部署在链上。同时,可以将链下智能合约的地址发布出来,例如,可以将链下智能合约的地址发布出来至联合学习APP。从而接受第三方机构审核联合学习程序,确保可信。For example, the model demander deploys off-chain smart contracts 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. Thereby accepting third-party institutions to review the joint learning program to ensure credibility.
应理解,链下智能合约的地址可以是指链下智能合约的哈希值,根据链下智能合约的地址可以查找到该链下智能合约。需要说明的是,与区块链中普通的智能合约不同,链下智能合约为智能合约的执行环境不在链上,而在链下手机端。可以将联合学习与区块链、链下智能合约相结合,可以保障联合学习程序的可信性。其中,链下智能合约的结构设计可以如表1所示。It should be understood that the address of the off-chain smart contract may 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 for smart contracts under the chain is not on the chain, but on the off-chain mobile phone. The joint learning can be combined with blockchain and off-chain smart contracts to ensure the credibility of the joint learning program. Among them, the structure design of the off-chain smart contract can be shown in Table 1.
步骤303、设备可以收到联合学习智能合约的程序的推荐,下载部署于区块链网络的链下智能合约程序。Step 303: The device may receive a recommendation of a program for joint learning of smart contracts, and download the off-chain smart contract program deployed on the blockchain network.
步骤304、设备向模型需求方发送数字货币钱包地址,并向模型需求方表明参与联合学习流程。Step 304: The device sends the digital currency wallet address to the model demander, and indicates to the model demander to participate in the joint learning process.
步骤305、模型需求方发布一个交易(例如,第二交易)到区块链网络,用于部署离链通道合约,建立与设备的状态通道(例如,链下支付通道)。Step 305: The model demander publishes a transaction (for example, a second transaction) to the blockchain network for deploying an off-chain channel contract and establishing a state channel with the device (for example, an off-chain payment channel).
其中,应用服务器节点与设备建立的状态通道可以是单向链下支付通道,用于模型需求方用于向设备支付数字货币;或者,可以是双向链下通道用于设备向模型需求方发生训练结果以及模型需求方向在接收到设备发送的训练结果后向设备支付数字货币。Among them, the state channel established by the application server node and the device can be a one-way off-chain payment channel for the model demander to pay digital currency to the device; or it can be a two-way off-chain channel for the device to train the model demander The result and the demand direction of the model pay digital currency to the device after receiving the training result sent by the device.
例如,模型需求方在单向链下支付通道中存了S。离链通道合约要求需要集合需求方的签名SigA,与用户的签名SigB的交易,才可关闭支付通道。此交易的总金额为S,输出到需求方的地址的金额为A,设备地址的金额为B,其中A+B=S。For example, the model demander deposits S in the one-way off-chain payment channel. The off-chain channel contract requires a transaction between the signature SigA of the demander and the signature SigB of the user 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 equipment address is B, where A+B=S.
步骤306、模型需求方接收区块链网络发送的通道地址信息,通道地址信息用于标识所述状态通道。Step 306: The model requester receives the channel address information sent by the blockchain network, and the channel address information is used to identify the state channel.
步骤307、模型需求方向设备发送通道地址信息。Step 307: The model request sends channel address information to the device.
需要说明的是,在步骤305中模型需求方向区块链网络发送交易,请求建立与设备之间的状态通道;当区块链网络接收到该交易后,部署了模型需求方与设备之间的状态通道,即位于区块链网络之外的离链通道,并将状态通道的地址信息发送至模型需求方。模型需求方接收到状态通道的地址信息后,将状态通道的地址信息发送至设备,用于设备能够识别建立的状态通道。It should be noted that in step 305, the model demand sends a transaction to the blockchain network, requesting the establishment of a state channel with the device; when the blockchain network receives the transaction, it deploys the model between the demander and the device The state channel is an off-chain channel located 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 for the device to identify the established state channel.
步骤308、模型需求方向设备发送初始模型参数。Step 308: The model requester sends initial model parameters to the device.
例如,模型需求方向设备发送本次联合学习的初始模型参数,初始参数可以是神经网络的权重w的值。For example, the model request sends the initial model parameters of this joint learning to the device, and the initial parameters may be the value of the weight w of the neural network.
步骤309、设备执行智能合约,在本地做单步的训练,其中,本地单步的训练可以是随机梯度下降优化算法,从而更新参数w值。Step 309: The device executes the smart contract and performs single-step training locally, where the local single-step training may be a stochastic gradient descent optimization algorithm, thereby updating the value of the parameter w.
在一个示例中,如图4所示,联合学习链下智能合约的执行环境是在虚拟机(virtual machine,VM)中的。联合学习App针对某一个联合学习合约,使用设备的用户数据与初始的模型参数,可以在链下智能合约VM中运行。链下智能合约的执行环境,不仅仅可以支持联合学习程序,同样也支持其它的链下智能合约程序。In an example, as shown in Figure 4, the execution environment of the smart contract under the joint learning chain is in a virtual machine (VM). The joint learning App uses the user data of the device and the initial model parameters for a certain joint learning contract to run in the off-chain smart contract VM. The execution environment of the off-chain smart contract can not only support the joint learning program, but also other off-chain smart contract programs.
步骤310、模型需求方接收到设备发送的训练结果。Step 310: The model requester receives the training result sent by the device.
例如,可以是设备通过与模型需求方建立的链下通道向模型需求方反馈训练结果。For example, it may be that the device feeds back the training result to the model consumer through an off-chain channel established with the model consumer.
步骤311、模型需求方通过状态通道(例如,链下支付通道)向设备支付数字货币。Step 311: The model demander pays digital currency to the device through a state channel (for example, an off-chain payment channel).
例如,通过状态通道,模型需求方给发一个交易给设备,如此时通道中的总资产为S,其中需求方有A,设备有B,此单次训练的费用为t。则此交易的输出中,模型需求方的数字货币为A-t,设备的数字货币为B+t,其中A+B=S。在此交易中,附带模型需求方的签名。当设备再对此交易签名后,便可向区块链网络发送交易,关闭通道,取出属于设备的数字货币。For example, through the state channel, the model demander sends a transaction to the device. In this case, the total asset in the channel is S, where the demander has A and the device has B. The cost of this single training is t. Then in the output of this transaction, the digital currency of the model demander is A-t, and the digital currency of the device is B+t, where A+B=S. In this transaction, the signature of the demander of the model is attached. After the device signs the transaction again, it can send the transaction to the blockchain network, close the channel, and withdraw the digital currency belonging to the device.
在一个示例中,状态通道可以运行在TEE环境中,设备在接收模型需求方的数字货币与向模型需求方发送模型数据更新,都可以在安全环境。而花费数字货币,则需要在SEE环境中使用数字货币钱包中的私钥做签名。In one example, the state channel can run in a TEE environment, and the device can be in a safe environment when receiving digital currency from the model demander and sending model data updates to the model demander. To spend digital currency, you need to use the private key in the digital currency wallet to sign in the SEE environment.
步骤312、模型需求方收到参与联合学习的设备的反馈的训练结果进行做平均处理,得到最新模型参数,返回到步骤306,再下发至参与联合学习的设备。Step 312: The model requester receives the feedback training results of the equipment participating in the joint learning and performs averaging processing to obtain the latest model parameters, returning to step 306, and then delivering to the equipment participating in the joint learning.
步骤313、设备可以随时查看属于设备的链上数字货币与链下数字货币。Step 313: The device can view the on-chain digital currency and off-chain digital currency belonging to the device at any time.
设备可以收到模型需求方发送的诸多交易,因此,设备的在状态通道中的数字货币是递增的,只需维护最新的交易。The device can receive many transactions sent by the demand side of the model. Therefore, the digital currency of the device in the state channel is increasing, and only the latest transactions need to be maintained.
步骤314、当联合学习结束设备决定关闭通道时,便针对最新的交易做签名,发送给区块链网络,取出属于设备的数字货币。Step 314: When the joint learning end 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.
应注意,图3的例子仅仅是为了帮助本领域技术人员理解本申请实施例,而非要将本申请实施例限于所例示的具体场景。本领域技术人员根据所给出的图3的例子,显然可以进行各种等价的修改或变化,这样的修改或变化也落入本申请实施例的范围内。It should be noted that the example in FIG. 3 is only to help those skilled in the art understand the embodiments of the present application, and is not intended to limit the embodiments of the present application to the specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the example of FIG. 3 given, and such modifications or changes also fall within the scope of the embodiments of the present application.
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, rather than corresponding to the embodiments of the present application. The implementation process constitutes any limitation.
上文详细描述了根据本申请实施例的联合学习方法,在本申请的实施例中,参与联合学习的设备参进行本地训练后生成的训练参数可以通过状态通道向应用服务器节点进行反馈,通过采用状态通道发送训练结果可以满足联合学习与区块链结合场景中高TPS的需求,同时,设备的训练结果也具有一定的隐私性,训练结果通过状态通道进行发送可以避免在区块链网络中各个节点的共享,可以保护设备数据的隐私性。应理解,本申请实施例的联合学习设备可以执行前述本申请实施例的各种方法,即以下各种产品的具体工作过程,可以参考前述方法实施例中的对应过程。The above describes the joint learning method according to the embodiment of the application in detail. In the embodiment of the application, the training parameters generated after the device participating in the joint learning participates in the local training can be fed back to the application server node through the state channel. The state channel sending training results can meet the requirements of high TPS in the combined learning and block chain scenario. At the same time, the training results of the device also have a certain degree of privacy. The training results can be sent through the state channel to avoid each node in the blockchain network. Sharing can protect the privacy of device data. It should be understood that the joint learning device of the embodiment of the present application can execute the various methods of the foregoing embodiment of the present application, that is, for the specific working processes of the following various products, refer to the corresponding process in the foregoing method embodiment.
图5是本申请实施例提供的联合学习设备500的示意性框图。应理解,联合学习设备500能够执行图2或图3的方法中设备执行的各个步骤,为了避免重复,此处不再详述。 联合学习设备500包括:接收单元510、处理单元520和发送单元530。FIG. 5 is a schematic block diagram of a joint learning device 500 provided by an embodiment of the present application. It should be understood that the joint learning device 500 can execute each step performed by the device in the method of FIG. 2 or FIG. 3, and in order to avoid repetition, it will not be described in detail here. The joint learning device 500 includes: a receiving unit 510, a processing unit 520, and a sending unit 530.
其中,接收单元510,用于接收应用服务器节点发送的初始模型参数,所述初始模型参数为参与联合学习的设备用于建立初始模型的参数;处理单元520,用于训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果;发送单元530,用于通过状态通道向应用服务器节点发送所述训练结果,所述状态通道为所述设备与所述应用服务器节点之间离链通道,所述离链通道位于区块链网络之外。Wherein, the receiving unit 510 is configured to receive the initial model parameters sent by the application server node, where the initial model parameters are parameters used by the equipment participating in the joint learning to establish the initial model; the processing unit 520 is configured to train the initial model parameters, Generate training results for updating the initial model parameters; sending unit 530, configured to send the training results to the application server node through a state channel, where the state channel is an off-chain connection between the device and the application server node Channel, the off-chain channel is located outside the blockchain network.
可选地,作为一个实施例,所述接收单元510还用于:接收所述应用服务器节点发送的通道地址信息,所述通道地址信息用于标识所述状态通道。Optionally, as an embodiment, the receiving unit 510 is further configured to: receive channel address information sent by the application server node, where the channel address information is used to identify the state channel.
可选地,作为一个实施例,所述接收单元510还用于:获取联合学习智能合约,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令;处理单元520具体用于:运行所述联合学习智能合约以训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果。Optionally, as an embodiment, the receiving unit 510 is further configured to: obtain a joint learning smart contract, where the joint learning smart contract includes training logic instructions for the initial model parameters; the processing unit 520 is specifically configured to: run The joint learning smart contract is used to train the initial model parameters, and generate training results for updating the initial model parameters.
可选地,作为一个实施例,所述接收单元510具体还用于:通过区块链网络获取所述联合学习智能合约,其中,所述联合学习智能合约为链下智能合约部,所述链下智能合约的执行环境不属于所述区块链网络的智能合约。Optionally, as an embodiment, the receiving unit 510 is specifically further configured to: obtain the joint learning smart contract through a blockchain network, where the joint learning smart contract is an off-chain smart contract department, and the chain The execution environment of the next smart contract does not belong to the smart contract of the blockchain network.
可选地,作为一个实施例,所述处理单元520具体用于:在联合学习应用程序中运行所述联合学习智能合约以训练所述初始模型参数。Optionally, as an embodiment, the processing unit 520 is specifically configured to: run the joint learning smart contract in a joint learning application to train the initial model parameters.
可选地,作为一个实施例,所述处理单元520具体用于:在可信执行环境TEE下,运行所述联合学习智能合约以训练所述初始模型参数。Optionally, as an embodiment, the processing unit 520 is specifically configured to: in a trusted execution environment TEE, run the joint learning smart contract to train the initial model parameters.
可选地,作为一个实施例,所述接收单元510具体用于:接收所述应用服务器节点通过所述状态通道支付的数字货币。Optionally, as an embodiment, the receiving unit 510 is specifically configured to: receive the digital currency paid by the application server node through the state channel.
可选地,作为一个实施例,所述接收单元510具体用于:在可信执行环境TEE下,接收所述应用服务器节点通过所述状态通道支付的数字货币。Optionally, as an embodiment, the receiving unit 510 is specifically configured to: in a trusted execution environment TEE, receive the digital currency paid by the application server node through the state channel.
可选地,作为一个实施例,所述发送单元530还用于:向所述应用服务器节点发送第一消息,所述第一消息用于指示所述设备参与联合学习,所述第一消息中包括所述设备的数字货币钱包地址。Optionally, as an embodiment, the sending unit 530 is further configured to send a first message to the application server node, where the first message is used to instruct the device to participate in joint learning, and the first message is Including the digital currency wallet address of the device.
可选地,作为一个实施例,所述处理单元520还用于:确定联合学习的训练任务结束;所述发送单元530还用于:向所述区块链网络发送第一交易,所述第一交易用于指示关闭所述状态通道。Optionally, as an embodiment, the processing unit 520 is further configured to: determine the end of the training task of joint learning; the sending unit 530 is further configured to: send the first transaction to the blockchain network, and the first transaction A transaction is used to instruct to close the state channel.
应理解,这里的联合学习设备500以功能单元的形式体现。这里的术语“单元”可以通过软件和/或硬件形式实现,对此不作具体限定。例如,“单元”可以是实现上述功能的软件程序、硬件电路或二者结合。所述硬件电路可能包括应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。因此,在本申请的实施例中描述的各示例的单元,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It should be understood that the joint learning device 500 here is embodied in the form of a functional unit. The term "unit" herein can be implemented in the form of software and/or hardware, which is not specifically limited. For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that realize the above-mentioned functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor for executing one or more software or firmware programs (such as a shared processor, a dedicated processor, or a group processor). Etc.) and memory, merged logic circuits and/or other suitable components that support the described functions. Therefore, the units of the examples described in the embodiments of the present application can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
图6是本申请实施例提供的联合学习设备600的示意性框图。应理解,联合学习设备 600可以是应用服务器节点,能够执行图2或图3的方法中应用服务器节点执行的各个步骤,为了避免重复,此处不再详述。联合学习设备600包括:发送单元610和接收单元620。FIG. 6 is a schematic block diagram of a joint learning device 600 provided by an embodiment of the present application. It should be understood that the joint learning device 600 may be an application server node, which can execute each step performed by the application server node in the method of FIG. 2 or FIG. 3, and in order to avoid repetition, it will not be detailed here. The joint learning device 600 includes a sending unit 610 and a receiving unit 620.
其中,所述发送单元610,用于向设备发送初始模型参数,所述初始模型参数为所述设备用于建立参与联合学习的初始模型的参数;所述接收单元620,用于通过状态通道接收用于更新所述初始模型参数的训练结果,其中,所述状态通道为所述设备与所述应用服务器节点之间的离链通道,所述离链通道位于区块链网络之外。Wherein, the sending unit 610 is configured to send initial model parameters to the device, and the initial model parameters are parameters used by the device to establish an initial model participating in joint learning; the receiving unit 620 is configured to receive through a state channel The training result used to update the initial model parameters, 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.
应理解,应用服务器节点600还可以包括处理单元,处理单元可以用于控制接收单元620和发送单元610执行相关步骤。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.
可选地,作为一个实施例,所述接收单元620还用于:接收所述区块链网络发送的通道地址信息,所述通道地址信息用于标识所述状态通道;所述发送单元610,还用于向所述设备发送所述通道地址信息。Optionally, as an embodiment, the receiving unit 620 is further configured to: receive channel address information sent by the blockchain network, where the channel address information is used to identify the status channel; the sending unit 610, It is also used to send the channel address information to the device.
可选地,作为一个实施例,所述发送单元610还用于:向区块链网络发送第二交易,所述第二交易用于部署所述状态通道。Optionally, as an embodiment, the sending unit 610 is further configured to send a second transaction to the blockchain network, where the second transaction is used to deploy the state channel.
可选地,作为一个实施例,所述发送单元610还用于:向区块链网络发送第三交易,所述第三交易用于将联合学习智能合约署于所述区块链网络,所述联合学习智能合约是链下智能合约,所述链下智能合约的执行环境不属于所述区块链网络,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令。Optionally, as an embodiment, the sending unit 610 is further configured to send a third transaction to the blockchain network, and the third transaction is used to sign the joint learning smart contract on the blockchain network, so 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.
可选地,作为一个实施例,所述发送单元610还用于:通过所述状态通道向所述设备支付数字货币。Optionally, as an embodiment, the sending unit 610 is further configured to: pay digital currency to the device through the state channel.
可选地,作为一个实施例,所述接收单元620还用于:接收所述设备发送的第一消息,所述第一消息用于指示所述设备参与联合学习,所述第一消息中包括所述设备的数字货币钱包地址。Optionally, as an embodiment, the receiving unit 620 is further configured to: receive a first message sent by the device, where the first message is used to instruct the device to participate in joint learning, and the first message includes The digital currency wallet address of the device.
应理解,这里的联合学习设备600以功能单元的形式体现。这里的术语“单元”可以通过软件和/或硬件形式实现,对此不作具体限定。例如,“单元”可以是实现上述功能的软件程序、硬件电路或二者结合。所述硬件电路可能包括应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。因此,在本申请的实施例中描述的各示例的单元,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It should be understood that the joint learning device 600 here is embodied in the form of a functional unit. The term "unit" herein can be implemented in the form of software and/or hardware, which is not specifically limited. For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that realize the above-mentioned functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor for executing one or more software or firmware programs (such as a shared processor, a dedicated processor, or a group processor). Etc.) and memory, merged logic circuits and/or other suitable components that support the described functions. Therefore, the units of the examples described in the embodiments of the present application can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
图7示出了本申请另一个实施例的联合学习设备700的示意性框图。该联合学习设备700可以是终端设备,如图7所示,该联合学习设备700包括处理器720、存储器760、通信接口740和总线750。其中,处理器720、存储器760、通信接口740通过总线750进行通信,也可以通过无线传输等其他手段实现通信。该存储器760用于存储指令,该处理器720用于执行该存储器760存储的指令。该存储器760存储程序代码711,且处理器720可以调用存储器760中存储的程序代码711执行图2或图3所示的联合学习方法。FIG. 7 shows a schematic block diagram of a joint learning device 700 according to another embodiment of the present application. The joint learning device 700 may be a terminal device. As shown in FIG. 7, the joint learning device 700 includes a processor 720, a memory 760, a communication interface 740, and a bus 750. Among them, the processor 720, the memory 760, and the communication interface 740 communicate through the bus 750, and may 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 instructions stored in the memory 760. The memory 760 stores program codes 711, and the processor 720 can call the program codes 711 stored in the memory 760 to execute the joint learning method shown in FIG. 2 or FIG. 3.
例如,处理器720可以用于执行上述图2中的220中训练模型参数,生成训练结果; 或者图3中的307执行智能合约,进行本地训练。For example, the processor 720 may be used to execute the training model parameters in 220 in FIG. 2 to generate training results; or 307 in FIG. 3 to execute a smart contract to perform local training.
该存储器760可以包括只读存储器和随机存取存储器,并向处理器720提供指令和数据。存储器760还可以包括非易失性随机存取存储器。该存储器760可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The memory 760 may include a read-only memory and a random access memory, and provides instructions and data to the processor 720. The memory 760 may also include a non-volatile random access memory. The memory 760 may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electronic Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), Double data rate synchronous dynamic random access memory (double data date SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (synchlink DRAM, SLDRAM) and direct Memory bus random access memory (direct rambus RAM, DR RAM).
该总线750除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图7中将各种总线都标为总线750。In addition to the data bus, the bus 750 may also include a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus 750 in FIG. 7.
应理解,图7所示的联合学习设备700能够实现图2以及图3所示方法实施例中设备执行的各个过程。联合学习设备700中的各个模块的操作和/或功能,分别为了实现上述方法实施例中设备的相应流程。具体可参见上述方法实施例中的描述,为避免重复,此处适当省略详细描述。It should be understood that the joint learning device 700 shown in FIG. 7 can implement various processes performed by the device in the method embodiments shown in FIG. 2 and FIG. 3. The operations and/or functions of the various modules in the joint learning device 700 are to implement the corresponding procedures of the devices in the foregoing method embodiments. For details, please refer to the descriptions in the foregoing method embodiments. To avoid repetition, detailed descriptions are appropriately omitted here.
图8示出了本申请另一个实施例的联合学习设备800的示意性框图。该联合学习设备800可以是应用服务器节点,如图8所示,该联合学习设备800包括处理器820、存储器860、通信接口840和总线850。其中,处理器820、存储器860、通信接口840通过总线850进行通信,也可以通过无线传输等其他手段实现通信。该存储器860用于存储指令,该处理器820用于执行该存储器860存储的指令。该存储器860存储程序代码811,且处理器820可以调用存储器860中存储的程序代码811执行图2或图3所示的联合学习方法。FIG. 8 shows a schematic block diagram of a joint learning device 800 according to another embodiment of the present application. The joint learning device 800 may be an application server node. As shown in FIG. 8, the joint learning device 800 includes a processor 820, a memory 860, a communication interface 840, and a bus 850. Among them, the processor 820, the memory 860, and the communication interface 840 communicate through the bus 850, and may 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 instructions stored in the memory 860. The memory 860 stores the program code 811, and the processor 820 can call the program code 811 stored in the memory 860 to execute the joint learning method shown in FIG. 2 or FIG. 3.
其中,如图8所示通信接口840可以与图6所示的终端设备中的接收单元620和发送单元610对应。Wherein, the communication interface 840 shown in FIG. 8 may correspond to the receiving unit 620 and the sending unit 610 in the terminal device shown in FIG. 6.
该存储器820可以包括只读存储器和随机存取存储器,并向处理器820提供指令和数据。存储器860还可以包括非易失性随机存取存储器。该存储器860可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型 同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The memory 820 may include a read-only memory and a random access memory, and provides instructions and data to the processor 820. The memory 860 may also include a non-volatile random access memory. The memory 860 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electronic Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), Double data rate synchronous dynamic random access memory (double data date SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (synchlink DRAM, SLDRAM) and direct Memory bus random access memory (direct rambus RAM, DR RAM).
该总线850除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图8中将各种总线都标为总线850。In addition to the data bus, the bus 850 may also include a power bus, a control bus, and a status signal bus. However, for clear description, various buses are marked as bus 850 in FIG. 8.
应理解,图8所示的联合学习设备800能够实现图2以及图3所示方法实施例中应用服务器节点执行的各个过程。联合学习设备800中的各个模块的操作和/或功能,分别为了实现上述方法实施例中应用服务器节点的相应流程。具体可参见上述方法实施例中的描述,为避免重复,此处适当省略详细描述。It should be understood that the joint learning device 800 shown in FIG. 8 can implement various processes performed by the application server node in the method embodiments shown in FIG. 2 and FIG. 3. The operations and/or functions of each module in the joint learning device 800 are used to implement the corresponding procedures of the application server nodes in the foregoing method embodiments. For details, please refer to the descriptions in the foregoing method embodiments. To avoid repetition, detailed descriptions are appropriately omitted here.
本申请还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行上述如图2、图3所示的联合学习方法中的各个步骤。This application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium. When the instructions run on a computer, the computer executes the joint learning methods shown in FIG. 2 and FIG. 3. The various steps.
本申请还提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机或任一至少一种处理器上运行时,使得计算机执行如图2、图3所示的联合学习方法中的各个步骤。The present application also provides a computer program product containing instructions. When the computer program product runs on a computer or any one of at least one processor, the computer executes the joint learning methods shown in FIG. 2 and FIG. 3 Various steps.
本申请还提供一种芯片,包括处理器。该处理器用于读取并运行存储器中存储的计算机程序,以执行本申请提供的唤醒屏幕的方法执行的相应操作和/或流程。This application also provides a chip including a processor. The processor is used to read and run the computer program stored in the memory to execute the corresponding operation and/or process performed by the method for waking up the screen provided in this application.
可选地,该芯片还包括存储器,该存储器与该处理器通过电路或电线与存储器连接,处理器用于读取并执行该存储器中的计算机程序。进一步可选地,该芯片还包括通信接口,处理器与该通信接口连接。通信接口用于接收需要处理的数据和/或信息,处理器从该通信接口获取该数据和/或信息,并对该数据和/或信息进行处理。该通信接口可以是输入输出接口。Optionally, the chip further includes a memory, the memory and the processor are connected to the memory through a circuit or a wire, and the processor is used to read and execute the computer program in the memory. Further optionally, the chip further includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive data and/or information that needs 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.
以上各实施例中,涉及的处理器可以例如包括中央处理器(central processing unit,CPU)、微处理器、微控制器或数字信号处理器,还可包括GPU、NPU和ISP,该处理器还可包括必要的硬件加速器或逻辑处理硬件电路,如特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请技术方案程序执行的集成电路等。此外,处理器可以具有操作一个或多个软件程序的功能,软件程序可以存储在存储器中。In the above embodiments, the processors involved may include, for example, a central processing unit (CPU), a microprocessor, a microcontroller, or a digital signal processor, and may also include GPU, NPU, and ISP. The processor may also include It may include necessary hardware accelerators or logic processing hardware circuits, such as application-specific integrated circuits (ASICs), or one or more integrated circuits used to control the execution of the technical solutions of this application. In addition, the processor may have a function of operating one or more software programs, and the software programs may be stored in the memory.
存储器可以是只读存储器(read-only memory,ROM)、可存储静态信息和指令的其它类型的静态存储设备、随机存取存储器(random access memory,RAM)或可存储信息和指令的其它类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备,或者还可以是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质等。The memory can be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions Dynamic storage devices can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical disc storage ( Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can Any other medium accessed by the computer, etc.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达, 是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the embodiments of the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of the associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. Among them, A and B can be singular or plural. The character "/" generally indicates that the associated objects are in an "or" relationship. "The following at least one item" and similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
本领域普通技术人员可以意识到,本文中公开的实施例中描述的各单元及算法步骤,能够以电子硬件、计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may be aware that the units and algorithm steps described in the embodiments disclosed herein can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,任一功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。In the several embodiments provided in this 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 this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .
以上所述,仅为本申请的具体实施方式,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application. Any person skilled in the art can easily conceive of changes or substitutions within the technical scope disclosed in this application, which should be covered by the protection scope of this application. The protection scope of this application shall be subject to the protection scope of the claims.
Claims (17)
- 一种基于区块链网络的联合学习方法,其特征在于,包括:A joint learning method based on blockchain network, which is characterized in that it includes:接收应用服务器节点发送的初始模型参数,所述初始模型参数为参与联合学习的设备用于建立初始模型的参数;Receiving an initial model parameter sent by an application server node, where the initial model parameter is a parameter used by a device participating in the joint learning to establish an initial model;训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果;Training the initial model parameters, and generating training results for updating the initial model parameters;通过状态通道向应用服务器节点发送所述训练结果,所述状态通道为所述设备与所述应用服务器节点之间的离链通道,所述离链通道位于区块链网络之外。The training result is sent to the application server node through a state channel, which is an off-chain channel between the device and the application server node, and the off-chain channel is located outside the blockchain network.
- 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, wherein the method further comprises:接收所述应用服务器节点发送的通道地址信息,所述通道地址信息用于标识所述状态通道。Receiving channel address information sent by the application server node, where the channel address information is used to identify the state channel.
- 如权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:获取联合学习智能合约,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令;Acquiring a joint learning smart contract, where the joint learning smart contract includes training logic instructions for the initial model parameters;所述训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果,包括:The training of the initial model parameters and generating a training result for updating the initial model parameters includes:运行所述联合学习智能合约以训练所述初始模型参数,生成用于更新所述初始模型参数的训练结果。Run the joint learning smart contract to train the initial model parameters, and generate training results for updating the initial model parameters.
- 如权利要求3所述的方法,其特征在于,所述获取联合学习智能合约,包括:The method of claim 3, wherein said acquiring a joint learning smart contract comprises:通过所述区块链网络获取所述联合学习智能合约,其中,所述联合学习智能合约为链下智能合约,所述链下智能合约的执行环境不属于所述区块链网络。The joint learning smart contract is acquired 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.
- 如权利要求3或4所述的方法,其特征在于,所述运行所述联合学习智能合约以训练所述初始模型参数,包括:The method according to claim 3 or 4, wherein the running the joint learning smart contract to train the initial model parameters comprises:在可信执行环境TEE下,运行所述联合学习智能合约以训练所述初始模型参数。Under the trusted execution environment TEE, run the joint learning smart contract to train the initial model parameters.
- 如权利要求1至5中任一项所述的方法,其特征在于,所述通过状态通道向应用服务器节点发送所述训练结果之后,所述方法还包括:The method according to any one of claims 1 to 5, wherein after the sending the training result to an application server node through a state channel, the method further comprises:接收所述应用服务器节点通过所述状态通道支付的数字货币。Receiving the digital currency paid by the application server node through the state channel.
- 如权利要求1至6中任一项所述的方法,其特征在于,所述接收所述应用服务器节点通过所述状态通道支付的数字货币之前,所述方法还包括:The method according to any one of claims 1 to 6, wherein before the receiving the digital currency paid by the application server node through the state channel, the method further comprises:向所述应用服务器节点发送第一消息,所述第一消息用于指示所述设备参与联合学习,所述第一消息中包括所述设备的数字货币钱包地址。Send a first message 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 the digital currency wallet address of the device.
- 如权利要求6或7所述的方法,其特征在于,所述接收所述应用服务器节点通过所述状态通道支付的数字货币,包括:The method according to claim 6 or 7, wherein the receiving digital currency paid by the application server node through the state channel comprises:在可信执行环境TEE下,接收所述应用服务器节点通过所述状态通道支付的数字货币。Under the trusted execution environment TEE, the digital currency paid by the application server node through the state channel is received.
- 如权利要求1至8中任一项所述的方法,其特征在于,所述方法还包括:8. The method according to any one of claims 1 to 8, wherein the method further comprises:确定联合学习的训练任务结束;Confirm the end of the training task of joint learning;向所述区块链网络发送第一交易,所述第一交易用于指示关闭所述状态通道。Send a first transaction to the blockchain network, where the first transaction is used to instruct to close the state channel.
- 一种基于区块链网络的联合学习方法,其特征在于,包括:A joint learning method based on blockchain network, which is characterized in that it includes:向设备发送初始模型参数,所述初始模型参数为所述设备用于建立参与联合学习的初始模型的参数;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;通过状态通道接收用于更新所述初始模型参数的训练结果,其中,所述状态通道为所述设备与应用服务器节点之间的离链通道,所述离链通道位于区块链网络之外。The training result for updating the initial model parameters is received 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.
- 如权利要求10所述的方法,其特征在于,所述方法还包括:The method of claim 10, wherein 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;向所述设备发送所述通道地址信息。Sending the channel address information to the device.
- 如权利要求11所述的方法,其特征在于,所述接收所述区块链网络发送的通道地址信息之前,所述方法还包括:The method according to claim 11, wherein before said receiving the channel address information sent by the blockchain network, the method further comprises:向所述区块链网络发送第二交易,所述第二交易用于部署所述状态通道。A second transaction is sent to the blockchain network, and the second transaction is used to deploy the state channel.
- 如权利要求10至12中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 10 to 12, wherein the method further comprises:向所述区块链网络发送第三交易,所述第三交易用于将联合学习智能合约署于所述区块链网络,所述联合学习智能合约是链下智能合约,所述链下智能合约的执行环境不属于所述区块链网络,所述联合学习智能合约中包括所述初始模型参数的训练逻辑指令。Send a third transaction to the blockchain network, the third transaction is used to sign a joint learning smart contract on the blockchain network, the joint learning smart contract is an off-chain smart contract, and the off-chain smart The execution environment of the contract does not belong to the blockchain network, and the joint learning smart contract includes training logic instructions for the initial model parameters.
- 如权利要求10至13中任一项所述的方法,其特征在于,所述通过状态通道接收更新所述初始模型参数的训练结果之后,所述方法还包括:The method according to any one of claims 10 to 13, wherein after the receiving the training result for updating the initial model parameters through the state channel, the method further comprises:通过所述状态通道向所述设备支付数字货币。The digital currency is paid to the device through the state channel.
- 如权利要求14方法,其特征在于,所述通过所述状态通道向所述设备支付数字货币之前,所述方法还包括:The method according to claim 14, characterized in that, before the payment of digital currency to the device through the state channel, the method further comprises:接收所述设备发送的第一消息,所述第一消息用于指示所述设备参与联合学习,所述第一消息中包括所述设备的数字货币钱包地址。A first message sent by the device is received, the first message is used to instruct the device to participate in joint learning, and the first message includes the digital currency wallet address of the device.
- 一种联合学习设备,其特征在于,包括存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于从所述存储器中调用并运行所述计算机程序,以执行如权利要求1至9中任一项所述的方法。A joint learning device, characterized by comprising a memory and a processor, 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 claims 1 to 9. The method of any one of 9.
- 一种联合学习设备,其特征在于,包括存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于从所述存储器中调用并运行所述计算机程序,以执行如权利要求10至15中任一项所述的方法。A joint learning device, characterized by comprising a memory and a processor, 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 claims 10 to The method of any one of 15.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/082865 WO2020210979A1 (en) | 2019-04-16 | 2019-04-16 | Blockchain-network-based joint learning method and joint learning device |
CN201980007212.3A CN112166445A (en) | 2019-04-16 | 2019-04-16 | Joint learning method and joint learning equipment based on block chain network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/082865 WO2020210979A1 (en) | 2019-04-16 | 2019-04-16 | Blockchain-network-based joint learning method and joint learning device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020210979A1 true WO2020210979A1 (en) | 2020-10-22 |
Family
ID=72836866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/082865 WO2020210979A1 (en) | 2019-04-16 | 2019-04-16 | Blockchain-network-based joint learning method and joint learning device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112166445A (en) |
WO (1) | WO2020210979A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200394471A1 (en) * | 2019-06-12 | 2020-12-17 | International Business Machines Corporation | Efficient database maching learning verification |
US11694110B2 (en) | 2019-06-12 | 2023-07-04 | International Business Machines Corporation | Aggregated machine learning verification for database |
US11983608B2 (en) | 2019-06-12 | 2024-05-14 | International Business Machines Corporation | Efficient verification of machine learning applications |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114844785B (en) * | 2021-02-01 | 2024-02-06 | 大唐移动通信设备有限公司 | Model updating method, device and storage medium in communication system |
CN113094761B (en) * | 2021-04-25 | 2022-02-08 | 中山大学 | Method for monitoring federated learning data tamper-proofing and related device |
CN113792347B (en) * | 2021-08-24 | 2023-09-26 | 上海点融信息科技有限责任公司 | Federal learning method, device, equipment and storage medium based on block chain |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105575389A (en) * | 2015-12-07 | 2016-05-11 | 百度在线网络技术(北京)有限公司 | Model training method, system and device |
CN106156810A (en) * | 2015-04-26 | 2016-11-23 | 阿里巴巴集团控股有限公司 | General-purpose machinery learning algorithm model training method, system and calculating node |
CN106934715A (en) * | 2017-01-23 | 2017-07-07 | 天津米游科技有限公司 | A kind of high frequency method of commerce and system based on block chain |
CN107871160A (en) * | 2016-09-26 | 2018-04-03 | 谷歌公司 | Communicate efficient joint study |
CN108280522A (en) * | 2018-01-03 | 2018-07-13 | 北京大学 | A kind of plug-in type distributed machines study Computational frame and its data processing method |
CN109194508A (en) * | 2018-08-27 | 2019-01-11 | 联想(北京)有限公司 | Data processing method and device based on block chain |
CN109543726A (en) * | 2018-11-06 | 2019-03-29 | 联动优势科技有限公司 | A kind of method and device of training pattern |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180285839A1 (en) * | 2017-04-04 | 2018-10-04 | Datient, Inc. | Providing data provenance, permissioning, compliance, and access control for data storage systems using an immutable ledger overlay network |
WO2019055585A1 (en) * | 2017-09-12 | 2019-03-21 | Kadena Llc | Parallel-chain architecture for blockchain systems |
US20190095879A1 (en) * | 2017-09-26 | 2019-03-28 | Cornell University | Blockchain payment channels with trusted execution environments |
CN108694669A (en) * | 2018-07-18 | 2018-10-23 | 矩阵元技术(深圳)有限公司 | A kind of block chain intelligence contract implementation method and device |
CN109189825B (en) * | 2018-08-10 | 2022-03-15 | 深圳前海微众银行股份有限公司 | Federated learning modeling method, server and medium for horizontal data segmentation |
CN109493216B (en) * | 2018-09-30 | 2021-02-09 | 北京小米移动软件有限公司 | Model training method, device, system and storage medium |
CN109167695B (en) * | 2018-10-26 | 2021-12-28 | 深圳前海微众银行股份有限公司 | Federal learning-based alliance network construction method and device and readable storage medium |
-
2019
- 2019-04-16 WO PCT/CN2019/082865 patent/WO2020210979A1/en active Application Filing
- 2019-04-16 CN CN201980007212.3A patent/CN112166445A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106156810A (en) * | 2015-04-26 | 2016-11-23 | 阿里巴巴集团控股有限公司 | General-purpose machinery learning algorithm model training method, system and calculating node |
CN105575389A (en) * | 2015-12-07 | 2016-05-11 | 百度在线网络技术(北京)有限公司 | Model training method, system and device |
CN107871160A (en) * | 2016-09-26 | 2018-04-03 | 谷歌公司 | Communicate efficient joint study |
CN106934715A (en) * | 2017-01-23 | 2017-07-07 | 天津米游科技有限公司 | A kind of high frequency method of commerce and system based on block chain |
CN108280522A (en) * | 2018-01-03 | 2018-07-13 | 北京大学 | A kind of plug-in type distributed machines study Computational frame and its data processing method |
CN109194508A (en) * | 2018-08-27 | 2019-01-11 | 联想(北京)有限公司 | Data processing method and device based on block chain |
CN109543726A (en) * | 2018-11-06 | 2019-03-29 | 联动优势科技有限公司 | A kind of method and device of training pattern |
Non-Patent Citations (2)
Title |
---|
PAN, CHEN ET AL.: "Research on Scalability of Blockchain Technology: Problems and Methods", JOURNAL OF COMPUTER RESEARCH AND DEVELOPMENT, vol. 55, no. 10, 31 October 2018 (2018-10-31), pages 2099 - 2110, XP055754924, DOI: 20191023114721A * |
WANG, CHIYU: "Research and Implementation of Lightning Network on Blockchain", CHINESE MASTER’S THESES FULL-TEXT DATABASE, INFORMATION SCIENCE AND TECHNOLOGY, no. 3, 15 March 2019 (2019-03-15), DOI: 20191023115044A * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200394471A1 (en) * | 2019-06-12 | 2020-12-17 | International Business Machines Corporation | Efficient database maching learning verification |
US11562228B2 (en) * | 2019-06-12 | 2023-01-24 | International Business Machines Corporation | Efficient verification of machine learning applications |
US11694110B2 (en) | 2019-06-12 | 2023-07-04 | International Business Machines Corporation | Aggregated machine learning verification for database |
US11983608B2 (en) | 2019-06-12 | 2024-05-14 | International Business Machines Corporation | Efficient verification of machine learning applications |
Also Published As
Publication number | Publication date |
---|---|
CN112166445A (en) | 2021-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020210979A1 (en) | Blockchain-network-based joint learning method and joint learning device | |
JP7364724B2 (en) | Operating system for blockchain IoT devices | |
JP6892513B2 (en) | Off-chain smart contract service based on a reliable execution environment | |
JP7186178B2 (en) | Secure blockchain-based consensus | |
JP6955026B2 (en) | Systems and methods for parallel processing blockchain transactions | |
WO2021017441A1 (en) | Blockchain-based data authorization method and apparatus | |
KR102151907B1 (en) | Blockchain data processing and storage in a trusted execution environment | |
JP7208930B2 (en) | Release of controlled cryptographic private keys | |
US10700850B2 (en) | System and method for information protection | |
WO2021017444A1 (en) | Blockchain-based data authorization method and device | |
WO2020103566A1 (en) | Blockchain certificate storage method and apparatus, and computer device | |
US10938549B2 (en) | System and method for information protection | |
JP2020518880A (en) | Parallel execution of transactions in blockchain network based on smart contract whitelist | |
CN111164935A (en) | System and method for providing privacy and security protection in blockchain based private transactions | |
CN111066047A (en) | Implementing a blockchain based workflow | |
JP2020524925A (en) | System and method for multi-round token distribution using blockchain network | |
EP4002786A1 (en) | Distributed ledger system | |
CN112202554B (en) | Information processing method, device and equipment for generating key based on attribute of information | |
CN112199697A (en) | Information processing method, device, equipment and medium based on shared root key | |
WO2019153660A1 (en) | Transaction processing method and apparatus, and computer device and storage medium | |
CN112202555B (en) | Information processing method, device and equipment for generating random number based on information attribute | |
US20200043016A1 (en) | Network node for processing measurement data | |
JP2021505002A (en) | Computer implementation system and method for enhanced Bitcoin wallet | |
AU2019101581A4 (en) | System and method for information protection | |
KR20210048336A (en) | Method and system for off-chain payment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19924864 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19924864 Country of ref document: EP Kind code of ref document: A1 |