CN113221163A - Method and system for training model - Google Patents

Method and system for training model Download PDF

Info

Publication number
CN113221163A
CN113221163A CN202110473057.3A CN202110473057A CN113221163A CN 113221163 A CN113221163 A CN 113221163A CN 202110473057 A CN202110473057 A CN 202110473057A CN 113221163 A CN113221163 A CN 113221163A
Authority
CN
China
Prior art keywords
model
cluster
blockchain
edge
edge servers
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.)
Granted
Application number
CN202110473057.3A
Other languages
Chinese (zh)
Other versions
CN113221163B (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.)
Shenzhen University
Original Assignee
Shenzhen University
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 Shenzhen University filed Critical Shenzhen University
Priority to CN202110473057.3A priority Critical patent/CN113221163B/en
Publication of CN113221163A publication Critical patent/CN113221163A/en
Application granted granted Critical
Publication of CN113221163B publication Critical patent/CN113221163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/502Proximity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Bioethics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

According to the method for training the model, a first request is obtained, wherein the first request comprises the geographic position of a user; according to the geographic position, sending indication information to the first cluster, so as to indicate each edge server in the first cluster to train the first model; obtaining a first model verified by at least part of an edge server in a block chain from a first cluster; and generating a target model according to the verified first model. According to the method, the central server generates the target model according to the first model, a user does not need to provide a local sample set, and data security of the user is protected; when the edge server is attacked, all data of the user cannot be leaked, and the safety of the data is ensured; and verifying the first model according to at least part of edge servers in the block chain, and generating a target model according to the verified first model, so that the reliability of the target model is improved.

Description

Method and system for training model
Technical Field
The application belongs to the technical field of edge computing, and particularly relates to a method and a system for training a model.
Background
With the rapid development of computer technology, Deep Learning (DL) is receiving more and more attention. Applying deep learning requires training a deep learning model (DL model). However, training an effective DL model requires a significant amount of resources, such as computing power, memory power, etc., of the device. Some individual users or small corporations may lack sufficient equipment or capital to train complex DL models.
The advent of Deep Learning as a Service (DLaaS) platforms eased the problem of DL model training. In the related technology, a DL aas platform sets a DL resource pool in a cloud data center, a user provides an original data set and a target DL model, the DLaaS platform automatically schedules a training machine and deploys an operating environment, and finally a training result and the model are returned to the user. The techniques enable a user to offload the training process of the DL model to the DLaaS platform.
Because a user needs to upload an original data set to the DLaaS platform, when the DLaaS platform is invaded by an attacker, information and data of the user may be leaked and tampered, and a DL model obtained based on the tampered data is not a real model. Therefore, the security and reliability of the DLaaS platform are low.
Disclosure of Invention
In view of the above technical problems, embodiments of the present application provide a method and a system for training a model, which can ensure data security and model reliability.
In a first aspect, an embodiment of the present application provides a method for training a model, which is applied to a system for training a model, where the system includes a central server, a plurality of edge servers, and a blockchain, where the plurality of edge servers are a plurality of blockchain nodes in the blockchain, and the method includes:
obtaining a first request, wherein the first request comprises the geographic position of a user;
according to the geographic position, sending indication information to a first cluster, wherein the first cluster is determined according to the geographic position, the indication information indicates each edge server in the first cluster to train a first model, and a plurality of trained first models belong to a plurality of submodels of a target model;
obtaining the first model verified by at least part of the edge servers in the blockchain from the first cluster;
generating the target model according to the first model verified by at least part of the edge servers in the block chain.
In particular, sending, to the first cluster, indication information according to the geographical location includes:
and sending indication information to a first cluster according to the geographic position and the type of the target model, wherein the first cluster is determined according to the geographic position and the type of the target model.
In particular, the method further comprises:
acquiring the operating conditions of the plurality of edge servers;
the sending of the indication information to the first cluster according to the geographical location includes:
and sending indication information to a first cluster according to the geographic position and the operating conditions of the edge servers, wherein the first cluster is determined according to the geographic position and the operating conditions of the edge servers.
The first request can be responded to quickly and the calculation delay of the model training task is minimized by considering the geographical position and the operation condition of the edge server.
Specifically, the first model is obtained by training, according to the resource, each edge server in the first cluster after acquiring the resource under the indication of the indication information, where the resource includes a training environment.
In particular, for any first model passing verification, at least part of the edge servers in the block chain corresponding to the first model comprise edge servers in the block chain except the edge server generating the first model.
In particular, the at least part of the edge server is determined from a plurality of random numbers generated by the blockchain.
At least part of edge servers are determined according to the random numbers, and fairness and randomness can be guaranteed when the part of edge servers are determined.
In particular, the plurality of random numbers are generated based on a random number seed generated by the block chain.
In particular, each of the random numbers is generated according to a random number seed generated by the blockchain and a weight of each edge server in the blockchain.
Specifically, each of the random numbers is generated according to a random number seed generated by the blockchain, a weight of each edge server in the blockchain, and a private key of each edge server in the blockchain, and the random numbers are used to determine at least part of the edge servers after public key verification, where the private key corresponds to the public key.
The public/private key pair ensures that the random number corresponds to the edge server, improving the accuracy of determining a portion of the edge server.
In a second aspect, an embodiment of the present application provides a system for training a model, where the system includes a central server, a plurality of edge servers, and a blockchain, where the plurality of edge servers are a plurality of blockchain nodes in the blockchain, and the system is configured to implement the method of the first aspect.
In a third aspect, an embodiment of the present application provides an apparatus for training a model, where the apparatus includes:
an obtaining module, configured to obtain a first request, where the first request includes a geographic location of a user;
the processing module is used for sending indication information to a first cluster according to the geographic position, the first cluster is determined according to the geographic position, the indication information indicates each edge server in the first cluster to train a first model, and a plurality of trained first models belong to a plurality of sub models of a target model; obtaining the first model verified by at least part of the edge servers in the blockchain from the first cluster; generating the target model according to the first model verified by at least part of the edge servers in the block chain.
In a fourth aspect, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method according to the first aspect when executing the computer program.
In a fifth aspect, the present embodiments also provide a computer-readable storage medium storing computer instructions, which, when executed on a computer, cause the computer to perform the method according to the first aspect.
In a sixth aspect, the present application further provides a computer program product, which includes a computer program and when the computer program product runs on a computer, the method according to the first aspect is implemented.
According to the method for training the model, a first request is obtained, wherein the first request comprises the geographic position of a user; according to the geographic position, sending indication information to the first cluster, so as to indicate each edge server in the first cluster to train the first model; obtaining a first model verified by at least part of an edge server in a block chain from a first cluster; a target model is generated from a first model verified by at least a portion of the edge servers in the blockchain.
The method provided by the embodiment of the application has the following beneficial effects:
firstly, the central server generates a target model according to the first model, a user does not need to provide a local sample set, and the data security of the user is protected;
secondly, migrating the model training process to each edge server in the first cluster, wherein the model training process is dispersed, the first model obtained by training each edge server in the first cluster belongs to a sub-model of the target model, the data corresponding to each first model is part of the data in all the data, and when the edge server is attacked, all the data of a user cannot be leaked, so that the data security is ensured;
thirdly, the first model is verified according to at least part of edge servers in the block chain, and a target model is generated according to the verified first model, so that the reliability of the target model is improved;
fourthly, the edge servers in the first cluster are used for carrying out parallel training on the model, and the speed of training the model is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic structural diagram of a system for training a model according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart diagram illustrating a method for training a model according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart diagram illustrating another method for training a model according to an embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of another system for training a model according to an embodiment of the present disclosure;
FIG. 5 is a block diagram of an apparatus for training a model according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, "a plurality" means two or more unless otherwise specified.
Training an effective DL model requires significant resources such as equipment power, storage, etc. Thus, some individual users or small companies may have difficulty running complex DL algorithms due to lack of sufficient equipment or funds. The emergence of DLaaS platforms greatly alleviates the resource problem of training DL models. It allows users to offload the training process of DL models to the DLaaS platform and to process submitted DL tasks for users with high-performance computing devices, thereby reducing the training time of DL models. At present, different DLaaS platforms are developed by multiple manufacturers and researchers, and network performance is improved in terms of time delay, throughput, energy consumption and the like. However, the existing DLaaS platform still faces system security and model reliability issues. The user needs to provide the raw data set to the centralized DLaaS platform. On the one hand, some users may be reluctant to expose their own sensitive business data sets. On the other hand, an attacker may invade the DLaaS platform and destroy the original data set stored in the platform, resulting in information leakage and tampering; due to the lack of trust mechanisms, the services provided by the DLaaS platform are still unreliable. An attacker may provide a forged DL model, but the user cannot discriminate the validity of the DL model, so that the user's needs cannot be satisfied. Based on the above problems, embodiments of the present application provide a method and a system for training a model, so as to ensure the security and privacy of data and ensure the validity and reliability of the model.
As shown in fig. 1, the embodiment of the present application provides a system 100 for training a model, where the system 100 includes a central server 11, a plurality of edge servers 12, and a blockchain 13, and the plurality of edge servers 12 are a plurality of blockchain nodes (#1, #2, #3, #4, etc.) in the blockchain 13. The central server 11 is responsible for scheduling edge resources, and aggregating and storing the target models. The edge server 12 is responsible for training the first model and providing the training results to the user.
The central server 11 provides a uniform resource access interface for the user, and the user sends a first request to the central server 11 through the resource access interface, where the first request instructs the central server 11 to provide a service for training a DL model for the user.
The first request includes the geographical location of the user, and the central server 11 determines a first cluster according to the geographical location, and then sends indication information to the first cluster, the indication information indicating that each edge server 12 in the first cluster trains the first model. Each edge server 12 in the first cluster obtains a sample set from the user location.
After each edge server 12 in the first cluster has trained the first model, at least some edge servers 12 in the blockchain 13 verify each first model. The central server 11 obtains from the first cluster a first model verified by at least part of the edge servers in the blockchain. And generating a target model from the first model verified by at least part of the edge servers in the blockchain.
Users include, but are not limited to, individuals, various businesses, or various terminals that have the need to train DL models. The central server 11 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers. The edge server 12 may be implemented as a stand-alone server or as a server cluster of multiple servers. A plurality of edge servers 12 communicate with the central server 11 through a resource access interface or other interface provided by the central server 11.
In addition, the central server 11 further includes a fee center, which is responsible for calculating and recording the fee of the DLaaS resource corresponding to the user. The central server 11 also provides data visualization service, and provides real-time status of task scheduling, execution, and cost statistics for users.
In practical applications, the system 100 may be named as SAPE (Secure and centralized DLaaS Platform in Edge computing, DLaaS-based Secure and reliable Edge computing Platform). The SAPE system is a DLaaS-based edge computing platform. The SAPE system provides a uniform resource access interface for a user, the user obtains the DL model by using the SAPE system without providing an original data set, the safety and the privacy of data are guaranteed, and the cost of training the model is greatly reduced.
As shown in fig. 2, an embodiment of the present application provides a method 200 for training a model, where the method 200 is performed by a central server in the system 100, and the method 200 includes:
s201: a first request is obtained, the first request including a geographic location of a user.
S202: and according to the geographic position, sending indication information to a first cluster, wherein the first cluster is determined according to the geographic position, the indication information indicates each edge server in the first cluster to train a first model, and a plurality of trained first models belong to a plurality of sub models of the target model.
S203: a first model is obtained from a first cluster that is validated by at least a portion of an edge server in a blockchain.
S204: a target model is generated from a first model verified by at least a portion of the edge servers in the blockchain.
The user sends a first request to the central server, and the central server analyzes the first request to obtain information related to the user after receiving the first request. And the central server inputs the information related to the user into a pre-trained edge resource scheduling model to obtain an edge resource scheduling strategy, namely determining the first cluster.
In one implementation, the first request includes a geographic location of the user, and the central server determines the first cluster based on the geographic location of the user. The central server stores Address information of each edge server, including an Internet Protocol Address (IP Address) and a geographical location. At this time, the distance between the geographical location of each edge server in the first cluster and the geographical location of the user is less than a preset distance threshold.
In one implementation, the central server obtains a type of the target model in addition to the geographic location of the user, and the central server determines the first cluster according to the geographic location of the user and the type of the target model. The type of the target model may be carried in the first request or may be sent to the central server by the user after the first request.
In one implementation, the central server determines the first cluster according to the geographic location of the user, the type of the target model, and the parameters of the target model, in addition to the geographic location of the user. At this time, the distance between the geographical position of each edge server in the first cluster and the geographical position of the user is smaller than the preset distance threshold, and each edge server in the first cluster can more effectively complete the training of the first model.
As one example, the type of the target model may be a detection class model, such as detecting images, detecting text, etc., and the parameters of the target model include, but are not limited to, the number of hidden layers, the number of neurons, etc.
For any one of the three implementation manners, the central server can also obtain the operation conditions of the edge servers; upon determining the first cluster, the operating conditions of the plurality of edge servers are input into an edge resource scheduling model.
As one example, the central server determines the first cluster based on the geographic location of the user and the operating conditions of the plurality of edge servers. The operation conditions of the edge server comprise: congestion status, packet loss rate, propagation delay, and available resources, etc. The operation condition of the edge server is used as a decision factor, and the calculation response delay of the user task can be dynamically optimized.
After determining the first cluster, the central server sends indication information to each edge server in the first cluster in a one-time broadcast mode, wherein the indication information indicates that each edge server in the first cluster trains the first model. The indication information includes the identification of the user, such as the name of the user, the IP address of the user, and the like.
And after receiving the indication information, the edge server communicates with the user to obtain a training sample set of the user. The first cluster includes at least two edge servers, each edge server in the first cluster obtaining only a portion of the user's training sample set. The edge server obtains information such as the type and parameters of the target model from a user or the central server, and deploys corresponding container resources according to the type and parameters of the target model, wherein the container resources comprise training environments such as a language environment and a running environment.
In one implementation, the edge server has a resource pool locally, and can locally invoke and deploy corresponding container resources according to the type and parameters of the target model.
In one implementation, the central server has a resource pool, the central server determines the container resource according to the type and the parameter of the target model, and the indication information further includes a storage address of the container resource. The edge server downloads and installs the corresponding container resource according to the storage address, so that complex environment configuration is avoided.
After the container resource deployment is completed, each edge server in the first cluster trains a first model according to the obtained sample set to obtain a plurality of first models, and the plurality of first models belong to a plurality of sub models of the target model.
At least part of the edge servers in the block chain verify the first models, and the corresponding edge servers upload the verified first models to the central server. The central server generates a target model, i.e. a DL model, from the first model verified by at least part of the edge servers in the blockchain.
According to the method for training the model, a user does not need to provide a local sample set, and data safety of the user is protected; migrating the model training process to each edge server in a first cluster, wherein the model training process is dispersed, the first model obtained by training each edge server in the first cluster belongs to a sub-model of a target model, the data corresponding to each first model is part of all data, and when the edge server is attacked, all data of a user cannot be leaked, so that the data security is ensured; verifying the first model according to at least part of edge servers in the block chain, and generating a target model according to the verified first model, so that the reliability of the target model is improved; and the edge server in the first cluster is used for carrying out parallel training on the model, so that the model training speed is greatly improved.
As shown in fig. 3, when generating the target model, the central server aggregates the verified first models 31 into a first global model 32, and updates parameters of the first global model according to a federal averaging algorithm (FedAvg), where the parameters include weights and bias values of neurons, and the like. And judging whether the first global model converges. And when the first global model converges, taking the first global model as a target model.
When the first global model 32 is not converged, a broadcast message is sent to each edge server in the first cluster, after each edge server in the first cluster receives the broadcast message, the first global model 32 is downloaded, and a sample set is used for carrying out next round of training to obtain a plurality of second models, wherein the plurality of second models belong to a plurality of sub-models of the target model.
And at least part of the edge servers in the block chain verify the plurality of second models, and the corresponding edge servers upload the verified second models to the central server. And the central server generates a second global model according to the second model verified by at least part of the edge servers in the block chain, and takes the second global model as a target model when the second global model is converged. When the second global model is not converged, the above process is repeated until the global model is converged to obtain the target model.
The target model can be obtained through multiple times of aggregation, and in the embodiment of the application, when the task quantity is small, verification can be performed in each round of aggregation process. When the amount of tasks is too large, that is, when the central server receives too many requests, the central server may set the authentication mode to be periodic authentication. For example, the verification is performed every 3 rounds or every 5 rounds.
In each round of training process, the central controller is responsible for aggregating and distributing the global model, and the distributed edge server trains and updates the global model according to the local data set and provides the updated sub-models for the central server. The entire federal training process will continue until the global model converges. By transferring the training process to the edge end, on one hand, a plurality of high-performance edge servers are allowed to perform parallel training, and the training speed of the DL model is greatly improved; on the other hand, the Federal learning mechanism enables the edge server not to provide an original data set, and the safety and the privacy of data are guaranteed.
In order to ensure the reliability of the DLaaS service, an intelligent contract is set in the block chain in the embodiment of the present application, a first model obtained by training each edge server in the first cluster is verified through the intelligent contract, and the verified first model is recorded on the block chain.
Wherein, intelligent contract includes: (1) an identity contract for maintaining and managing identity information of the edge server; (2) data contracts to manage data interactions (including model downloads and uploads) between distributed edge servers and blockchains; (3) a validation contract for voting for validity of the first model; (4) a reputation contract for managing reputation values of network entities and providing token rewards or penalties. The contract is verified and used for electing a success committee, and the validity of the first model is voted through the committee.
As shown in fig. 4, when the edge server accesses the system 100, the identity contract is first invoked to confirm the identity information of the edge server. The edge server that passes the identity authentication can be dispatched by the central server.
The working result of the block chain nodes in the block chain is transparent, each edge server is used as the block chain node in the block chain, and the results of models obtained by training other edge servers except the edge server can be obtained to achieve consensus. Each edge server may download other edge server trained models using data contracts. And after the edge server in the first cluster trains to obtain the first model, verifying the obtained multiple first models respectively by using a verification contract.
After the first model passes the verification, the corresponding edge server uploads the first model passing the verification to the block chain according to the data contract to form a transaction record. And the central server acquires the verified first model from the block chain, and further generates a target model.
If a first model trained by an edge server passes verification, the edge server is rewarded with blockchain tokens; if the first model trained by one edge server fails to validate, then the edge server gets a penalty for blockchain tokens. The reward or punishment affects the reputation value of the edge server, and the reputation value of the edge server is updated according to the reputation contract.
In the embodiment of the application, the verification of the first model is completed in a mode of voting on the validity of the model. In one implementation, for any one first model, all edge servers in the blockchain download and evaluate the performance (e.g., accuracy) of the first model, and vote on the first model, which may be valid or invalid. And when the number of the obtained valid tickets of the first model is greater than the preset value, the first model is considered to pass the verification.
In one implementation, for any one first model, an edge server in the blockchain except the edge server generating the first model downloads and evaluates the performance of the first model, and votes for the first model to evaluate the effectiveness of the first model. At this time, for any first model passing the verification, at least part of the edge servers in the block chain corresponding to the first model comprise the edge servers in the block chain except the edge server generating the first model.
If all edge servers participate in the voting process, it can be very time consuming to agree among a large number of edge servers. Therefore, a committee-based authentication mechanism is employed in the embodiments of the present application. In each training round, a committee is established according to certain rules, and part of edge servers in the block chain are members of the committee. A first model is considered valid, i.e. validated, when it obtains more than a preset number of valid votes in the committee members (e.g. more than 50% votes).
In one implementation, the committee members are determined directly from the level of reputation value of each edge server in the blockchain. And selecting a preset number of edge servers to establish committees according to the sequence of the reputation values from high to low.
In one implementation, the committee members are determined based on a plurality of random numbers generated by the blockchain. One edge server corresponds to one random number. In one implementation, the plurality of random numbers are generated based on a random number seed generated by the block chain. A random number seed may generate a sequence of numbers including a plurality of random numbers, where the same random number may be present. The edge servers are sorted in a non-increasing order of random numbers, and the first r edge servers with the largest value are selected as committee members.
In one implementation, each random number is generated based on a random number seed generated by the blockchain and a weight (i.e., reputation value) for each edge server in the blockchain. The committee member election process includes the following steps:
(1) generating a random number seed by a bottom layer distributed protocol;
(2) acquiring the weight of each edge server in the block chain;
(3) according to the Random number seeds generated in the step (1) and the weight of each edge server in the block chain, the system 100 runs a Verifiable Random Function (VRF) to generate a Random number for each edge server;
(4) and (3) sorting the random numbers in the step (3) in a non-increasing order by the system 100, and selecting the first r edge servers with the largest numerical values as committee members.
In one implementation, each random number is generated according to a random number seed generated by the blockchain, a weight (i.e., a reputation value) of each edge server in the blockchain, and a private key of each edge server in the blockchain, and the random number is used to determine at least part of the edge servers after verification of the public key, where the private key corresponds to the public key. The committee member election process includes the following steps:
(1) generating a random number seed by a bottom layer distributed protocol;
(2) acquiring the weight of each edge server in the block chain, and determining a public key/private key pair of each edge server in the block chain;
(3) running a VRF function according to the random number seeds generated in the step (1), the weight of each edge server in the block chain and a private key, and generating a random number for each edge server;
(4) the system 100 verifies the random number of each edge server by using the public key, sorts the random numbers after successful verification according to a non-increasing sequence, and selects the first r edge servers with the largest numerical value as committee members.
In the embodiment of the application, a blockchain technology is adopted, a first model provided by each edge server in a first cluster is recorded and identified, an intelligent contract is set, random sampling and timing verification are performed on the first model obtained by training each edge server in the first cluster, and corresponding blockchain token reward/punishment is provided for honest/dishonest edge servers according to the result of the model verification so as to maintain the reliability of the edge servers, thereby ensuring the reliability of the model.
In summary, the method for training the model provided by the embodiment of the application can provide a low-delay and high-reliability DLaaS edge computing service for a user. In the SAPE system, a central server provides a uniform resource access interface for a user to receive a first request sent by the user. Meanwhile, the central server manages and dispatches the edge servers of the whole network in a global angle, and the response speed of tasks is improved. The SAPE system adopts a federal learning training mode, so that a user and an edge server do not need to provide a sample set for a central server, and data safety and privacy are protected. In addition, the SAPE system combines the block chain technology, records and verifies the effectiveness of the first model trained by each edge server, improves the reliability of the DL model, and further improves the safety of the DLaaS platform.
Fig. 5 is an apparatus for training a model according to an embodiment of the present application, where the apparatus 500 includes an obtaining module 501 and a processing module 502.
An obtaining module 501 is configured to obtain a first request, where the first request includes a geographic location of a user.
A processing module 502, configured to send indication information to a first cluster according to a geographic location, where the first cluster is determined according to the geographic location, and the indication information indicates each edge server in the first cluster to train a first model, where a plurality of trained first models belong to a plurality of submodels of a target model; obtaining a first model verified by at least part of an edge server in a block chain from a first cluster; a target model is generated from a first model verified by at least a portion of the edge servers in the blockchain.
In particular, the processing module 502 is further configured to send the indication information to the first cluster according to the geographic location and the type of the target model, where the first cluster is determined according to the geographic location and the type of the target model.
In particular, the processing module 502 is further configured to obtain operating conditions of a plurality of edge servers; and sending indication information to a first cluster according to the geographical position and the operating conditions of the plurality of edge servers, wherein the first cluster is determined according to the geographical position and the operating conditions of the plurality of edge servers.
Specifically, the first model is obtained by training resources according to the resources after each edge server in the first cluster acquires the resources under the indication of the indication information, where the resources include a training environment.
In particular, for any first model that passes the verification, at least part of the edge servers in the blockchain to which the first model corresponds include edge servers in the blockchain other than the edge server that generated the first model.
In particular, at least a portion of the edge servers are determined based on a plurality of random numbers generated by the blockchain.
In particular, the plurality of random numbers are generated based on a random number seed generated by the block chain.
In particular, each random number is generated based on a random number seed generated for the blockchain and a weight for each edge server in the blockchain.
Specifically, each random number is generated according to a random number seed generated by the blockchain, the weight of each edge server in the blockchain and a private key of each edge server in the blockchain, the random number is used for determining at least part of the edge servers after the public key is verified, and the private key corresponds to the public key.
It should be understood that the apparatus 500 of the embodiment of the present application may be implemented by an application-specific integrated circuit (ASIC), or a Programmable Logic Device (PLD), which may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof. The method for training the model shown in fig. 2 may be implemented by software, and when the method for training the model shown in fig. 2 is implemented by software, the control device 500 and each module thereof may be a software module.
Fig. 6 is a schematic structural diagram of an electronic device 600 according to an embodiment of the present application. As shown in fig. 6, the device 600 includes a processor 601, a memory 602, a communication interface 603, and a bus 604. The processor 601, the memory 602, and the communication interface 603 communicate with each other via the bus 604, or may communicate with each other via other means such as wireless transmission. The memory 602 is used for storing instructions and the processor 601 is used for executing the instructions stored by the memory 602. The memory 602 stores program code 6021 and the processor 601 may invoke the program code 6021 stored in the memory 602 to perform the method of training the model shown in fig. 2.
It should be understood that in the embodiments of the present application, the processor 601 may be a CPU, and the processor 601 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like.
The memory 602 may include both read-only memory and random access memory and provides instructions and data to the processor 601. The memory 602 may also include non-volatile random access memory. The memory 602 may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and direct bus RAM (DR RAM).
The bus 604 may include a power bus, a control bus, a status signal bus, and the like, in addition to a data bus. But for clarity of illustration the various busses are labeled in figure 6 as bus 604.
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded or executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more collections of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium may be a Solid State Drive (SSD).
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for training a model, the method being applied to a system for training a model, the system comprising a central server, a plurality of edge servers and a blockchain, the plurality of edge servers being a plurality of blockchain nodes in the blockchain, the method comprising:
obtaining a first request, wherein the first request comprises the geographic position of a user;
according to the geographic position, sending indication information to a first cluster, wherein the first cluster is determined according to the geographic position, the indication information indicates each edge server in the first cluster to train a first model, and a plurality of trained first models belong to a plurality of submodels of a target model;
obtaining the first model verified by at least part of the edge servers in the blockchain from the first cluster;
generating the target model according to the first model verified by at least part of the edge servers in the block chain.
2. The method of claim 1, wherein sending the indication information to the first cluster based on the geographic location comprises:
and sending indication information to a first cluster according to the geographic position and the type of the target model, wherein the first cluster is determined according to the geographic position and the type of the target model.
3. The method of claim 1, further comprising:
acquiring the operating conditions of the plurality of edge servers;
the sending of the indication information to the first cluster according to the geographical location includes:
and sending indication information to a first cluster according to the geographic position and the operating conditions of the edge servers, wherein the first cluster is determined according to the geographic position and the operating conditions of the edge servers.
4. The method of claim 1, wherein the first model is obtained by training, according to the resource, each edge server in the first cluster after acquiring the resource under the indication of the indication information, the resource comprising a training environment.
5. The method according to any one of claims 1 to 4, wherein for any one first model that passes the verification, at least part of the edge servers in the blockchain to which the first model corresponds comprise edge servers in the blockchain other than the edge server that generated the first model.
6. The method of claim 5, wherein the at least some edge servers are determined based on a plurality of random numbers generated by the blockchain.
7. The method of claim 6, wherein the plurality of random numbers are generated according to a random number seed generated by the block chain.
8. The method of claim 6, wherein each of the random numbers is generated according to a random number seed generated by the blockchain and a weight of each edge server in the blockchain.
9. The method according to any one of claims 6 to 8, wherein each of the random numbers is generated according to a random number seed generated by the blockchain, a weight of each edge server in the blockchain, and a private key of each edge server in the blockchain, and the random numbers are used for determining the at least part of the edge servers after public key verification, and the private key corresponds to the public key.
10. A system for training a model, the system comprising a central server, a plurality of edge servers, and a blockchain, the plurality of edge servers being a plurality of blockchain nodes in the blockchain, the system being configured to implement the method of any one of claims 1 to 9.
CN202110473057.3A 2021-04-29 2021-04-29 Model training method and system Active CN113221163B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110473057.3A CN113221163B (en) 2021-04-29 2021-04-29 Model training method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110473057.3A CN113221163B (en) 2021-04-29 2021-04-29 Model training method and system

Publications (2)

Publication Number Publication Date
CN113221163A true CN113221163A (en) 2021-08-06
CN113221163B CN113221163B (en) 2023-05-23

Family

ID=77090032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110473057.3A Active CN113221163B (en) 2021-04-29 2021-04-29 Model training method and system

Country Status (1)

Country Link
CN (1) CN113221163B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884944A (en) * 2022-04-28 2022-08-09 广东电网有限责任公司 Data processing method, device, equipment and storage medium
CN115460053A (en) * 2022-07-28 2022-12-09 山东浪潮科学研究院有限公司 Service calling method and device and edge computing system
CN116484922A (en) * 2023-04-23 2023-07-25 深圳大学 Federal learning method, system, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110428056A (en) * 2018-04-30 2019-11-08 慧与发展有限责任合伙企业 Use the system and method for the distributing machine learning of block chain
CN110599173A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Block chain consensus node determination method, device, equipment and storage medium
US20200351344A1 (en) * 2019-04-30 2020-11-05 EMC IP Holding Company LLC Data tiering for edge computers, hubs and central systems
WO2020253266A1 (en) * 2019-06-15 2020-12-24 华为技术有限公司 Method for providing edge service, apparatus and device
CN112580822A (en) * 2020-12-16 2021-03-30 北京百度网讯科技有限公司 Countermeasure training method and apparatus for machine learning model, electronic device, and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110428056A (en) * 2018-04-30 2019-11-08 慧与发展有限责任合伙企业 Use the system and method for the distributing machine learning of block chain
US20200351344A1 (en) * 2019-04-30 2020-11-05 EMC IP Holding Company LLC Data tiering for edge computers, hubs and central systems
WO2020253266A1 (en) * 2019-06-15 2020-12-24 华为技术有限公司 Method for providing edge service, apparatus and device
CN110599173A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Block chain consensus node determination method, device, equipment and storage medium
CN112580822A (en) * 2020-12-16 2021-03-30 北京百度网讯科技有限公司 Countermeasure training method and apparatus for machine learning model, electronic device, and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴琪等: "边缘学习:关键技术、应用与挑战", 《无线电通信技术》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884944A (en) * 2022-04-28 2022-08-09 广东电网有限责任公司 Data processing method, device, equipment and storage medium
CN115460053A (en) * 2022-07-28 2022-12-09 山东浪潮科学研究院有限公司 Service calling method and device and edge computing system
CN115460053B (en) * 2022-07-28 2023-06-27 山东浪潮科学研究院有限公司 Service calling method, device and edge computing system
CN116484922A (en) * 2023-04-23 2023-07-25 深圳大学 Federal learning method, system, equipment and storage medium
CN116484922B (en) * 2023-04-23 2024-02-06 深圳大学 Federal learning method, system, equipment and storage medium

Also Published As

Publication number Publication date
CN113221163B (en) 2023-05-23

Similar Documents

Publication Publication Date Title
CN113221163B (en) Model training method and system
Xiong et al. Peertrust: Supporting reputation-based trust for peer-to-peer electronic communities
US10740411B2 (en) Determining repeat website users via browser uniqueness tracking
US20200036515A1 (en) Identity confidence score based on blackchain based attributes
EP2689371B1 (en) Fast device classification
Witt et al. Decentral and incentivized federated learning frameworks: A systematic literature review
US20190294786A1 (en) Intelligent Security Risk Assessment
KR102451133B1 (en) Method, device and system for providing transaction and authenticity verification platform service for nft-based media contents
CN111125420B (en) Object recommendation method and device based on artificial intelligence and electronic equipment
US20230068511A1 (en) Interactive swarming
US20210105277A1 (en) Systems and methods for preventing a fraudulent registration
CN113111359A (en) Big data resource sharing method and resource sharing system based on information security
Xie et al. Primary node election based on probabilistic linguistic term set with confidence interval in the PBFT consensus mechanism for blockchain
Mujawar et al. Behavior and feedback based trust computation in cloud environment
Bruschi et al. Tunneling trust into the blockchain: A merkle based proof system for structured documents
CN112702410B (en) Evaluation system, method and related equipment based on blockchain network
Cui et al. Message spreading in networks with stickiness and persistence: Large clustering does not always facilitate large-scale diffusion
Marti Trust and reputation in peer-to-peer networks
CN111222885B (en) Data processing request endorsement method and device, computer equipment and storage medium
US11095528B2 (en) Identity network onboarding based on confidence scores
Mohsenzadeh et al. A novel reputation-based consensus framework (RCF) in distributed ledger technology
CN109905388A (en) A kind of processing method and system of the domain name credit based on block chain
Sudha Sadasivam A critical review on using blockchain technology in education domain
RU2745362C1 (en) System and method of generating individual content for service user
Benjamin Franklin et al. Machine learning-based trust management in cloud using blockchain technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant