A temperature and humidity control method for smart factories based on federated learning

By training the LSTM model under the federated learning framework, the problem of temperature and humidity control methods being unable to meet the needs of different seasons and weather conditions and data privacy leakage is solved, and intelligent temperature and humidity adjustment and production quality improvement are achieved.

CN114399031BActive Publication Date: 2024-09-24CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210055738.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-18
Publication Date
2024-09-24
Estimated Expiration
2042-01-18

AI Technical Summary

Technical Problem

Existing temperature and humidity control methods and equipment cannot meet the needs for temperature and humidity changes in weaving workshops under different seasons and weather conditions, and there are problems of privacy leakage and data loss during data fusion.

Method used

Using a method based on federated learning, combined with the LSTM model, by predicting temperature and humidity in the client and training the model under the federated learning framework, production privacy is protected and intelligent regulation of temperature and humidity is achieved. Specific steps include data collection and preprocessing, building an LSTM model on the client, gradient encryption upload, central aggregation and model update until the model converges.

Benefits of technology

It realizes intelligent control of temperature and humidity while protecting data privacy, improves production quality and efficiency, solves the problem of data islands, and realizes AI collaboration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114399031B
    Figure CN114399031B
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and specifically discloses a method for controlling temperature and humidity in a smart factory based on federated learning, including: collecting temperature and humidity data and preprocessing them; building an LSTM model in a client, and predicting the temperature and humidity at the next time based on the temperature and humidity data; training the LSTM model based on a federated learning framework, updating the model parameters until the model converges; and controlling the temperature and humidity according to the trained LSTM model to adjust the temperature and humidity. Using a method combining LSTM and federated learning, the temperature and humidity are adjusted to ensure production quality and efficiency while protecting production privacy from being leaked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more specifically to a temperature and humidity control method for an intelligent factory based on federated learning. Background Art

[0002] Currently, most of the existing industrial temperature and humidity control methods and equipment are to ensure constant temperature and humidity in the operating environment or to start the equipment to adjust the temperature and humidity when the temperature and humidity exceed a certain threshold. However, in factories that do not need to maintain constant temperature and humidity but have variable requirements for temperature and humidity, the existing temperature and humidity control methods and equipment cannot fully meet the needs. For example: Too low or too high temperature and humidity in the weaving workshop will affect the output and quality. Different fabrics are woven in different seasons and weathers, and there are different requirements for temperature and humidity. Traditional temperature and humidity control methods cannot meet the needs. A new temperature and humidity control method is needed to achieve intelligent control of temperature and humidity.

[0003] LSTM networks can predict single sensor time series data, but single sensor time series data is difficult to reflect comprehensive information, and there are data missing, lack of fault tolerance and reliability. At the same time, if multiple information is to be integrated, there is a problem of privacy leakage, such as patent CN202010832093.X.

[0004] Therefore, how to provide a control method for intelligently controlling the temperature and humidity of interconnected factories while ensuring data privacy, so that the temperature and humidity can change intelligently according to manufacturing needs and ensure manufacturing quality is an urgent problem that technical personnel in this field need to solve. Summary of the invention

[0005] In view of this, the present invention provides a temperature and humidity control method for a smart factory based on federated learning, which uses a method combining LSTM and federated learning to adjust the temperature and humidity while protecting production privacy from being leaked, thereby ensuring production quality and efficiency.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A temperature and humidity control method for a smart factory based on federated learning, comprising:

[0008] Collect temperature and humidity data and pre-process them;

[0009] Build an LSTM model in the client and predict the temperature and humidity at the next time based on the temperature and humidity data;

[0010] Train the LSTM model based on the federated learning framework and update the model parameters until the model converges;

[0011] The temperature and humidity are controlled and adjusted according to the trained LSTM model.

[0012] Preferably, training the LSTM model based on the federated learning framework and updating the model parameters until the model converges specifically includes:

[0013] Step a: System initialization: After the central server and the client establish a connection, the client receives the initial parameters sent by the central server and initializes the local LSTM model;

[0014] Step b: Local calculation: The LSTM model performs gradient training based on the temperature and humidity data, and desensitizes the obtained gradient, encrypts the gradient, and uploads it to the central server;

[0015] Step c: Central aggregation: The central server aggregates the gradients of each LSTM model to obtain aggregated parameters;

[0016] Step d: Model update: The central server updates the global model based on the aggregated parameters and returns the updated global model to each client participating in the training. The client updates the LSTM model based on the global model. After the LSTM model updates its parameters, a new cycle is performed, i.e., steps b to d are repeated until the LSTM model converges.

[0017] Preferably, gradient encryption includes differential privacy encryption or homomorphic encryption.

[0018] Preferably, the temperature and humidity data preprocessing is specifically as follows: when the temperature and humidity data are less missing, the missing data are filled by taking the average of the previous and next temperature and humidity data; when the temperature and humidity data are more missing or abnormal, the entire data is deleted.

[0019] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a method for controlling temperature and humidity in a smart factory based on federated learning. Federated learning can effectively help multiple institutions use data and conduct machine learning modeling while meeting the requirements of user privacy protection and data security. Federated learning, as a distributed machine learning paradigm, can effectively solve the problem of data islands, allowing participants to jointly model without sharing data, and can technically break data islands and realize AI collaboration. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0021] Figure 1The accompanying figure is a flow chart of the temperature and humidity control method of a smart factory based on federated learning provided by the present invention.

[0022] Figure 2 The accompanying drawing is an application principle diagram of the temperature and humidity control method for a smart factory based on federated learning provided by the present invention. DETAILED DESCRIPTION

[0023] 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 only 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.

[0024] The embodiment of the present invention discloses a temperature and humidity control method for a smart factory based on federated learning, such as Figure 1 As shown, including:

[0025] S1: Collect temperature and humidity data and perform preprocessing;

[0026] S2: Build an LSTM model in the client and predict the temperature and humidity at the next time based on the temperature and humidity data;

[0027] S3: Train the LSTM model based on the federated learning framework and update the model parameters until the model converges;

[0028] S4: Control the temperature and humidity according to the trained LSTM model and adjust the temperature and humidity.

[0029] In this embodiment, the collected time series temperature and humidity data often have missing and abnormal situations, so the data is preprocessed: when the data is less missing, it is filled by taking the average of the previous and next temperature and humidity; when the data is indeed more or abnormal, the entire data is deleted.

[0030] In this embodiment, for the above step S3, the specific steps are as follows:

[0031] Step S31: System initialization. The central server sends a TCP connection request to the client, and the client responds and establishes a connection to accept the training task. The client builds an LSTM model and starts to initialize the local LSTM model after receiving the initial parameters sent by the central server.

[0032] Step S32: Local calculation. After the central server sends the initial parameters to the client, each client performs local calculations based on the temperature and humidity data. After the calculation is completed, the gradient obtained by the local calculation is desensitized and encrypted and uploaded to the central server for an update of the global model.

[0033] Step S33: Central aggregation. The central server aggregates the gradients sent by the client. In the process of aggregation, it is necessary to consider multiple issues such as efficiency, security, and privacy. For example, sometimes due to the heterogeneity of the system, the central server may not wait for all clients to upload, but select a suitable subset of clients as the collection target, or use certain encryption technology to encrypt the parameters in order to safely aggregate the parameters.

[0034] Step S34: Model update. The central server updates the global model based on the aggregated results and returns the updated global model to the clients participating in the modeling. The client updates the local LSTM model and starts the next local calculation while evaluating the performance of the updated model. When the performance is good enough, the training is terminated and the joint modeling is completed. The established global model will be retained on the central server side for subsequent prediction or classification work. Among them, during the 0th training, the LSTM model deployed on the client is consistent with the global model deployed on the central server side.

[0035] In this embodiment, the specific steps of gradient encryption are as follows: the gradient information can be encrypted using various methods such as differential privacy or homomorphic encryption.

[0036] In this embodiment, the differential privacy method is used, including:

[0037] Step a: Generate a key

[0038] (1) Choose two large prime numbers p and q to ensure that gcd(pq, (p-1)(q-1)) = 1 (the greatest common divisor of (p-1)(q-1) and pq is 1);

[0039] (2) Calculate n = pq, λ = lcm(p-1,q-1) (λ is the least common multiple of p-1 and q-1);

[0040] (3) Define L(x) = (x-1) / n;

[0041] (4) Randomly select a number less than n 2 positive integer g, and there exists μ=(L(g λ mod n 2 )) -1 mod n, mod means modulo operation;

[0042] (5) Generate a public key, which is (n,g);

[0043] (6) Generate a private key, which is (λ,μ);

[0044] Step B: Encryption

[0045] (1) The plaintext m is the parameter that the client needs to transfer to the central server, that is, the gradient desensitized data;

[0046] (2) Randomly select r such that 0 < r < n and r and n are relatively prime;

[0047] (3) Encrypt the plaintext, and the ciphertext c = g m r n mod n 2 , and upload the encrypted result to the central server.

[0048] In this embodiment, the specific process of differential privacy encryption is as follows:

[0049] (1) Select an appropriate privacy protection budget ε;

[0050] (2) Generate Laplace noise Lap(1 / ε) according to the selected ε;

[0051] (2) Add Laplace noise to the data to be sent (the gradient desensitized data), that is, the data sent is the superposition of the original data and the noise.

[0052] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0053] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A temperature and humidity control method for a smart factory based on federated learning, characterized in that: Including: Collecting temperature and humidity data and performing preprocessing; Building an LSTM model in the client and predicting the temperature and humidity at the next time based on the temperature and humidity data; Training the LSTM model based on the federated learning framework, updating the model parameters until the model converges; Controlling the temperature and humidity according to the trained LSTM model and adjusting the temperature and humidity; Training the LSTM model based on the federated learning framework and updating the model parameters until the model converges specifically includes: Step a System initialization: After the central server and the client establish a connection, the client initializes the local LSTM model after receiving the initial parameters sent by the central server; Step b Local calculation: The LSTM model performs gradient training according to the temperature and humidity data, and uploads the encrypted gradient after desensitizing the obtained gradient to the central server; Step c Central aggregation; The central server aggregates the gradients of each LSTM model to obtain the aggregated parameters; Step d Model update: The central server updates the global model according to the aggregated parameters, returns the updated global model to each client participating in the training, and the client updates the LSTM model according to the global model. After the LSTM model updates the parameters, a new round of loop is performed, that is, repeating steps b - d until the LSTM model converges; Gradient encryption includes differential privacy encryption or homomorphic encryption; Using the method of differential privacy, including: Step a: Generating keys (1) Select two large prime numbers p, q to ensure that gcd(pq, (p - 1)(q - 1)) = 1, the greatest common divisor of (p - 1)(q - 1) and pq is 1; (2) Calculate n = pq, λ = lcm(p - 1, q - 1), λ is the least common multiple of p - 1 and q - 1; (3) Define L(x) = (x - 1) / n; (4) Randomly select a positive integer g less than n², and there exists μ= mod n, mod means modulo operation; (5) Generating the public key, which is (n, g); (6) Generating the private key, which is (λ, μ); Step b: Encryption (1) The plaintext m is the parameter that the client wants to transfer to the central server, that is, the desensitized gradient data; (2) Randomly select r satisfying 0 < r < n and r is relatively prime to n; (3) Encrypt the plaintext, ciphertext c = mod n², upload to the central server after encryption; Specific process of differential privacy encryption: (1) Select an appropriate privacy protection budget ε; (2) Generate Laplace noise Lap(1 / ε) according to the selected ε; (3) Add Laplace noise to the desensitized gradient data to be sent, that is, the data sent is the superposition of the original data and the noise.

2. According to the method of temperature and humidity control of a smart factory based on federated learning in claim 1, it is characterized in that: The preprocessing of temperature and humidity data is specifically as follows: When the temperature and humidity data is missing less, fill it by taking the average of the previous and subsequent temperature and humidity data; When the temperature and humidity data is missing more or abnormal, delete the whole data.