CN111614679A - Federal learning qualification recovery method, device and readable storage medium - Google Patents

Federal learning qualification recovery method, device and readable storage medium Download PDF

Info

Publication number
CN111614679A
CN111614679A CN202010445869.2A CN202010445869A CN111614679A CN 111614679 A CN111614679 A CN 111614679A CN 202010445869 A CN202010445869 A CN 202010445869A CN 111614679 A CN111614679 A CN 111614679A
Authority
CN
China
Prior art keywords
verification
preset
qualification
federal learning
hash
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
CN202010445869.2A
Other languages
Chinese (zh)
Other versions
CN111614679B (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.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010445869.2A priority Critical patent/CN111614679B/en
Publication of CN111614679A publication Critical patent/CN111614679A/en
Application granted granted Critical
Publication of CN111614679B publication Critical patent/CN111614679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • 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
    • 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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3218Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs
    • H04L9/3221Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs interactive zero-knowledge proofs
    • 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)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Power Engineering (AREA)
  • Storage Device Security (AREA)

Abstract

The application discloses a method, equipment and a readable storage medium for recovering the qualification of federated learning, wherein the method for recovering the qualification of federated learning comprises the following steps: receiving first verification information and second verification information sent by second equipment, verifying the identity validity of the second equipment based on the first verification information and a preset Hash coding model to obtain an identity verification result, verifying the authenticity of the block chain qualification of the second equipment based on the second verification information to obtain an authenticity verification result, and recovering the federal learning qualification of the second equipment based on the identity verification result and the authenticity verification result. The method and the device solve the technical problem that the federal learning participator cannot participate in the federal learning after losing the federal learning qualification.

Description

Federal learning qualification recovery method, device and readable storage medium
Technical Field
The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular, to a method, device, and readable storage medium for recovering the qualification of banjo learning.
Background
With the continuous development of financial technologies, especially internet technology and finance, more and more technologies (such as distributed, Blockchain, artificial intelligence and the like) are applied to the financial field, but the financial industry also puts higher requirements on the technologies, such as higher requirements on the distribution of backlog of the financial industry.
With the continuous development of computer software and artificial intelligence, the application of federal learning is more and more extensive, at present, in order to ensure the safety and reliability of model parameters in the process of federal learning, a block chain technology can be applied to federal learning, namely, a block chain provides a credible mechanism for each participant of federal learning, but in the federal learning based on the block chain, the model parameters are usually bound with a private key of the block chain, but because the private key does not have any relation with the real identity information of the participant, if the participant loses the private key, the participant loses the unique identity of the participant on the block chain, and further the participant loses the legal qualification for participating in the federal learning training, and can not continuously participate in the federal learning.
Disclosure of Invention
The main purpose of the present application is to provide a method, a device, and a readable storage medium for recovering federal learning qualification, which are used to solve the technical problem that the federal learning participants cannot participate in federal learning after losing the federal learning qualification in the prior art.
In order to achieve the above object, the present application provides a federal learning qualification recovery method applied to a first device, including:
receiving first verification information and second verification information sent by second equipment, and performing identity validity verification on the second equipment based on the first verification information and a preset Hash coding model to obtain an identity verification result;
performing authenticity verification on the block chain qualification of the second equipment based on the second verification information to obtain an authenticity verification result;
recovering the federally learned qualification of the second device based on the authentication result and the authenticity verification result.
Optionally, the step of performing identity validity verification on the second device based on the first verification information and a preset hash coding model to obtain an identity verification result includes:
inputting the first verification information into a preset Hash coding model, and carrying out Hash coding on the first verification information based on the class characteristic information of the first verification information to obtain an output Hash coding value;
and acquiring each preset Hash code value generated by the preset Hash code model, and determining the identity verification result based on the output Hash code value and each preset Hash code value.
Optionally, the step of determining the authentication result based on the output hash code value and each of the preset hash code values includes:
calculating the calculated Hamming distance between the output Hash code value and each preset Hash code value respectively, and determining a target Hamming distance in each calculated Hamming distance;
comparing the target Hamming distance with a preset Hamming distance threshold, and if the target Hamming distance is smaller than or equal to the preset Hamming distance threshold, judging that the identity verification result is that the identity is legal;
and if the target Hamming distance is larger than the preset Hamming distance threshold value, judging that the identity verification result is illegal.
Optionally, the second verification information comprises encrypted blockchain qualification data, verification blockchain qualification data, and verification random parameters, the blockchain qualification comprising the newly generated public key,
the authenticity verification is performed on the block chain qualification of the second device based on the second verification information, and the step of obtaining the authenticity verification result comprises the following steps:
calculating a first zero knowledge proof result corresponding to the encryption block chain qualification data based on a preset verification challenge parameter;
based on the newly generated public key and the verification random parameter, encrypting the verification block chain qualification data to obtain a second zero knowledge proof result;
determining the authenticity verification result based on the first zero knowledge proof result and the second zero knowledge proof result.
Optionally, the blockchain qualification includes a newly generated public key and a newly generated private key,
before the step of performing authenticity verification on the blockchain qualification of the second device based on the second verification information to obtain an authenticity verification result, the federal learning qualification recovery method further includes:
receiving the newly generated public key sent by the second device, and encrypting a preset verification challenge parameter based on the newly generated public key to obtain an encrypted verification challenge parameter;
and sending the encryption verification challenge parameter to the second equipment so that the second equipment can decrypt the encryption verification challenge parameter based on the newly generated private key to obtain the preset verification challenge parameter, and generate the second verification information based on the preset verification challenge parameter.
Optionally, the step of recovering the federally learned qualification of the second device based on the authentication result and the authenticity verification result includes:
generating an identity confirmation certificate corresponding to the second equipment based on the identity verification result and the authenticity verification result;
and respectively sending the identity confirmation certificates to federal participants related to the second equipment federally, and recovering the federal learning qualification of the second equipment.
In order to achieve the above object, the present application further provides a federal learning qualification recovery method, where the federal learning qualification recovery method is applied to a second device, and the federal learning qualification recovery method includes:
acquiring user information, and taking the user information as first verification information;
generating a newly generated public key and a newly generated private key, sending the newly generated public key to first equipment, and receiving an encryption verification challenge parameter fed back by the first equipment based on the newly generated public key;
decrypting the encrypted verification challenge parameter based on the newly generated private key to obtain a preset verification challenge parameter;
generating the second verification information based on the preset verification challenge parameter;
and sending the first verification information and the second verification information to the first equipment so that the first equipment can recover the federal learning qualification of the second equipment.
Optionally, the second authentication information comprises an encryption hash code value, an authentication hash code value and an authentication random parameter to be sent,
the step of generating the second verification information based on the preset verification challenge parameter includes:
acquiring a block address corresponding to the newly generated private key, and performing hash coding on the block address to acquire a hash coding value;
encrypting the hash code value based on the newly generated public key and a preset verification random parameter to obtain an encrypted hash code value;
calculating the verification hash code value based on the preset verification challenge parameter and the hash code value;
and generating the verification random parameter to be sent based on the preset verification challenge parameter and the preset verification random parameter.
The present application further provides a federal learning qualification recovery device, federal learning qualification recovery device is virtual device, just federal learning qualification recovery device is applied to first equipment, federal learning qualification recovery device includes:
the first verification module is used for receiving first verification information and second verification information sent by second equipment, and verifying the identity validity of the second equipment based on the first verification information and a preset Hash coding model to obtain an identity verification result;
the first verification module is used for verifying the authenticity of the block chain qualification of the second equipment based on the second verification information to obtain an authenticity verification result;
a recovery module to recover the federal learning qualifications of the second device based on the authentication result and the authenticity verification result.
Optionally, the first authentication module comprises:
the hash coding unit is used for inputting the first verification information into a preset hash coding model so as to carry out hash coding on the first verification information based on the class characteristic information of the first verification information and obtain an output hash coding value;
and the first determining unit is used for acquiring each preset Hash code value generated by the preset Hash code model and determining the identity verification result based on the output Hash code value and each preset Hash code value.
Optionally, the determining unit includes:
the calculating subunit is used for calculating the calculated Hamming distance between the output Hash code value and each preset Hash code value respectively and determining a target Hamming distance in each calculated Hamming distance;
the first judgment unit is used for comparing the target Hamming distance with a preset Hamming distance threshold value, and if the target Hamming distance is smaller than or equal to the preset Hamming distance threshold value, judging that the identity verification result is that the identity is legal;
and the second judgment unit is used for judging that the identity verification result is illegal if the target Hamming distance is greater than the preset Hamming distance threshold value.
Optionally, the second authentication module comprises:
the computing unit is used for computing a first zero knowledge proof result corresponding to the encrypted block chain qualification data based on a preset verification challenge parameter;
the encryption processing unit is used for carrying out encryption processing on the verification block chain qualification data based on the newly generated public key and the verification random parameter to obtain a second zero knowledge proof result;
a second determining unit configured to determine the authenticity verification result based on the first zero knowledge proof result and the second zero knowledge proof result.
Optionally, the federal learning qualification recovery apparatus further includes:
the encryption module is used for receiving the newly generated public key sent by the second equipment and encrypting a preset verification challenge parameter based on the newly generated public key to obtain an encrypted verification challenge parameter;
and the sending module is used for sending the encrypted verification challenge parameter to the second equipment so that the second equipment can decrypt the encrypted verification challenge parameter based on the newly generated private key to obtain the preset verification challenge parameter, and generate the second verification information based on the preset verification challenge parameter.
Optionally, the recovery module comprises:
the generating unit is used for generating an identity confirmation certificate corresponding to the second equipment based on the identity verification result and the authenticity verification result;
and the recovery unit is used for respectively sending the identity confirmation certificates to federal participants related to the second equipment federally and recovering the federal learning qualification of the second equipment.
In order to achieve the above object, the present application further provides a federal learning qualifications recovery device, where the federal learning qualifications recovery device is a virtual device, and the federal learning qualifications recovery device is applied to a second device, and the federal learning qualifications recovery device includes:
the system comprises an acquisition module, a verification module and a verification module, wherein the acquisition module is used for acquiring user information and taking the user information as first verification information;
the first generation module is used for generating a newly generated public key and a newly generated private key, sending the newly generated public key to the first equipment and receiving an encryption verification challenge parameter fed back by the first equipment based on the newly generated public key;
the decryption module is used for decrypting the encrypted verification challenge parameter based on the newly generated private key to obtain a preset verification challenge parameter;
the second generation module is used for generating the second verification information based on the preset verification challenge parameter;
and the recovery module is used for sending the first verification information and the second verification information to the first equipment so that the first equipment can recover the federal learning qualification of the second equipment.
Optionally, the second generating module includes:
the hash coding unit is used for acquiring the block address corresponding to the newly generated private key and carrying out hash coding on the block address to obtain a hash coding value;
the encryption unit is used for encrypting the hash code value based on the newly generated public key and a preset verification random parameter to obtain the encrypted hash code value;
a calculating unit, configured to calculate the verification hash code value based on the preset verification challenge parameter and the hash code value;
and the generating unit is used for generating the verification random parameter to be sent based on the preset verification challenge parameter and the preset verification random parameter.
The present application further provides a federal learning qualification recovery apparatus, which is an entity apparatus, the federal learning qualification recovery apparatus including: a memory, a processor, and a program of the federal learning qualification recovery method stored in the memory and executable on the processor, the program of the federal learning qualification recovery method being executable by the processor to implement the steps of the federal learning qualification recovery method as set forth above.
The present application also provides a readable storage medium having stored thereon a program for implementing the federal learning qualification recovery method, the program implementing the steps of the federal learning qualification recovery method as set forth above when executed by a processor.
This application is through receiving first verification information and the second verification information that sends with the second equipment, and based on first verification information is right with predetermineeing hash coding model the second equipment carries out the validity of identity and verifies, obtains the authentication result, and then based on the second verification information is right the block chain qualification of second equipment carries out the authenticity and verifies, obtains the authenticity verification result, and then based on the authentication result and the authenticity verification result, resume the second equipment the federal study qualification. That is, after receiving the first verification information and the second verification information sent by the second device, the application may verify whether the identity of the federate learning participant of the second device is legal based on the first verification information and a preset hash coding model, and further, may verify whether the second device re-applies the real and legal block chain qualification, that is, whether the second device re-applies the real and legal public and private key based on the second verification information, and after verifying the identity of the legal participant of the second device and determining that the second device re-applies the real and legal public and private key, may prove that the second device has the qualification to participate in the federate learning based on the block chain, and may recover the federate learning of the second device, and further avoid the participant losing the legal qualification to participate in the federate learning, the situation that the Federal learning can not be continued occurs, so the technical problem that the Federal learning participator can not participate in the Federal learning after losing the Federal learning qualification is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram illustrating a first embodiment of a federal learning qualification recovery method of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a second embodiment of a federal learning qualification recovery method of the present application;
fig. 3 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
The objectives, features, and advantages of the present application will be further described with reference to the accompanying drawings.
Detailed Description
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 a first embodiment of the federal learning qualification recovery method in the present application, the federal learning qualification recovery method is applied to a first device, and referring to fig. 1, the federal learning qualification recovery method includes:
step S10, receiving first verification information and second verification information sent by second equipment, and performing identity validity verification on the second equipment based on the first verification information and a preset Hash coding model to obtain an identity verification result;
in this embodiment, it should be noted that the first verification information is information for verifying whether the second device has a legal identity participating in federal learning, the second verification information is information for verifying whether the second device has a block chain qualification, where the block chain qualification is a new public and private key pair or a block address applied by the second device on a block chain, and the first verification information includes user information, such as a user name and a user phone number.
Additionally, it should be noted that the first device is a federal learning qualification recovery center, the second device is a party involved in federal learning, and the first device and each of the second devices both exist in a block chain for performing the federal learning, wherein the first device may be a coordinator of the federal learning, or may be a node alone in the block chain having a capability of recovering the federal learning qualification of the party, and the first device stores hash codes corresponding to the first verification information of each of the second devices in a block corresponding to the own party, that is, before performing step S10, the first device receives verification information sent by each of the parties having a legal identity involved in the federal learning, and based on the preset hash code model, performs hash coding on the verification information respectively, to obtain a preset hash value corresponding to each of the verification information, and storing each preset hash code in a Mercker tree constructed based on the preset hash code model.
Receiving first verification information and second verification information sent by second equipment, verifying the identity validity of the second equipment based on the first verification information and a preset hash coding model to obtain an identity verification result, specifically, receiving the first verification information and the second verification information sent by the second equipment associated with the first equipment verification, inputting the first verification information into the preset hash coding model, performing hash coding on the first verification information to obtain an output hash coding value, comparing the output hash coding value with each preset hash coding value to determine whether a target hash coding value consistent with the output hash coding value exists in each preset hash coding value, and if so, proving that the second equipment has a legal identity participating in federal learning, and then the identity verification result is legal, if the target hash code value does not exist, the second equipment is proved not to have the legal identity participating in the federal study, and then the identity verification result is illegal.
Additionally, it should be noted that the preset hash coding model may be a model constructed based on a deep polarization network, where the preset hash coding model includes a hidden layer and a hash layer of the deep polarization network, the deep polarization network is a neural network optimized based on preset category information, where the preset category information is category label information of training data corresponding to the deep polarization network, for example, a hash coding value generated based on a category label of the training data, the hidden layer is a data processing layer of the preset deep polarization network, and is used for performing data processing processes such as convolution processing and pooling processing, the hidden layer is one or more layers of neural networks trained based on deep learning, and the hash layer is an output layer of the preset deep polarization network, and is used for hashing the data to be processed, and outputting a corresponding hash result, wherein the hash layer is one or more layers of neural networks trained based on deep learning.
Further, in a feasible implementation scheme, after the first device receives first verification information and second verification information sent by a second device, the first verification information is input into a preset hash coding model constructed based on a deep polarization network, so as to polarize and hash code the first verification information based on category characteristic information of the first verification information, obtain an output hash code value, and compare the output hash code value with each preset hash code value, so as to determine whether a target hash code value consistent with the output hash code value exists in each preset hash code value, if the target hash code value exists, the second device is proved to have a legal identity participating in federal learning, and then the authentication result is legal, and if the target hash code value does not exist, the second device is proved not to have a legal identity participating in federal learning, and the identity authentication result is illegal.
The step of inputting the first verification information into a preset hash coding model constructed based on a deep polarization network to perform polarization hash coding on the first verification information based on the category characteristic information of the first verification information to obtain an output hash coding value includes:
step A10, inputting the first verification information into a hidden layer of the deep polarization network, and performing data processing on the first verification information to obtain the category characteristic information;
specifically, the verification information representation matrix corresponding to the first verification information is input into a hidden layer of the deep polarization network, and matrix transformation is performed on the verification information representation matrix, where the matrix transformation includes, but is not limited to, convolution, pooling, full connection, and the like, so as to obtain a feature representation matrix corresponding to the verification information representation matrix, and the feature representation matrix is used as the category feature information
Step A20, inputting the category characteristic information into a hash layer of the deep polarization network, and performing polarization hash coding on the category characteristic information to obtain the output hash coding value.
Specifically, inputting a feature representation matrix corresponding to the category feature information into a hash layer of the deep polarization network, fully connecting the feature representation matrix to obtain a fully connected vector, further matching each target bit in the fully connected vector with a corresponding polarization output channel, polarizing the target bit corresponding to each polarization output channel based on each polarization output channel, assigning a polarization identifier to each target bit, further outputting a hash vector corresponding to each polarized target bit in common, further extracting each polarization identifier in the hash vector, and generating the output hash code value based on the position of each target bit in the hash vector, wherein the polarization output channel is a model output channel assigning a polarization identifier to the target bit, the polarization identifiers are signs of the target bit, for example, assuming that the fully concatenated vector is (a, b), the hash vector is (a, -b), and the polarization identifier corresponding to target bit a is +1, the polarization identifier corresponding to target bit-b is-1, and the output hash code value is (1, -1).
Further, before the step of inputting the first verification information into a preset hash coding model constructed based on a deep polarization network, performing polarized hash coding on the first verification information based on the class feature information of the first verification information, and obtaining an output hash coding value, the federal learning qualification recovery method further includes:
acquiring training data and a hash coding model to be trained, wherein the training data may be user information collected from each second device, and further performing hash coding on the training data based on a preset hash coding mode to obtain a training target hash coding value corresponding to the training data, wherein the preset hash coding method may be any one of hash coding modes, and further performing iterative training on the hash coding model to be trained based on the training data and the training target hash coding value to optimize a preset polarization loss function corresponding to the deep polarization network until the hash coding model to be trained reaches a preset iteration ending condition, and using the hash coding model to be trained as the preset hash coding model, specifically, based on the training data and the training target hash coding value, performing iterative training on the hash coding model to be trained to optimize a polarization loss function corresponding to the deep polarization network until the hash coding model to be trained reaches a preset iteration ending condition, wherein the step of taking the hash coding model to be trained as the preset hash coding model comprises the following steps:
step B10, inputting the training data into the Hash coding model to be trained, so as to carry out Hash coding on the training data based on the preset polarization loss function, and obtain an initial Hash coding value;
in this embodiment, the training data at least includes one training sample, and the initial hash code value is a hash code value corresponding to the training sample.
Inputting the training data into the hash coding model to be trained, performing hash coding on the training data based on the preset polarization loss function to obtain an initial hash coding value, specifically, inputting a training matrix to be processed corresponding to the training sample into the hash coding model to be trained, wherein the training matrix to be processed is a matrix representation form of the training sample, further performing hash on the training matrix to be processed to obtain a training hash vector, further performing forced polarization on each bit of the training hash vector based on the preset polarization loss function to obtain a training polarization vector corresponding to the training hash vector, and further generating the initial hash coding value corresponding to the training sample based on a polarization identifier corresponding to each bit in the training polarization vector, wherein the preset polarization loss function is as follows,
L(v,t^c)=max(m-v*t^c,0)
wherein L is the predetermined polarization loss function, m is a predetermined forced polarization parameter, v is a value at each bit of the hash vector in the training hash vector, and an absolute value of v is greater than m, t ^ c is a target hash value corresponding to the bit of the hash vector, the target hash value is a bit value at a predetermined hash code value corresponding to the training sample, and t ^ c { -1, +1}, and the predetermined polarization loss function converges to 0, for example, assuming that m is 1, t ^ c is 1, v is-1, at this time, L ^ 2, if the predetermined polarization loss function converges to 0, then force-polarize v so that v is 1, at this time, L ^ 0, and further during the training of the hash code model to be trained, when t ^ c is equal to 1, the value at the bit of the training vector gradually moves away from 0 in the positive direction, when t ^ c is equal to-1, the numerical value on the bit position of the training hash vector gradually keeps away from 0 in the negative direction, and then after the polarization is successful, the polarization identifier of each bit position in the obtained training polarization vector is consistent with the corresponding target hash value.
Additionally, it should be noted that each bit in the training hash vector corresponds to a polarization output channel in the hash coding model to be trained, and a preset forced polarization parameter corresponding to each polarization output channel is obtained by training and optimizing the hash coding model, and further the preset forced polarization parameters corresponding to each polarization output channel may be the same or different, where the polarization output channel is configured to force-polarize, based on the preset forced polarization parameter, a value on the corresponding bit in the training hash vector through the corresponding preset polarization loss function, and output a coding value of the corresponding bit in the initial hash coding value.
Step B20, calculating the training Hamming distance between the initial Hash code value and the training target Hash code value, and comparing the training Hamming distance with a preset Hamming distance threshold value;
in this embodiment, a training hamming distance between the initial hash code value and the training target hash code value is calculated, and the training hamming distance is compared with a preset hamming distance threshold, specifically, a numerical value on each bit of the initial hash code value is compared with a numerical value on each bit of the training target hash code value, a number of bits with different bit numbers between the initial hash code value and the training target hash code value is determined, the number of bits is used as the training hamming distance, and the training hamming distance is compared with the preset hamming distance threshold, for example, if the initial hash code value is a vector (1, 1, 1, 1), and the target hash code result is a vector (-1, 1, 1, -1), the number of bits is 2, the training hamming distance is 2.
Step B30, if the training Hamming distance is greater than the preset Hamming distance threshold, determining that the Hash code model to be trained does not reach the preset iteration end condition, and optimizing the preset polarization loss function based on the initial Hash code value;
in this embodiment, if the training hamming distance is greater than the preset hamming distance threshold, it is determined that the hash coding model to be trained does not reach the preset iteration end condition, and the preset polarization loss function is optimized based on the initial hash coding value, specifically, if the training hamming distance is greater than the preset hamming distance threshold, it is determined that the preset polarization loss function does not converge on all the polarization output channels, that is, the preset polarization loss function does not converge, and it is further determined that the hash coding model to be trained does not reach the preset iteration end condition, and further one or more different bits between the initial hash coding value and the preset hash coding value are determined, and non-converged polarization output channels corresponding to the different bits are determined, and further a preset forced polarization parameter in the preset polarization loss function corresponding to the non-converged polarization output channels is adjusted, the non-convergence polarization output channel is a polarization output channel corresponding to a non-convergence preset polarization loss function, wherein the hash coding model to be trained at least comprises one polarization output channel, and the number of the polarization output channels is related to the number of bits in the training hash vector, that is, a bit in the training hash vector corresponds to one polarization output channel.
Step B40, based on the optimized preset polarization loss function, the training of the Hash code model to be trained is carried out again until the training Hamming distance is smaller than or equal to the preset Hamming distance threshold value;
in this embodiment, based on the optimized preset polarization loss function, the training of the hash coding model to be trained is performed again until the hamming distance of the training is smaller than or equal to the preset hamming distance threshold, specifically, the training data is obtained again, and based on the obtained training data, the iterative training is performed again on the hash coding model to be trained corresponding to the optimized preset polarization loss function, so as to continuously optimize the preset polarization loss function until the hamming distance of the training is smaller than or equal to the preset hamming distance threshold.
And step B50, if the training Hamming distance is less than or equal to the preset Hamming distance threshold, determining that the Hash code model to be trained reaches the preset iteration end condition, and taking the Hash code model to be trained as the preset Hash code model.
In this embodiment, if the training hamming distance is less than or equal to the preset hamming distance threshold, it is determined that the hash coding model to be trained reaches the preset iteration end condition, and the hash coding model to be trained is used as the preset hash coding model, specifically, if the training hamming distance is less than or equal to the preset hamming distance threshold, it is determined that the hash coding model to be trained reaches the preset iteration end condition, that is, a preset polarization loss function corresponding to each polarization output channel in the hash coding model to be trained converges, and the hash coding model to be trained is used as the preset hash coding model.
Additionally, it should be noted that, in the existing hash coding method based on deep learning, the paired similarity labels are usually used as training targets, and a constraint condition needs to be added during training, so that parameters that need to be optimized during training of the preset hash coding model become more.
And because the hash coding model based on the deep polarization network training can output the same hash coding value for the user information belonging to the same category, that is, even if the second device changes the own user information and the hamming distance between the changed user information and the original user information is less than the threshold value of the preset classification hamming distance, the preset hash coding model can still obtain the hash coding value with the same or the similarity exceeding the threshold value, and further when each second device slightly changes the own user information, the first device can still accurately identify the user information of the second device, and further can accurately identify the legal identity of the second device participating in federal learning, so that the accuracy of the first device in determining the legal identity of the second device participating in federal learning is improved, and after the second device changes the user information, and the changed user information does not need to be reported to the first equipment, so that the interaction process between the first equipment and the second equipment is reduced, and the system computing resources and the system transmission resources of the first equipment and the second equipment are saved.
For example. A first vector of the user information of a certain second device is represented as (a, b, c, d), and the corresponding hash code value is (1, -1, 1, -1), and further, if the user name of the second device is changed, the second vector of the user information of the second device is represented as (a, b, c, e), since the hamming distance between the first vector representation and the second vector representation is 1 and less than the preset classification hamming distance threshold value, it is determined that the first vector representation and the second vector representation belong to the same class, and the hash code value corresponding to the second vector representation is still (1, -1, 1, -1).
The identity validity verification is performed on the second device based on the first verification information and a preset Hash coding model, and the step of obtaining an identity verification result comprises the following steps:
step S11, inputting the first verification information into a preset hash coding model, and performing hash coding on the first verification information based on the category feature information of the first verification information to obtain an output hash coding value;
in this embodiment, the first verification information is input into a preset hash coding model, so as to perform hash coding on the first verification information based on the class feature information of the first verification information, to obtain an output hash coding value, specifically, a verification information representation matrix corresponding to the first verification information is input into a hidden layer of the deep polarization network, where the verification information representation matrix is a coding matrix of the first verification information, and then data processing is performed on the verification information representation matrix, where the data processing includes, but is not limited to, convolution, pooling, and the like, so as to obtain a feature representation matrix corresponding to the verification information representation matrix, and the feature representation matrix is used as the class feature information, and then the feature representation matrix corresponding to the class feature information is input into a hash layer of the deep polarization network, fully connecting the feature expression matrixes to obtain fully-connected vectors, matching corresponding polarization output channels with target bits in the fully-connected vectors, polarizing the target bits corresponding to the polarization output channels based on the polarization output channels, giving polarization identifications to the target bits, outputting hash vectors corresponding to the polarized target bits, extracting the polarization identifications corresponding to the hash vectors, and generating the output hash code values based on the polarization identifications and the positions of the target bits in the hash vectors, wherein the polarization output channels are model output channels giving polarization identifications to the target bits, the polarization identifications are signs of the target bits, and for example, if the fully-connected vectors are (a, b) and the hash vector is (a, -b), and then the polarization identifier corresponding to the target bit a is +1, and the polarization identifier corresponding to the target bit-b is-1, then the output hash code value is (1, -1).
Step S12, obtaining each preset hash code value generated by the preset hash code model, and determining the authentication result based on the output hash code value and each preset hash code value.
In this embodiment, it should be noted that the preset hash code value is a hash code value corresponding to user information of a party having a legal identity participating in federal learning, and the preset hash code value is generated by the preset hash code model.
Acquiring each preset hash code value generated by the preset hash code model, determining the identity verification result based on the output hash code value and each preset hash code value, specifically, acquiring each preset hash code value generated by the preset hash code model in a corresponding block in a block chain of the first device, calculating a calculated similarity between the output hash code value and each preset hash code value, comparing each calculated similarity with a preset similarity threshold, if the calculated similarity less than or equal to the preset similarity threshold exists, proving that the second device has a legal identity participating in federal learning, further determining that the identity verification result is legal, if the calculated similarity less than or equal to the preset similarity threshold does not exist, proving that the second device does not have a legal identity participating in federal learning, and further judging that the identity authentication result is illegal.
Wherein the step of determining the authentication result based on the output hash code value and each of the preset hash code values comprises:
step S121, calculating the calculated Hamming distance between the output Hash code value and each preset Hash code value respectively, and determining a target Hamming distance in each calculated Hamming distance;
in this embodiment, the calculated hamming distances between the output hash code value and each of the preset hash code values are respectively calculated, and the target hamming distance is determined in each of the calculated hamming distances, specifically, the difference bit number between the output hash code value and each of the preset hash code values is respectively calculated, and the difference bit number is used as the calculated hamming distance, and the smallest calculated hamming distance is selected from each of the calculated hamming distances as the target hamming distance.
Step S122, comparing the target Hamming distance with a preset Hamming distance threshold, and if the target Hamming distance is smaller than or equal to the preset Hamming distance threshold, judging that the identity verification result is that the identity is legal;
in this embodiment, the target hamming distance is compared with a preset hamming distance threshold, and if the target hamming distance is less than or equal to the preset hamming distance threshold, it is proved that the second device has a legal identity participating in federal learning, and the identity verification result is judged to be legal.
Step S123, if the target Hamming distance is greater than the preset Hamming distance threshold, the identity verification result is judged to be illegal.
In this embodiment, if the target hamming distance is greater than the preset hamming distance threshold, it is proved that the second device does not have a legal identity participating in federal learning, and the identity verification result is determined to be illegal.
Step S20, performing authenticity verification on the blockchain qualification of the second device based on the second verification information, and obtaining an authenticity verification result;
in this embodiment, it should be noted that, if the second device applies for a public-private key and a block address in a block chain corresponding to federal learning, where the block address is bound to a new generated private key in the public-private key, the second device is certified to have block chain qualification.
Performing authenticity verification on the blockchain qualification of the second device based on the second verification information to obtain an authenticity verification result, specifically, based on the second verification information, performing zero-knowledge proof on the block qualification of the second device to respectively calculate a first zero-knowledge proof result and a second zero-knowledge proof result corresponding to the second verification information, and comparing the first zero knowledge proof result with the second zero knowledge proof result, if the first zero knowledge proof result is consistent with the second zero knowledge proof result, proving that the second device has block chain qualification, and the authenticity verification result is true, if the first zero knowledge proof result is inconsistent with the second zero knowledge proof result, the second device is proved not to have block chain qualification, and the authenticity verification result is not authentic.
Wherein the second verification information comprises encrypted blockchain qualification data, verification blockchain qualification data and verification random parameters, the blockchain qualification comprises a newly generated public key,
the authenticity verification is performed on the block chain qualification of the second device based on the second verification information, and the step of obtaining the authenticity verification result comprises the following steps:
step S21, calculating a first zero knowledge proof result corresponding to the encrypted block chain qualification data based on a preset verification challenge parameter;
in this embodiment, it should be noted that the verification random parameter includes a first verification random parameter and a second verification random parameter, before the first device receives the second verification information, the second device sends a new generated public key in the public and private key to the first device, the first device encrypts a preset verification challenge parameter corresponding to the new generated public key based on the new generated public key to obtain an encrypted verification challenge parameter, and then feeds the encrypted verification challenge parameter back to the second device, and the second device decrypts the encrypted verification challenge parameter based on the new generated private key in the public and private key to obtain a preset verification challenge parameter, further, the second device performs hash coding on the block address to obtain a block address hash coding value, and then based on the new generated public key and the verification random parameter, homomorphic encrypting the block address hash code value to obtain the encrypted block chain qualification data, and further generating the verification block chain qualification data based on the preset verification challenge parameter and the block address hash code value, for example, assuming that the newly generated public key is P, and a first verification random parameter for homomorphic encrypting is r1Encrypting block chain qualification data h after encrypting the block address Hash code value m based on homomorphic encryption algorithmm=Enc(P,m,r1) Wherein Enc is a homomorphic encryption symbol, and the preset verification challenge parameter is assumed to include a first challenge parameter x1And a second challenge parameter x2Then the verification blockchain data is m x1+m*x2It should be noted that, the number of the preset verification challenge parameters may be set by itself, and the number of the preset verification challenge parameters does not affect the result of the authenticity verification.
Additionally, it should be noted that the second verification is performed at the same timeThe machine parameter may be calculated by the second device based on a preset verification challenge parameter and the first verification random parameter, for example, assuming that the first verification random parameter is r1The preset verification challenge parameter comprises a first challenge parameter x1And a second challenge parameter x2Then the second verification random parameter
Figure BDA0002505146850000171
Additionally, it should be noted that, in this embodiment, the first device and the second device both perform encryption based on a homomorphic encryption algorithm, where in an implementable scheme, the homomorphic encryption algorithm should satisfy the following properties:
c ═ Enc (PK, m, r), and for C1=Enc(PK,m1,r1) And C) and2=Enc(PK,m2,r2) And satisfies the following conditions:
Figure BDA0002505146850000172
wherein, C, C1And C2All are parameters to be encrypted after encryption, PK is an encrypted secret key, m and m1And m2As parameters to be encrypted, r1And r2The random number required for encryption.
Calculating a first zero knowledge proof result corresponding to the encrypted block chain qualification data based on a preset verification challenge parameter, specifically, performing homomorphic encryption operation on the encrypted block chain qualification data based on the preset verification challenge parameter to obtain the first zero knowledge proof result, for example, assuming that the preset verification challenge parameter is x1And x2The qualification data of the block chain is encrypted as hm=Enc(P,m,r1) Where P is the newly generated public key, r1For the first verification random parameter, m is the block address hash code value, and the first zero knowledge verification result is
Figure BDA0002505146850000181
Step S22, based on the newly generated public key and the verification random parameter, encrypting the verification block chain qualification data to obtain a second zero knowledge proof result;
in this embodiment, the verification blockchain qualification data is encrypted based on the newly generated public key and the verification random parameter to obtain a second zero knowledge proof result, and specifically, the homomorphic encryption operation is performed on the verification blockchain qualification data based on the newly generated public key and the second verification random parameter to obtain the second zero knowledge proof result, for example, assuming that the preset verification challenge parameter is x1And x2The qualification data of the block chain is encrypted as hm=Enc(P,m,r1) Where P is the newly generated public key, r1For the first verification random parameter, m is the block address hash code value, and the verification block chain data n ═ m × x1+m*x2Second verification of random parameters
Figure BDA0002505146850000182
And the second zero knowledge verification result is
Figure BDA0002505146850000183
Step S23, determining the authenticity verification result based on the first zero knowledge proof result and the second zero knowledge proof result.
In this embodiment, the authenticity verification result is determined based on the first zero knowledge proof result and the second zero knowledge proof result, specifically, if the first zero knowledge proof result is consistent with the second zero knowledge proof result, it is verified that the second device has block chain qualification, and then the authenticity verification result is true, and if the first zero knowledge proof result is inconsistent with the second zero knowledge proof result, it is verified that the second device does not have block chain qualification, and then the authenticity verification result is false.
Wherein the blockchain qualification includes a newly generated public key and a newly generated private key,
before the step of performing authenticity verification on the blockchain qualification of the second device based on the second verification information to obtain an authenticity verification result, the federal learning qualification recovery method further includes:
step C10, receiving the newly generated public key sent by the second device, and encrypting a preset verification challenge parameter based on the newly generated public key to obtain an encrypted verification challenge parameter;
in this embodiment, it should be noted that before step B10, because the original private key is lost by the second device, the second device cannot continue to participate in the block chain-based federal learning, and the second device needs to re-apply for a new public and private key to re-acquire the new public and private key participating in the federal learning, and send the new generated public key in the public and private key to the first device.
Step C20, sending the encrypted verification challenge parameter to the second device, so that the second device decrypts the encrypted verification challenge parameter based on the newly generated private key to obtain the preset verification challenge parameter, and generates the second verification information based on the preset verification challenge parameter.
In this embodiment, it should be noted that, if the second device does hold the newly generated private key corresponding to the newly generated public key, the encrypted verification challenge parameter may be decrypted based on the newly generated private key to obtain a preset verification challenge parameter, and then second verification information is generated based on the preset verification challenge parameter, and if an authenticity verification result obtained based on the authenticity verification of the second verification information is legal, it is proved that the second device does apply for the public and private key, that is, it is proved that the second device has block chain qualification.
Step S30, recovering the federally learned qualification of the second device based on the authentication result and the authenticity verification result.
In this embodiment, the federal learning qualification of the second device is recovered based on the identity verification result and the authenticity verification result, and specifically, if the identity verification result is legal and the authenticity verification result is true, the validity of the federal learning qualification of the second device is broadcasted to all federal learning participants and federal learning coordinators related to the second device federation, and the federal learning qualification of the second device is recovered.
Wherein the step of recovering the federally learned qualification of the second device based on the authentication result and the authenticity verification result includes:
step D10, generating an identity confirmation corresponding to the second device based on the identity verification result and the authenticity verification result;
in this embodiment, it should be noted that the identity confirmation certificate is a certificate for determining that the second device has a legal federal learning qualification for the first device, where the identity confirmation certificate is signed by an endorsement of the first device to prove the confirmation of the legal federal learning qualification of the second device by the first device.
And D20, respectively sending the identity confirmation certificates to federal participants related to the second equipment federally, and recovering the federal learning qualification of the second equipment.
In this embodiment, it should be noted that the federal participant is a participant performing federal learning with the second device.
The identity confirmation certificates are respectively sent to federal participants associated with the second device federally, the federal learning qualification of the second device is recovered, specifically, the identity confirmation certificates and the new generated public keys are respectively sent to federal participants associated with the second device federally, so that the federal learning participants can store the new generated public keys and the identity confirmation certificates in a local database held locally, wherein the local database can be formed by a local merck tree constructed based on a preset polarization hash coding model, that is, after receiving the identity confirmation certificates and the new generated public keys, the federal participants update the local merck tree, so as to store the identity confirmation certificates and the new generated public keys.
The embodiment verifies information through receiving first verification information and second verification information sent by second equipment, and based on the first verification information and a preset Hash coding model, right the second equipment performs identity validity verification to obtain an identity verification result, and further based on the second verification information, right the block chain qualification of the second equipment performs authenticity verification to obtain an authenticity verification result, and further based on the identity verification result and the authenticity verification result, the federal learning qualification of the second equipment is recovered. That is, after receiving the first verification information and the second verification information sent by the second device, the embodiment may verify whether the identity of the federate learning participant of the second device is legal based on the first verification information and the preset hash coding model, and further, may verify whether the second device re-applies the real and legal block chain qualification, that is, whether the second device re-applies the real and legal public and private key based on the second verification information, and after verifying the identity of the legal participant of the second device and determining that the second device re-applies the real and legal public and private key, may prove that the second device has the qualification of participating in the federate learning based on the block chain, and may recover the federate learning of the second device, and further avoid the participant losing the legal qualification of participating in the federate learning training, the situation that the Federal learning can not be continued occurs, so the technical problem that the Federal learning participator can not participate in the Federal learning after losing the Federal learning qualification is solved.
Further, referring to fig. 2, in another embodiment of the present application, based on the first embodiment of the present application, the federal learning qualification recovery method is applied to a second device, and the federal learning qualification recovery method includes:
step E10, obtaining user information, and using the user information as first verification information;
in this embodiment, it should be noted that the user information is identification information of the second device, for example, a user name, a user mobile phone number, and the like.
Step E20, generating a new generated public key and a new generated private key, sending the new generated public key to the first device, and receiving an encryption verification challenge parameter fed back by the first device based on the new generated public key;
in this embodiment, a newly generated public key and a newly generated private key are generated, the newly generated public key is sent to a first device, and an encryption verification challenge parameter fed back by the first device based on the newly generated public key is received, specifically, the newly generated public key and the newly generated private key are generated, and the newly generated public key is sent to the first device, so that the first device encrypts a preset verification challenge parameter based on the newly generated public key to obtain an encryption verification challenge parameter, and feeds back the encryption verification challenge parameter to a second device, and the second device receives the encryption verification challenge parameter.
Step E30, based on the newly generated private key, decrypting the encrypted verification challenge parameter to obtain a preset verification challenge parameter;
in this embodiment, it should be noted that the newly generated public key and the newly generated private key are a pair of public and private keys, where the newly generated private key is bound to a new tile reapplied by the second device in the tile chain.
Step E40, generating the second verification information based on the preset verification challenge parameter;
in this embodiment, it should be noted that the second authentication information includes an encrypted hash code value, an authentication hash code value, and an authentication random parameter to be sent.
Generating the second verification information based on the preset verification challenge parameter, specifically, randomly generating an initial verification random parameter, generating the verification random parameter to be sent based on the preset verification challenge parameter and the initial verification random parameter, further acquiring a block address of the new block, performing hash coding on the block address to acquire a block address hash code value, further performing homomorphic encryption on the block address hash code value based on the initial verification random parameter and the new generation public key to acquire an encrypted hash code value, and further, generating a base random parameter, a block address to be sent based on the block address hash code value, and further, generating a new verification random parameter based on the block address hash code value and the new generation public keyGenerating the verification block chain qualification data according to a preset verification challenge parameter and the block address hash code value, and performing the authenticity verification by the first device after receiving the encrypted hash code value, the verification hash code value and the random verification parameter to be sent, wherein in an implementable scheme, the preset verification challenge parameter is x1And x2If the hash code value of the block address is m, the verification block chain data n is m x1+m*x2The initial verification random parameter is r1The random parameter of the verification to be sent is
Figure BDA0002505146850000211
The encrypted hash code value is hm=Enc(P,m,r1) And the homomorphic encryption algorithm should satisfy the following properties:
c ═ Enc (PK, m, r), and for C1=Enc(PK,m1,r1) And C) and2=Enc(PK,m2,r2) And satisfies the following conditions:
Figure BDA0002505146850000212
wherein, C, C1And C2All are parameters to be encrypted after encryption, PK is an encrypted secret key, m and m1And m2As parameters to be encrypted, r1And r2The random number required for encryption.
Wherein the second verification information comprises an encrypted hash code value, a verification hash code value and a verification random parameter to be sent,
the step of generating the second verification information based on the preset verification challenge parameter includes:
step E41, obtaining a block address corresponding to the newly generated private key, and performing hash coding on the block address to obtain a hash coding value;
in this embodiment, it should be noted that the method for hash-coding the block address includes hash-coding by a hash function, hash-coding by a hash-coding model, for example, a polarization hash-coding model constructed based on a deep polarization network, and the like.
Step E42, based on the newly generated public key and a preset verification random parameter, encrypting the hash code value to obtain the encrypted hash code value;
in this embodiment, the hash code value is encrypted based on the newly generated public key and a preset verification random parameter to obtain the encrypted hash code value, and specifically, the hash code value is homomorphically encrypted by a preset homomorphic encryption algorithm based on the newly generated public key and the preset verification random parameter to obtain the encrypted hash code value.
Step E43, calculating the verification hash code value based on the preset verification challenge parameter and the hash code value;
in this embodiment, it should be noted that the preset verification challenge parameter includes a first challenge parameter and a second challenge parameter.
And calculating the verification hash code value based on the preset verification challenge parameter and the hash code value, specifically, calculating a first product between the first challenge parameter and the hash code value, calculating a second product between the second challenge parameter and the hash code value, and then summing the first product and the second product to obtain the verification hash code value.
Step E44, generating the verification random parameter to be sent based on the preset verification challenge parameter and the preset verification random parameter.
In this embodiment, the random parameter to be verified is generated based on the preset verification challenge parameter and the preset random verification parameter, specifically, the first challenge parameter is used as an exponent of the preset random verification parameter, a power operation is performed on the preset random verification parameter to obtain a first power operation result, similarly, the second challenge parameter is used as an exponent of the preset random verification parameter, a power operation is performed on the preset random verification parameter to obtain a second power operation result, and then a product of the first power operation result and the second power operation result is obtained, and the product is used as the random verification parameter to be verified.
Step E50, sending the first verification information and the second verification information to the first device, so that the first device recovers the federally learned qualification of the second device.
In this embodiment, the first verification information and the second verification information are sent to the first device, so that the first device recovers the federal learning qualification of the second device, and specifically, the first verification information and the second verification information are sent to the first device, so that the first device performs identity validity verification on the second device based on the first verification information to obtain an identity verification result, performs authenticity verification on the block chain qualification of the second device based on the second verification information to obtain an authenticity verification result, and recovers the federal learning qualification of the second device based on the identity verification result and the authenticity verification result.
In this embodiment, user information is obtained and used as first verification information, so that a newly generated public key and a newly generated private key are generated, the newly generated public key is sent to a first device, an encryption verification challenge parameter fed back by the first device based on the newly generated public key is received, the encryption verification challenge parameter is decrypted based on the newly generated private key, a preset verification challenge parameter is obtained, then, based on the preset verification challenge parameter, second verification information is generated, and the first verification information and the second verification information are sent to the first device, so that the first device recovers the federal learning qualification of the second device. That is, the present embodiment provides a method for generating first verification information and second verification information, and then sending the first verification information and the second verification information to the first device to recover the federal learning qualification, that is, after generating the first verification information and the second verification information, sending the first verification information and the second verification information to the first device, the first device may verify whether the second device has a legitimate participant identity of federal learning and whether the second device reappears a public and private key based on the first verification information and the second verification information, and then the first device may prove that the second device has the qualification to participate in federal learning based on a block chain after determining the legitimate participant identity of the second device and determining that the second device reappears the public and private key, and the federal learning qualification of the second equipment can be recovered, so that the technical problem that the federal learning participator can not participate in the federal learning after losing the federal learning qualification is solved.
Referring to fig. 3, fig. 3 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
As shown in fig. 3, the federal learning qualification recovery device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Optionally, the federal learning recovery device may further include a rectangular user interface, a network interface, a camera, RF (Radio Frequency) circuits, a sensor, an audio circuit, a WiFi module, and the like. The rectangular user interface may comprise a Display screen (Display), an input sub-module such as a Keyboard (Keyboard), and the optional rectangular user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
It will be understood by those skilled in the art that the federal learned competency recovery device configuration shown in fig. 3 does not constitute a limitation of the federal learned competency recovery device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 3, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, and a federally learned qualification recovery method program. The operating system is a program that manages and controls the hardware and software resources of the federal learned qualifications recovery device, supporting the operation of the federal learned qualifications recovery method program, as well as other software and/or programs. The network communication module is used to enable communication between components within the memory 1005, as well as with other hardware and software in the federal learned competency recovery method system.
In the federal learning qualification recovery device shown in fig. 3, the processor 1001 is configured to execute the program of the federal learning qualification recovery method stored in the memory 1005, and implement the steps of the federal learning qualification recovery method described in any one of the above.
The specific implementation of the federal learning qualification recovery device of the present application is substantially the same as the embodiments of the federal learning qualification recovery method described above, and is not described herein again.
The embodiment of the present application further provides a federal learning qualification recovery device, where the federal learning qualification recovery device is applied to a first device, and the federal learning qualification recovery device includes:
the first verification module is used for receiving first verification information and second verification information sent by second equipment, and verifying the identity validity of the second equipment based on the first verification information and a preset Hash coding model to obtain an identity verification result;
the first verification module is used for verifying the authenticity of the block chain qualification of the second equipment based on the second verification information to obtain an authenticity verification result;
a recovery module to recover the federal learning qualifications of the second device based on the authentication result and the authenticity verification result.
Optionally, the first authentication module comprises:
the hash coding unit is used for inputting the first verification information into a preset hash coding model so as to carry out hash coding on the first verification information based on the class characteristic information of the first verification information and obtain an output hash coding value;
and the first determining unit is used for acquiring each preset Hash code value generated by the preset Hash code model and determining the identity verification result based on the output Hash code value and each preset Hash code value.
Optionally, the determining unit includes:
the calculating subunit is used for calculating the calculated Hamming distance between the output Hash code value and each preset Hash code value respectively and determining a target Hamming distance in each calculated Hamming distance;
the first judgment unit is used for comparing the target Hamming distance with a preset Hamming distance threshold value, and if the target Hamming distance is smaller than or equal to the preset Hamming distance threshold value, judging that the identity verification result is that the identity is legal;
and the second judgment unit is used for judging that the identity verification result is illegal if the target Hamming distance is greater than the preset Hamming distance threshold value.
Optionally, the second authentication module comprises:
the computing unit is used for computing a first zero knowledge proof result corresponding to the encrypted block chain qualification data based on a preset verification challenge parameter;
the encryption processing unit is used for carrying out encryption processing on the verification block chain qualification data based on the newly generated public key and the verification random parameter to obtain a second zero knowledge proof result;
a second determining unit configured to determine the authenticity verification result based on the first zero knowledge proof result and the second zero knowledge proof result.
Optionally, the federal learning qualification recovery apparatus further includes:
the encryption module is used for receiving the newly generated public key sent by the second equipment and encrypting a preset verification challenge parameter based on the newly generated public key to obtain an encrypted verification challenge parameter;
and the sending module is used for sending the encrypted verification challenge parameter to the second equipment so that the second equipment can decrypt the encrypted verification challenge parameter based on the newly generated private key to obtain the preset verification challenge parameter, and generate the second verification information based on the preset verification challenge parameter.
Optionally, the recovery module comprises:
the generating unit is used for generating an identity confirmation certificate corresponding to the second equipment based on the identity verification result and the authenticity verification result;
and the recovery unit is used for respectively sending the identity confirmation certificates to federal participants related to the second equipment federally and recovering the federal learning qualification of the second equipment.
The specific implementation of the federal learning qualification recovery device of the present application is substantially the same as the embodiments of the federal learning qualification recovery method described above, and is not described herein again.
In order to achieve the above object, this embodiment further provides a federal learning qualification recovery device, where the federal learning qualification recovery device is applied to a second device, and the federal learning qualification recovery device includes:
the system comprises an acquisition module, a verification module and a verification module, wherein the acquisition module is used for acquiring user information and taking the user information as first verification information;
the first generation module is used for generating a newly generated public key and a newly generated private key, sending the newly generated public key to the first equipment and receiving an encryption verification challenge parameter fed back by the first equipment based on the newly generated public key;
the decryption module is used for decrypting the encrypted verification challenge parameter based on the newly generated private key to obtain a preset verification challenge parameter;
the second generation module is used for generating the second verification information based on the preset verification challenge parameter;
and the recovery module is used for sending the first verification information and the second verification information to the first equipment so that the first equipment can recover the federal learning qualification of the second equipment.
Optionally, the second generating module includes:
the hash coding unit is used for acquiring the block address corresponding to the newly generated private key and carrying out hash coding on the block address to obtain a hash coding value;
the encryption unit is used for encrypting the hash code value based on the newly generated public key and a preset verification random parameter to obtain the encrypted hash code value;
a calculating unit, configured to calculate the verification hash code value based on the preset verification challenge parameter and the hash code value;
and the generating unit is used for generating the verification random parameter to be sent based on the preset verification challenge parameter and the preset verification random parameter.
The specific implementation of the federal learning qualification recovery device of the present application is substantially the same as the embodiments of the federal learning qualification recovery method described above, and is not described herein again.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (10)

1. A federated learning qualification recovery method is applied to a first device, and comprises the following steps:
receiving first verification information and second verification information sent by second equipment, and performing identity validity verification on the second equipment based on the first verification information and a preset Hash coding model to obtain an identity verification result;
performing authenticity verification on the block chain qualification of the second equipment based on the second verification information to obtain an authenticity verification result;
recovering the federally learned qualification of the second device based on the authentication result and the authenticity verification result.
2. The federal learning qualification recovery method as claimed in claim 1, wherein the step of performing identity validity verification on the second device based on the first verification information and a preset hash coding model to obtain an identity verification result comprises:
inputting the first verification information into a preset Hash coding model, and carrying out Hash coding on the first verification information based on the class characteristic information of the first verification information to obtain an output Hash coding value;
and acquiring each preset Hash code value generated by the preset Hash code model, and determining the identity verification result based on the output Hash code value and each preset Hash code value.
3. The federal learning qualification recovery method as claimed in claim 2, wherein the step of determining the authentication result based on the output hash code value and each of the preset hash code values comprises:
calculating the calculated Hamming distance between the output Hash code value and each preset Hash code value respectively, and determining a target Hamming distance in each calculated Hamming distance;
comparing the target Hamming distance with a preset Hamming distance threshold, and if the target Hamming distance is smaller than or equal to the preset Hamming distance threshold, judging that the identity verification result is that the identity is legal;
and if the target Hamming distance is larger than the preset Hamming distance threshold value, judging that the identity verification result is illegal.
4. The federally learned membership recovery method as claimed in claim 1, wherein the second verification information includes encrypted blockchain qualification data, verification blockchain qualification data, and verification random parameters, the blockchain qualification including a newly generated public key,
the authenticity verification is performed on the block chain qualification of the second device based on the second verification information, and the step of obtaining the authenticity verification result comprises the following steps:
calculating a first zero knowledge proof result corresponding to the encryption block chain qualification data based on a preset verification challenge parameter;
based on the newly generated public key and the verification random parameter, encrypting the verification block chain qualification data to obtain a second zero knowledge proof result;
determining the authenticity verification result based on the first zero knowledge proof result and the second zero knowledge proof result.
5. The federal learning qualification recovery method of claim 1, wherein the blockchain qualification includes a newly generated public key and a newly generated private key,
before the step of performing authenticity verification on the blockchain qualification of the second device based on the second verification information to obtain an authenticity verification result, the federal learning qualification recovery method further includes:
receiving the newly generated public key sent by the second device, and encrypting a preset verification challenge parameter based on the newly generated public key to obtain an encrypted verification challenge parameter;
and sending the encryption verification challenge parameter to the second equipment so that the second equipment can decrypt the encryption verification challenge parameter based on the newly generated private key to obtain the preset verification challenge parameter, and generate the second verification information based on the preset verification challenge parameter.
6. The federal learning qualification recovery method of claim 1, wherein the step of recovering the federal learning qualification of the second device based on the authentication result and the authenticity verification result comprises:
generating an identity confirmation certificate corresponding to the second equipment based on the identity verification result and the authenticity verification result;
and respectively sending the identity confirmation certificates to federal participants related to the second equipment federally, and recovering the federal learning qualification of the second equipment.
7. The federated learning qualification recovery method is applied to a second device, and comprises the following steps:
acquiring user information, and taking the user information as first verification information;
generating a newly generated public key and a newly generated private key, sending the newly generated public key to first equipment, and receiving an encryption verification challenge parameter fed back by the first equipment based on the newly generated public key;
decrypting the encrypted verification challenge parameter based on the newly generated private key to obtain a preset verification challenge parameter;
generating the second verification information based on the preset verification challenge parameter;
and sending the first verification information and the second verification information to the first equipment so that the first equipment can recover the federal learning qualification of the second equipment.
8. The federal learning qualification recovery method of claim 7, wherein the second verification information includes a cryptographic hash code value, a verification hash code value, and a verification random parameter to be transmitted,
the step of generating the second verification information based on the preset verification challenge parameter includes:
acquiring a block address corresponding to the newly generated private key, and performing hash coding on the block address to acquire a hash coding value;
encrypting the hash code value based on the newly generated public key and a preset verification random parameter to obtain an encrypted hash code value;
calculating the verification hash code value based on the preset verification challenge parameter and the hash code value;
and generating the verification random parameter to be sent based on the preset verification challenge parameter and the preset verification random parameter.
9. A federal learning qualification recovery apparatus characterized by comprising: a memory, a processor, and a program stored on the memory for implementing the federal learning qualification recovery method,
the memory is used for storing a program for realizing the federal learning qualification recovery method;
the processor is configured to execute a program implementing the federal learning qualification recovery method to implement the steps of the federal learning qualification recovery method as claimed in any of claims 1 to 6 or 7 to 8.
10. A readable storage medium having stored thereon a program for implementing a federal learning qualifications recovery method, the program being executable by a processor to perform the steps of the federal learning qualifications recovery method as claimed in any one of claims 1 to 6 or 7 to 8.
CN202010445869.2A 2020-05-22 2020-05-22 Federal learning qualification recovery method, device and readable storage medium Active CN111614679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010445869.2A CN111614679B (en) 2020-05-22 2020-05-22 Federal learning qualification recovery method, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010445869.2A CN111614679B (en) 2020-05-22 2020-05-22 Federal learning qualification recovery method, device and readable storage medium

Publications (2)

Publication Number Publication Date
CN111614679A true CN111614679A (en) 2020-09-01
CN111614679B CN111614679B (en) 2021-07-27

Family

ID=72205348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010445869.2A Active CN111614679B (en) 2020-05-22 2020-05-22 Federal learning qualification recovery method, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN111614679B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112381000A (en) * 2020-11-16 2021-02-19 深圳前海微众银行股份有限公司 Face recognition method, device, equipment and storage medium based on federal learning
CN114785810A (en) * 2022-03-31 2022-07-22 海南师范大学 Tree broadcast data synchronization algorithm suitable for federal learning
WO2023245640A1 (en) * 2022-06-24 2023-12-28 亚信科技(中国)有限公司 Blockchain-based federated learning device, method and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079101A (en) * 2007-06-19 2007-11-28 中山大学 Zernike moment based robust hashing image authentification method
CN108243182A (en) * 2017-10-26 2018-07-03 招商银行股份有限公司 Management authorization method, sub- management end, root management end and the storage medium of block chain
US20190138934A1 (en) * 2018-09-07 2019-05-09 Saurav Prakash Technologies for distributing gradient descent computation in a heterogeneous multi-access edge computing (mec) networks
CN110399742A (en) * 2019-07-29 2019-11-01 深圳前海微众银行股份有限公司 A kind of training, prediction technique and the device of federation's transfer learning model
CN110741369A (en) * 2017-06-02 2020-01-31 维萨国际服务协会 Secure biometric authentication using electronic identity
US10581896B2 (en) * 2016-12-30 2020-03-03 Chronicle Llc Remedial actions based on user risk assessments
CN110995737A (en) * 2019-12-13 2020-04-10 支付宝(杭州)信息技术有限公司 Gradient fusion method and device for federal learning and electronic equipment
CN111027086A (en) * 2019-12-16 2020-04-17 支付宝(杭州)信息技术有限公司 Private data protection method and system
CN111125779A (en) * 2019-12-17 2020-05-08 山东浪潮人工智能研究院有限公司 Block chain-based federal learning method and device
CN111177762A (en) * 2019-12-30 2020-05-19 北京同邦卓益科技有限公司 Data processing method, device, server and federal learning system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079101A (en) * 2007-06-19 2007-11-28 中山大学 Zernike moment based robust hashing image authentification method
US10581896B2 (en) * 2016-12-30 2020-03-03 Chronicle Llc Remedial actions based on user risk assessments
CN110741369A (en) * 2017-06-02 2020-01-31 维萨国际服务协会 Secure biometric authentication using electronic identity
CN108243182A (en) * 2017-10-26 2018-07-03 招商银行股份有限公司 Management authorization method, sub- management end, root management end and the storage medium of block chain
US20190138934A1 (en) * 2018-09-07 2019-05-09 Saurav Prakash Technologies for distributing gradient descent computation in a heterogeneous multi-access edge computing (mec) networks
CN110399742A (en) * 2019-07-29 2019-11-01 深圳前海微众银行股份有限公司 A kind of training, prediction technique and the device of federation's transfer learning model
CN110995737A (en) * 2019-12-13 2020-04-10 支付宝(杭州)信息技术有限公司 Gradient fusion method and device for federal learning and electronic equipment
CN111027086A (en) * 2019-12-16 2020-04-17 支付宝(杭州)信息技术有限公司 Private data protection method and system
CN111125779A (en) * 2019-12-17 2020-05-08 山东浪潮人工智能研究院有限公司 Block chain-based federal learning method and device
CN111177762A (en) * 2019-12-30 2020-05-19 北京同邦卓益科技有限公司 Data processing method, device, server and federal learning system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112381000A (en) * 2020-11-16 2021-02-19 深圳前海微众银行股份有限公司 Face recognition method, device, equipment and storage medium based on federal learning
CN114785810A (en) * 2022-03-31 2022-07-22 海南师范大学 Tree broadcast data synchronization algorithm suitable for federal learning
CN114785810B (en) * 2022-03-31 2023-05-16 海南师范大学 Tree-like broadcast data synchronization method suitable for federal learning
WO2023245640A1 (en) * 2022-06-24 2023-12-28 亚信科技(中国)有限公司 Blockchain-based federated learning device, method and system

Also Published As

Publication number Publication date
CN111614679B (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN111639361B (en) Block chain key management method, multi-person common signature method and electronic device
CN111598254B (en) Federal learning modeling method, device and readable storage medium
CN111614679B (en) Federal learning qualification recovery method, device and readable storage medium
CN107483191B (en) SM2 algorithm key segmentation signature system and method
US11223486B2 (en) Digital signature method, device, and system
WO2020038137A1 (en) Two-dimensional code generation method, data processing method, apparatus, and server
WO2010005071A1 (en) Password authenticating method
CN102263639A (en) Authentication device, authentication method, program, and signature generation device
CN111931533B (en) Authentication method for multi-owner RFID tag
CN107104788B (en) Terminal and non-repudiation encryption signature method and device thereof
CN112364335B (en) Identification identity authentication method and device, electronic equipment and storage medium
TW202211047A (en) Data acquisition method, apparatus and device, and medium
CN116318784B (en) Identity authentication method, identity authentication device, computer equipment and storage medium
CN113761570B (en) Data interaction method for privacy intersection
CN112423295B (en) Lightweight security authentication method and system based on block chain technology
CN113407928B (en) Multi-owner RFID authentication method based on block chain
CN104868994A (en) Collaboration secret key management method, device and system
CN112491840B (en) Information modification method, device, computer equipment and storage medium
CN115278620A (en) Radio frequency identification data security authentication method and system based on random rearrangement block matrix encryption
CN114567448A (en) Collaborative signature method and collaborative signature system
CN107872312A (en) Symmetric key dynamic creation method, device, equipment and system
CN111552950A (en) Software authorization method and device and computer readable storage medium
CN117097561B (en) Trusted equipment transfer identity authentication method for industrial Internet of things
CN116782210B (en) Dynamic encryption key generation method of high-speed encryption algorithm
CN108155991B (en) Generation system of trusted key

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