Federal learning system and method of Internet of Things, electronic equipment and readable storage medium

By using multi-key homomorphic encryption technology to encrypt gradient data in the Internet of Things environment, the problem of data privacy protection of IoT devices is solved, and the secure transmission and processing of gradient data is realized.

CN119892866APending Publication Date: 2025-04-25GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411873104.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the Internet of Things environment, IoT devices have privacy protection problems during data collection and transmission. The existing technology cannot effectively protect the confidentiality of gradient data and is vulnerable to malicious attacks.

Method used

Using multi-key homomorphic encryption technology, IoT devices homomorphically encrypt the gradient data trained by local machine learning models, and re-encrypt and decrypt it through proxy servers and trusted servers to ensure that the gradient data remains encrypted during transmission and processing.

Benefits of technology

It realizes effective encryption of gradient data in the Internet of Things environment, protects user privacy, and resists joint attacks by malicious devices and servers, improving data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892866A_ABST
    Figure CN119892866A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an Internet of Things federated learning system and method, electronic equipment and a readable storage medium, Internet of Things equipment adopts local data collected by the Internet of Things equipment to train a local machine learning model, and gradient data is extracted from the trained local machine learning model; performing homomorphic encryption on the gradient data by adopting a device public key of the Internet of Things device and a random factor to obtain encrypted gradient data, and sending the encrypted gradient data to a proxy server; the proxy server generates a re-encryption key according to the public key and the equipment public key, encrypts the encryption gradient data by adopting the re-encryption key to obtain re-encryption gradient data, and sends the re-encryption gradient data to the trusted server; and the trusted server decrypts the re-encrypted gradient data by using the private key to obtain gradient data, updates the global machine learning model by using the gradient data and sends the updated model to the Internet of Things equipment. According to the embodiment of the invention, user privacy protection and data security transmission can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of Internet technology, and in particular to an Internet of Things federated learning method, an Internet of Things federated learning device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of Internet of Things (IoT) technology, various IoT devices (smart devices) continue to emerge, promoting the ability of data collection and analysis.

[0003] For this reason, the issue of privacy protection of original data is becoming increasingly prominent during the data collection and transmission process of IoT devices in the IoT environment. Summary of the invention

[0004] In view of the above problems, an IoT federated learning system, method, electronic device and readable storage medium are proposed to overcome the above problems or at least partially solve the above problems. The specific technical solutions are as follows:

[0005] The embodiment of the present invention discloses an Internet of Things federated learning system, which includes a proxy server, a trusted server and an Internet of Things device, wherein the proxy server includes a public key, the trusted server includes a global machine learning model, a public key and a private key, and the Internet of Things device includes a local machine learning model, a device public key and a random factor, wherein:

[0006] The IoT device is used to train a local machine learning model using local data collected by the IoT device, extract gradient data from the trained local machine learning model, homomorphically encrypt the gradient data using a device public key and a random factor of the IoT device to obtain encrypted gradient data, and send the encrypted gradient data to the proxy server;

[0007] The proxy server is used to generate a re-encryption key according to the public key and the device public key, encrypt the encrypted gradient data with the re-encryption key to obtain re-encrypted gradient data, and send the re-encrypted gradient data to the trusted server;

[0008] The trusted server is used to use the private key to decrypt the re-encrypted gradient data to obtain gradient data, and use the gradient data to update the global machine learning model, and send the updated global machine learning model to the Internet of Things device.

[0009] In one embodiment of the present invention, the Internet of Things device is used to send the encrypted gradient data to the proxy server through a preset secure channel.

[0010] In one embodiment of the present invention, the trusted server is used to generate a public key and a private key using a preset public key cryptographic algorithm, and send the public key to the proxy server;

[0011] The proxy server is used to store the public key.

[0012] In one embodiment of the present invention, the IoT device is used to obtain device information of the IoT device, generate a device public key and a device private key using a preset cryptographic hash function according to the device information and a random salt, and send the device public key to the proxy server; the device information includes at least a unique identifier;

[0013] The proxy server is used to store the device public key.

[0014] In one embodiment of the present invention, the trusted server is used to authenticate the IoT device and allow the IoT device that has passed the authentication to participate in the update of the local machine learning model.

[0015] In one embodiment of the present invention, the trusted server further includes a device public key, the IoT device is used to obtain the identity information and authentication information of the IoT device, encrypt the authentication information using the device private key to obtain encrypted authentication information, and send the encrypted authentication information and the identity information to the trusted server;

[0016] The trusted server is used to use the device public key to decrypt the encrypted authentication information to obtain authentication information, and when the verification is passed, allow the Internet of Things device corresponding to the identity information to participate in the update of the global machine learning model.

[0017] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to adjust the workload of the Internet of Things device.

[0018] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to adjust the training rounds of the local machine learning model of the Internet of Things device, the part of the global machine learning model sent to the Internet of Things device, and the amount of local data used by the Internet of Things device to train the local machine learning model.

[0019] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to control whether the Internet of Things device participates in the update of the global machine learning model.

[0020] The embodiment of the present invention also discloses an IoT federated learning method, which is applied to an IoT federated learning system. The IoT federated learning system includes a proxy server, a trusted server, and an IoT device. The proxy server includes a public key, the trusted server includes a global machine learning model, a public key, and a private key, and the IoT device includes a local machine learning model, a device public key, and a random factor. The method includes:

[0021] Obtaining a public key sent by the trusted server;

[0022] Receive encrypted gradient data sent by the IoT device; the encrypted gradient data is obtained by training a local machine learning model using local data collected locally by the IoT device, extracting gradient data from the trained local machine learning model, and homomorphically encrypting the gradient data using a device public key and a random factor of the IoT device to obtain encrypted gradient data;

[0023] generating a re-encryption key based on the public key and the device public key;

[0024] Using the re-encryption key to encrypt the encrypted gradient data to obtain re-encrypted gradient data;

[0025] The re-encrypted gradient data is sent to the trusted server; the trusted server is used to use the private key to decrypt the encrypted gradient data to obtain gradient data, use the gradient data to update the global machine learning model, and send the updated global machine learning model to the Internet of Things device.

[0026] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0027] The memory is used to store computer programs;

[0028] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0029] The embodiment of the present invention further discloses a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the embodiment of the present invention.

[0030] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.

[0031] The embodiments of the present invention include the following advantages:

[0032] In an embodiment of the present invention, an IoT federated learning system may include a proxy server, a trusted server and an IoT device, the proxy server includes a public key, the trusted server includes a global machine learning model, a public key and a private key, the IoT device includes a local machine learning model, a device public key and a random factor. Specifically, when only the model parameters of the global machine learning model need to be updated, the IoT device is used to train the local machine learning model using local data collected by the IoT device, extract gradient data from the trained local machine learning model, encrypt the gradient data using the device public key and the random factor of the IoT device to obtain encrypted gradient data, and send the encrypted gradient data to the proxy server, the proxy server generates a re-encryption key according to the public key and the device public key, encrypts the encrypted gradient data using the re-encryption key to obtain re-encrypted gradient data, and sends the re-encrypted gradient data to the trusted server, the trusted server decrypts the re-encrypted gradient data using the private key to obtain gradient data, updates the global machine learning model using the gradient data, and sends the updated global machine learning model to the IoT device. The embodiments of the present invention can adopt a multi-key homomorphic encryption mechanism through a proxy server, a trusted server and an IoT device to encrypt the gradient data extracted by the IoT device after training the local machine learning model, so that the gradient data remains encrypted during the transmission and processing of the IoT environment, thereby achieving user privacy protection and data security transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a structural block diagram of an Internet of Things federated learning system provided in an embodiment of the present invention;

[0034] Figure 2 This is an overall flow chart of IoT federated learning provided in an embodiment of the present invention;

[0035] Figure 3 It is a flowchart of the steps of an Internet of Things federated learning method provided in an embodiment of the present invention;

[0036] Figure 4 It is a schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention. DETAILED DESCRIPTION

[0037] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0038] In specific implementation, federated learning is an emerging distributed machine learning method that enables IoT devices to train local machine learning models (local models) locally, avoiding the direct transmission of raw data in the IoT environment, thereby protecting user privacy to a certain extent. However, existing federated learning solutions still have many security risks, especially model reasoning attacks and collusion attacks, which may lead to user privacy leakage. Current technologies cannot effectively protect the confidentiality of gradient data and are vulnerable to joint attacks by malicious devices and servers. Therefore, there is an urgent need for an effective method to achieve privacy protection in the federated learning process in the IoT environment.

[0039] In response to the above problems, the embodiments of the present invention provide an IoT federated learning system and method, which aims to effectively solve the problem of insufficient protection of shared gradient data in existing federated learning schemes through multi-key homomorphic encryption technology. Specifically, the embodiments of the present invention enable IoT devices to upload gradient data extracted after local machine learning model training in an encrypted manner without leaking the original data, thereby preventing user data leakage due to malicious attacks.

[0040] Reference Figure 1 , shows a structural block diagram of an IoT federated learning system provided in an embodiment of the present invention, wherein the IoT federated learning system includes an IoT device 101, a proxy server 102, and a trusted server 103, wherein the proxy server includes a public key, the trusted server includes a global machine learning model, a public key, and a private key, and the IoT device includes a local machine learning model, a device public key, and a random factor, wherein:

[0041] The IoT device 101 is used to train a local machine learning model using local data collected by the IoT device, extract gradient data from the trained local machine learning model, homomorphically encrypt the gradient data using a device public key and a random factor of the IoT device to obtain encrypted gradient data, and send the encrypted gradient data to the proxy server;

[0042] The proxy server 102 is configured to generate a re-encryption key according to the public key and the device public key, encrypt the encrypted gradient data using the re-encryption key to obtain re-encrypted gradient data, and send the re-encrypted gradient data to the trusted server;

[0043] The trusted server 103 is used to use the private key to decrypt the re-encrypted gradient data to obtain gradient data, and use the gradient data to update the global machine learning model, and send the updated global machine learning model to the Internet of Things device.

[0044] In a specific implementation, the IoT environment may include an IoT federated learning system, in which IoT devices, proxy servers and trusted servers (central servers) may be included, wherein IoT devices may include smart light bulbs, switches, sockets, temperature and humidity sensors, smoke alarms, smart door locks and security cameras, etc. IoT devices may communicate with each other through communication protocols. Among them, a local machine learning model (local model) may be deployed in the IoT device, and a global machine learning model (global model) may be deployed in the trusted server. The global machine learning model is a model trained and maintained by all IoT devices in the IoT federated learning system. The local machine learning model is a model trained locally by each corresponding IoT device, and has its own set of model parameters (such as weights and biases). The IoT device uses its own collected local data (such as temperature data and humidity data collected by temperature and humidity sensors, etc.) to independently train the local machine learning model without uploading the local data to the trusted server. The local data will not leave the IoT device. Subsequently, the IoT device can extract gradient data from the trained local machine learning model. Among them, the gradient data is the core information describing the optimization process of the local machine learning model. The gradient data reflects how the IoT device adjusts the parameters of the local machine learning model to improve the model performance.

[0045] Among them, the global machine learning model is a unified model aggregated by the trusted server based on the local machine learning model update information (such as gradient data or model parameters) uploaded by all IoT devices. The global machine learning model integrates the data distribution information of all IoT devices and represents the training results of the entire federated learning system. For example, suppose there is a smart home system, and each home device (such as smart speakers, air conditioners, lighting systems, etc.) is participating in a federated learning task - training a speech recognition model to better understand the user's voice commands. Each home's IoT device has its own user data (such as voice commands, device operation habits), which is private and will not be uploaded to the proxy server or trusted server. The goal is to use federated learning to allow each IoT device to train a speech recognition model without leaking user privacy, and at the same time the trusted server generates a universal speech recognition model, namely the global machine learning model, to improve the recognition performance of all IoT devices. The local machine learning model of family A has learned to better recognize the user's voice "lower the air conditioner temperature". The local machine learning model of family B has learned to optimize the recognition of "open the curtains". The global machine learning model can learn common commands such as "close the curtains" and "turn on the lights" by acquiring and aggregating the local machine learning model training gradient data of all households. It is suitable for most IoT devices and even other non-IoT devices.

[0046] Specifically, gradient data refers to the numerical value used to describe the update direction and magnitude of model parameters (weights and biases) during machine learning or deep learning training, that is, whether the weight increases or decreases and how much the increase and decrease are. Weights are the "static part" of the model and represent the current state of the model. Gradient data is the "dynamic part" of the model and represents the adjustment information during the optimization process. Gradient data is calculated based on the error between the model's prediction results and the actual target. The calculation of gradient data depends on the optimization algorithm and loss function, and is an important basis for model learning. Since gradient data is directly derived from training data (such as local data used in IoT device training), even if gradient data is an intermediate calculation result, it may leak the original data. For example, by analyzing gradient data, local data features or sensitive information of IoT devices may be inferred, resulting in user data leakage.

[0047] In one embodiment of the present invention, gradient data can be calculated from a local machine learning model:

[0048] Formula 1:

[0049] θ n is the parameter vector of the model, L(θ) represents the loss function, represents the gradient vector.

[0050] Formula 2:

[0051] Among them, θ new is the model parameter updated using gradient data, θ old is the current parameter, η is the learning rate, which is used to control the step size of the update and can be considered as the coefficient of the function. is the gradient data corresponding to θ. Model parameters are a set of parameters (such as weights and biases) that make up the local machine learning model. The loss function is to calculate the error (loss) by comparing the prediction results of the local machine learning model with the true label (actual target). Gradient calculation is the partial derivative of the gradient loss function with respect to the model parameters, indicating how the model parameters should be adjusted to minimize the error. The gradient data can be calculated by the above formula 1, and the model parameters are updated according to the gradient data using formula 2.

[0052] In each round of federated learning, the IoT device uploads the gradient data and other parameters extracted after training its local machine learning model to the trusted server through the proxy server. The trusted server aggregates the global machine learning model (such as weighted average) based on the gradient data of each IoT device participating in federated learning to generate a new global machine learning model. The trusted server can send the global machine learning model (either part or all) to the IoT device as the basis for the next round of federated learning.

[0053] In an embodiment of the present invention, the proxy server may include a public key (PK_server), the trusted server may include a global machine learning model, a public key (PK_server) and a private key (SK_server), and the IoT device may include a local machine learning model, a public key and a private key pair, and a random factor (r), wherein the public key and the private key pair may include a device public key (PK_device) and a device private key. Specifically, the public key (PK_server) may be generated by a trusted server and used to encrypt data uploaded by the IoT device (e.g., gradient data), and the trusted server publicly distributes the public key (PK_server) to the proxy server and the IoT device. The public key and private key pair are generated by the IoT device, and the IoT device may distribute the device public key (PK_device) in the public key and private key pair to the proxy server and the trusted server.

[0054] When the IoT device needs to transmit gradient data to a trusted server, the device public key (PK_device) and a random factor (r) can be used to encrypt the gradient data to obtain encrypted gradient data, and the encrypted gradient data is sent to the proxy server. The embodiment of the present invention introduces a random factor (r) to encrypt the gradient data, which increases the difficulty for attackers to obtain plaintext, effectively resists joint attacks by malicious devices and servers, and achieves anti-collusion attacks.

[0055] In one embodiment of the present invention, the IoT device locally collects sensor data (such as temperature, humidity, etc.) as local data, and uses the local data to train a local machine learning model. The IoT device then calculates and generates local gradient data G_local based on the trained local machine learning model. The gradient data G_local is used to describe the update of model parameters.

[0056] The IoT device uses its own device public key (PK_device) and a randomly generated secret factor (r) to homomorphically encrypt the gradient data G_local to obtain encrypted gradient data:

[0057] Enc_{PK_device}(G_local)=E(G_local,r)

[0058] Among them, E represents the homomorphic encryption function, and r represents the random factor used to enhance security. The random factor can ensure that the encryption result is different each time, even if the input data is the same.

[0059] Then, the IoT device uploads the encrypted gradient data Enc_{PK_device}(G_local) to the proxy server. At this time, the proxy server cannot decrypt the encrypted data.

[0060] In one embodiment of the present invention, the IoT device may send the encrypted gradient data Enc_{PK_device}(G_local) to the proxy server through a preset secure channel, such as TLS (Transport Layer Security), to further prevent data leakage.

[0061] After receiving the encrypted gradient data Enc_{PK_device}(G_local) uploaded by one or more IoT devices, the proxy server uses the proxy re-encryption technology to convert the encrypted gradient data Enc_{PK_device}(G_local) into Enc_{PK_public}(G_local), that is, re-encrypt the gradient data. The specific implementation steps may include: the proxy server first generates a re-encryption key RK, which is calculated based on the device public key (PK_device) and the public key (PK_server). The proxy server uses the re-encryption key RK to convert the encrypted gradient data Enc_{PK_device}(G_local) of the IoT device:

[0062] Enc_{PK_public}(G_local)=R(E(G_local,r),RK)

[0063] At this time, the proxy server cannot decrypt Enc_{PK_public}(G_local), but can successfully convert the ciphertext format of Enc_{PK_public}(G_local) into a form that can be processed by the trusted server. The embodiment of the present invention converts the encrypted gradient data of the IoT device into ciphertext under the public key through the proxy server, so that the trusted server can process it without decrypting the original data.

[0064] The trusted server receives all re-encrypted gradient data Enc_{PK_public}(G_local) forwarded by the proxy server.

[0065] The trusted server uses its private key (SK_server) to decrypt the encrypted gradients of all IoT devices and obtain the actual plaintext gradient data G_local:

[0066] G_local=D(Enc_{PK_public}(G_local),SK_server)

[0067] Where D represents the decryption function and SK_server is the private key of the trusted server.

[0068] The trusted server calculates the global machine learning model update G_total based on the decrypted gradient data of all IoT devices, and adjusts the model parameters through optimization algorithms (such as SGD, Adam, etc.) to obtain an updated global machine learning model. The updated global machine learning model can be sent to the corresponding IoT devices, so that the IoT devices can use the global machine learning model or enter the next round of federated learning.

[0069] In an embodiment of the present invention, an IoT federated learning system may include a proxy server, a trusted server and an IoT device, the proxy server includes a public key, the trusted server includes a global machine learning model, a public key and a private key, the IoT device includes a local machine learning model, a device public key and a random factor. Specifically, when only the model parameters of the global machine learning model need to be updated, the IoT device is used to train the local machine learning model using local data collected by the IoT device, extract gradient data from the trained local machine learning model, encrypt the gradient data using the device public key and the random factor of the IoT device to obtain encrypted gradient data, and send the encrypted gradient data to the proxy server, the proxy server generates a re-encryption key according to the public key and the device public key, encrypts the encrypted gradient data using the re-encryption key to obtain re-encrypted gradient data, and sends the re-encrypted gradient data to the trusted server, the trusted server decrypts the re-encrypted gradient data using the private key to obtain gradient data, updates the global machine learning model using the gradient data, and sends the updated global machine learning model to the IoT device. The embodiments of the present invention can adopt a multi-key homomorphic encryption mechanism through a proxy server, a trusted server and an IoT device to encrypt the gradient data extracted by the IoT device after training the local machine learning model, so that the gradient data remains encrypted during the transmission and processing of the IoT environment, thereby achieving user privacy protection and data security transmission.

[0070] In one embodiment of the present invention, the trusted server is used to generate a public key and a private key using a preset public key cryptographic algorithm, and send the public key to the proxy server;

[0071] The proxy server is used to store the public key.

[0072] In an embodiment of the present invention, the trusted server can use a public key cryptographic algorithm (such as RSA or Elliptic Curve Cryptography, ECC) to generate a pair of keys, which may include a public key (PK_server), which is used to encrypt data uploaded by the Internet of Things device and can be publicly distributed to the proxy server, which can save the public key (PK_server); the key also includes a private key (SK_server), which is used to decrypt the gradient data uploaded by the Internet of Things device and is saved in the security hardware of the trusted server.

[0073] In one embodiment of the present invention, the IoT device is used to obtain device information of the IoT device, generate a device public key and a device private key using a preset cryptographic hash function according to the device information and a random salt, and send the device public key to the proxy server; the device information includes at least a unique identifier;

[0074] The proxy server is used to store the device public key.

[0075] Among them, the device information of the Internet of Things device may at least include a unique identifier; specifically, the unique identifier may include a MAC address, and the Internet of Things device in the Internet of Things can be uniquely identified based on the MAC address.

[0076] In an embodiment of the present invention, each IoT device (such as a smart sensor) generates its public key and private key pair (device public key and device private key), and the specific steps are as follows: using the MAC address of the IoT device as input, combined with a randomly generated salt (salt) through a cryptographic hash function (such as SHA-256) to generate a device public key (PK_device) and a device private key, the IoT device can send the device public key (PK_device) to the proxy server. The IoT device of the embodiment of the present invention generates a public key and a private key pair based on its unique identifier (such as a MAC address), ensuring that the public key and private key pair of each IoT device are unique and easy to manage.

[0077] In one embodiment of the present invention, the trusted server is used to authenticate the IoT device and allow the IoT device that has passed the authentication to participate in the update of the local machine learning model.

[0078] In an embodiment of the present invention, in order to ensure the reliability of gradient data used to update the global machine learning model, before each round of federated learning begins, the trusted server verifies the identity of the IoT device through a hybrid encryption algorithm (such as a combination of symmetric encryption and asymmetric encryption). The trusted server only allows IoT devices that have passed identity authentication to participate in the update of the local machine learning model.

[0079] In one embodiment of the present invention, the trusted server further includes a device public key, the IoT device is used to obtain the identity information and authentication information of the IoT device, encrypt the authentication information using the device private key to obtain encrypted authentication information, and send the encrypted authentication information and the identity information to the trusted server;

[0080] The trusted server is used to use the device public key to decrypt the encrypted authentication information to obtain authentication information, and when the verification is passed, allow the Internet of Things device corresponding to the identity information to participate in the update of the global machine learning model.

[0081] In an embodiment of the present invention, before each round of federated learning begins, the trusted server needs to verify the identity of the IoT device. Specifically, the IoT device sends its own identity information (which may include other device information such as MAC address) and authentication information encrypted using the device private key. The trusted server can use the device public key of the IoT device to decrypt the encrypted authentication information to obtain the decrypted authentication information, thereby verifying the identity based on the authentication information. After the verification is passed, the trusted server can save the identity information. In the subsequent process of federated learning, the trusted server only allows the IoT device corresponding to the verified identity information to participate in the update process of the global machine learning model. The embodiment of the present invention is based on the identity authentication mechanism of the hybrid encryption algorithm to ensure that the identity of the IoT device participating in federated learning is authentic and valid, and prevent the intrusion of malicious devices.

[0082] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to adjust the workload of the Internet of Things device.

[0083] In the embodiment of the present invention, in order to reduce the computing burden of the IoT device, the trusted server can undertake part of the decryption and model calculation tasks. For example, the trusted server can use its powerful computing power to iteratively update the global machine learning model, while the IoT device only needs to perform a small amount of encryption, uploading and receiving operations.

[0084] In addition, the trusted server can also obtain the computing power and network conditions of each IoT device, and use the computing power and network conditions to adjust the workload of each IoT device, where the workload may include training rounds of local machine learning models, parts of the global machine learning model sent to the IoT device, and the amount of local data used by the IoT device to train the local machine learning model.

[0085] Specifically, the trusted server can adjust the task complexity according to the computing power of the IoT device, which may include: 1. Adjusting the number of local training rounds: high-performance IoT devices run more local training rounds (epochs) to provide more accurate gradient data updates. Low-performance IoT devices run fewer training rounds to reduce the computing burden. 2. Allocating different model sizes: high-performance devices can receive the complete model (global machine learning model) for training, and low-performance IoT devices only receive part of the parameters (such as certain layers or modules in the global machine learning model) to participate in the training. For example, in a convolutional neural network, high-performance IoT devices train deep convolutional layers, while low-performance IoT devices can only train shallow or fully connected layers. 3. Selecting the proportion of training samples: For high-performance IoT devices, more local data can be allocated to participate in model training. Low-performance IoT devices can sample a portion of local data for training to reduce the burden.

[0086] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to control whether the Internet of Things device participates in the update of the global machine learning model.

[0087] In the embodiment of the present invention, in addition to adjusting the workload according to the computing power and network conditions of the IoT device, the trusted server can also determine whether to allow the IoT device to participate in the update of the global machine learning model according to the computing power and network conditions of the IoT device. For example, IoT devices with poor computing power and network conditions may not be allowed to participate in the update of the global machine learning model, thereby ensuring the efficiency of the overall model update.

[0088] The trusted server of the embodiment of the present invention ensures overall efficiency by dynamically adjusting its workload according to the computing power and network conditions of the IoT device, thereby avoiding overloading of a certain IoT device and reducing the model update efficiency.

[0089] In order to enable those skilled in the art to better understand the embodiments of the present invention, a specific example is used below for illustration. Figure 2, is an overall implementation flow chart of IoT federated learning provided in an embodiment of the present invention, and the specific process includes: key generation; data collection; data training; gradient (gradient data) generation; homomorphic encryption; device (IoT device) identity authentication; gradient upload proxy server (agent); proxy server processes encrypted data (encrypted gradient data); re-encryption (encrypting the encrypted gradient data with a re-encryption key to obtain re-encrypted gradient data, and the re-encryption key is generated according to the public key and the device public key); uploading to a trusted server; the trusted server decrypts the re-encrypted gradient data to obtain gradient data, and uses the gradient data to update the global machine learning model (global model); the trusted server returns the global machine learning model data to the IoT device.

[0090] In summary, the application of the embodiments of the present invention has at least the following effects: Data privacy protection: Through homomorphic encryption technology, the gradient data of the IoT device is ensured to remain encrypted during transmission and processing, protecting the user's privacy information. Anti-collusion attack: The introduction of the random secret factor (r) encryption mechanism increases the difficulty for attackers to obtain plaintext and effectively resists the joint attack of malicious devices and servers. Improved system efficiency: Transferring part of the decryption computing tasks to the trusted server reduces the computing burden of the IoT device and improves the overall operating efficiency of the system.

[0091] Reference Figure 3 , shows a flowchart of the steps of an IoT federated learning method provided in an embodiment of the present invention, which is applied to an IoT federated learning system, wherein the IoT federated learning system includes a proxy server, a trusted server, and an IoT device, wherein the proxy server includes a public key, the trusted server includes a global machine learning model, a public key, and a private key, and the IoT device includes a local machine learning model, a device public key, and a random factor. The method may specifically include the following steps:

[0092] Step 301: Obtain the public key sent by the trusted server;

[0093] Step 302: receiving encrypted gradient data sent by the IoT device; the encrypted gradient data is obtained by training a local machine learning model using local data collected locally by the IoT device, extracting gradient data from the trained local machine learning model, and homomorphically encrypting the gradient data using a device public key and a random factor of the IoT device to obtain encrypted gradient data;

[0094] Step 303: Generate a re-encryption key according to the public key and the device public key;

[0095] Step 304: using the re-encryption key to encrypt the encrypted gradient data to obtain re-encrypted gradient data;

[0096] Step 305: Send the re-encrypted gradient data to the trusted server; the trusted server is used to use the private key to decrypt the encrypted gradient data to obtain gradient data, use the gradient data to update the global machine learning model, and send the updated global machine learning model to the Internet of Things device.

[0097] In one embodiment of the present invention, the method comprises:

[0098] The encrypted gradient data is sent to the proxy server through a preset secure channel.

[0099] In one embodiment of the present invention, the trusted server is used to generate a public key and a private key using a preset public key cryptographic algorithm, and send the public key to the proxy server; the proxy server is used to store the public key.

[0100] In one embodiment of the present invention, the trusted server is used to obtain device information of the IoT device, generate a device public key and a device private key using a preset cryptographic hash function according to the device information and a random salt, and send the device public key to the proxy server; the device information at least includes a unique identifier;

[0101] The proxy server is used to store the device public key.

[0102] In one embodiment of the present invention, the trusted server is used to authenticate the IoT device and allow the IoT device that has passed the authentication to participate in the update of the local machine learning model.

[0103] In one embodiment of the present invention, the trusted server further includes a device public key, and the trusted server is used to obtain the identity information and authentication information of the IoT device, encrypt the authentication information using the device private key to obtain encrypted authentication information, and send the encrypted authentication information and the identity information to the trusted server;

[0104] The encrypted authentication information is decrypted using the device public key to obtain authentication information, and when the verification passes, the Internet of Things device corresponding to the identity information is allowed to participate in the update of the global machine learning model.

[0105] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to adjust the workload of the Internet of Things device.

[0106] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to adjust the training rounds of the local machine learning model of the Internet of Things device, the part of the global machine learning model sent to the Internet of Things device, and the amount of local data used by the Internet of Things device to train the local machine learning model.

[0107] In one embodiment of the present invention, the trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to control whether the Internet of Things device participates in the update of the global machine learning model.

[0108] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0109] As for the method embodiment, since it is basically similar to the system embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the system embodiment.

[0110] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, each process of the above-mentioned IoT federated learning method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0111] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned IoT federated learning method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0112] An embodiment of the present invention also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned IoT federated learning method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0113] Figure 4 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0114] The electronic device 400 includes but is not limited to: a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, a processor 410, and a power supply 411. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0115] It should be understood that in the embodiment of the present invention, the radio frequency unit 401 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 410 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 401 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 401 can also communicate with the network and other devices through a wireless communication system.

[0116] The electronic device provides users with wireless broadband Internet access through the network module 402, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0117] The audio output unit 403 can convert the audio data received by the RF unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output it as sound. Moreover, the audio output unit 403 can also provide audio output related to a specific function performed by the electronic device 400 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, etc.

[0118] The input unit 404 is used to receive audio or video signals. The input unit 404 may include a graphics processor (GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 406. The image frame processed by the graphics processor 4041 can be stored in the memory 409 (or other storage medium) or sent via the radio frequency unit 401 or the network module 402. The microphone 4042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 401 in the case of a telephone call mode.

[0119] The electronic device 400 also includes at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 4061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 4061 and / or the backlight when the electronic device 400 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 405 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0120] The display unit 406 is used to display information input by the user or information provided to the user. The display unit 406 may include a display panel 4061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0121] The user input unit 407 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 4071 or near the touch panel 4071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 4071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 410, receives the command sent by the processor 410 and executes it. In addition, the touch panel 4071 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 4071, the user input unit 407 may also include other input devices 4072. Specifically, other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.

[0122] Furthermore, the touch panel 4071 may be overlaid on the display panel 4061. When the touch panel 4071 detects a touch operation on or near it, it is transmitted to the processor 410 to determine the type of the touch event. Then, the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Figure 4 In the figure, the touch panel 4071 and the display panel 4061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 4071 and the display panel 4061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0123] The interface unit 408 is an interface for connecting an external device to the electronic device 400. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 400 or may be used to transmit data between the electronic device 400 and an external device.

[0124] The memory 409 can be used to store software programs and various data. The memory 409 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 409 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0125] The processor 410 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 409, and calling data stored in the memory 409, so as to monitor the electronic device as a whole. The processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 410.

[0126] The electronic device 400 may also include a power supply 411 (such as a battery) for supplying power to each component. Preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0127] In addition, the electronic device 400 includes some functional modules not shown, which will not be described in detail here.

[0128] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0129] 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 invention, 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 (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 invention.

[0130] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0131] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0133] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0137] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. An IoT federated learning system, characterized in that: The IoT federated learning system includes a proxy server, a trusted server and an IoT device, wherein the proxy server includes a public key, the trusted server includes a global machine learning model, a public key and a private key, and the IoT device includes a local machine learning model, a device public key and a random factor, wherein: The IoT device is used to train a local machine learning model using local data collected by the IoT device, extract gradient data from the trained local machine learning model, homomorphically encrypt the gradient data using a device public key and a random factor of the IoT device to obtain encrypted gradient data, and send the encrypted gradient data to the proxy server; The proxy server is used to generate a re-encryption key according to the public key and the device public key, encrypt the encrypted gradient data with the re-encryption key to obtain re-encrypted gradient data, and send the re-encrypted gradient data to the trusted server; The trusted server is used to use the private key to decrypt the re-encrypted gradient data to obtain gradient data, and use the gradient data to update the global machine learning model, and send the updated global machine learning model to the Internet of Things device.

2. The IoT federated learning system according to claim 1, characterized in that: The Internet of Things device is used to send the encrypted gradient data to the proxy server through a preset secure channel.

3. The IoT federated learning system according to claim 1, characterized in that: The trusted server is used to generate a public key and a private key using a preset public key cryptographic algorithm, and send the public key to the proxy server; The proxy server is used to store the public key.

4. The IoT federated learning system according to claim 1, characterized in that: The IoT device is used to obtain device information of the IoT device, generate a device public key and a device private key using a preset cryptographic hash function according to the device information and a random salt, and send the device public key to the proxy server; the device information at least includes a unique identifier; The proxy server is used to store the device public key.

5. The IoT federated learning system according to claim 4, characterized in that: The trusted server is used to authenticate the IoT device and allow the IoT device that has passed the authentication to participate in the update of the local machine learning model.

6. The IoT federated learning system according to claim 5, characterized in that: The trusted server also includes a device public key, The IoT device is used to obtain the identity information and authentication information of the IoT device, encrypt the authentication information using the device private key to obtain encrypted authentication information, and send the encrypted authentication information and the identity information to the trusted server; The trusted server is used to use the device public key to decrypt the encrypted authentication information to obtain authentication information, and when the verification is passed, allow the Internet of Things device corresponding to the identity information to participate in the update of the global machine learning model.

7. The IoT federated learning system according to claim 1, characterized in that: The trusted server is used to obtain the computing power and network conditions of the IoT device, and use the computing power and network conditions to adjust the workload of the IoT device.

8. The IoT federated learning system according to claim 7, characterized in that: The trusted server is used to obtain the computing power and network conditions of the IoT device, and use the computing power and network conditions to adjust the training rounds of the local machine learning model of the IoT device, the part of the global machine learning model sent to the IoT device, and the amount of local data used by the IoT device to train the local machine learning model.

9. The IoT federated learning system according to claim 7, characterized in that: The trusted server is used to obtain the computing power and network conditions of the Internet of Things device, and use the computing power and network conditions to control whether the Internet of Things device participates in the update of the global machine learning model.

10. A method for federated learning of the Internet of Things, characterized in that: Applied to an IoT federated learning system, the IoT federated learning system includes a proxy server, a trusted server and an IoT device, the proxy server includes a public key, the trusted server includes a global machine learning model, a public key and a private key, the IoT device includes a local machine learning model, a device public key and a random factor, and the method includes: Obtaining a public key sent by the trusted server; Receive encrypted gradient data sent by the IoT device; the encrypted gradient data is obtained by training a local machine learning model using local data collected locally by the IoT device, extracting gradient data from the trained local machine learning model, and homomorphically encrypting the gradient data using a device public key and a random factor of the IoT device to obtain encrypted gradient data; generating a re-encryption key based on the public key and the device public key; Using the re-encryption key to encrypt the encrypted gradient data to obtain re-encrypted gradient data; The re-encrypted gradient data is sent to the trusted server; the trusted server is used to use the private key to decrypt the encrypted gradient data to obtain gradient data, use the gradient data to update the global machine learning model, and send the updated global machine learning model to the Internet of Things device.

11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 9 when executing the program stored in the memory.

12. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Federated learning gradient fusion method and device and electronic equipment

    CN110995737A

  • Federal learning privacy protection method and system, medium, equipment and terminal

    CN115883076A

  • Federal learning method and device, readable storage medium and electronic equipment

    CN116050537A

  • TEE federated learning privacy protection method based on proxy re-encryption

    CN116436593A

  • Federal learning method and system based on multiple keys

    CN118643919A