Federal learning model sharing training system based on block chain

By introducing blockchain technology into the federated learning framework, model registration, training result broadcast and contribution calculation are implemented, the trust problems and security threats brought by centralized parameter servers are solved, and the security and transparency of model parameters are improved. Reduced trust costs.

CN118966381APending Publication Date: 2024-11-15BEIHANG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411023432.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

There are problems with centralized parameter servers in the existing federated learning framework, resulting in trust issues, risk of rule modification, single point of failure and security threats, and data bias may lead to unfair model training results.

Method used

Using a federated learning model sharing training system based on blockchain, the smart contract layer, block function layer and storage layer can realize model registration, training result broadcast, contribution degree calculation and decentralized distributed parameter server, combined with Tensorflow's C&S separate training framework implements model winding and contribution calculation contracts, incentive mechanisms and multi-point execution verification.

Benefits of technology

It improves the security of model parameters, reduces the trust cost, solves the trust crisis brought about by centralized parameter servers, enhances the transparency and security of the system, and reduces the trust operation cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118966381A_ABST
    Figure CN118966381A_ABST
Patent Text Reader

Abstract

The invention relates to a block chain-based federated learning model sharing training system, which comprises an interaction layer, an interface layer, an application layer, an intelligent contract layer, a block function layer and a storage layer, and is characterized in that the storage layer is provided with a LevelDB and a StateDB, and adopts MySQL to realize a data double-writing strategy, the application layer and the interface layer define and realize rule means for interaction between the system and the external environment. The federal learning model sharing training system comprises various data structures required by a model uplink process, realizes a model contribution degree calculation contract and an incentive mechanism, and combines Clientamp; a distributed parameter server for multi-point execution verification in a contract is realized through a Server separated training architecture, the decentralization of the Server can increase the security of model parameters, meanwhile, the trust crisis caused by the current federal learning centralized parameter server is solved, and the trust cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a blockchain-based federated learning model sharing training system. Background Art

[0002] In 2016, Google proposed a method for establishing a shared model between mobile terminals and deep learning servers. This type of model learning is called Federated Learning. Its goal is to solve the security issues of potential sensitive data in mobile devices participating in machine learning, and to complete local training and server model aggregation updates without uploading personal privacy data to centralized data centers.

[0003] In most federated learning frameworks, a centralized parameter server is required to aggregate the training model parameters of each client to generate a new global model. The client then pulls the latest model from the server. As a model training node, the client mainly runs on the end of each data holder. The participants need to actively run the client and use their own private data for training. After training, the parameter model is returned to the server. At the same time, after the model update is completed on the server, the latest global model can be obtained to join the next round of model training. The server mainly uses the parameter updates submitted by the client after training to calculate the contribution of the model updates submitted by the participants and aggregate the updated model. The server is unique, and this design undermines the concept of distributed design to a certain extent. Figure 1 This is the sequence diagram of the Federated Learning Server & Client.

[0004] Federated learning has a model center server that processes the model in a centralized manner. The server needs to run under a centralized and trusted community leader. Centralization often allows leaders to modify internal rules, which also leads to greater risks:

[0005] Trust issue: Although the data is not stored centrally, the model center server still needs to be trusted by all participants because it controls the model training process.

[0006] Rule Modification: If the operator of the server decides to modify the rules, it may affect the fairness and transparency of the training results.

[0007] Single point of failure: If the central server fails, the entire federated learning process may be affected.

[0008] Security threats: Central servers may become targets of attacks, such as data breaches or denial of service (DDoS) attacks.

[0009] Data bias: If the central server is biased during the aggregation process, it may lead to unfair model training results. Summary of the invention

[0010] In order to solve the existing problems, the present invention provides a blockchain-based federated learning model sharing training system.

[0011] The present invention adopts the following technical solutions:

[0012] A blockchain-based federated learning model sharing training system, including: interaction layer, interface layer, application layer, smart contract layer, block function layer and storage layer.

[0013] The storage layer is provided with a LevelDB storage unit and a StateDB storage unit, and uses the relational database MySQL to implement a double-write strategy for data;

[0014] The smart contract layer is used for: contracts are triggered by transactions. When a transaction is input into the contract executor ContractManager, it will be parsed and decomposed into a parameter set. The parameter set includes the contract name and contract parameters. The type of contract is determined by the contract name.

[0015] The application layer and interface layer define and implement the rules and means for the blockchain and federated learning model sharing training system to interact with the external environment. The operations on the blockchain are divided into transaction behaviors and query behaviors according to the external behaviors. Among them, transaction behaviors will trigger the blockchain contract and change the underlying data of the blockchain, and the transactions are sent by the outside world to the blockchain; query behaviors only query the existing block data and do not involve the modification of block data. Such behaviors belong to the query of traditional data.

[0016] Furthermore, in the storage layer, the StateDB storage unit is responsible for the blockchain data and is used in processes such as consensus and execution of smart contracts; the relational database MySQL is responsible for the data of business scenarios and provides services for WEB applications. The summary of each data in the relational database MySQL needs to be mapped to the StateDB storage unit.

[0017] Furthermore, in the smart contract layer, the contract trigger information is sent to the blockchain node in the form of a transaction. The node parses the transaction field, obtains the contract name that the transaction needs to trigger, and then determines whether it is a native contract:

[0018] If it is a native contract, directly call the invoke method of the OriContract object and pass in the corresponding parameters;

[0019] If it is not a native contract, you need to check whether the contract is deployed in the blockchain. If not, end the process directly. If it has been deployed in the blockchain, analyze the Class class loaded in the JVM memory. If the contract has been loaded into the memory, directly reflect and call this contract. Otherwise, read and load the contract into the memory according to the full class name of the contract, and then perform the contract reflection call;

[0020] All contracts persist the state after execution and modify the global account status corresponding to the business.

[0021] Furthermore, the block function layer is used to fill in various parameters into the map when encapsulating the transaction, and then construct the ContractCaller object with the transaction contract address and the parameters of the triggered contract as parameters, and then serialize the object into Json and store it as a data field of String type.

[0022] Furthermore, the federated learning model sharing training system also includes a C&S separation training framework based on Tensorflow, and the model training process of the C&S separation training framework includes:

[0023] Using the model registration smart contract, the Server and Client model codes are registered in the blockchain, and the Client code is used by data participants;

[0024] After the participants complete a round of model training, they broadcast the training results to the blockchain. At this time, each client submission is packaged into a transaction that can be recognized by the blockchain.

[0025] The blockchain node selects the master node for this round through polling, collects all updates of the model, and runs the server-side code registered on the blockchain for model aggregation evaluation; at the same time, the blockchain master node runs the model contribution calculation contract to calculate the contribution distribution of this round;

[0026] After waiting for the model aggregation update and contribution calculation to be completed, the master node will broadcast the latest global model of this round and the contribution update of the corresponding participant account, and each slave node will run the consensus protocol to verify the model and contribution;

[0027] After consensus is reached, the current round of models and participants’ contributions are updated and persisted, and the system waits for the next round of updates.

[0028] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention provides a blockchain-based federated learning model sharing training system, which includes various data structures required for the model chain process, realizes the model contribution calculation contract and incentive mechanism, and realizes a distributed parameter server with multi-point execution verification within the contract by combining the Client&Server separation training architecture. The decentralization of the server can increase the security of the model parameters, and at the same time solves the trust crisis brought about by the current centralized parameter server of federated learning and reduces the trust cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following briefly introduces the drawings required for use in the embodiment:

[0030] Figure 1 This is the Federated Learning Server & Client timing diagram;

[0031] Figure 2 This is a schematic diagram of a blockchain-based federated learning model sharing training system framework provided by the present invention;

[0032] Figure 3 This is a schematic diagram of the dual database writing mode;

[0033] Figure 4 It is a schematic diagram of the block data structure;

[0034] Figure 5 It is the model account-user account correspondence diagram;

[0035] Figure 6 It is the execution flow chart of the smart contract layer system;

[0036] Figure 7-a and Figure 7-b It is a comparison chart of transaction sending;

[0037] Figure 8 This is a schematic diagram of the Client&Server separate chain framework. DETAILED DESCRIPTION

[0038] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0039] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0040] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0041] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0042] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0043] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0044] In order to illustrate the technical solution described in this application, a specific implementation method is provided below.

[0045] First, let me introduce blockchain. Blockchain is a special data structure that organizes data in the form of blocks and chains. Cryptography is used to ensure that block data cannot be tampered with or forged. It is essentially a decentralized distributed shared ledger. Due to the characteristics of blockchain such as decentralization, development, autonomy, security, reliability, and programmability, it has set off a wave of technological reform in many fields.

[0046] By utilizing the immutability of blockchain, the behavior of each terminal updating the model can be recorded in the blockchain, and participating members can query the update records of all versions on the chain at any time, ensuring the transparency of the update. At the same time, once the block is passed by consensus and persisted, it has immutability. First, it ensures that the model update submitted by the terminal user is not tampered with, safeguarding the interests of the training party; second, it ensures the security of the global model, which makes the models on the chain pulled by users reliable. Secondly, as a distributed trusted system, blockchain can provide decentralized services, abandoning the centralized parameter server required in the original distributed training process. Multiple nodes use a set of consensus algorithms to maintain the entire community, which not only reflects the openness of the entire system, but also ensures that there will be no inequality of rights and interests caused by excessive concentration of power. Secondly, from the perspective of blockchain programmability, smart contracts can be written to complete the contribution distribution algorithm within an autonomous community. Smart contracts have the characteristics of automatic execution when conditions are met, and fully retain transparency. Such contracts can be transformed from the traditional trust model reached between people through paper agreements to trust in the same smart contract, effectively bypassing the original trusted third-party intermediary's proof, directly establishing point-to-point trust, and greatly reducing the cost of community trust operation. In addition, the traceability of blockchain also reduces the verification cost caused by objection complaints from another perspective.

[0047] This embodiment provides a blockchain-based federated learning model sharing training system, referred to as the MSChain system (Model Share Chain).

[0048] The MSChain system uses a layered and modular design architecture, including 6 layers: interaction layer, interface layer, application layer, smart contract layer, block function layer and storage layer. Figure 2 As shown. The system adopts the bottom-up design and development principle, and components and modularizes each level, allowing each level to be adjusted and changed according to needs to meet the flexible scalability of the system. The focus of this embodiment is on the interface layer, application layer, smart contract layer and storage layer. In addition to the block, transaction and account design originally based on digital transactions as templates, the storage layer also needs to design and develop various basic data structures that meet the model chain according to the data structure characteristics of the model and the key information generated during the model training process, and realize the storage and query of the model. The smart contract layer includes the basic smart contract design, which is divided into two categories: native smart contracts and user smart contracts from the bottom-level implementation principle. This embodiment uses the native smart contract as a design template to develop a model contribution calculation smart contract and an incentive mechanism contract to protect the interests of multiple participants. The application and interface layer mainly includes the demand analysis of the upper-level business process. Through the study of the model chain process, various internal transaction trigger mechanisms and external data query functions are designed and implemented.

[0049] Among them, the basic data structure of the storage layer is the underlying key to support blockchain and federated learning model services. Formulating a complete data structure design before implementing the upper-level business design can greatly simplify the subsequent development difficulty. The model on-chain has similarities and differences with the traditional transaction blockchain block and transaction structure, and it is necessary to focus on the relevant data structure support for model training and evaluation.

[0050] In terms of underlying implementation, the storage layer is equipped with LevelDB storage units and StateDB storage units. As the main storage technologies of blockchain, LevelDB and StateDB provide persistence for blocks, transactions, and accounts. Their storage model is stored in the form of KV. There are not too many existing models provided for data organization. When dealing with more complex data models, it is impossible to perform quick and convenient data analysis and data query. In order to facilitate the query of business data, the relational database MySQL is used to implement the dual-write strategy for data. StateDB is responsible for blockchain data and is used in processes such as consensus and execution of smart contracts; the MySQL database can be additionally responsible for business scenario data and provide services for WEB applications. The summary of each data in MySQL needs to be mapped to StateDB. The design of the dual database strengthens the immutability of blockchain data to a certain extent. Figure 3 shown.

[0051] As the most basic and core data structure of blockchain, blocks carry the storage of various aggregated information on the chain. Blocks generate chain structures by recording the height information and the hash of the previous block, while the block body generates the hash of the current block by storing data in units of transactions and using the Merkle tree algorithm. This data structure organization can ensure that blocks and transactions within blocks cannot be tampered with. The block structure is as follows: Figure 4 shown.

[0052] In this embodiment, the data field design of the blockchain is shown in Table 1, which is a block data field design table.

[0053] Table 1

[0054]

[0055]

[0056] The block function of the MSChain system is designed in comparison with the traditional blockchain. Model-related information will be packaged into transactions and stored in the block. In this blockchain, data fields such as extra are defined to facilitate statistics and evaluation of the block performance of the blockchain.

[0057] Transactions carry user behavior information on the chain, and their main function is to provide relevant data as smart contract input to trigger the contract. Transactions need to include timestamps, transaction types, version numbers, signature information, and serialized and encrypted contract information data. The data field design included in a transaction is shown in Table 2, which is a transaction data field design table.

[0058] Table 2

[0059]

[0060] In order to achieve the transmission of transactions on the network and normal parsing after sending to the blockchain, it is necessary to specify the rules for encapsulating transaction content. The transaction content needs to be stored in the data field, which is the ContractCaller object after Json serialization. Therefore, the block function layer needs to fill in each parameter in the map when encapsulating the transaction, and then construct the ContractCaller object with the transaction contract address and the parameters of the triggering contract as parameters, and then serialize this object into Json and store it as a data field of String type.

[0061] The system mainly focuses on two process scenarios: model training and community incentives, and formulates the account data structure based on the scenario design. The account is divided into the following three parts:

[0062] (1) UserAccount: User accounts are the basis for the operation of community accounts and are the credentials for each community user's activities on the chain. The role of a user in the community is not fixed. Users can provide algorithms and data, or purchase and use other people's models. Therefore, in the design, user accounts are not divided into roles, but are divided into levels using a reputation mechanism. The user account field design is shown in Table 3, which is the user field table.

[0063] Table 3

[0064]

[0065] (2) ContractAccount: The contract account is the information storage party for the contract deployed on the chain. Each contract corresponds to a contract account, which contains various information required to store, query and trigger this contract. The contract field definition is shown in Table 4, which is the contract account field table.

[0066] Table 4

[0067] Field Name type describe contractKey String Contract address, stored in state contractName String Contract Name data String Contract related data classData Byte[] Contract code class data fullName String Fully qualified class name, used to detect conflicts intro String Contract Introduction type String Contract file type: class type; jar type params String Contract parameter introduction

[0068] (3) ModelAccount: The model account is an important credential for the model to be put on the chain, and is also a summary of the global model information during the training process. Compared with the user account, the model account has more fields that describe the current status of the model. The field definition is shown in Table 5, which is the contract account field table.

[0069] Table 5

[0070]

[0071]

[0072] By defining user accounts and model accounts, it is not difficult to see that the internal information of the model account corresponds to multiple user accounts, such as Figure 5 shown.

[0073] This design is mainly used for quick crediting of incentive points. The incentive contract reads the contributionMap data field of the model account and parses the points corresponding to the user account contribution, and then distributes the points. In addition, the design decouples the model from the user account, increases account flexibility, and enables the user account to connect to the account system of other communities.

[0074] In the smart contract layer, the contract is triggered by a transaction. When a transaction is input into the contract executor ContractManager, it will be parsed and decomposed into a parameter set. The parameter set includes the contract name and contract parameters. The type of contract is determined by the contract name. In this embodiment, the types of smart contracts in the system can be divided into user smart contracts and native smart contracts from the bottom-level implementation method. The user smart contract refers to the process of Ethereum deploying and executing Solidity smart contracts on the EVM virtual machine, that is, contract writing, compilation and packaging, deployment, interpreter loading and execution of bytecode. Based on the concept of the EVM virtual machine, this embodiment uses Java's reflection mechanism on the basis of the Java chain to implement the execution process of the contract on the JVM (Java Virtual Machine), that is, the contract written in Java language is loaded and executed on the JVM.

[0075] Java reflection can dynamically obtain the properties of an object and call various methods of the object. After the contract is deployed on the chain, the JVM virtual machine does not load the contract class into the memory, but organizes it in the form of a file in the blockchain system. It is necessary to define a ClassLoader loader to check whether the class is loaded. If not, it is loaded into the memory according to the path for calling. The contract code is stored in the form of a file on the chain, so a FileClassLoader based on file reading and loading is defined. After the class is loaded, it mainly relies on the invoke method of the Method class under the java.lang.reflect package to call the packaged object method. In order to unify the management of all smart contracts, this embodiment defines the entry rules of the contract:

[0076] 1) The contract entry function name must be run;

[0077] 2) The contract needs to fully implement the ContractInterface interface.

[0078] After successful loading, the user smart contract will be added to the ContractEntrance maintenance<name,key> The mapping table makes it easier to find the smart contract account entity class next time.

[0079] The native smart contract is loaded when the blockchain is started, and the contract name is added to the OriContract contract table. When the contract name field of the transaction exists in the native contract table, the native contract is directly called.

[0080] like Figure 6 As shown, the contract trigger information is sent to the blockchain node in the form of a transaction. The node parses the transaction field, obtains the contract name that the exchange needs to trigger, and then determines whether it is a native contract:

[0081] If it is a native contract, directly call the invoke method of the OriContract object and pass in the corresponding parameters;

[0082] If it is not a native contract, it is necessary to check whether the contract is deployed in the blockchain. If not, the process ends directly. If it has been deployed in the blockchain, the Class class loaded in the JVM memory is analyzed. If the contract has been loaded into the memory, the contract is directly reflected and called. Otherwise, according to the full class name of the contract, the contract is read from the data storage medium and loaded into the memory, and then the contract is reflected and called.

[0083] All contracts should persist the state after execution and modify the global account state corresponding to the business.

[0084] The application layer and interface layer define and implement the rules and means for the blockchain and federated learning model sharing training system to interact with the external environment. The operations on the blockchain are divided into transaction behaviors and query behaviors according to the external behavior. Among them, transaction behaviors will trigger the blockchain contract and change the underlying data of the blockchain, and the external world will send transactions to the blockchain; query behaviors only query the existing block data and do not involve the modification of block data. Such behaviors belong to the query of traditional data.

[0085] The transaction behavior in the blockchain application interface layer design includes the broadcast, reception and extraction functions of the transaction. In order to solve the asynchronous problem of block making and transaction reception, Redis is used as the transaction cache pool. The block making node will read the quantitative transactions from the local transaction pool and then make blocks. During the block making process, users can still send new transactions to the blockchain transaction pool and execute the blocks in sequence. After adding the transaction cache pool, the throughput of the system can be improved. The timing comparison diagram at this time is as follows Figure 7-a and Figure 7-b As shown, Figure 7-a This is a schematic diagram of sending directly to a blockchain node; Figure 7-b A schematic diagram of the transaction buffer pool sent to the blockchain.

[0086] Transaction behavior requires users to package the data strictly according to the transaction data format and then send it to the Redis pool.

[0087] The query behavior involves the query of each account information and the query of blockchain operation information. Based on MySQL as the query database, MyBatis is used as the SQL persistence layer executor, and an HTTP query request interface based on SpringBoot is provided to the outside world. It is developed according to the needs, including block query, transaction query and account information query.

[0088] In this embodiment, in order to achieve decentralization on the server side, this embodiment provides a set of C&S (Client And Server) separation training framework based on Tensorflow, and connects to the blockchain system to realize a distributed federated learning server cluster in which nodes on the chain participate together. The framework diagram is shown in the figure below. Figure 8 shown.

[0089] The model training process of the C&S separation training framework includes the following:

[0090] Using the model registration smart contract, the Server and Client model codes are registered in the blockchain, and the Client code is used by data participants;

[0091] After the participants complete a round of model training (which may be multiple batches on the client side), they broadcast the training results to the blockchain side. At this time, each client submission is packaged into a transaction that can be recognized by the blockchain;

[0092] The blockchain node selects the master node for this round through polling, collects all updates of the model, and runs the server-side code registered on the blockchain for model aggregation evaluation; at the same time, the blockchain master node runs contracts such as model contribution calculation to calculate the contribution distribution of this round;

[0093] After waiting for the model aggregation update and contribution calculation to be completed, the master node will broadcast the latest global model of this round and the contribution update of the corresponding participant account, and each slave node will run the consensus protocol to verify the model and contribution;

[0094] After consensus is reached, the current round of models and participants’ contributions are updated and persisted, and the system waits for the next round of updates.

[0095] Based on the above process, a decentralized federated learning server parameter server is implemented, and the auditable, controllable, and tamper-proof features of blockchain further improve the security and credibility of the distributed training framework.

[0096] The MSChain system includes various data structures required for the model on-chain process, implements the model contribution calculation contract and incentive mechanism, and realizes a distributed parameter server with multi-point execution verification within the contract by combining the Client&Server separated training architecture. The decentralization of the server can increase the security of the model parameters, and at the same time solves the trust crisis brought about by the centralized parameter server of the current federated learning, reducing the trust cost.

[0097] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A blockchain-based federated learning model sharing training system, characterized in that: include: Interaction layer, interface layer, application layer, smart contract layer, block function layer and storage layer. The storage layer is provided with a LevelDB storage unit and a StateDB storage unit, and uses the relational database MySQL to implement a double-write strategy for data; The smart contract layer is used for: contracts are triggered by transactions. When a transaction is input into the contract executor ContractManager, it will be parsed and decomposed into a parameter set. The parameter set includes the contract name and contract parameters. The type of contract is determined by the contract name. The application layer and interface layer define and implement the rules and means for the blockchain and federated learning model sharing training system to interact with the external environment. The operations on the blockchain are divided into transaction behaviors and query behaviors according to the external behaviors. Among them, transaction behaviors will trigger the blockchain contract and change the underlying data of the blockchain, and the transactions are sent by the outside world to the blockchain; query behaviors only query the existing block data and do not involve the modification of block data. Such behaviors belong to the query of traditional data.

2. The blockchain-based federated learning model sharing training system according to claim 1 is characterized in that: In the storage layer, the StateDB storage unit is responsible for blockchain data and is used in processes such as consensus and smart contract execution; the relational database MySQL is responsible for business scenario data and provides services for WEB applications. The summary of each data in the relational database MySQL needs to be mapped to the StateDB storage unit.

3. The blockchain-based federated learning model sharing training system according to claim 1 is characterized in that: In the smart contract layer, the contract trigger information is sent to the blockchain node in the form of transactions. The node parses the transaction field, obtains the contract name that the exchange needs to trigger, and then determines whether it is a native contract: If it is a native contract, directly call the invoke method of the OriContract object and pass in the corresponding parameters; If it is not a native contract, you need to check whether the contract is deployed in the blockchain. If not, end the process directly. If it has been deployed in the blockchain, analyze the Class class loaded in the JVM memory. If the contract has been loaded into the memory, directly reflect and call this contract. Otherwise, read and load the contract into the memory according to the full class name of the contract, and then perform the contract reflection call; All contracts persist the state after execution and modify the global account status corresponding to the business.

4. The blockchain-based federated learning model sharing training system according to claim 1 is characterized in that: The block function layer is used to fill in various parameters into the map when encapsulating the transaction, and then construct the ContractCaller object with the transaction contract address and the parameters of the triggered contract as parameters, and then serialize this object into Json and store it as a data field of String type.

5. The blockchain-based federated learning model sharing training system according to claim 1 is characterized in that: The federated learning model sharing training system also includes a C&S separation training framework based on Tensorflow. The model training process of the C&S separation training framework includes: Using the model registration smart contract, the Server and Client model codes are registered in the blockchain, and the Client code is used by data participants; After the participants complete a round of model training, they broadcast the training results to the blockchain. At this time, each client submission is packaged into a transaction that can be recognized by the blockchain. The blockchain node selects the master node for this round through polling, collects all updates of the model, and runs the server-side code registered on the blockchain for model aggregation evaluation; at the same time, the blockchain master node runs the model contribution calculation contract to calculate the contribution distribution of this round; After waiting for the model aggregation update and contribution calculation to be completed, the master node will broadcast the latest global model of this round and the contribution update of the corresponding participant account, and each slave node will run the consensus protocol to verify the model and contribution; After consensus is reached, the model and participants’ contributions for this round are updated and persisted, and the system waits for the next round of updates.

Citation Information

Cited By

  • Federal learning-oriented block chain mixed granularity parallel transaction processing method

    CN120031662A