CN110490305B - Machine learning model processing method based on block chain network and node - Google Patents

Machine learning model processing method based on block chain network and node Download PDF

Info

Publication number
CN110490305B
CN110490305B CN201910776690.2A CN201910776690A CN110490305B CN 110490305 B CN110490305 B CN 110490305B CN 201910776690 A CN201910776690 A CN 201910776690A CN 110490305 B CN110490305 B CN 110490305B
Authority
CN
China
Prior art keywords
machine learning
learning model
node
participant
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910776690.2A
Other languages
Chinese (zh)
Other versions
CN110490305A (en
Inventor
黎新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911295577.9A priority Critical patent/CN110991622B/en
Priority to CN201910776690.2A priority patent/CN110490305B/en
Publication of CN110490305A publication Critical patent/CN110490305A/en
Application granted granted Critical
Publication of CN110490305B publication Critical patent/CN110490305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The invention provides a machine learning model processing method based on a block chain network, a node and a storage medium; the machine learning model processing method comprises the following steps: acquiring a machine learning model sent by a demand side node, and storing the machine learning model to a block chain network; responding to a query request for the machine learning model sent by a participant node, and sending the machine learning model to the participant node so that the participant node updates the machine learning model according to training data of the participant node; acquiring the updated machine learning model sent by the participant node, and performing consensus on the updated machine learning model; and when the consensus is successful, storing the updated machine learning model to the block chain network. By the method and the device, the safety of training data can be improved and the processing efficiency of the machine learning model can be improved in a machine learning model training scene with participation of multiple parties.

Description

Machine learning model processing method based on block chain network and node
Technical Field
The invention relates to artificial intelligence and a block chain technology, in particular to a machine learning model processing method based on a block chain network, a node of the block chain network and a storage medium.
Background
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. Machine Learning (ML) is a one-to-many domain interdisciplinary, is the core of artificial intelligence, is the fundamental approach to making computers intelligent, and is applied in various domains.
The training data is a key asset for determining whether the machine learning model can be effectively used, and different company, enterprise or government organization departments generally have own unique training data, and the training data are often distributed in independent data islands according to different sources. In the solutions provided in the related art, a data mart or big data platform is usually established, on which training data is shared and traded, so that the machine learning model can be updated according to a large amount of training data from different sources.
However, the application scenario of the machine learning model is becoming complicated, for example, a plurality of business subjects may participate in the training process, and the training scheme provided by the related art cannot meet the requirements of security and efficiency.
Disclosure of Invention
The embodiment of the invention provides a machine learning model processing method based on a block chain network, a node and a storage medium, which can ensure the safety and efficiency in a machine learning model training scene with participation of multiple parties.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a machine learning model processing method based on a block chain network, which comprises the following steps:
acquiring a machine learning model sent by a demander node and demand information corresponding to the machine learning model, and storing the machine learning model and the demand information to a block chain network;
the demand information is used for indicating nodes belonging to a specific service subject in the block chain network to update the machine learning model, or indicating nodes having specific training data in the block chain network to update the machine learning model;
acquiring a query request and an authorization code of the machine learning model sent by a participant node, and performing authority authentication according to the authorization code;
when the authority authentication is successful, the machine learning model is sent to the participant node, so that the participant node updates the machine learning model according to the training data of the participant node;
acquiring the updated machine learning model and participation information related to updating operation sent by the participant node, constructing the demand information, the updated machine learning model and the participation information into a block, and commonly identifying the block;
and when the consensus is successful, storing the updated machine learning model and the participation information to the blockchain network.
In the foregoing solution, the storing the machine learning model to a blockchain network includes:
the blockchain network comprises blockchains for uniformly storing different machine learning models, and the machine learning models are stored into the blockchains of the blockchain network; alternatively, the first and second electrodes may be,
the blockchain network comprises a plurality of channels corresponding to different types of machine learning models, and the machine learning models are stored in blockchains of the channels of the corresponding types.
An embodiment of the present invention provides a node of a blockchain network, including:
the model acquisition module is used for acquiring a machine learning model sent by a demander node and demand information corresponding to the machine learning model, and storing the machine learning model and the demand information to a block chain network; the demand information is used for indicating nodes belonging to a specific service subject in the block chain network to update the machine learning model, or indicating nodes having specific training data in the block chain network to update the machine learning model;
the model transaction module is used for acquiring a query request and an authorization code of the machine learning model, which are sent by a participant node, and performing authority authentication according to the authorization code; when the authority authentication is successful, the machine learning model is sent to the participant node, so that the participant node updates the machine learning model according to the training data of the participant node;
a consensus module, configured to obtain the updated machine learning model and participation information related to an update operation sent by the participant node, construct the demand information, the updated machine learning model, and the participation information into a block, and perform consensus on the block;
and the updating storage module is used for storing the updated machine learning model and the participation information to the block chain network when the consensus is successful.
In the foregoing solution, the model obtaining module is further configured to:
the blockchain network comprises blockchains for uniformly storing different machine learning models, and the machine learning models are stored into the blockchains of the blockchain network; alternatively, the first and second electrodes may be,
the blockchain network comprises a plurality of channels corresponding to different types of machine learning models, and the machine learning models are stored in blockchains of the channels of the corresponding types.
An embodiment of the present invention provides a node of a blockchain network, including:
a memory for storing executable instructions;
and the processor is used for realizing the machine learning model processing method provided by the embodiment of the invention when executing the executable instructions stored in the memory.
The embodiment of the invention provides a storage medium, which stores executable instructions and is used for causing a processor to execute so as to realize the machine learning model processing method provided by the embodiment of the invention.
The embodiment of the invention has the following beneficial effects:
the block chain network is used as a sharing platform of the machine learning model, the machine learning model is submitted to the block chain network by the demand side node, the machine learning model is inquired to the block chain network by the participant side node, the machine learning model is updated locally, and the updated machine learning model is submitted to the block chain network, so that the safety of training data can be improved in a multi-party machine learning model training scene, and meanwhile, the processing efficiency of the machine learning model is improved.
Drawings
Fig. 1 is an alternative architecture diagram of a machine learning model processing system based on a blockchain network according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an alternative functional architecture of a blockchain network according to an embodiment of the present invention;
fig. 3 is an alternative structural diagram of a node of a blockchain network according to an embodiment of the present invention;
fig. 4 is an alternative flowchart of a processing method of a machine learning model based on a blockchain network according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of another alternative process of the machine learning model processing method based on the blockchain network according to the embodiment of the present invention;
fig. 6 is a schematic flow chart of another alternative method for processing a machine learning model based on a blockchain network according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of another alternative process of the machine learning model processing method based on the blockchain network according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, to enable embodiments of the invention described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) Transactions (transactions), equivalent to the computer term "Transaction," include operations that need to be committed to a blockchain network for execution and do not refer solely to transactions in the context of commerce, which embodiments of the present invention follow in view of the convention colloquially used in blockchain technology.
For example, a deployment (deployment) transaction is used to install a specified smart contract to a node in a blockchain network and is ready to be invoked; the Invoke (Invoke) transaction is used to append records of the transaction in the blockchain by invoking the smart contract and to perform operations on the state database of the blockchain, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e., querying key-value pairs in the state database).
2) A Block chain (Blockchain) is a storage structure for encrypted, chained transactions formed from blocks (blocks).
For example, the header of each block may include hash values of all transactions in the block, and also include hash values of all transactions in the previous block, so as to achieve tamper resistance and forgery resistance of the transactions in the block based on the hash values; newly generated transactions, after being filled into the tiles and passing through the consensus of nodes in the blockchain network, are appended to the end of the blockchain to form a chain growth.
3) A Blockchain Network (Blockchain Network) incorporates new blocks into a set of nodes of a Blockchain in a consensus manner.
4) Ledger (legger) is a general term for blockchains (also called Ledger data) and state databases synchronized with blockchains.
Wherein, the blockchain records the transaction in the form of a file in a file system; the state database records the transactions in the blockchain in the form of different types of Key (Key) Value pairs for supporting fast query of the transactions in the blockchain.
5) Intelligent Contracts (Smart Contracts), also known as chain codes (chaincodes) or application codes, are programs deployed in nodes of a blockchain network, and the nodes execute the intelligent Contracts called in received transactions to perform operations of updating or querying key-value data of the account database.
6) Consensus (Consensus), a process in a blockchain network, is used to agree on transactions in a block among a plurality of nodes involved, the agreed block is to be appended to the end of the blockchain, and the mechanisms for achieving Consensus include Proof of workload (PoW, Proof of Work), Proof of rights and interests (PoS, Proof of equity (DPoS), Proof of granted of shares (DPoS), Proof of Elapsed Time (PoET, Proof of Elapsed Time), and so on.
7) The machine learning model is a model that organizes an existing knowledge structure according to empirical data to continuously improve the performance of the model, such as a linear regression model, a random forest model, a neural network model, and the like. The training of the machine learning model requires processing of training data and learning of an optimal mathematical representation satisfying constraint conditions under certain constraint conditions. The machine learning model referred to herein mainly includes a structure of the model (e.g., a neural network structure) and parameters of the model (e.g., connection weight parameters between respective layers of the neural network, weight parameters of respective feature terms of logistic regression).
Referring to fig. 1, fig. 1 is a schematic diagram of an architecture of a machine learning model processing system based on a blockchain network provided by an embodiment of the present invention, including a blockchain network 200 (exemplarily shown to include a node 210-1 to a node 210-3), an authentication center 300, a service agent 400 (exemplarily shown to belong to a requiring party node 410 of the service agent 400 and a graphical interface 420 thereof) and a service agent 500 (exemplarily shown to belong to a participating party node 510 of the service agent 500 and a graphical interface 520 thereof), wherein the requiring node 410 and the participating node 510 are both client nodes within the blockchain network 200, the illustration in figure 1 is merely for convenience of illustrating an embodiment of the present invention, and does not mean that the requiring node 410 and the participating node 510 exist independently of the blockchain network 200. In addition, the authentication center may be independent of the blockchain network, and may also exist as an authentication node in the blockchain network. The following description will be made separately.
The type of blockchain network 200 is flexible and may be, for example, any of a public chain, a private chain, or a federation chain. Taking a public link as an example, electronic devices such as user terminals and servers of any service entity can access the blockchain network 200 without authorization; taking a federation chain as an example, an electronic device (e.g., a terminal/server) under the jurisdiction of a service entity after authorization may access the blockchain network 200 and become a client node in the blockchain network 200.
It is noted that the client node may only provide functionality to support the initiation of transactions by the business entity (e.g., for uplink storage of data or querying of data on the chain), while the client node may be implemented by default or selectively (e.g., depending on the specific business requirements of the business entity) for the functionality of the conventional (native) node 210 of the blockchain network 200, such as the ranking functionality, consensus services, and ledger functionality, etc., described below. Therefore, the data and the service processing logic of the service subject can be migrated into the block chain network 200 to the maximum extent, and the credibility and traceability of the data and service processing process are realized through the block chain network 200.
The blockchain network 200 receives transactions submitted by client nodes (e.g., the requiring party node 410 attributed to the business entity 400 and the participant node 510 attributed to the business entity 500 shown in fig. 1) from different business entities (e.g., the business entity 400 and the business entity 500 shown in fig. 1), performs the transactions to update the ledger or query the ledger, and displays various intermediate or final results of performing the transactions at a user interface of the client nodes (e.g., the graphical interface 420 of the requiring party node 410, the graphical interface 520 of the participant node 510).
An exemplary application of a blockchain network is described below, taking as an example a process in which multiple business entities access the blockchain network to implement a machine learning model.
Referring to fig. 1, a service body 400 accesses a blockchain network 200 through a requiring party node 410, and a service body 500 accesses the blockchain network 200 through a participating party node 510. The business personnel of the business agent 400 inputs the machine learning model in the graphical interface 420 of the demander node 410, the demander node 410 generates a corresponding transaction for the submission operation, specifies in the transaction the smart contract that needs to be invoked to implement the submission operation and the parameters passed to the smart contract, and the transaction also carries a digital signature signed by the demander node 410 (e.g., encrypted using a private key in a digital certificate issued by the certificate authority 300 to obtain a digest of the transaction), and broadcasts the transaction to the blockchain network 200.
When a transaction is received in the node 210 in the block chain network 200, a digital signature carried by the transaction is verified, after the digital signature is verified successfully, whether the requiring party node 410 has a transaction right is determined according to the identity of the requiring party node 410 carried in the transaction, and the transaction fails due to the fact that any one of the digital signature and the right verification fails to be verified and judged. After successful verification, node 210 signs its own digital signature (e.g., by encrypting a digest of the transaction using a private key in the digital certificate of node 210-1) and continues to broadcast in blockchain network 200.
After the node 210 with the sorting function in the blockchain network 200 receives the transaction successfully verified, the transaction is filled into a new block and broadcasted to the node providing the consensus service in the blockchain network 200.
The node 210 providing the consensus service in the blockchain network 200 performs the consensus process on the new block to reach an agreement, the node 210 providing the ledger function appends the new block to the tail of the blockchain, and performs the transaction in the new block: namely, for the transaction submitted with the machine learning model, the key value pair corresponding to the machine learning model is added in the ledger database.
Similarly, a business person of the business entity 500 may input a machine learning model/machine learning model query request in the graphical interface 520 of the participant node 510, and the participant node 510 generates a transaction corresponding to the update operation/query operation according to the machine learning model/machine learning model query request and broadcasts the transaction to the blockchain network 200.
After broadcasting, sorting, and consensus of the transaction by the node 210 in the blockchain network 200, the node 210 in the blockchain 200, which provides the ledger function, adds a new block corresponding to the transaction to the tail of the blockchain, and executes the transaction in the new block: for the transaction of inquiring the machine learning model, inquiring the key value pair corresponding to the machine learning model from the account book database, and returning an inquiry result; and for the transaction submitted with the updated machine learning model, updating the key value pair corresponding to the machine learning model in the book database. It should be noted that the updated machine learning model submitted by the participant node 510 may be obtained by the participant node updating the queried machine learning model by using its own training data.
It will be appreciated that data that a business entity can query/update in the blockchain network 200 can be implemented by restricting the authority of transactions that the business entity can initiate, for example, when the business entity 400 has the authority to initiate a transaction that submits a machine learning model, a business person of the business entity 400 can enter the machine learning model in the graphical interface 420 of the demander node 410 and generate a transaction broadcast by the demander node 410 for submitting the machine learning model into the blockchain network 200 to add the machine learning model in the ledger of the blockchain network 200.
When the business entity 500 has the authority to initiate a transaction to update/query the machine learning model, the business personnel of the business entity 500 may enter an update/query request for the machine learning model in the graphical interface 520 of the participant node 510 and generate a transaction broadcast by the participant node 510 for updating/querying the machine learning model into the blockchain network 200 to update the machine learning model in the ledger of the blockchain network 200 or to obtain a corresponding machine learning model from the blockchain network 200.
An exemplary functional architecture of a block chain network provided in an embodiment of the present invention is described below, referring to fig. 2, fig. 2 is a functional architecture schematic diagram of a block chain network 200 provided in an embodiment of the present invention, which includes an application layer 201, a consensus layer 202, a network layer 203, a data layer 204, and a resource layer 205, which are described below respectively.
The resource layer 205 encapsulates computing, storage, and communication resources that implement each node 210 in the blockchain network 200, such as computing, storage, and communication resources in computers, servers/clusters, and clouds, abstracts and provides a uniform interface to the data layer 204 to shield the underlying hardware implementing the resource layer 205 from differences.
The computing resources include various forms of processors such as a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), and a Field-Programmable Gate Array (FPGA).
The storage resources include various types of storage media such as various volatile memories and nonvolatile memories. The nonvolatile Memory may be a Read Only Memory (ROM) or a Programmable Read-Only Memory (PROM). Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory.
The communication resources include various links for communication between nodes 210 of the blockchain network, between the blockchain network 200 and the traffic master.
The data layer 204 encapsulates various data structures that implement the ledger, including blockchains implemented in files in a file system, state databases of the key-value type, and presence certificates (e.g., hash trees of transactions in blocks).
The network layer 203 encapsulates the functions of a Point-to-Point (P2P) network protocol, a data propagation mechanism and a data verification mechanism, an access authentication mechanism and service agent identity management.
Wherein the P2P network protocol implements communication between nodes 210 in the blockchain network 200, the data propagation mechanism ensures propagation of transactions in the blockchain network 200, and the data verification mechanism implements reliability of data transmission between nodes 210 based on cryptography methods (e.g., digital certificates, digital signatures, public/private key pairs); the access authentication mechanism is used for authenticating the identity of the service subject added into the block chain network 200 according to an actual service scene, and endowing the service subject with the authority of accessing the block chain network 200 when the authentication is passed; the business entity identity management is used to store the identity of the business entity that is allowed to access blockchain network 200, as well as the permissions (e.g., the types of transactions that can be initiated).
The consensus layer 202 encapsulates the functions of the mechanism for the nodes 210 in the blockchain network 200 to agree on a block (i.e., a consensus mechanism), transaction management, and ledger management.
The consensus mechanism comprises consensus algorithms such as POS, POW and DPOS, and the pluggable consensus algorithm is supported.
The transaction management is configured to verify a digital signature carried in the transaction received by the node 210, verify identity information of the service entity, and determine whether the node has an authority to perform the transaction (read related information from the identity management of the service entity) according to the identity information; for the service agents authorized to access the blockchain network 200, the service agents all have digital certificates issued by the certificate authority, and the service agents sign the submitted transactions by using private keys in the digital certificates of the service agents, so that the legal identities of the service agents are declared.
Account book management: for maintaining block chains and ledger databases. For the block with the consensus, adding the block to the tail of the block chain; and executing the transaction in the block which obtains the consensus, updating the key-value pairs in the state database when the transaction comprises an updating operation, inquiring the key-value pairs in the account book database when the transaction comprises an inquiring operation, and returning an inquiring result to the business body. The method supports query operations of multiple dimensions of the account book database, and comprises the following steps: querying the chunk based on the chunk sequence number (e.g., hash value of the transaction); inquiring the block according to the block hash value; inquiring a block according to the transaction serial number; inquiring the transaction according to the transaction serial number; inquiring account data of a business main body according to an account (serial number) of the business main body; and inquiring the block chain in the channel according to the channel name.
The application layer 201 encapsulates various services that the blockchain network can implement, including tracing, crediting, and verifying transactions.
An exemplary structure of a node of the blockchain network implementing an embodiment of the present invention is described below, and it is understood that the hardware structure of any type of node in the blockchain network 200 may be implemented according to the hardware structure described below.
Referring to fig. 3, fig. 3 is a schematic diagram of a structure of a node 210 in a blockchain network 200 according to an embodiment of the present invention, where the node 210 shown in fig. 3 includes: at least one processor 2110, memory 2140, and at least one network interface 2120. The various components in node 210 are coupled together by a bus system 2130. It is understood that the bus system 2130 is used to enable communications among these components. The bus system 2130 includes a power bus, a control bus, and a status signal bus, in addition to the data bus. But for the sake of clarity the various buses are identified in figure 3 as bus system 2130.
The Processor 2110 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc., wherein the general purpose Processor may be a microprocessor or any conventional Processor, etc.
The memory 2140 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. The memory 2140 optionally includes one or more storage devices physically located remote from the processor 2110.
The memory 2140 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), and the volatile memory may be a Random Access Memory (RAM). The memory 2140 described with embodiments of the invention is intended to comprise any suitable type of memory.
In some embodiments, the memory 2140 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 2141, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 2142 for reaching other computing devices via one or more (wired or wireless) network interfaces 2120, exemplary network interfaces 2120 including: bluetooth, wireless compatibility authentication (wi fi), and Universal Serial Bus (USB), etc.;
in some embodiments, the nodes of the blockchain network provided by the embodiments of the present invention may be implemented in software, and fig. 3 shows software modules 2143 stored in the memory 2140, which may be software in the form of programs and plug-ins, and the like, and include the following modules: the model acquisition module 21431, the model transaction module 21432, the consensus module 21433, and the update storage module 21434 are logical and thus may be arbitrarily combined or further split depending on the functionality implemented. The functions of the respective modules will be explained below.
The following describes a method for processing a machine learning model based on a blockchain network according to an embodiment of the present invention, with reference to an exemplary application and implementation of the blockchain network according to an embodiment of the present invention.
Referring to fig. 4, fig. 4 is an optional flowchart of a processing method of a machine learning model based on a blockchain network according to an embodiment of the present invention, which will be described with reference to the steps shown in fig. 4.
In step 401, the blockchain network obtains the machine learning model sent by the demander node and stores the machine learning model.
Here, the demand side node exists inside the blockchain network in the form of a client node. The nodes of the demand side belong to the service body, for the service body, firstly, the block chain network needs to be accessed, and the access conditions of the service body are different according to different types of the block chain network, for example, under the condition that the block chain network is a public chain, the service body can be directly accessed to the block chain network without verification; in the case where the blockchain network is a federation chain, an access condition may be set, and only when a service agent satisfies the access condition, the service agent is allowed to access to become a client node in the blockchain network, for example, the access condition may be set to a service agent with a registration time of 3 years or more.
When initializing, a node formed by a business subject accessing a block chain network and other nodes of the block chain network requests a certificate authority to configure a root certificate and a digital certificate issued by the same certificate authority, so that when sending information to other nodes, the nodes in the block chain network attach the digital certificate to the information, the digital certificate comprises a digital signature signed by identity information, and after receiving the information, the node serving as a receiver decrypts the digital signature according to a public key in the root certificate owned by the node, thereby verifying whether the public key in the digital certificate is held by a user declared by the digital certificate, and ensuring the credibility of the information.
The method comprises the steps that a requiring party node starts a transaction submitting a machine learning model, the transaction carries a digital certificate of the requiring party node and a digital signature (different from the digital signature signed by identity information) of the requiring party node for the transaction, when the transaction is received by other nodes in a block chain network, the digital certificate and the digital signature carried by the transaction are verified, after the digital certificate and the digital signature are verified successfully, the identity of the requiring party node is verified, whether the requiring party node has a transaction right or not is confirmed, and the transaction failure is caused by the fact that any one of the digital certificate, the digital signature and the right verification fails. After the verification is successful, the node signs the digital signature of the node, carries the digital signature and the digital certificate of the node in the transaction, and continuously broadcasts the transaction in the block chain network. After the node with the sorting function in the blockchain network receives the transaction which is successfully verified, the transaction is filled into a new block and is broadcasted to the node which provides the consensus service in the blockchain network. The node providing the consensus service in the blockchain network performs the consensus process on the new block to reach an agreement, the node providing the ledger function adds the new block to the tail of the blockchain, and executes the transaction in the new block: namely, for the transaction submitted with the machine learning model, the key value pair corresponding to the machine learning model is added in the ledger database. It should be noted that the ledger in the embodiment of the present invention may include the blockchain itself and a status database synchronized with the blockchain, and the embodiment of the present invention does not limit the related consensus mechanism.
In some embodiments, between any of the steps, the machine learning model processing method further comprises: the block chain network acquires demand information sent by the demander node, wherein the demand information corresponds to the machine learning model; and storing the requirement information.
Besides the machine learning model, the demand side node can also send demand information corresponding to the machine learning model to the blockchain network, and the demand information is the training requirement of the machine learning model. For example, the requirement information indicates that nodes belonging to a particular class of business entities (e.g., internet enterprises) update the machine learning model, or the requirement information indicates that nodes having a particular class of training data (e.g., messenger chat data) update the machine learning model. Similarly, after the operations of broadcasting, verifying, consensus and the like are performed, the blockchain network stores the requirement information of successful consensus, wherein the requirement information and the corresponding machine learning model can be stored in one block for being checked conveniently. After the storage is finished, the business subject operating the participant node can judge whether the participant node meets the requirement or not by acquiring the requirement information, so as to judge whether to participate in the updating of the machine learning model or not. Through the method for storing the demand information, the effectiveness of updating the machine learning model is improved, and the probability that the participant nodes which do not meet the demand update the machine learning model is reduced.
In some embodiments, storing the machine learning model described above may also be implemented by: the blockchain network comprises blockchains for uniformly storing different machine learning models, and the machine learning models are stored into the blockchains of the blockchain network; or the block chain network comprises a plurality of channels corresponding to different types of machine learning models, and the machine learning models are stored in the block chains of the channels of the corresponding types.
The embodiment of the invention provides two storage mechanisms, wherein in one storage mechanism, a block chain network comprises a block chain for uniformly storing different machine learning models, and when the machine learning models sent by a demand side node are obtained, the machine learning models are stored in the block chain. In another storage mechanism, a plurality of channels are arranged in a blockchain network, each channel corresponds to one type of machine learning model, and each channel comprises nodes related to the machine learning model, namely a submission model and a participation training. After obtaining the machine learning model sent by the node of the demand party, the block chain network broadcasts, verifies and identifies the machine learning model, and when the identification succeeds, the machine learning model is stored in a block chain of a type channel corresponding to the machine learning model in the block chain network, so that the node of a participant in the channel inquires and updates the machine learning model. It is worth noting that the participant node and the demander node may be member nodes common to multiple channels, depending on which machine learning models the nodes participate in, i.e., one participant node may be located on both channel a and channel B. When one participant node exits from the training of one machine learning model, namely exits from one channel, the participant node can still participate in the training of the machine learning models of other channels, and sends the updated machine learning model to the blockchain network. By the method, the flexibility of the machine learning model is improved, and the storage mechanism of the block chain network can be determined according to the actual application scene.
In step 402, the blockchain network transmits the machine learning model to a participant node in response to a query request for the machine learning model transmitted by the participant node.
Here, the participant node is also a client node inside the blockchain network, and the participant node may send a query request for the machine learning model to the blockchain network, and the blockchain network performs operations such as broadcasting, verification, consensus, and the like on the query request. And when the block chain network successfully identifies the query request, the block chain network sends the machine learning model stored in the block chain network to the local participant node according to the query request.
In step 403, the participant node updates the machine learning model according to its own training data.
Here, the update operation performed by the participant node on the machine learning model is independent of the blockchain network, thereby achieving protection of the self-training data. For example, when the machine learning model is a neural network model, the participant node may optimize the neural network structure in the neural network model according to the training data, and optimize the connection weight parameters between layers in the neural network structure, which is not described herein again.
In step 404, the blockchain network obtains the updated machine learning model sent by the participant node, and performs consensus on the updated machine learning model.
After the participant node completes updating the machine learning model, the participant node may initiate a transaction to submit the updated machine learning model to the blockchain network, and the blockchain network also performs operations such as broadcasting, verification, consensus and the like on the transaction.
In step 405, when the consensus is successful, the blockchain network stores the updated machine learning model.
When the blockchain network is successful in identifying the transaction, the blockchain network stores the updated machine learning model into the blockchain network according to the transaction, so that the nodes in the blockchain network can check the updated machine learning model.
In some embodiments, the above-described consensus on the updated machine learning model may be achieved by: the blockchain network broadcasts the updated machine learning model in the blockchain network, so that nodes in the blockchain network fill the updated machine learning model into an update block, and consistency verification is performed on the update block.
And broadcasting the updated machine learning model to the original nodes in the block chain network by the participant nodes, and simultaneously carrying the digital signature and the digital certificate. And after receiving the updated machine learning model, the digital signature and the digital certificate, the native node in the block chain network verifies the digital signature and the digital certificate, signs the digital signature and the digital certificate of the native node after the verification is successful, and continuously broadcasts the updated machine learning model in the block chain network.
And the nodes with the sequencing function in the block chain network acquire the updated machine learning model, fill the updated machine learning model into a new block on the basis of confirming that the corresponding digital signature and the digital certificate are verified successfully, name the filled block as an update block for the convenience of distinguishing and broadcast the update block to the consensus service node in the block chain network. The consensus service node in the blockchain network performs consistency verification on the update blocks to achieve consistency.
Storing the updated machine learning model to the blockchain network as described above may be implemented in such a way that: the update block is appended to the end of the blockchain.
When the consistency verification is successful, the node providing the ledger function in the blockchain network appends the update block to the tail of the blockchain that exists in the blockchain network. By the method, the uplink storage of the updated machine learning model is realized.
As can be seen from the above exemplary implementation of fig. 4, in the embodiment of the present invention, the blockchain network is used as a shared platform of the machine learning model, and meanwhile, the process of updating the machine learning model according to the training data is handed over to the participant node to be performed inside the node, so that the security of the training data held by the participant node is improved, the leakage of the training data is effectively avoided, and the processing efficiency of the machine learning model is improved.
In some embodiments, referring to fig. 5, fig. 5 is another optional flowchart of a processing method of a machine learning model based on a blockchain network according to an embodiment of the present invention, and based on fig. 4, before step 402, the blockchain network may further determine an authorized participant node in step 501.
The blockchain network may authorize the participant node according to the instruction of the demand party node, and determine the authorized participant node in this step, which is of course determined according to other manners, which is not limited in the embodiment of the present invention.
In some embodiments, before step 501, further comprising: the block chain network acquires information of a participant node needing authorization, which is sent by the demand party node, wherein the information of the participant node comprises identity information, a validity period for accessing the block chain network and a machine learning model capable of being trained; and when the information of the participant node meets the authorization condition through the intelligent contract deployed to the block chain network by the demand side node, storing the information of the participant node needing authorization.
In the embodiment of the invention, the blockchain network can authorize the participant node according to the indication of the demand side node. Specifically, the blockchain network obtains information of a participant node needing authorization, which is sent by a demand party node, where the information of the participant node includes identity information, a validity period for accessing the blockchain network, and a machine learning model capable of being trained, the identity information includes a unit name and a unit property of a business subject to which the participant node belongs, the validity period refers to a future existence duration of the participant node in the blockchain network, and the machine learning model capable of being trained can be represented in the information of the participant node through an identifier of the machine learning model, such as a name or a serial number. When the information of the participant node is not configured with the validity period, the default participant node always exists in the block chain network in the future; when a machine learning model capable of training is not configured, the default participant node may train all kinds of machine learning models. It should be noted that the above node information is only an example, and in an actual application scenario, the node information may include more or less contents.
When the blockchain network is deployed to an intelligent contract of a node of the blockchain network through a demand side node, and the information of a participant node is determined to meet an authorization condition, the information of the participant node needing authorization is filled into a new block, the new block is added into the blockchain when the new block is successfully identified, and the state database is updated under the condition that the state database exists.
In some embodiments, before step 402, further comprising: the blockchain network verifies a digital signature of a query request sent by a participant node before responding to the query request to the machine learning model; when the verification is passed, inquiring the information of the participant node sending the inquiry request in the information of the authorized participant node in the block chain network; and when inquiring the information of the participant node sending the inquiry request, determining to respond to the inquiry request.
And the participant node initiates a transaction comprising the query request to the blockchain network, wherein the transaction carries a digital signature, and the digital signature is obtained by encrypting the abstract of the transaction. When a node of the block chain network acquires a transaction comprising an inquiry request, verifying a corresponding digital signature, specifically, processing the transaction by the node to obtain a first abstract, decrypting the digital signature carried by the transaction to obtain a second abstract, and determining that the digital signature passes verification when the first abstract is the same as the second abstract. When the verification is passed, the blockchain network inquires the information of the participant node sending the inquiry request in the stored information of the authorized participant nodes, and determines to respond to the inquiry request when the information of the participant node sending the inquiry request is inquired. By the mode of inquiring the information of the participant node, whether the inquiry request is responded or not is judged in a front-end mode, and the processing resource of the block chain network is saved.
In some embodiments, before storing the information of the participant node requiring authorization when the information of the participant node satisfies the authorization condition is determined by the intelligent contract deployed to the blockchain network by the demander node, the method further includes: the block chain network acquires an intelligent contract which is sent by the demand side node and comprises an authorization condition, wherein the authorization condition corresponds to the machine learning model; and deploying the authorization condition.
The authorization condition for judging whether to authorize the information of the participant node can be pre-deployed in the block chain network. Specifically, the demand side node sends a deployment transaction to the blockchain network, the deployment transaction is used for deploying the intelligent contract including the authorization condition to the nodes in the blockchain network, the blockchain network performs operations such as broadcasting, verification and consensus on the deployment transaction, and when the consensus is successful, the blockchain network deploys the authorization condition (the intelligent contract) to the nodes in the blockchain network according to the deployment transaction. Thus, when the subsequent demand side node authorizes the participant node, the demand side node can initiate a calling transaction aiming at the information of the participant node, and call the deployed intelligent contract in the transaction, so that the block chain network carries out uplink operation on the information of the participant node meeting the authorization condition.
In step 502, the blockchain network generates authorization codes corresponding to authorized participant nodes one to one, and sends the authorization codes to the corresponding participant nodes, where the authorization codes are used for the participant nodes to query the machine learning model.
For each authorized participant node, the blockchain network generates a unique authorization code, and sends the authorization code to the participant node, so that the authorization codes owned by different participant nodes are not consistent, and identity identification is facilitated, wherein the authorization code is used as a certificate for the participant node to inquire a machine learning model in the blockchain network. It should be noted that the execution sequence of steps 501 to 502 in fig. 5 is only an example, and according to different practical application scenarios, the execution may be performed in more execution sequences, for example, steps 501 to 502 may be performed before step 401.
In fig. 5, step 402 of fig. 4 can be implemented by steps 503 to 505, and will be described with reference to each step.
In step 503, the blockchain network obtains the query request and the authorization code sent by the participant node.
And for the participant node which acquires the authorization code, sending a query request for the machine learning model to the blockchain network, carrying the digital signature and the digital certificate, and sending the authorization code. And the block chain network verifies the digital certificate and the digital signature corresponding to the query request, and verifies the authorization code on the basis of successful verification of both the digital certificate and the digital signature.
In step 504, the block chain network performs authorization authentication according to the authorization code.
And the block chain network judges whether the participant node has the authority of inquiring the machine learning model according to the authorization code.
In some embodiments, the authentication of the authorization by the blockchain network according to the authorization code may be implemented in such a manner that: the block chain network generates authorization parameters of the authorization codes according to the historical updating times, model promotion degrees, contribution data volumes and historical query times of the participant nodes on the machine learning model; and when the authorization parameters meet the set parameter conditions, determining that the authority authentication is successful.
In the embodiment of the present invention, for a participant node corresponding to the authorization code, the blockchain network may obtain the historical update times, the model promotion degree, the contribution data amount, and the historical query times of the participant node to the machine learning model, where the model promotion degree refers to an accuracy promotion degree of data processing performed according to the updated machine learning model after the participant node updates the machine learning model, and is mainly used to measure the effectiveness of training data of the participant node on the machine learning model, and for convenience of quantization, the model promotion degree may be embodied in a promotion degree of a specific service, such as a promotion degree of a delivery success rate or a click rate, after the updated machine learning model is applied; the contribution data amount may refer to the total amount of training data used by the participant node to update the machine learning model, or may refer to the ratio between the total amount of training data used by the participant node and the number of updates, i.e., the average amount of training data used at each update. The historical updating times, the model lifting degree, the contribution data amount and the historical query times can be stored in an account book of the block chain network, so that the historical updating times, the model lifting degree, the contribution data amount and the historical query times are convenient to obtain.
And then, obtaining the authorization parameter G '(S) by a function G' (S) ═ f '(history updating frequency, model lifting degree, contribution data amount and history query frequency), wherein the history updating frequency, the model lifting degree and the contribution data amount are in positive correlation with G' (S), the history query frequency and G '(S) are in negative correlation, and obtaining the authorization parameter G' (S) by a weighted summation mode. When the authorization parameters meet the set parameter conditions, the authority authentication is determined to be successful, and the participant node corresponding to the authorization code has the authority to inquire the machine learning model; and when the authorization parameter does not meet the parameter condition, determining that the authority authentication fails, wherein the parameter condition is larger than zero, such as the authorization parameter. The above manner of performing authority authentication by using the authorization parameter is to set an incentive mechanism for the participant node, that is, the participant node can obtain more inquiry (use) times only if actively participating in updating the machine learning model, so as to encourage more participant nodes to participate in updating the machine learning model, and improve the updating effect of the machine learning model.
In step 505, when the authority authentication is successful, the blockchain network sends the machine learning model to the participant node in response to the query request.
When the authority authentication is successful, the block chain network sends the corresponding machine learning model to the participant node according to the query request; when the authority authentication fails, the blockchain network does not respond to the query request, namely, the machine learning model is not sent.
In some embodiments, after step 505, further comprising: the block chain network acquires participation information sent by the participant node, wherein the participation information is related to the updating operation of the participant node on the machine learning model; and storing the participation information.
In addition to sending the updated machine learning model to the blockchain network, the participant node may also send participation information related to the update operation, for example, the participation information may include the contribution data amount of the current update of the participant node, the update degree of the machine learning model, and the like. And the block chain network acquires the participation information sent by the participant node, and performs operations such as broadcasting, verification, consensus and the like on the participation information. In combination with the above, the block chain network can construct the demand information submitted by the demand side node, the updated machine learning model submitted by the participant side node, and the participation information into a block, and can recognize the constructed block.
In case of successful consensus, the blockchain network stores the participation information, so that the blockchain network can obtain relevant information, such as contribution data amount, from the participation information when determining authorization parameters of the participant node or other conditions.
In some embodiments, between any of the steps, the machine learning model processing method further comprises: the blockchain network determines a model gain of the machine learning model; determining contribution parameters of the participant nodes according to the historical updating times, the model promotion degree and the contribution data volume of the participant nodes to the machine learning model; and determining corresponding model gains according to the contribution parameters of the participator nodes, and distributing the model gains to the participator nodes.
The block chain network may determine model gains of the machine learning model, and distribute the model gains, where the model gains may be economic gains obtained by applying the machine learning model to the production field, or gains in other forms, and the embodiment of the present invention does not limit this. Specifically, a contribution parameter g(s) can be obtained through a function g(s) ═ f (the number of historical updates, the model lifting degree, and the contribution data amount), the contribution parameter g(s) reflects the degree of contribution of the participant node to the final machine learning model, wherein the number of historical updates, the model lifting degree, and the contribution data amount all have positive correlation with g(s), and the contribution parameter g(s) is obtained through a weighted summation manner. Besides, when determining the contribution parameter, a factor of the number of historical queries of the participant node may be considered, that is, in the embodiment of the present invention, the authorization parameter described above may be used as the contribution parameter. It should be noted that the above-mentioned historical update times, model lifting degrees and contribution data volumes may be filled into the block by the node, and stored in the block chain after being identified, and on this basis, if a channel is provided in the block chain network, the historical update times, model lifting degrees and contribution data volumes are stored in the block chain of the corresponding channel for query.
According to different contribution degrees, the block chain network distributes model benefits to each participant node. In particular to the participant node SiModel profit benefit (si) of (G) (S) of (G) model of machine learningi)/(G(S1)+G(S2)+……+G(Sn) N) where n is the total number of participant nodes participating in the machine learning model update. It is worth to be noted that the blockchain network may perform distribution of model revenue by executing a corresponding intelligent contract, and specifically, the blockchain network obtains a deployment transaction including an intelligent contract sent by a demand side node, and deploys the intelligent contract into a node of the blockchain network, where the intelligent contract is an intelligent contract for distributing the model revenue. After deployment is completed, the block chain network obtains a calling transaction of the intelligent contract sent by the demand side node, so that model gains of the machine learning model are determined according to the intelligent contract, contribution parameters of the participant nodes are determined, model gains corresponding to the participant nodes are determined according to the contribution parameters, and the model gains are distributed to the participant nodes. The above mode of distributing model revenue is actually another set incentive mechanism, and the nodes of the participating parties are encouraged to update the machine learning model through revenue, so that the updating effect of the machine learning model is improved. In some embodiments, the aforementioned distribution of the model revenue to each of the participant nodes may be achieved by: the block chain network stores the distribution information of the model profit of each participant node and sends the corresponding model profit to each participant nodeAn identification in the blockchain network; wherein the model revenue includes at least one of: accessing a validity period of the blockchain network, in an available storage space in the blockchain network, and querying or storing a frequency of a machine learning model in the blockchain network.
In the embodiment of the present invention, after determining the model gains corresponding to each participant node, the blockchain network may store the allocation information of the model gains of each participant node, and send an identifier of the corresponding model gains in the blockchain network to each participant node, so that the participant node queries the model gains in the blockchain network according to the identifier, where the allocation information may be hashed to obtain the identifier, and the identifier may be set according to other manners. The model revenue, in addition to the economic revenue, may be set to include at least one of: the validity period, e.g., 10 days, for a participant node to access the blockchain network, the storage space available in the blockchain network, e.g., 1 gigabyte, and the frequency of querying or storing the machine learning model in the blockchain network, e.g., up to 1 day 3 times. By the mode of storing the distribution information of the model gains in the block chain network, the traceability of the model gains is improved.
As can be seen from the above exemplary implementation of fig. 5, in the embodiment of the present invention, the authorization code is used to perform authorization authentication, so that only the participant node with authorization can obtain the machine learning model through querying, and the query security of the machine learning model is improved.
In some embodiments, referring to fig. 6, fig. 6 is another optional flowchart of a machine learning model processing method provided by an embodiment of the present invention, and based on fig. 4, before step 402, the blockchain network may further determine, in step 601, an authorized participant node.
In the embodiment of the invention, an encryption mechanism can be arranged to ensure the data security of the machine learning model. Specifically, the blockchain network determines the authorized participant node according to the indication of the demand side node, and of course, the authorized participant node may also be determined according to other manners.
In step 602, the blockchain network generates a key pair corresponding to each authorized participant node one to one, and sends the key pair to the corresponding participant node.
In fig. 6, the machine learning model from the demand side node acquired by the blockchain network is encrypted by using a public key, so that the blockchain network generates a key pair including the public key and a unique private key matched with the public key for each authorized participant node through an asymmetric encryption algorithm, and sends the key pair to the corresponding participant node. For example, if the public key is a, and the authorized participant nodes include node 1 and node 2, a key pair including the public key a and a matching private key B1 is generated, and the key pair is sent to node 1; a key pair is generated comprising public key a and a mating private key B2 and sent to node 2. It is worth noting that the above-described key pairs may also be generated by the participant nodes. It should be noted that the execution sequence of steps 601 to 602 in fig. 6 is only an example, and different execution sequences may be applied to perform the steps according to different actual application scenarios, for example, steps 601 to 602 may be performed before step 401.
In fig. 6, step 403 shown in fig. 4 can be updated as:
in step 403, the participant node decrypts the encrypted machine learning model sent by the demand side node according to the private key in the held key pair, updates the machine learning model according to the training data of the participant node, and encrypts the updated machine learning model according to the public key in the held key pair.
After inquiring the machine learning model encrypted by the public key, the participant node decrypts the machine learning model according to the private key in the key pair held by the participant node. After decryption is completed, the participant nodes update the machine learning model according to the training data of the participant nodes, and encrypt the updated machine learning model by using the public key in the key pair. Since the public keys held by authorized participant nodes are the same, the updated machine learning model can be successfully decrypted by other participant nodes after being stored in the blockchain network.
On this basis, when the demand side node submits the demand information to the blockchain network, the demand side node can submit the original, i.e., unencrypted, demand information to the blockchain network because the demand information does not generally need to be kept secret. In addition, for the participation information submitted to the blockchain network by the participant node, whether the public key is used for encrypting the participation information can be set according to the actual application scene. For the case where the public key is set to encrypt the participation information, a block constructed in the blockchain network may include: 1) the demand information submitted by the demand side node is published by adopting a public plaintext; 2) the machine learning model specifically comprises structural information and parameter information of the model, and is issued by encryption; 3) and the participation information submitted by the participant nodes is published by adopting encryption.
As can be seen from the above exemplary implementation of fig. 6, in the embodiment of the present invention, the machine learning model is encrypted by the public key, so that the machine learning model stored in the blockchain network is not successfully decrypted by a node that does not hold a corresponding private key, and the security of storing the machine learning model is improved.
In the following, an exemplary application of the embodiments of the present invention in a practical application scenario will be described.
As shown in fig. 7, an alternative flow diagram of a machine learning model processing method is provided in the embodiment of the present invention, and for ease of understanding, fig. 7 is described below in a numbered form.
1) And the demander node starts a request and stores the demand information to the block chain network.
The demand side node is a node inside the block chain network, when model training is needed, a request is sent to the block chain network, demand information is sent to the block chain network, and the block chain network stores the demand information, wherein the demand information can include relevant details of a machine learning model and demands for training data.
2) The demand side node issues an initial machine learning model, and the machine learning model is stored in the block chain network in an encrypted mode.
The demand side node encrypts the initial machine learning model by using the public key, sends the encrypted machine learning model to the block chain network, and stores the encrypted machine learning model by the block chain network.
3) And determining whether to participate in the training of the machine learning model by the participant node according to the training data of the participant node.
And the participant node inquires from the block chain network to obtain the demand information and judges whether the training data of the participant node is matched with the demand information. For example, if the training data of the requirement information indicating the requirement is communication software chat data and the training data of the participant node itself is game data, the participant node determines that the training data of the participant node itself does not match the requirement information and does not participate in training the machine learning model.
4) The participator node inquires from the blockchain network to obtain an encrypted machine learning model, and decrypts the encrypted machine learning model according to a held private key; and updating the machine learning model according to the training data of the machine learning model.
For a public key used for encryption, a blockchain network or a participant node generates a plurality of unique private keys matched with the public key to form a plurality of key pairs, and the plurality of key pairs are sent to different participant nodes with authority one by one. And when determining to participate in the training of the machine learning model, the participant node queries from the blockchain network to obtain the encrypted machine learning model, decrypts the encrypted machine learning model according to the held private key, and updates the machine learning model according to the training data of the participant node.
5) And the participator node records participatory information related to the updating operation, and encrypts and stores the updated machine learning model and the participatory information to the blockchain network.
The participant nodes record participation information generated when updating the machine learning model, for example, the participation information may include the amount of contribution data of the participant nodes and the degree of update to the machine learning model. After the updating is completed, the participant nodes encrypt the updated machine learning model and the participant information through private keys and store the machine learning model and the participant information to the block chain network through a consensus mechanism. In conjunction with the above, a tile in a chain of tiles may include the following information: the method comprises the steps of encrypting published demand information, encrypting published machine learning models and encrypting published participation information. In subsequent processes, the participant node may determine whether to continue to participate in the training of the machine learning model.
As can be seen from the above exemplary implementation of fig. 7, in the embodiment of the present invention, the blockchain network is used as a network platform for sharing the machine learning model, so that the authorized nodes can store, update, and query the machine learning model, and meanwhile, the process of updating the machine learning model according to the training data is handed over to the participant nodes to be performed inside the nodes, thereby improving the security of the training data held by the participant nodes, and effectively avoiding the leakage of the training data.
Continuing with the exemplary structure in which the nodes of the blockchain network provided by embodiments of the present invention are implemented as software modules, in some embodiments, as shown in fig. 3, the software modules 2143 stored in the memory 2140 may include: the model acquisition module 21431 is configured to acquire a machine learning model sent by a demander node, and store the machine learning model in a blockchain network; the model transaction module 21432 is configured to send, in response to a query request for the machine learning model sent by a participant node, the machine learning model to the participant node, so that the participant node updates the machine learning model according to training data of the participant node; a consensus module 21433, configured to obtain the updated machine learning model sent by the participant node, and perform consensus on the updated machine learning model; the update storage module 21434 is configured to, when the consensus succeeds, store the updated machine learning model to the blockchain network.
In some embodiments, the software module 2143 further comprises: a first node determining module for determining authorized participant nodes; and the authorization module is used for generating authorization codes which correspond to the authorized participant nodes one by one and sending the authorization codes to the corresponding participant nodes, wherein the authorization codes are used for the participant nodes to inquire the machine learning model.
In some embodiments, the model trading module 21432 is further configured to: obtaining an authorization code sent by the participant node; performing authority authentication according to the authorization code; and when the authority authentication is successful, sending the machine learning model to the participant node.
In some embodiments, the performing the authority authentication according to the authorization code includes: generating authorization parameters of the authorization codes according to the historical updating times, the model promotion degree, the contribution data quantity and the historical query times of the participant nodes on the machine learning model; and when the authorization parameters meet the set parameter conditions, determining that the authority authentication is successful.
In some embodiments, the software module 2143 further comprises: the information acquisition module is used for acquiring information of a participant node needing authorization, which is sent by the demander node, wherein the information of the participant node comprises identity information, a validity period for accessing the block chain network and a machine learning model capable of being trained; and the information storage module is used for storing the information of the participant node needing to be authorized into the blockchain network when the information of the participant node meets an authorization condition through an intelligent contract which is deployed to the blockchain network by the demander node.
In some embodiments, the software module 2143 further comprises: a verification module for verifying a digital signature of a query request sent by a participant node in response to the query request for the machine learning model; the information inquiry module is used for inquiring the information of the participant node sending the inquiry request in the information of the authorized participant node in the block chain network when the verification is passed; and the response module is used for determining to respond to the query request when inquiring the information of the participant node sending the query request.
In some embodiments, the software module 2143 further comprises: the contract acquisition module is used for acquiring an intelligent contract which is sent by the demand side node and comprises an authorization condition, and the authorization condition corresponds to the machine learning model; and the contract deployment module is used for deploying the authorization condition into the block chain network.
In some embodiments, the software module 2143 further comprises: a profit determination module to determine a model profit for the machine learning model; the contribution determining module is used for determining contribution parameters of the participant nodes according to the historical updating times, the model lifting degrees and the contribution data volumes of the participant nodes to the machine learning model; and the distribution module is used for determining corresponding model gains according to the contribution parameters of the participator nodes and distributing the model gains to the participator nodes.
In some embodiments, said distributing said model revenue to each of said participant nodes comprises: storing the distribution information of the model profit of each participant node into the block chain network, and sending the identification of the corresponding model profit in the block chain network to each participant node; wherein the model revenue includes at least one of: accessing a validity period of the blockchain network, in an available storage space in the blockchain network, and querying or storing a frequency of a machine learning model in the blockchain network.
In some embodiments, the software module 2143 further comprises: a second node determining module for determining authorized participant nodes; and the key sending module is used for generating a key pair which corresponds to each authorized participant node one to one, and sending the key pair to the corresponding participant node, so that the participant node decrypts the encrypted machine learning model sent by the demand party node according to a private key in the held key pair, and encrypts the updated machine learning model according to a public key in the held key pair, wherein the private keys in the key pairs of different participant nodes are different.
In some embodiments, the software module 2143 further comprises: a participation information consensus module, configured to acquire participation information sent by the participant node and perform consensus on the participation information, where the participation information is related to an update operation performed on the machine learning model by the participant node; and the participation information storage module is used for storing the participation information to the block chain network when the consensus is successful.
In some embodiments, the software module 2143 further comprises: the demand information acquisition module is used for acquiring demand information sent by the demand side node, and the demand information corresponds to the machine learning model; and the demand information storage module is used for storing the demand information to the block chain network.
In some embodiments, the consensus module 21433 is further configured to: broadcasting the updated machine learning model in the blockchain network so that nodes in the blockchain network fill the updated machine learning model into an update block and carry out consistency verification on the update block;
the update storage module 21434 is further configured to: the update block is appended to the end of the blockchain.
In some embodiments, the model acquisition module 21431 is further configured to: the blockchain network comprises blockchains for uniformly storing different machine learning models, and the machine learning models are stored into the blockchains of the blockchain network; or the block chain network comprises a plurality of channels corresponding to different types of machine learning models, and the machine learning models are stored in the block chains of the channels of the corresponding types.
Embodiments of the present invention provide a storage medium having stored therein executable instructions that, when executed by a processor, will cause the processor to perform a method provided by embodiments of the present invention, for example, a machine learning model processing method as illustrated in fig. 4, 5, 6 or 7.
In some embodiments, the storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, in the embodiments of the present invention, a blockchain network is used as a network platform for sharing a machine learning model, so that authorized nodes can perform operations of storing, updating, and querying the machine learning model, and meanwhile, a process of updating the machine learning model according to training data is handed over to a participant node to be performed inside the node, thereby improving the security of the training data held by the participant node.
The above description is only an example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (13)

1. A machine learning model processing method based on a block chain network is characterized by comprising the following steps:
acquiring a machine learning model sent by a demander node and demand information corresponding to the machine learning model, and storing the machine learning model and the demand information to a block chain network;
the demand information is used for indicating nodes belonging to a specific service subject in the block chain network to update the machine learning model, or indicating nodes having specific training data in the block chain network to update the machine learning model;
acquiring a query request and an authorization code of the machine learning model sent by a participant node, and performing authority authentication according to the authorization code;
when the authority authentication is successful, the machine learning model is sent to the participant node, so that the participant node updates the machine learning model according to the training data of the participant node;
acquiring the updated machine learning model and participation information related to updating operation sent by the participant node, constructing the demand information, the updated machine learning model and the participation information into a block, and commonly identifying the block;
and when the consensus is successful, storing the updated machine learning model and the participation information to the blockchain network.
2. The machine learning model processing method of claim 1, further comprising:
determining an authorized participant node;
generating authorization codes corresponding to each authorized participant node one to one, and sending the authorization codes to the corresponding participant nodes, wherein the authorization codes are used for the participant nodes to inquire the machine learning model.
3. The machine learning model processing method of claim 1, wherein the performing authority authentication according to the authorization code comprises:
generating authorization parameters of the authorization codes according to the historical updating times, the model promotion degree, the contribution data quantity and the historical query times of the participant nodes on the machine learning model;
and when the authorization parameters meet the set parameter conditions, determining that the authority authentication is successful.
4. The machine learning model processing method of claim 2, further comprising:
acquiring information of a participant node needing authorization, which is sent by the requiring party node, wherein the information of the participant node comprises identity information, a validity period of accessing the block chain network and a machine learning model capable of being trained;
and when the information of the participant node meets the authorization condition through the intelligent contract deployed to the block chain network by the demander node, storing the information of the participant node needing authorization into the block chain network.
5. The machine learning model processing method of claim 4, further comprising:
before acquiring a query request and an authorization code of the machine learning model sent by the participant node, verifying a digital signature of the query request;
when the verification is passed, inquiring the information of the participant node sending the inquiry request in the information of the authorized participant node in the block chain network;
and when inquiring the information of the participant node sending the inquiry request, determining to respond to the inquiry request.
6. The machine learning model processing method of claim 4, further comprising:
acquiring an intelligent contract which is sent by the demand side node and comprises an authorization condition, wherein the authorization condition corresponds to the machine learning model;
deploying the authorization condition into the blockchain network.
7. The machine learning model processing method of claim 1, further comprising:
determining a model gain for the machine learning model;
determining contribution parameters of the participant nodes according to the historical updating times, the model promotion degree and the contribution data volume of the participant nodes to the machine learning model;
and determining corresponding model gains according to the contribution parameters of the participator nodes, and distributing the model gains to the participator nodes.
8. The machine learning model processing method of claim 7, wherein said distributing the model revenue to each of the participant nodes comprises:
storing the distribution information of the model profit of each participant node into the block chain network, and sending the identification of the corresponding model profit in the block chain network to each participant node;
wherein the model revenue includes at least one of: accessing a validity period of the blockchain network, in an available storage space in the blockchain network, and querying or storing a frequency of a machine learning model in the blockchain network.
9. The machine learning model processing method of claim 1, further comprising:
determining an authorized participant node;
generating a key pair corresponding to each authorized participant node one to one, and sending the key pair to the corresponding participant node, so that
The participant node decrypts the encrypted machine learning model sent by the demand party node according to a private key in a held key pair, and encrypts the updated machine learning model according to a public key in the held key pair,
wherein the private keys in the key pairs of different participant nodes are different.
10. The machine learning model processing method according to any one of claims 1 to 9,
the consensus on the blocks comprises:
broadcasting the blocks in the block chain network so that
Filling the blocks into an updating block by a node in the block chain network, and carrying out consistency verification on the updating block;
the storing the updated machine learning model and the participation information to the blockchain network includes:
the update block is appended to the end of the blockchain.
11. A node of a blockchain network, comprising:
the model acquisition module is used for acquiring a machine learning model sent by a demander node and demand information corresponding to the machine learning model, and storing the machine learning model and the demand information to a block chain network; the demand information is used for indicating nodes belonging to a specific service subject in the block chain network to update the machine learning model, or indicating nodes having specific training data in the block chain network to update the machine learning model;
the model transaction module is used for acquiring a query request and an authorization code of the machine learning model, which are sent by a participant node, and performing authority authentication according to the authorization code; when the authority authentication is successful, the machine learning model is sent to the participant node, so that the participant node updates the machine learning model according to the training data of the participant node;
the consensus module is used for acquiring the updated machine learning model and the participation information related to the updating operation, which are sent by the participant node, constructing the demand information, the updated machine learning model and the participation information into a block, and performing consensus on the block;
and the updating storage module is used for storing the updated machine learning model and the participation information to the block chain network when the consensus is successful.
12. A node of a blockchain network, comprising:
a memory for storing executable instructions;
a processor for implementing the machine learning model processing method of any one of claims 1 to 10 when executing executable instructions stored in the memory.
13. A computer-readable storage medium having stored thereon computer-executable instructions for performing the machine learning model processing method of any one of claims 1 to 10 when executed.
CN201910776690.2A 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node Active CN110490305B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911295577.9A CN110991622B (en) 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node
CN201910776690.2A CN110490305B (en) 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910776690.2A CN110490305B (en) 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201911295577.9A Division CN110991622B (en) 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node

Publications (2)

Publication Number Publication Date
CN110490305A CN110490305A (en) 2019-11-22
CN110490305B true CN110490305B (en) 2021-06-04

Family

ID=68552751

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201910776690.2A Active CN110490305B (en) 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node
CN201911295577.9A Active CN110991622B (en) 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201911295577.9A Active CN110991622B (en) 2019-08-22 2019-08-22 Machine learning model processing method based on block chain network and node

Country Status (1)

Country Link
CN (2) CN110490305B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111062044B (en) * 2019-12-09 2021-03-23 支付宝(杭州)信息技术有限公司 Model joint training method and device based on block chain
US11218293B2 (en) * 2020-01-27 2022-01-04 Hewlett Packard Enterprise Development Lp Secure parameter merging using homomorphic encryption for swarm learning
US11748835B2 (en) 2020-01-27 2023-09-05 Hewlett Packard Enterprise Development Lp Systems and methods for monetizing data in decentralized model building for machine learning using a blockchain
CN111859415A (en) * 2020-06-18 2020-10-30 上海艾麒信息科技有限公司 Neural network model encryption system and method
CN111753984A (en) * 2020-06-28 2020-10-09 中国银行股份有限公司 Distributed AI training method, device and system based on block chain
CN111882074A (en) * 2020-07-30 2020-11-03 平安科技(深圳)有限公司 Data preprocessing system, method, computer device and readable storage medium
CN112699414B (en) * 2020-08-14 2024-03-15 武汉乾云软件开发中心(有限合伙) Machine learning data evidence-storing method and system based on blockchain
CN112883111A (en) * 2020-08-20 2021-06-01 王红根 Information management method, system and platform based on block chain digital currency finance
CN112163034B (en) * 2020-09-03 2023-06-16 中国联合网络通信集团有限公司 Model sharing method, node and blockchain system
CN112348063A (en) * 2020-10-27 2021-02-09 广东电网有限责任公司电力调度控制中心 Model training method and device based on federal transfer learning in Internet of things
US20220198304A1 (en) * 2020-12-18 2022-06-23 International Business Machines Corporation Providing explainable machine learning model results using distributed ledgers
CN112801134A (en) * 2020-12-30 2021-05-14 杭州趣链科技有限公司 Gesture recognition model training and distributing method and device based on block chain and image
CN115250485A (en) * 2021-04-27 2022-10-28 华为技术有限公司 Method and device for distributing models
CN113420017B (en) * 2021-06-21 2023-10-13 上海特高信息技术有限公司 Block chain application method for acquiring training data set of robot navigation algorithm
CN113612598B (en) * 2021-08-02 2024-02-23 北京邮电大学 Internet of vehicles data sharing system and method based on secret sharing and federal learning
CN114037086B (en) * 2021-10-19 2023-01-24 中国联合网络通信集团有限公司 Block chain-based machine learning task distribution method, equipment and system
WO2023096637A1 (en) * 2021-11-23 2023-06-01 Visa International Service Association Automatic model onboarding and searching-based optimization
CN114707663B (en) * 2022-04-15 2024-02-23 中国电信股份有限公司 Distributed machine learning method, device, electronic equipment and storage medium
CN116566846B (en) * 2023-07-05 2023-09-22 中国电信股份有限公司 Model management method and system, shared node and network node

Family Cites Families (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10490304B2 (en) * 2012-01-26 2019-11-26 Netspective Communications Llc Device-driven non-intermediated blockchain system over a social integrity network
KR20190032433A (en) * 2016-07-18 2019-03-27 난토믹스, 엘엘씨 Distributed machine learning systems, apparatus, and methods
CN109891416A (en) * 2016-10-27 2019-06-14 株式会社电装 For authenticating and the system and method for authorization device
CN108234127A (en) * 2016-12-22 2018-06-29 中国移动通信集团公司 A kind of Internet of Things method and device based on block chain
US10270599B2 (en) * 2017-04-27 2019-04-23 Factom, Inc. Data reproducibility using blockchains
US10230530B2 (en) * 2017-08-05 2019-03-12 Proclus Technologies Limited Method and system for securing a blockchain with proof-of-transactions
EP3503012A1 (en) * 2017-12-20 2019-06-26 Accenture Global Solutions Limited Analytics engine for multiple blockchain nodes
CN108270780B (en) * 2018-01-08 2020-12-29 中国电子科技集团公司第三十研究所 Multi-center digital identity management method in heterogeneous network environment
WO2019144353A1 (en) * 2018-01-25 2019-08-01 深圳前海达闼云端智能科技有限公司 Blockchain-based data training method and device, storage medium and blockchain node
CN108563784A (en) * 2018-04-26 2018-09-21 福建中锐海沃科技有限公司 A kind of digital resource adduction relationship recording method and system
CN108768700B (en) * 2018-05-11 2021-09-03 北京奇虎科技有限公司 Reward distribution method, device and system in block chain
CN109685511B (en) * 2018-05-30 2023-06-09 上海分壳信息技术股份有限公司 Block chain-based data use right transaction method
CN108898219A (en) * 2018-06-07 2018-11-27 广东工业大学 A kind of neural network training method based on block chain, device and medium
CN109034837B (en) * 2018-06-29 2020-12-29 山东华夏维康农牧科技有限公司 Multi-code tracing anti-counterfeiting method and system
CN109242636A (en) * 2018-09-26 2019-01-18 盈盈(杭州)网络技术有限公司 A kind of data transacting system and its implementation based on block chain
CN109493216B (en) * 2018-09-30 2021-02-09 北京小米移动软件有限公司 Model training method, device, system and storage medium
CN109450856B (en) * 2018-10-12 2021-09-28 西安电子科技大学 Block chain-based data link information flow control system and method
CN109167695B (en) * 2018-10-26 2021-12-28 深圳前海微众银行股份有限公司 Federal learning-based alliance network construction method and device and readable storage medium
CN109543726A (en) * 2018-11-06 2019-03-29 联动优势科技有限公司 A kind of method and device of training pattern
CN109542856A (en) * 2018-11-26 2019-03-29 上海基诺联生物科技有限公司 A kind of Distributed data share system and method based on block chain
CN109698822A (en) * 2018-11-28 2019-04-30 众安信息技术服务有限公司 Combination learning method and system based on publicly-owned block chain and encryption neural network
CN109802940A (en) * 2018-12-12 2019-05-24 北京众享比特科技有限公司 Block chain data base encryption and decryption method, device, equipment and its storage medium
CN109670583A (en) * 2018-12-27 2019-04-23 浙江省公众信息产业有限公司 Data analysing method, system and the medium of decentralization
CN109711408B (en) * 2018-12-28 2023-05-26 天津智芯视界科技有限公司 Personnel identification system for construction site
CN110020774B (en) * 2019-01-30 2023-08-01 创新先进技术有限公司 Resource sharing method, system, device and electronic equipment
CN109873866B (en) * 2019-02-20 2020-10-09 北京邮电大学 Data sharing method and device based on block chain and electronic equipment
CN109922155B (en) * 2019-03-18 2022-03-04 众安信息技术服务有限公司 Method and device for realizing intelligent agent in block chain network
CN110034917A (en) * 2019-04-11 2019-07-19 鸿秦(北京)科技有限公司 A kind of alliance's chain data processing method and device based on homomorphic encryption algorithm

Also Published As

Publication number Publication date
CN110991622B (en) 2021-06-04
CN110490305A (en) 2019-11-22
CN110991622A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110490305B (en) Machine learning model processing method based on block chain network and node
CN112214780B (en) Data processing method and device, intelligent equipment and storage medium
CN111047319B (en) Transaction processing method of block chain network and block chain network
CN110532323B (en) Student identity information processing method and device in block chain network, electronic equipment and storage medium
CN110599069B (en) Application evaluation method and device based on block chain network
CN110599095B (en) Block chain network-based hazardous waste treatment method and node of block chain network
US20200127828A1 (en) System and method for creating decentralized identifiers
CN110235410B (en) Method for substituting user's login by PKI-based authentication using blockchain database of UTXO-based protocol and server using the same
CN111144881A (en) Selective access to asset transfer data
WO2020001117A1 (en) Blockchain maintaining method and apparatus, server, and computer-readable storage medium
US10554407B1 (en) Protocols for decentralized networks
CN110543525B (en) Block chain network control method, device, equipment and storage medium
CN110599213B (en) Article management method and device based on blockchain network and electronic equipment
EP3903268B1 (en) Blockchain management system
EP4216077A1 (en) Blockchain network-based method and apparatus for data processing, and computer device
CN110516474A (en) User information processing method, device, electronic equipment and storage medium in block chain network
CN112073413B (en) Online alliance chain management method and device, computer equipment and storage medium
CN112163954B (en) Transaction method and device based on block chain
CN110769274A (en) Live broadcast information processing method and device based on block chain network, electronic equipment and storage medium
CN112910870B (en) Collaborative privacy computation data communication method based on block chain
CN111798233A (en) Linking of tokens
CN114760071B (en) Zero-knowledge proof based cross-domain digital certificate management method, system and medium
CN115705601A (en) Data processing method and device, computer equipment and storage medium
CN113014540B (en) Data processing method, device, equipment and storage medium
CN111062497A (en) Property management method, platform and storage medium based on block chain network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40015683

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant