Federal learning and block chain-based identity identification method and apparatus, and related device
By using the federated learning method on the blockchain for identity verification, the problem of data leakage risk in blockchain data processing is solved, and higher data security and privacy protection are achieved.
Patent Information
- Application Number
- CN202411223790.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Blockchain-based data processing has the risk of data leakage, which affects the protection of data privacy. In particular, users' sensitive data (such as private keys) may leave the user's device.
An identity identification method based on federated learning and blockchain is used to receive identity information processing requests through the blockchain and call the identity verification model in the smart contract. The model is trained by the federated learning method and is used to perform operations on the blockchain node. Authentication to ensure sensitive data is processed locally to avoid data leakage.
Combining the decentralization and non-tamperability of blockchain with the privacy protection features of federated learning, the security and privacy of identity information processing are improved, ensuring that data is both safe and private during processing.
Smart Images

Figure CN118761052A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an identity identification method, device and related equipment based on federated learning and blockchain. Background Art
[0002] Blockchain is a distributed database technology that consists of a network of multiple nodes that jointly maintain and store data and uses cryptography to ensure the security and integrity of the data. Blockchain technology is widely used in various fields. The decentralized identity identification method of blockchain refers to the use of blockchain technology to achieve the secure management and verification of individual identity information without relying on traditional centralized identity management agencies.
[0003] However, in the process of blockchain-based data processing, it cannot be ensured that the user's sensitive data (such as private keys) will not leave the user's device, resulting in the risk of data leakage when blockchain-based data processing is still carried out, affecting the protection of data privacy. Summary of the invention
[0004] The embodiments of the present invention provide an identity identification method, apparatus, computer equipment and storage medium based on federated learning and blockchain, which improve the privacy of data processing by processing identity information based on federated learning and blockchain.
[0005] In order to solve the above technical problems, the embodiment of the present application provides an identity identification method based on federated learning and blockchain, including: Receive identity information processing requests from the user through the blockchain; Based on the smart contract of the blockchain, calling an identity authentication model, wherein the identity authentication module is set on a node in the blockchain, and the identity authentication model is used to indicate a model trained based on a federated learning method; Through the identity authentication model, the user terminal is authenticated according to the information carried in the identity information processing request to obtain a verification result; If the verification result is that the verification is passed, identity information processing is performed on the blockchain based on the identity information processing request to obtain an identity information processing result. In order to solve the above technical problems, the embodiment of the present application also provides an identity identification device based on federated learning and blockchain, including: An identity information processing request receiving unit, used to receive an identity information processing request from a user terminal through a blockchain; An identity verification model calling unit, configured to call an identity verification model based on a smart contract of the blockchain, wherein the identity verification module is set on a node in the blockchain, and the identity verification model is used to indicate a model trained based on a federated learning method; An identity verification unit, configured to verify the identity of the user terminal through the identity verification model according to the information carried in the identity information processing request, and obtain a verification result; The identity information processing unit is used to perform identity information processing on the blockchain based on the identity information processing request to obtain an identity information processing result if the verification result is verification passed.
[0006] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned identity identification method based on federated learning and blockchain when executing the computer program.
[0007] In order to solve the above technical problems, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned identity identification method based on federated learning and blockchain are implemented.
[0008] The identity identification method, device, computer equipment and storage medium based on federated learning and blockchain provided by the embodiment of the present invention receive identity information processing requests from the user end through blockchain; call the identity authentication model based on the smart contract of blockchain, wherein the identity authentication module is set on the node in the blockchain, and the identity authentication model is used to indicate the model trained based on the federated learning method; through the identity authentication model, the user end is authenticated according to the information carried by the identity information processing request to obtain the verification result; if the verification result is that the verification is passed, the identity information is processed based on the identity information processing request on the blockchain to obtain the identity information processing result. By processing identity information based on federated learning and blockchain, the present application combines the decentralization and immutability of blockchain and the privacy protection characteristics of federated learning, so that when processing identity information, both the security of data and the privacy of data can be protected. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0010] Figure 1 is an exemplary system architecture diagram to which the present application may be applied; Figure 2It is a flowchart of an embodiment of the identity identification method based on federated learning and blockchain of the present application; Figure 3 It is a structural schematic diagram of an embodiment of an identity identification device based on federated learning and blockchain according to the present application; Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0011] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0012] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0014] See also Figure 1 ,like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0015] Users can use terminal devices 101 , 102 , 103 to interact with server 105 via network 104 to receive or send messages, etc.
[0016] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Eperts Group Audio Layer III), MP4 (Moving Picture Eperts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0017] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0018] It should be noted that the identity identification method based on federated learning and blockchain provided in the embodiment of the present application is executed by a server, and accordingly, the identity identification device based on federated learning and blockchain is set in the server.
[0019] The identity identification method based on federated learning and blockchain provided in the embodiment of the present application is applied to the blockchain network, wherein the blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains information about a batch of network transactions, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer. Among them, the blockchain is a new distributed infrastructure and computing paradigm that uses a block chain data structure to verify and store data, a distributed node consensus algorithm to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script code to program and operate data.
[0020] The blockchain network in the embodiment of the present application may include blockchain nodes, and multiple blockchain nodes jointly maintain the blockchain. The blockchain node may be various computing nodes with the same or different computing power, such as a personal computer, a network server, a database server, a smart phone, etc., which are not limited here. Any two blockchain nodes in the blockchain node can communicate point-to-point. The blockchain is a distributed database of blocks linked in chronological order by hash pointers. The blocks of the blockchain are added in chronological order. When the predetermined conditions are met, each blockchain node in the blockchain network allows the current blockchain node to create a block and add the block to the blockchain, and the added block is used as the latest block on the blockchain. At a certain moment, the latest block obtained from the blockchain by the blockchain nodes maintaining the same blockchain is the same. In order to ensure that the blockchains stored locally by different blockchain nodes in the same blockchain network are consistent, a block synchronization process is required. It should be noted that the identity identification method provided in the embodiment of the present application can generally be executed by any blockchain node. Accordingly, the identity identification device provided in the embodiment of the present application can generally be set in any blockchain node.
[0021] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. The terminal devices 101, 102, 103 in the embodiment of the present application may specifically correspond to application systems in actual production.
[0022] See also Figure 2 , Figure 2 An identity identification method based on federated learning and blockchain provided by an embodiment of the present invention is shown. The method is applied in Figure 1 The server in is used as an example to illustrate the details as follows: S201. Receive an identity information processing request from a user through blockchain.
[0023] The identity information processing request refers to a request to process the identity information of the user end.
[0024] There may be many types of identity information processing requests, which may be adjusted according to actual conditions, and are not limited in the embodiments of the present application. For example, the identity information processing request includes an identity information processing request, that is, registering the identity information of the user terminal on the blockchain to generate an identity identifier of the user terminal. For another example, the identity information processing request includes an identity information update request, that is, updating the identity information of the user terminal stored on the blockchain.
[0025] It should be noted that in the embodiment of the present application, the user first generates its own public key and private key, and the public key is used as part of the user's identity. The information carried by the identity information processing request includes at least the public key of the user. The information carried by the identity information processing request may also include personal information, digital certificates, etc.
[0026] S202. Based on the smart contract of blockchain, an identity authentication model is called, wherein the identity authentication module is set on a node in the blockchain, and the identity authentication model is used to indicate a model trained based on a federated learning method.
[0027] The authentication model refers to the model trained based on the federated learning method. Federated learning is also called collaborative learning. It can perform large-scale training on the devices that generate data, and these sensitive data are retained by the data owner, collected locally, and trained locally. After local training, the central training coordinator obtains the training contribution of each node by obtaining the update of the distributed model, but does not access the actual sensitive data.
[0028] It should be noted that in the embodiment of the present application, the user-end device can collaboratively train an identity authentication model set on a node of the blockchain without uploading its private key information. Subsequently, the identity authentication model can be directly called through the smart contract of the blockchain to authenticate the user end, so as to achieve the decentralization and immutability of the blockchain and the privacy protection characteristics of federated learning, so that when processing identity information, both the security of the data and the privacy of the data can be protected. Federated learning ensures that the user's sensitive data (such as private keys) will not leave the user's device, thereby reducing the risk of data leakage. The immutability of the blockchain ensures the integrity of the identity information. Once the information is recorded on the blockchain, it cannot be modified by unauthorized third parties. Federated learning allows model training on local devices without uploading the user's original data, thereby protecting the user's privacy. Users can choose when and with whom to share their identity information, thereby reducing unnecessary monitoring and data abuse.
[0029] S203: Perform identity authentication on the user terminal through the identity authentication model according to the information carried in the identity information processing request to obtain a verification result.
[0030] In this application, the execution process of the identity authentication model is to select the initial cluster center by random initialization according to the information carried by the identity information processing request, calculate the distance between each sample point and the initial cluster center, and divide the sample points into the closest class according to the minimum distance principle. The federated learning framework coordinates multiple user-end devices to jointly train a global identity authentication model. Each user-end device only uploads the update of the model (gradient information) instead of the original data, which protects the privacy of the user. The goal of model training is to be able to identify valid user identities while rejecting unauthorized access. When the user needs to verify his identity (such as logging into the system or making a transaction), the user device uses the private key to sign a challenge and sends the signature and public key to the blockchain network. After receiving the request, the smart contract calls the federated learning model and provides the user's public key and signature as input. The federated learning model runs on the nodes in the blockchain network and uses the computing resources of the nodes to perform identity authentication.
[0031] S204. If the verification result is that the verification is passed, identity information processing is performed on the blockchain based on the identity information processing request to obtain an identity information processing result.
[0032] The identity information processing result refers to the result obtained after the identity information processing request is processed. There can be many types of identity information processing results. For example, when the identity information processing request is an identity information update request, the identity information processing result is the updated identity information. For another example, when the identity information processing request is an identity registration request, the identity information processing result is an identity identifier.
[0033] In this embodiment, an identity information processing request from a user is received through a blockchain; an identity authentication model is called based on a smart contract of the blockchain, wherein the identity authentication module is set on a node in the blockchain, and the identity authentication model is used to indicate a model trained based on a federated learning method; through the identity authentication model, the user is authenticated according to the information carried by the identity information processing request to obtain a verification result; if the verification result is a passed verification, identity information processing is performed on the blockchain based on the identity information processing request to obtain an identity information processing result. By processing identity information based on federated learning and blockchain, this application combines the decentralization and immutability of blockchain and the privacy protection characteristics of federated learning, so that when processing identity information, both the security of data and the privacy of data can be protected.
[0034] In some optional implementations of this embodiment, before step S204, the following steps are further included: Divide the nodes on the blockchain into multiple consensus groups.
[0035] Calculate the behavior weight value of each node in the consensus group.
[0036] Based on the behavior weight value of each node, the master node and consensus node are selected in the consensus group, and the consensus between the consensus groups is controlled based on the master node.
[0037] Specifically, the consensus algorithm is used to divide the nodes into multiple groups according to the grouping mechanism to reduce the waiting time of the decentralized identity nodes and the data transmission time; the behavior weight value model selects the RSU nodes with high behavior weight values as trusted nodes to produce blocks. Among them, the RSU nodes collect transactions into blocks and verify these blocks so that they can be further added to the allowed blockchain. Participating in the consensus process of the blockchain, these nodes are selected as nodes for producing blocks because they have high behavior weight values.
[0038] The specific process of the consensus algorithm includes: Based on the clustering, the nodes are divided into k consensus sets.
[0039] Calculate the behavior weight value of the node. The process of calculating the behavior weight value includes: first, according to the node attribute value, divide the nodes into three categories: managers, candidates, and ordinary nodes; second, according to the node behavior performance, calculate the behavior performance value of managers, candidates, and ordinary nodes respectively; finally, calculate the node behavior weight value through the node attribute value and the node behavior performance value.
[0040] The block producers are elected based on the behavior weight values of each node. The node with the highest behavior weight value in each group is a trusted node, representing the group to complete the block production. Trusted nodes whose behavior weight values exceed the threshold are reset to candidates to avoid the behavior weight values of trusted nodes being too high, which will make the system centralized.
[0041] Control block production, broadcasting and verification based on the node attributes. After a trusted node generates a new block and successfully verifies it, it broadcasts the block to the entire network; when nodes in other groups receive a new block to be verified, the trusted nodes of each group collect votes from other nodes in the group; if the majority of votes collected by the trusted node are in favor, the new block passes the verification of the group.
[0042] Node category update: After all groups in the system have completed the production of valid blocks, the node category is updated and the next round of consensus is entered.
[0043] In this embodiment, consensus nodes and master nodes are selected based on the idea of selecting nodes based on blockchain, and consensus nodes are sorted in descending order according to reputation values to fill each group in turn, and master nodes are randomly selected from the blockchain consensus group. Each blockchain group is guided by the master node to reach consensus, thereby improving the fairness of blockchain node selection and system operation efficiency. At the same time, the selection method of consensus nodes is not easy to cause node reputation accumulation problems, reducing the degree of system centralization, and improving the enthusiasm of blockchain monomer nodes to participate in consensus node selection. At the same time, the selection method of the main blockchain monomer node also improves the reliability of the main blockchain monomer node, introduces a common neighbor blockchain monomer node similarity model, divides the network blockchain monomer node into communities, and improves consensus efficiency. Based on the credit mechanism, the reputation and type of the blockchain monomer node are dynamically adjusted through the behavior of the blockchain monomer node, and the blockchain monomer node with high reputation produces blocks, which improves the reliability of the witness blockchain monomer node. In response to the participation and security issues of blockchain single nodes, a reward and punishment mechanism is adopted to provide income rewards to honest blockchain single nodes, reduce the possibility of blockchain single nodes receiving bribes, and increase the participation of blockchain single nodes; at the same time, reputation penalties are given to malicious blockchain single nodes to reduce the risk of system attacks, improve system security, and ensure the safety and reliability of the entire system when grouping.
[0044] Since the system may adopt a multi-chain structure, that is, there are multiple chains running in parallel. When the central node of the first chain is re-determined to be the second node, the central node information of the re-determined first chain may be sent to other nodes in the blockchain system, and the multiple first nodes may be clustered according to the access delay information to group the multiple first nodes.
[0045] Among them, the first chain refers to the main chain, which is responsible for handling the main transactions and data storage in the system. The second chain is an auxiliary chain that specializes in handling a certain type of transaction or data, such as the update and management of identity verification information. This design can optimize performance and improve efficiency and responsiveness by sharing the load of the main chain. In a multi-chain structure, the first chain and the second chain exchange and synchronize information through a certain mechanism (such as cross-chain technology) to ensure the consistency and security of the entire system. This design also helps to isolate specific functions or data on different chains, thereby better managing and optimizing the performance of each chain.
[0046] In this embodiment, step S204, on the blockchain, identity information processing is performed based on the identity information processing request, and the process of obtaining the identity information processing result may include: determining the target consensus group to which the identity information processing request belongs; generating a target block based on the master node on the target consensus group of the blockchain, and performing identity information processing on the identity information processing request based on the consensus node of the target consensus group to obtain the identity information processing result; and storing the identity information processing result on the target block.
[0047] In some embodiments, the process of storing the identity information processing result on the target block may include: when the identity information processing request is an identity registration request, the identity information processing result is an identity identifier, and the identity identifier is stored on the target block.
[0048] In some embodiments, the process of storing the identity information processing result on the target block may also include: when the identity information processing request is an identity information update request, the identity information processing result is the updated identity information, and based on the updated identity information, the identity information stored on the target block is replaced.
[0049] In this embodiment, if the user's identity information changes, when the public key or other key information is replaced, the user can update his or her identity information through the blockchain to ensure that the latest information can be verified and used. After that, the client (user) who initiates the identity information processing request can control the access and use of his or her own information through the private key to achieve overall decentralized identity identification; The step of updating its identity information includes: receiving the updated identity information of the user end (user) that initiates the identity information processing request; the updated identity information of the user end (user) that initiates the identity information processing request includes the identity identifier of the user end (user) that initiates the identity information processing request; obtaining the identity information of the user end (user) that initiates the identity information processing request corresponding to the identity identifier of the user end (user) that initiates the identity information processing request from the login blockchain information storage end; updating the identity information of the user end (user) that initiates the identity information processing request through the updated identity information of the user end (user) that initiates the identity information processing request, and writing the updated identity information into the blockchain.
[0050] The identity information of the client (user) initiating the identity information processing request is directly replaced with the updated identity information of the client (user) initiating the identity information processing request, and the updated identity information of the client (user) initiating the identity information processing request is determined as the updated identity information.
[0051] In some embodiments, the process of storing the identity information processing result on the target block may further include: encrypting the identity information processing result to obtain the encrypted identity information processing result; and storing the encrypted identity information processing result on the target block.
[0052] Among them, the user's identity information will generate a corresponding identity tag after registration. This tag is usually based on the characteristic that the hash value output by SHA-512 is a fixed length. It can split the hash value and ciphertext attached to the file, and then decrypt it through the AES encryption algorithm to obtain the encrypted ciphertext, and then store the encrypted user's identity information.
[0053] In some embodiments, the functions in the SHA-512 class may be designed as: har* getHashstring(); Converts a hash value array to a string unsigned long long single_Change(unsigned long long tmp,int a); Single-step round change void printHash(); Output the hash value of the file on the screen In some embodiments, the functions in the AES class may be designed as: int keyExpansion(const uint8_t *key, uint32_t keyLen, AesKey *aesKey) / / Implement key expansion function int addRoundKey(uint8_t (*state)[4], uint32_t int *key) / / Implement round key addition function int subBytes(uint8_t(*state)[4]) / / implement byte replacement function int invSubBytes(uint8_t(*state)[4]) / / implement the inverse byte replacement function int shiftRows(uint8_t(*state)[4]) / / implement row shift function int invShiftRows(uint8_t(*state)[4]) / / implement reverse shift function int mixColumns(uint8_t(*state)[4]) / / implement column mixing function int invMixColumns(uint8_t(*state)[4]) / / Implement inverse column mixing function int aesEncrypt(const uint8_t *key, uint32_t keyLen, const uint8_t *pt, uint8_t *ct, uint32_t len) / / Implement AES encryption function int aesEncrypt(const uint8_t *key, uint32_t keyLen, const uint8_t *ct, uint8_t *pt, uint32_t len) / / Implement AES decryption function Void printHex(uint8_t *ptr,int len,char *tag) / / Easy to output hexadecimal numbers Function to save the file hash value class: int savetotext(); / / Save the hash value to the end of the encrypted file Function to judge the integrity of file data: void divideHash(filename f) void compareHash(string hash1, string hash2).
[0054] Based on the above SHA-512 and AES, the encryption process is as follows: S1: Operational data structure design Typedef struct{ Uint32_t ek
[44] , dk
[44] Int N }Aeskey struct file{ char address
[200] ; / / file address charhashstr
[550] ;} / / File hash value unsigned long long readData[0x2000000] / / Read file data unsigned long long expandWord
[80] unsigned long long centry_Hash[8] / / Store intermediate results unsigned long long last_Hash[8] / / Store the final result const unsigned long long Kt
[80] string filename / / The input file storage address Unsigned char s
[256] / / S box Unsigned char inv_s
[256] / / Inverse S box Static const con128
[10] / / AES 128 round constant Uint8_t ct
[16] ={0} / / External data memory for encrypted data Unit8_t plain
[16] ={0} / / External request output data memory, used for decrypted data S2: The user enters the address of the file to be encrypted according to the prompt to obtain the encrypted ciphertext information and the hash value calculated by SHA-512; S3: The user enters the address of the file to be decrypted according to the prompt to obtain the plaintext information.
[0055] S4: Before the file is modified, the hash value is output and the file integrity authentication is displayed; S5: After the file is modified, the hash value is output and the integrity authentication is not passed; S6: The user completes the encryption operation and exits the system; The function flow pseudo code is: from Crypto.Cipher import AES # Initialize the AES encryptor key = b'Sixteen byte key' cipher = AES.new(key, AES.MODE_ECB) # Plaintext to be encrypted plaintext = b'Hello, AES! This is a secret message.' #Pad the plaintext to the appropriate length block_size = 16 padding_length = block_size - len(plaintext) % block_size padded_plaintext = plaintext + bytes([padding_length]) * padding_length # Encryption ciphertext = cipher.encrypt(padded_plaintext) print("Encrypted ciphertext:", ciphertext) # Decryption decipher = AES.new(key, AES.MODE_ECB) decrypted_paddedtext = decipher.decrypt(ciphertext) padding_length = decrypted_paddedtext[-1] decrypted_plaintext = decrypted_paddedtext[:-padding_length] print("Decrypted plaintext:", decrypted_plaintext.decode('utf-8')).
[0056] In the embodiment of the present application, the data encryption system designed based on the AES algorithm and the SHA-512 algorithm not only has the ability to resist all currently known attacks by relying on the AES algorithm to a large extent, but is also easy to implement on various blockchain platforms, has the characteristics of fast speed and simple design to ensure the confidentiality of data. It can not only effectively ensure the integrity of the storage of identity information parameters, but also more efficiently improve the confidentiality of the identity information parameters, and can also rely on the high complexity of finding messages with a given digest of the SHA-512 algorithm to ensure the integrity of the data, thereby increasing the ability of the entire identity information parameter storage encryption system to defend against virus attacks, and increasing the security and reliability of the overall method.
[0057] In some optional implementations of this embodiment, before step S204, it also includes: performing intrusion detection on the identity information processing request based on a data transmission intrusion detection module set on the blockchain.
[0058] Among them, the data transmission intrusion detection module is used to intercept the blockchain identity information data each time as a known time series, predict the data to be transmitted next, and compare it with the three sets of data that actually occurred to determine whether the blockchain identity information transmission process is normal or not.
[0059] In this embodiment, step S204, on the blockchain, identity information processing is performed based on the identity information processing request to obtain the identity information processing result, which may include: on the blockchain, identity information processing is performed based on the identity information processing request detected by intrusion to obtain the identity information processing result.
[0060] Among them, the data transmission intrusion detection module includes a device address detection submodule, a blockchain function code detection submodule and a parameter abnormal data detection submodule.
[0061] Specifically, based on the data transmission intrusion detection module set on the blockchain, the process of performing intrusion detection on the identity information processing request may include: based on the device address detection submodule, determining whether the device address sending the identity information processing request has been tampered with; based on the blockchain function code detection submodule, determining whether the function code corresponding to the node processing the identity information processing request has been tampered with; based on the parameter abnormal data detection submodule, obtaining the execution parameters of the blockchain, and determining the parameter abnormal data from the execution parameters, and determining the type of attack on the blockchain based on the parameter abnormal data.
[0062] Specifically, when the parameter abnormal data detection submodule is in use, the PLC (Programmable Logic Controller) notifies the actuator of parameter abnormalities, and the actuator begins to classify the parameter abnormality data, further derives the attack type, and then uses the attack classification module to determine the attack type on the blockchain based on the parameter abnormality data when the storage amount of parameter abnormality blockchain identity information is greater than 3.
[0063] For example, assume that the speed data in the first 3 seconds is correct. Starting from 3.3 seconds, for each data transmission time point t, that is, the 10t round, PLC selects the speed values of 30 sets of blockchain identity information [10t-33, 10t-3] as the training time series, uses the ARIMA (1, 1, 0) model training, predicts the speed values of 10t-2, 10t-1, and 10t, and calculates the error between the predicted value and the true value, and further calculates the mse according to the following formula (1): (1) Among them, mse refers to the storage amount of identity information of the parameter-different blockchain, y i It refers to the true speed value corresponding to the i-th moment. It refers to the predicted speed value corresponding to the i-th moment. If mse>threshold 3, it is considered as parameter abnormal data, and the time point at this moment is recorded as the attack time point. The threshold of 3 is the result obtained after many experiments. The PLC notifies the actuator of the abnormal parameters, and the actuator begins to classify the abnormal parameter data and further derive the attack type.
[0064] The process of the attack classification module is as follows: compare the parameter anomaly blockchain identity information, reorder the parameter anomaly blockchain identity information according to its first appearance order in the total blockchain identity information, and determine whether the order has changed. If it has not changed, it means that it is a replay attack or data tampering. If the order has changed, it is a sequential logic attack.
[0065] Among them, the method of the attack classification module for judging replay attacks and data tampering attacks is: the speed curve tends to be consistent after 50s, and the messages after this moment are the same. It is believed that the attacker cannot intercept the messages after this period of time, otherwise it cannot cause a replay attack. That is, among the messages intercepted by the attacker, some of the early messages only appear twice in all the messages received by the executor, while the number of occurrences of data tampering attacks is not fixed. Based on this condition, it can be judged whether it is a replay attack or a data tampering attack.
[0066] In this embodiment, by setting a data transmission intrusion detection module on the blockchain, the designed intrusion test and detection platform simulates three attacks on the system, and uses the detection algorithm based on the ARIMA model for intrusion detection. The entire industrial control system is simplified to the data transmission process between the PLC and the speed actuator, which uses the Modbus protocol, thereby improving the overall security and integrity of the system. At the same time, the data transmission intrusion detection module not only considers the attacks on the blockchain identity information equipment and function codes, but also well implements the prediction and detection work of the blockchain identity information data part, and can almost detect all tampering, replay and timing logic attacks in real time 100%, and has a reminder effect. At the same time, the client and the server are connected more perfectly, and the user can control the execution and stop of the system in real time according to the client data, especially when an attack occurs, the system can be stopped in real time, which not only ensures the security of the system, but also reduces the losses that may be caused by the user due to the attack, and improves the safety and reliability of the overall method during use.
[0067] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0068] Figure 3 The principle block diagram of the identity identification device based on federated learning and blockchain is shown, which corresponds to the identity identification method based on federated learning and blockchain in the above embodiment. Figure 3 As shown, the identity identification device based on federated learning and blockchain includes an identity information processing request receiving unit 31, an identity authentication model calling unit 32, an identity authentication unit 33 and an identity information processing unit 34. The functional modules are described in detail as follows: The identity information processing request receiving unit 31 is used to receive the identity information processing request from the user terminal through the blockchain; An identity verification model calling unit 32 is used to call an identity verification model based on a smart contract in a blockchain, wherein the identity verification module is set on a node in the blockchain, and the identity verification model is used to indicate a model trained based on a federated learning method; The identity authentication unit 33 is used to authenticate the user end through the identity authentication model according to the information carried in the identity information processing request, and obtain a verification result; The identity information processing unit 34 is used to perform identity information processing on the blockchain based on the identity information processing request to obtain an identity information processing result if the verification result is passed.
[0069] Optionally, before the identity information processing unit 34, the following is further included: A consensus group division unit, used to divide the nodes on the blockchain into multiple consensus groups; The behavior weight value calculation unit is used to calculate the behavior weight value of each node in the consensus group; The node selection unit is used to select the master node and consensus node in the consensus group based on the behavior weight value of each node, and control the consensus between the consensus groups based on the master node.
[0070] Optionally, the identity information processing unit includes: A target consensus group determination subunit, used to determine the target consensus group to which the identity information processing request belongs; The first identity information processing subunit is used to generate a target block based on the master node of the target consensus group of the blockchain, and to perform identity information processing on the identity information processing request based on the consensus node of the target consensus group to obtain an identity information processing result; The storage subunit is used to store the identity information processing result on the target block.
[0071] Optionally, the above-mentioned storage subunit includes: A first storage module, used for storing the identity identifier in a target block when the identity information processing request is an identity registration request and the identity information processing result is an identity identifier; The second storage module is used to replace the identity information stored in the target block based on the updated identity information when the identity information processing request is an identity information update request and the identity information processing result is the updated identity information.
[0072] Optionally, the above-mentioned storage subunit includes: The encryption module is used to encrypt the identity information processing result to obtain the encrypted identity information processing result; The third storage module is used to store the encrypted identity information processing result in the target block.
[0073] Optionally, before the identity information processing unit 34, the following is further included: An intrusion detection unit, used to perform intrusion detection on identity information processing requests based on a data transmission intrusion detection module set on the blockchain; The identity information processing unit 34 includes: The second subunit of identity information processing is used to perform identity information processing on the blockchain based on the identity information processing request detected by intrusion, and obtain the identity information processing result.
[0074] Optionally, the data transmission intrusion detection module includes a device address detection submodule, a blockchain function code detection submodule, and a parameter abnormal data detection submodule; The above-mentioned second subunit for identity information processing includes: A first detection module, used to determine whether the address of the device sending the identity information processing request has been tampered with based on the device address detection submodule; The second detection module is used to determine whether the function code corresponding to the node that processes the identity information processing request has been tampered with based on the blockchain function code detection submodule; The third detection module is used to obtain the execution parameters of the blockchain based on the parameter abnormal data detection submodule, and determine the parameter abnormal data from the execution parameters, and determine the type of attack on the blockchain based on the parameter abnormal data.
[0075] In the embodiment of the present application, the identity information processing request receiving unit 31 receives the identity information processing request from the user end through the blockchain; the identity authentication model calling unit 32 calls the identity authentication model based on the smart contract of the blockchain, wherein the identity authentication module is set on the node in the blockchain, and the identity authentication model is used to indicate the model trained based on the federated learning method; the identity authentication unit 33 authenticates the user end through the identity authentication model according to the information carried by the identity information processing request to obtain the verification result; the identity information processing unit 34, if the verification result is that the verification is passed, performs identity information processing on the blockchain based on the identity information processing request to obtain the identity information processing result. By processing identity information based on federated learning and blockchain, the present application combines the decentralization and immutability of blockchain and the privacy protection characteristics of federated learning, so that when processing identity information, both the security of data and the privacy of data can be protected.
[0076] For the specific limitations of the identity identification device based on federated learning and blockchain, please refer to the limitations of the identity identification method based on federated learning and blockchain above, which will not be repeated here. Each module in the above-mentioned identity identification device based on federated learning and blockchain can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0077] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0078] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components connected to the memory 41, the processor 42, and the network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0079] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0080] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D interface display memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as the program code for controlling electronic files, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0081] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the program code stored in the memory 41 or process data, such as running the program code for controlling the electronic file.
[0082] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0083] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores an interface display program, and the interface display program can be executed by at least one processor so that the at least one processor performs the steps of the identity identification method based on federated learning and blockchain as described above.
[0084] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0085] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. An identity identification method based on federated learning and blockchain, characterized in that: The identity identification method based on federated learning and blockchain includes: Receive identity information processing requests from the user through the blockchain; Based on the smart contract of the blockchain, calling an identity verification model, wherein the identity verification model is set on a node in the blockchain, and the identity verification model is used to indicate a model trained based on a federated learning method; Through the identity authentication model, the user terminal is authenticated according to the information carried in the identity information processing request to obtain a verification result; If the verification result is that the verification is passed, identity information processing is performed on the blockchain based on the identity information processing request to obtain an identity information processing result.
2. The identity identification method based on federated learning and blockchain as claimed in claim 1, characterized in that: On the blockchain, performing identity information processing based on the identity information processing request and obtaining the identity information processing result further includes: Dividing the nodes on the blockchain into a plurality of consensus groups; Calculating the behavior weight value of each node in the consensus group; Based on the behavior weight value of each of the nodes, a master node and a consensus node are selected in the consensus group, and the consensus among the consensus groups is controlled based on the master node.
3. The identity identification method based on federated learning and blockchain as claimed in claim 2, characterized in that: On the blockchain, identity information processing is performed based on the identity information processing request to obtain an identity information processing result, including: Determine a target consensus group to which the identity information processing request belongs; Based on the master node of the target consensus group of the blockchain, a target block is generated, and based on the consensus node of the target consensus group, identity information processing is performed on the identity information processing request to obtain an identity information processing result; The identity information processing result is stored in the target block.
4. The identity identification method based on federated learning and blockchain as claimed in claim 3, characterized in that: The storing the identity information processing result in the target block includes: When the identity information processing request is an identity registration request, the identity information processing result is an identity identifier, and the identity identifier is stored in the target block; When the identity information processing request is an identity information update request, the identity information processing result is updated identity information, and the identity information stored on the target block is replaced based on the updated identity information.
5. The identity identification method based on federated learning and blockchain as claimed in claim 3, characterized in that: The storing the identity information processing result in the target block includes: Encrypting the identity information processing result to obtain an encrypted identity information processing result; The encrypted identity information processing result is stored in the target block.
6. The identity identification method based on federated learning and blockchain according to any one of claims 1 to 5, characterized in that: On the blockchain, performing identity information processing based on the identity information processing request and obtaining the identity information processing result further includes: Based on the data transmission intrusion detection module set on the blockchain, perform intrusion detection on the identity information processing request; The performing identity information processing on the blockchain based on the identity information processing request to obtain an identity information processing result includes: On the blockchain, identity information processing is performed based on the identity information processing request that passes the intrusion detection to obtain an identity information processing result.
7. The identity identification method based on federated learning and blockchain as claimed in claim 6, characterized in that: The data transmission intrusion detection module includes a device address detection submodule, a blockchain function code detection submodule and a parameter abnormal data detection submodule. The data transmission intrusion detection module set on the blockchain performs intrusion detection on the identity information processing request, including: Based on the device address detection submodule, determining whether the address of the device sending the identity information processing request has been tampered with; Based on the blockchain function code detection submodule, determine whether the function code corresponding to the node that processes the identity information processing request has been tampered with; Based on the parameter abnormal data detection submodule, the execution parameters of the blockchain are obtained, and the parameter abnormal data are determined from the execution parameters, and based on the parameter abnormal data, the type of attack on the blockchain is determined.
8. An identity identification device based on federated learning and blockchain, characterized in that: The identity identification device based on federated learning and blockchain includes: An identity information processing request receiving unit, used to receive an identity information processing request from a user terminal through a blockchain; An identity verification model calling unit, configured to call an identity verification model based on a smart contract of the blockchain, wherein the identity verification model is set on a node in the blockchain, and the identity verification model is used to indicate a model trained based on a federated learning method; An identity verification unit, configured to verify the identity of the user terminal through the identity verification model according to the information carried in the identity information processing request, and obtain a verification result; The identity information processing unit is used to perform identity information processing on the blockchain based on the identity information processing request to obtain an identity information processing result if the verification result is verification passed.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the identity identification method based on federated learning and blockchain is implemented as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the identity identification method based on federated learning and blockchain is implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Student identity information processing method and student identity information processing device in block chain network, electronic equipment and storage medium
CN110532323A
Distributed Internet of Things intrusion detection method and system based on block chain and federated learning
CN113794675A
Byzantine fault-tolerant consensus algorithm and system based on Fabric
CN114598475A
Information security verification method based on big data
CN118277978A
Federated learning platform and machine learning framework
US20220255764A1
Cited By
Unmanned aerial vehicle group security collaboration system based on block chain and federated learning
CN120075797A
