CN117857647A - Federal learning communication method and system based on MQTT oriented to industrial Internet of things - Google Patents

Federal learning communication method and system based on MQTT oriented to industrial Internet of things Download PDF

Info

Publication number
CN117857647A
CN117857647A CN202311743532.XA CN202311743532A CN117857647A CN 117857647 A CN117857647 A CN 117857647A CN 202311743532 A CN202311743532 A CN 202311743532A CN 117857647 A CN117857647 A CN 117857647A
Authority
CN
China
Prior art keywords
data
things
federal learning
user terminal
industrial internet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311743532.XA
Other languages
Chinese (zh)
Inventor
余丹
兰雨晴
马海洋
邢智涣
王丹星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Standard Intelligent Security Technology Co Ltd
Original Assignee
China Standard Intelligent Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Standard Intelligent Security Technology Co Ltd filed Critical China Standard Intelligent Security Technology Co Ltd
Priority to CN202311743532.XA priority Critical patent/CN117857647A/en
Publication of CN117857647A publication Critical patent/CN117857647A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention provides a federal learning communication method and a federal learning communication system for industrial Internet of things based on MQTT. The federal learning communication method based on the MQTT oriented to the industrial Internet of things comprises the following steps: training a federal learning model of a user terminal in an industrial Internet of things scene by using federal learning requirement information and communication requirement information; when a user terminal of the industrial Internet of things generates data information to be transmitted, performing data compression through a federal learning model of the user terminal to obtain a compressed data packet; and sending the compressed data packet to an Internet of things platform corresponding to the industrial Internet of things by utilizing an MQTT protocol. The system comprises modules corresponding to the method steps.

Description

Federal learning communication method and system based on MQTT oriented to industrial Internet of things
Technical Field
The invention provides a federal learning communication method and a federal learning communication system based on an MQTT oriented industrial Internet of things, and belongs to the technical field of federal learning communication.
Background
The existing federal learning communication technology cannot be directly applied to the scene of industrial Internet of things, IIoT equipment usually operates in a bandwidth-limited and delay-sensitive environment, and minimized traffic is required for model transmission.
Disclosure of Invention
The invention provides a federal learning communication method and a federal learning communication system for industrial Internet of things based on MQTT, which are used for solving the problem that the federal learning communication technology in the prior art cannot be directly applied to the scene of the industrial Internet of things:
the federal learning communication method based on the MQTT oriented to the industrial Internet of things comprises the following steps:
training a federal learning model of a user terminal in an industrial Internet of things scene by using federal learning requirement information and communication requirement information;
when a user terminal of the industrial Internet of things generates data information to be transmitted, performing data compression through a federal learning model of the user terminal to obtain a compressed data packet;
and sending the compressed data packet to an Internet of things platform corresponding to the industrial Internet of things by utilizing an MQTT protocol.
Further, training a federal learning model of a user terminal in an industrial internet of things scenario using federal learning requirement information and communication requirement information, comprising:
extracting federal learning requirement information in an industrial Internet of things scene;
extracting communication demand information for communication by adopting an MQTT protocol;
and acquiring local data at a user terminal of the industrial Internet of things, and training a learning model corresponding to federal learning by utilizing the local data.
Further, collecting local data at a user terminal of the industrial internet of things, and training a learning model corresponding to federal learning by using the local data, including:
controlling the user terminal of the industrial Internet of things to acquire local data corresponding to the user terminal;
performing data cleaning on the local data to obtain local data after data cleaning, and taking the local data after data cleaning as sample data to form a sample data set;
the abnormal value identification and rejection process in the data cleaning process is as follows:
step one: setting the value of the ith data as V i I is a data number, which is greater than or equal to 1 and less than or equal to n, and the average value of the n data is:
wherein Avg is the mean of the n data;
step two: according to the calculation result of the first step, calculating standard deviation of the n data, wherein the calculation formula is as follows:
wherein Std is the standard deviation of the n data;
step three: calculating the value of the ith data as V according to the calculation results of the first step and the second step i The calculation formula of the K value of (2) is as follows:
wherein K is i The value of the ith data is V i K value of (C). When K is i When the data is more than 3, the data is indicated to be abnormal data and should be rejected; when K is i And when the data is smaller than or equal to 3, indicating that the data is normal data and keeping the normal data.
Retrieving a federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information corresponding to the user terminal of the industrial Internet of things, and taking the federal learning model as a target learning model;
transmitting the target learning model to a corresponding user terminal;
and the user terminal trains the received target learning model by utilizing the sample data set to obtain a trained target learning model.
Further, when the user terminal of the industrial internet of things generates data information to be transmitted, data compression is performed through the federal learning model of the user terminal to obtain a compressed data packet, which includes:
when a user terminal of the industrial Internet of things generates data information to be transmitted, extracting the data information to be compressed;
inputting the data information to be compressed into a federal learning model, compressing the data according to a compression rule by the federal learning model, and outputting a compressed data packet.
Further, the compression rule is as follows:
extracting data information to be compressed and carrying out gradient information corresponding to compression processing;
carrying out thinning treatment on the gradient of a fixed proportion by using a single threshold value of an absolute value on the gradient information corresponding to the compression treatment on the data information to be compressed;
mapping the gradient to a minimum integer value using a linear quantization method of 8-bit unsigned shaping;
and compressing the data information to be compressed according to the minimum integer value corresponding to the gradient mapping obtained by the data information to be compressed.
The federal learning communication system based on the MQTT facing the industrial Internet of things comprises:
the learning model training module is used for training the federal learning model of the user terminal in the industrial Internet of things scene by utilizing federal learning requirement information and communication requirement information;
the data compression module is used for carrying out data compression through a federal learning model of the user terminal when the user terminal of the industrial Internet of things generates data information to be transmitted, so as to obtain a compressed data packet;
and the data transmitting module is used for transmitting the compressed data packet to an Internet of things platform corresponding to the industrial Internet of things by utilizing an MQTT protocol.
Further, the learning model training module includes:
the learning requirement information extraction module is used for extracting federal learning requirement information in an industrial Internet of things scene;
the communication demand information extraction module is used for extracting communication demand information communicated by adopting an MQTT protocol;
and the training execution module is used for collecting local data at a user terminal of the industrial Internet of things and training a learning model corresponding to federal learning by utilizing the local data.
Further, the training execution module includes:
the local data acquisition module is used for controlling the user terminal of the industrial Internet of things to acquire local data corresponding to the user terminal;
the sample data set acquisition module is used for carrying out data cleaning on the local data to obtain the local data after data cleaning, and taking the local data after data cleaning as sample data to form a sample data set;
the abnormal value identification and rejection process in the data cleaning process is as follows:
step one: setting the value of the ith data as V i I is a data number, which is greater than or equal to 1 and less than or equal to n, and the average value of the n data is:
wherein Avg is the mean of the n data;
step two: according to the calculation result of the first step, calculating standard deviation of the n data, wherein the calculation formula is as follows:
wherein Std is the standard deviation of the n data;
step three: calculating the value of the ith data as V according to the calculation results of the first step and the second step i The calculation formula of the K value of (2) is as follows:
wherein K is i The value of the ith data is V i K value of (2); when K is i When the data is more than 3, the data is indicated to be abnormal data and should be rejected; when K is i And when the data is smaller than or equal to 3, indicating that the data is normal data and keeping the normal data.
The target learning model acquisition module is used for retrieving a federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information corresponding to the user terminal of the industrial Internet of things, and taking the federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal as a target learning model;
the target learning model sending module is used for sending the target learning model to a corresponding user terminal;
and the model training execution module is used for training the received target learning model by the user terminal by using the sample data set to obtain a trained target learning model.
Further, the data compression module includes:
the system comprises a data information extraction module to be compressed, a data compression module and a data compression module, wherein the data information extraction module is used for extracting data information to be compressed when a user terminal of the industrial Internet of things generates data information to be transmitted;
and the data packet output module is used for inputting the data information to be compressed into the federal learning model, carrying out data compression according to a compression rule through the federal learning model and outputting a compressed data packet.
Further, the compression rule is as follows:
extracting data information to be compressed and carrying out gradient information corresponding to compression processing;
carrying out thinning treatment on the gradient of a fixed proportion by using a single threshold value of an absolute value on the gradient information corresponding to the compression treatment on the data information to be compressed;
mapping the gradient to a minimum integer value using a linear quantization method of 8-bit unsigned shaping;
and compressing the data information to be compressed according to the minimum integer value corresponding to the gradient mapping obtained by the data information to be compressed.
The invention has the beneficial effects that:
the federal learning communication method and system based on the MQTT oriented to the industrial Internet of things provided by the invention adopts various modes for compression treatment, and adopts a gradient sparsification technology (a gradient with fixed proportion is sparsely formed based on a single threshold value of an absolute value), gradient quantization (a linear quantization method adopting 8-bit unsigned shaping) and a gradient coding and decoding method (a bit mapping method). The federal learning communication method and system based on the MQTT oriented to the industrial Internet of things provided by the invention have the advantages that the communication cost of model training is reduced, the communication transmission quantity between equipment and a server is reduced, and the system communication efficiency is improved.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
fig. 2 is a system block diagram of the system of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
The embodiment of the invention provides a federal learning communication method based on an MQTT oriented industrial Internet of things, which comprises the following steps of:
s1, training a federal learning model of a user terminal in an industrial Internet of things scene by using federal learning requirement information and communication requirement information;
s2, when a user terminal of the industrial Internet of things generates data information to be transmitted, performing data compression through a federal learning model of the user terminal to obtain a compressed data packet;
and S3, sending the compressed data packet to an Internet of things platform corresponding to the industrial Internet of things by utilizing an MQTT protocol.
The working principle of the technical scheme is as follows: training federal learning model (S1): firstly, training a federal learning model of a user terminal in an industrial Internet of things scene by using federal learning requirement information and communication requirement information. This means that the user terminals can co-learn without transmitting the original data.
Data compression (S2): when the user terminal of the industrial Internet of things generates data information to be transmitted, the data cannot be directly transmitted. In contrast, the data is compressed by the federal learning model of the user terminal to obtain a compressed data packet. This step helps to reduce the size of the data transmission, reducing the network bandwidth requirements.
Data transmission (S3): the compressed data packet is sent to an internet of things platform corresponding to the industrial internet of things by using a MQTT (Message Queuing Telemetry Transport) protocol. The MQTT is a lightweight and efficient publish/subscribe protocol and is suitable for communication between devices of the Internet of things.
The technical scheme has the effects that: reducing the data transmission amount: by using the federal learning model to perform data compression on the user terminal, the amount of data that needs to be transmitted over the network is reduced. This helps to reduce network bandwidth requirements, reducing data transmission costs and delays.
Privacy protection: federal learning allows user terminals to model train without sharing the original data. This helps to protect the privacy of the user data, as sensitive data does not leave the user terminal.
Efficient communication: the use of the MQTT protocol for data transfer ensures efficient messaging and communication management, and is particularly useful in industrial internet of things environments where real-time or periodic data transfer is required.
The network cost is reduced: reducing the amount of data transmission and improving communication efficiency may reduce network costs associated with data transmission, which is particularly important in large-scale industrial internet of things applications.
According to one embodiment of the invention, the federal learning model of the user terminal in the industrial Internet of things scene is trained by using federal learning requirement information and communication requirement information, and the method comprises the following steps:
s101, extracting federal learning requirement information in an industrial Internet of things scene;
s102, extracting communication demand information for communication by adopting an MQTT protocol;
s103, collecting local data at a user terminal of the industrial Internet of things, and training a learning model corresponding to federal learning by utilizing the local data.
The working principle of the technical scheme is as follows: extracting federal learning requirement information (S101): in an industrial internet of things scenario, first, federally learned requirement information needs to be determined. This includes determining the tasks that require federal learning, the terminal devices involved, and the model types to be trained. This demand information may play a key guiding role in subsequent model training.
Extracting communication demand information (S102): at the same time, there is a need to extract communication requirement information, including determining the requirements for communication using the MQTT protocol. This step determines the communication protocol to ensure uniform communication between the user terminals.
Local data acquisition and model training (S103): the user terminal locally collects data that will be used to train the federal learning model. The federal learning model may be a machine learning model, such as a neural network, for specific tasks such as prediction, classification, or anomaly detection. And the user terminal uses the extracted requirement information to perform model training so as to meet the specific requirements of the industrial Internet of things scene.
The technical scheme has the effects that: training a personalized model: by performing local model training on each user terminal, a personalized model can be created from the user terminal's local data and demand information. This enables each terminal to train according to its own characteristics without sharing the original data.
Privacy protection: the privacy is better protected because the data does not leave the user terminal. The user's sensitive data will not be transmitted over the network and only model parameters or model updates will be transmitted in the communication.
Customized communication requirements: the extraction of the communication requirement information ensures that the MQTT protocol is used for communication, which helps to ensure consistency of the communication mode, and can be customized for specific communication requirements.
According to the technical scheme, local model training is performed on the terminal through federal learning, so that individuation of the model is achieved, and meanwhile, the high efficiency and consistency of communication are guaranteed through an MQTT protocol.
In one embodiment of the present invention, collecting local data at a user terminal of an industrial internet of things, and training a learning model corresponding to federal learning by using the local data includes:
s1031, controlling a user terminal of the industrial Internet of things to acquire local data corresponding to the user terminal;
s1032, carrying out data cleaning on the local data to obtain local data after data cleaning, and taking the local data after data cleaning as sample data to form a sample data set;
s1033, invoking a federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information corresponding to the user terminal of the industrial Internet of things, and taking the federal learning model as a target learning model;
s1034, the target learning model is sent to a corresponding user terminal;
s1035, the user terminal trains the received target learning model by using the sample data set, and the trained target learning model is obtained.
Because the local data collected from the user terminal is irregular and contains a plurality of abnormal values, for example, the time of use is longer than 1 year, the starting time is 1970, and the like, if the abnormal values cannot be correctly identified and removed, the abnormal values will cause great interference to the subsequent model training and have great influence on the accuracy of the model. In order to accurately identify and reject the abnormal value, the following algorithm is adopted:
step one: setting the value of the ith data as V i I is a data number, which is greater than or equal to 1 and less than or equal to n, and the average value of the n data is:
where Avg is the mean of the n data.
Step two: according to the calculation result of the first step, calculating standard deviation of the n data, wherein the calculation formula is as follows:
where Std is the standard deviation of the n data.
Step three: calculating the value of the ith data as V according to the calculation results of the first step and the second step i The calculation formula of the K value of (2) is as follows:
wherein K is i The value of the ith data is V i K value of (C). When K is i When the data is more than 3, the data is indicated to be abnormal data and should be rejected; when K is i And when the data is smaller than or equal to 3, indicating that the data is normal data and keeping the normal data.
The algorithm accurately identifies abnormal data through the relation between the detected data and the overall data mean value and variance, ensures the accuracy of a model training data set, provides good basic conditions for model training, and also provides guarantee for the accuracy of the model.
The working principle of the technical scheme is as follows: control local data acquisition (S1031): and controlling the user terminal of the industrial Internet of things to acquire local data. Such local data may include sensor data, device status, operational records, etc., depending on the particular industrial internet of things application scenario.
Data cleansing (S1032): and cleaning the collected local data to remove noise, abnormal values or unnecessary information, thereby obtaining clean data. These cleaned data will be used as sample data for training the federal learning model.
Retrieving the target learning model (S1033): and acquiring a federal learning model matched with the requirements of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information of the user terminal of the industrial Internet of things. This target learning model will be used to train the local data.
Transmitting the target learning model (S1034): and sending the acquired target learning model to the corresponding user terminal. This object model will provide an initialized model structure that the user terminal will use for training.
Local model training (S1035): the user terminal uses the collected sample data set and the received target learning model to carry out model training. The training process of the local model may employ federal learning or the like to ensure that the data of the user terminal does not leave the local and remain private. After training, the user terminal will obtain a personalized model, suitable for its specific data and requirements.
The technical scheme has the effects that: training a personalized model: the user terminal can train a personalized model according to the local data, which can improve the performance and adaptability of the model so as to meet different requirements and data characteristics.
Privacy protection: the data does not leave the user terminal, so that the privacy is better protected. The user's local data will not be transmitted over the network and only model parameters or model updates will be transmitted in the communication.
Communication efficiency: the user terminal only needs to transmit model parameters and updates instead of original data, which can reduce communication overhead and improve communication efficiency.
According to the technical scheme, the user terminal can train the personalized model locally through federal learning, and meanwhile data privacy and communication efficiency are ensured.
In one embodiment of the present invention, when a user terminal of an industrial internet of things generates data information to be transmitted, data compression is performed through a federal learning model of the user terminal to obtain a compressed data packet, including:
s201, when a user terminal of the industrial Internet of things generates data information to be transmitted, extracting the data information to be compressed;
s202, inputting the data information to be compressed into a federal learning model, compressing the data according to a compression rule through the federal learning model, and outputting a compressed data packet.
Wherein, the compression rule is as follows:
extracting data information to be compressed and carrying out gradient information corresponding to compression processing;
carrying out thinning treatment on the gradient of a fixed proportion by using a single threshold value of an absolute value on the gradient information corresponding to the compression treatment on the data information to be compressed;
mapping the gradient to a minimum integer value using a linear quantization method of 8-bit unsigned shaping;
and compressing the data information to be compressed according to the minimum integer value corresponding to the gradient mapping obtained by the data information to be compressed.
The working principle of the technical scheme is as follows: extracting data information to be compressed (S201): when the user terminal generates data information to be transmitted, the data is extracted as data information to be compressed.
Federal learning model performs data compression (S202): and carrying out data compression on the data information to be compressed through the federal learning model. The compression rule is as follows:
gradient information extraction: gradient information corresponding to the data information to be compressed is extracted, and the gradient information is generally used for updating the federal learning model.
Gradient sparsification treatment: the gradient of the fixed ratio is thinned using a single threshold of absolute value. This means that only those portions of the absolute value of the gradient that exceed a certain threshold will be retained, while the other gradients will be set to zero.
Linear quantization: the gradient is mapped to the smallest integer value using an 8-bit unsigned integer linear quantization method. This helps to reduce the accuracy of the data, and thus the size of the data.
Compressed data generation: and obtaining the minimum integer value corresponding to the gradient mapping according to the data information to be compressed, and then mapping the minimum integer value into a compressed data packet.
The technical scheme has the effects that: data compression: and compressing the data through the federal learning model, and compressing the original data information into smaller data packets. This may reduce the amount of data that needs to be transmitted, thereby reducing communication overhead.
Gradient sparsification: through the gradient sparsification process, important gradient information can be retained while less important gradients are reduced to further reduce data size.
Linear quantization: mapping the gradient to integer values using a linear quantization method reduces the accuracy of the data, but still retains sufficient information to support the training of the federal learning model.
The technical scheme of the embodiment is beneficial to reducing the cost and communication delay of data transmission through data compression, and simultaneously maintains enough information to support updating of the federal learning model.
The embodiment of the invention provides a federal learning communication system based on an MQTT oriented industrial Internet of things, as shown in fig. 2, the federal learning communication system based on the MQTT oriented industrial Internet of things comprises:
the learning model training module is used for training the federal learning model of the user terminal in the industrial Internet of things scene by utilizing federal learning requirement information and communication requirement information;
the data compression module is used for carrying out data compression through a federal learning model of the user terminal when the user terminal of the industrial Internet of things generates data information to be transmitted, so as to obtain a compressed data packet;
and the data transmitting module is used for transmitting the compressed data packet to an Internet of things platform corresponding to the industrial Internet of things by utilizing an MQTT protocol.
The working principle of the technical scheme is as follows: firstly, training a federal learning model of a user terminal in an industrial Internet of things scene by using federal learning requirement information and communication requirement information. This means that the user terminals can co-learn without transmitting the original data.
When the user terminal of the industrial Internet of things generates data information to be transmitted, the data cannot be directly transmitted. In contrast, the data is compressed by the federal learning model of the user terminal to obtain a compressed data packet. This step helps to reduce the size of the data transmission, reducing the network bandwidth requirements.
The compressed data packet is sent to an internet of things platform corresponding to the industrial internet of things by using a MQTT (Message Queuing Telemetry Transport) protocol. The MQTT is a lightweight and efficient publish/subscribe protocol and is suitable for communication between devices of the Internet of things.
The technical scheme has the effects that: reducing the data transmission amount: by using the federal learning model to perform data compression on the user terminal, the amount of data that needs to be transmitted over the network is reduced. This helps to reduce network bandwidth requirements, reducing data transmission costs and delays.
Privacy protection: federal learning allows user terminals to model train without sharing the original data. This helps to protect the privacy of the user data, as sensitive data does not leave the user terminal.
Efficient communication: the use of the MQTT protocol for data transfer ensures efficient messaging and communication management, and is particularly useful in industrial internet of things environments where real-time or periodic data transfer is required.
The network cost is reduced: reducing the amount of data transmission and improving communication efficiency may reduce network costs associated with data transmission, which is particularly important in large-scale industrial internet of things applications.
In one embodiment of the present invention, the learning model training module includes:
the learning requirement information extraction module is used for extracting federal learning requirement information in an industrial Internet of things scene;
the communication demand information extraction module is used for extracting communication demand information communicated by adopting an MQTT protocol;
and the training execution module is used for collecting local data at a user terminal of the industrial Internet of things and training a learning model corresponding to federal learning by utilizing the local data.
The working principle of the technical scheme is as follows: in an industrial internet of things scenario, first, federally learned requirement information needs to be determined. This includes determining the tasks that require federal learning, the terminal devices involved, and the model types to be trained. This demand information may play a key guiding role in subsequent model training.
At the same time, there is a need to extract communication requirement information, including determining the requirements for communication using the MQTT protocol. This step determines the communication protocol to ensure uniform communication between the user terminals.
The user terminal locally collects data that will be used to train the federal learning model. The federal learning model may be a machine learning model, such as a neural network, for specific tasks such as prediction, classification, or anomaly detection. And the user terminal uses the extracted requirement information to perform model training so as to meet the specific requirements of the industrial Internet of things scene.
The technical scheme has the effects that: training a personalized model: by performing local model training on each user terminal, a personalized model can be created from the user terminal's local data and demand information. This enables each terminal to train according to its own characteristics without sharing the original data.
Privacy protection: the privacy is better protected because the data does not leave the user terminal. The user's sensitive data will not be transmitted over the network and only model parameters or model updates will be transmitted in the communication.
Customized communication requirements: the extraction of the communication requirement information ensures that the MQTT protocol is used for communication, which helps to ensure consistency of the communication mode, and can be customized for specific communication requirements.
According to the technical scheme, local model training is performed on the terminal through federal learning, so that individuation of the model is achieved, and meanwhile, the high efficiency and consistency of communication are guaranteed through an MQTT protocol.
In one embodiment of the present invention, the training execution module includes:
the local data acquisition module is used for controlling the user terminal of the industrial Internet of things to acquire local data corresponding to the user terminal;
the sample data set acquisition module is used for carrying out data cleaning on the local data to obtain the local data after data cleaning, and taking the local data after data cleaning as sample data to form a sample data set;
the target learning model acquisition module is used for retrieving a federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information corresponding to the user terminal of the industrial Internet of things, and taking the federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal as a target learning model;
the target learning model sending module is used for sending the target learning model to a corresponding user terminal;
and the model training execution module is used for training the received target learning model by the user terminal by using the sample data set to obtain a trained target learning model.
Because the local data collected from the user terminal is irregular and contains a plurality of abnormal values, for example, the time of use is longer than 1 year, the starting time is 1970, and the like, if the abnormal values cannot be correctly identified and removed, the abnormal values will cause great interference to the subsequent model training and have great influence on the accuracy of the model. In order to accurately identify and reject the abnormal value, the following algorithm is adopted:
step one: setting the value of the ith data as V i I is a data number, which is greater than or equal to 1 and less than or equal to n, and the average value of the n data is:
where Avg is the mean of the n data.
Step two: according to the calculation result of the first step, calculating standard deviation of the n data, wherein the calculation formula is as follows:
where Std is the standard deviation of the n data.
Step three: calculating the value of the ith data as V according to the calculation results of the first step and the second step i The calculation formula of the K value of (2) is as follows:
wherein K is i The value of the ith data is V i K value of (C). When K is i When the data is more than 3, the data is indicated to be abnormal data and should be rejected; when K is i And when the data is smaller than or equal to 3, indicating that the data is normal data and keeping the normal data.
The algorithm accurately identifies abnormal data through the relation between the detected data and the overall data mean value and variance, ensures the accuracy of a model training data set, provides good basic conditions for model training, and also provides guarantee for the accuracy of the model.
The working principle of the technical scheme is as follows: and controlling the user terminal of the industrial Internet of things to acquire local data. Such local data may include sensor data, device status, operational records, etc., depending on the particular industrial internet of things application scenario.
And cleaning the collected local data to remove noise, abnormal values or unnecessary information, thereby obtaining clean data. These cleaned data will be used as sample data for training the federal learning model.
And acquiring a federal learning model matched with the requirements of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information of the user terminal of the industrial Internet of things. This target learning model will be used to train the local data.
And sending the acquired target learning model to the corresponding user terminal. This object model will provide an initialized model structure that the user terminal will use for training.
The user terminal uses the collected sample data set and the received target learning model to carry out model training. The training process of the local model may employ federal learning or the like to ensure that the data of the user terminal does not leave the local and remain private. After training, the user terminal will obtain a personalized model, suitable for its specific data and requirements.
The technical scheme has the effects that: training a personalized model: the user terminal can train a personalized model according to the local data, which can improve the performance and adaptability of the model so as to meet different requirements and data characteristics.
Privacy protection: the data does not leave the user terminal, so that the privacy is better protected. The user's local data will not be transmitted over the network and only model parameters or model updates will be transmitted in the communication.
Communication efficiency: the user terminal only needs to transmit model parameters and updates instead of original data, which can reduce communication overhead and improve communication efficiency.
According to the technical scheme, the user terminal can train the personalized model locally through federal learning, and meanwhile data privacy and communication efficiency are ensured.
In one embodiment of the present invention, the data compression module includes:
the system comprises a data information extraction module to be compressed, a data compression module and a data compression module, wherein the data information extraction module is used for extracting data information to be compressed when a user terminal of the industrial Internet of things generates data information to be transmitted;
and the data packet output module is used for inputting the data information to be compressed into the federal learning model, carrying out data compression according to a compression rule through the federal learning model and outputting a compressed data packet.
Wherein, the compression rule is as follows:
extracting data information to be compressed and carrying out gradient information corresponding to compression processing;
carrying out thinning treatment on the gradient of a fixed proportion by using a single threshold value of an absolute value on the gradient information corresponding to the compression treatment on the data information to be compressed;
mapping the gradient to a minimum integer value using a linear quantization method of 8-bit unsigned shaping;
and compressing the data information to be compressed according to the minimum integer value corresponding to the gradient mapping obtained by the data information to be compressed.
The working principle of the technical scheme is as follows: when the user terminal generates data information to be transmitted, the data is extracted as data information to be compressed.
And carrying out data compression on the data information to be compressed through the federal learning model. The compression rule is as follows:
gradient information extraction: gradient information corresponding to the data information to be compressed is extracted, and the gradient information is generally used for updating the federal learning model.
Gradient sparsification treatment: the gradient of the fixed ratio is thinned using a single threshold of absolute value. This means that only those portions of the absolute value of the gradient that exceed a certain threshold will be retained, while the other gradients will be set to zero.
Linear quantization: the gradient is mapped to the smallest integer value using an 8-bit unsigned integer linear quantization method. This helps to reduce the accuracy of the data, and thus the size of the data.
Compressed data generation: and obtaining the minimum integer value corresponding to the gradient mapping according to the data information to be compressed, and then mapping the minimum integer value into a compressed data packet.
The technical scheme has the effects that: data compression: and compressing the data through the federal learning model, and compressing the original data information into smaller data packets. This may reduce the amount of data that needs to be transmitted, thereby reducing communication overhead.
Gradient sparsification: through the gradient sparsification process, important gradient information can be retained while less important gradients are reduced to further reduce data size.
Linear quantization: mapping the gradient to integer values using a linear quantization method reduces the accuracy of the data, but still retains sufficient information to support the training of the federal learning model.
The technical scheme of the embodiment is beneficial to reducing the cost and communication delay of data transmission through data compression, and simultaneously maintains enough information to support updating of the federal learning model.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. The federal learning communication method based on the MQTT oriented to the industrial Internet of things is characterized by comprising the following steps of:
training a federal learning model of a user terminal in an industrial Internet of things scene by using federal learning requirement information and communication requirement information;
when a user terminal of the industrial Internet of things generates data information to be transmitted, performing data compression through a federal learning model of the user terminal to obtain a compressed data packet;
and sending the compressed data packet to an Internet of things platform corresponding to the industrial Internet of things by utilizing an MQTT protocol.
2. The federal learning communication method for industrial internet of things based on MQTT according to claim 1, wherein training the federal learning model of the user terminal in the industrial internet of things scene using federal learning requirement information and communication requirement information comprises:
extracting federal learning requirement information in an industrial Internet of things scene;
extracting communication demand information for communication by adopting an MQTT protocol;
and acquiring local data at a user terminal of the industrial Internet of things, and training a learning model corresponding to federal learning by utilizing the local data.
3. The federal learning communication method for industrial internet of things based on MQTT according to claim 2, wherein collecting local data at a user terminal of the industrial internet of things and training a learning model corresponding to federal learning by using the local data comprises:
controlling the user terminal of the industrial Internet of things to acquire local data corresponding to the user terminal;
performing data cleaning on the local data to obtain local data after data cleaning, and taking the local data after data cleaning as sample data to form a sample data set;
retrieving a federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information corresponding to the user terminal of the industrial Internet of things, and taking the federal learning model as a target learning model;
transmitting the target learning model to a corresponding user terminal;
the user terminal trains the received target learning model by utilizing the sample data set to obtain a trained target learning model;
the abnormal value identification and rejection process in the data cleaning process is as follows:
step one: setting the value of the ith data as V i I is a data number, which is greater than or equal to 1 and less than or equal to n, and the average value of the n data is:
wherein Avg is the mean of the n data;
step two: according to the calculation result of the first step, calculating standard deviation of the n data, wherein the calculation formula is as follows:
wherein Std is the standard deviation of the n data;
step three: calculating the value of the ith data as V according to the calculation results of the first step and the second step i The calculation formula of the K value of (2) is as follows:
wherein K is i The value of the ith data is V i K value of (2); when K is i When the data is more than 3, the data is indicated to be abnormal data and should be rejected; when K is i And when the data is smaller than or equal to 3, indicating that the data is normal data and keeping the normal data.
4. The federal learning communication method for industrial internet of things based on MQTT according to claim 1, wherein when the user terminal of the industrial internet of things generates data information to be transmitted, data compression is performed through the federal learning model of the user terminal to obtain the compressed data packet, comprising:
when a user terminal of the industrial Internet of things generates data information to be transmitted, extracting the data information to be compressed;
inputting the data information to be compressed into a federal learning model, compressing the data according to a compression rule by the federal learning model, and outputting a compressed data packet.
5. The federal learning communication method for industrial internet of things based on MQTT according to claim 4, wherein the compression rule is as follows:
extracting data information to be compressed and carrying out gradient information corresponding to compression processing;
carrying out thinning treatment on the gradient of a fixed proportion by using a single threshold value of an absolute value on the gradient information corresponding to the compression treatment on the data information to be compressed;
mapping the gradient to a minimum integer value using a linear quantization method of 8-bit unsigned shaping;
and compressing the data information to be compressed according to the minimum integer value corresponding to the gradient mapping obtained by the data information to be compressed.
6. The federal learning communication system based on the MQTT facing the industrial Internet of things is characterized in that the federal learning communication system based on the MQTT facing the industrial Internet of things comprises:
the learning model training module is used for training the federal learning model of the user terminal in the industrial Internet of things scene by utilizing federal learning requirement information and communication requirement information;
the data compression module is used for carrying out data compression through a federal learning model of the user terminal when the user terminal of the industrial Internet of things generates data information to be transmitted, so as to obtain a compressed data packet;
and the data transmitting module is used for transmitting the compressed data packet to an Internet of things platform corresponding to the industrial Internet of things by utilizing an MQTT protocol.
7. The federal learning communications system for industrial internet of things based on MQTT of claim 6, wherein the learning model training module comprises:
the learning requirement information extraction module is used for extracting federal learning requirement information in an industrial Internet of things scene;
the communication demand information extraction module is used for extracting communication demand information communicated by adopting an MQTT protocol;
and the training execution module is used for collecting local data at a user terminal of the industrial Internet of things and training a learning model corresponding to federal learning by utilizing the local data.
8. The federal learning communications system for industrial internet of things based on MQTT of claim 7, wherein the training execution module comprises:
the local data acquisition module is used for controlling the user terminal of the industrial Internet of things to acquire local data corresponding to the user terminal;
the sample data set acquisition module is used for carrying out data cleaning on the local data to obtain the local data after data cleaning, and taking the local data after data cleaning as sample data to form a sample data set;
the target learning model acquisition module is used for retrieving a federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal from a database of the industrial Internet of things according to the federal learning requirement information and the communication requirement information corresponding to the user terminal of the industrial Internet of things, and taking the federal learning model corresponding to the federal learning requirement information and the communication requirement information of the user terminal as a target learning model;
the target learning model sending module is used for sending the target learning model to a corresponding user terminal;
the model training execution module is used for training the received target learning model by the user terminal by utilizing the sample data set to obtain a trained target learning model;
the abnormal value identification and rejection process in the data cleaning process is as follows:
step one: setting the value of the ith data as V i I is the number of data, which is greater than or equal to 1 and less than or equal to n, the average value of the n dataThe method comprises the following steps:
wherein Avg is the mean of the n data;
step two: according to the calculation result of the first step, calculating standard deviation of the n data, wherein the calculation formula is as follows:
wherein Std is the standard deviation of the n data;
step three: calculating the value of the ith data as V according to the calculation results of the first step and the second step i The calculation formula of the K value of (2) is as follows:
wherein K is i The value of the ith data is V i K value of (2); when K is i When the data is more than 3, the data is indicated to be abnormal data and should be rejected; when K is i And when the data is smaller than or equal to 3, indicating that the data is normal data and keeping the normal data.
9. The federal learning communications system for industrial internet of things based on MQTT of claim 6, wherein the data compression module comprises:
the system comprises a data information extraction module to be compressed, a data compression module and a data compression module, wherein the data information extraction module is used for extracting data information to be compressed when a user terminal of the industrial Internet of things generates data information to be transmitted;
and the data packet output module is used for inputting the data information to be compressed into the federal learning model, carrying out data compression according to a compression rule through the federal learning model and outputting a compressed data packet.
10. The federal learning communication system for industrial internet of things based on MQTT of claim 9, wherein the compression rules are as follows:
extracting data information to be compressed and carrying out gradient information corresponding to compression processing;
carrying out thinning treatment on the gradient of a fixed proportion by using a single threshold value of an absolute value on the gradient information corresponding to the compression treatment on the data information to be compressed;
mapping the gradient to a minimum integer value using a linear quantization method of 8-bit unsigned shaping;
and compressing the data information to be compressed according to the minimum integer value corresponding to the gradient mapping obtained by the data information to be compressed.
CN202311743532.XA 2023-12-18 2023-12-18 Federal learning communication method and system based on MQTT oriented to industrial Internet of things Pending CN117857647A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311743532.XA CN117857647A (en) 2023-12-18 2023-12-18 Federal learning communication method and system based on MQTT oriented to industrial Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311743532.XA CN117857647A (en) 2023-12-18 2023-12-18 Federal learning communication method and system based on MQTT oriented to industrial Internet of things

Publications (1)

Publication Number Publication Date
CN117857647A true CN117857647A (en) 2024-04-09

Family

ID=90545671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311743532.XA Pending CN117857647A (en) 2023-12-18 2023-12-18 Federal learning communication method and system based on MQTT oriented to industrial Internet of things

Country Status (1)

Country Link
CN (1) CN117857647A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401552A (en) * 2020-03-11 2020-07-10 浙江大学 Federal learning method and system based on batch size adjustment and gradient compression rate adjustment
WO2021115480A1 (en) * 2020-06-30 2021-06-17 平安科技(深圳)有限公司 Federated learning method, device, equipment, and storage medium
CN113792883A (en) * 2021-03-03 2021-12-14 京东科技控股股份有限公司 Model training method, device, equipment and medium based on federal learning
CN114880123A (en) * 2022-05-20 2022-08-09 苏州中桦科技有限公司 Federal learning method and system for industrial Internet of things communication control
CN115527090A (en) * 2022-08-25 2022-12-27 广东明创软件科技有限公司 Model training method, device, server and storage medium
CN115718868A (en) * 2021-08-23 2023-02-28 华为技术有限公司 Model training method, device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401552A (en) * 2020-03-11 2020-07-10 浙江大学 Federal learning method and system based on batch size adjustment and gradient compression rate adjustment
WO2021115480A1 (en) * 2020-06-30 2021-06-17 平安科技(深圳)有限公司 Federated learning method, device, equipment, and storage medium
CN113792883A (en) * 2021-03-03 2021-12-14 京东科技控股股份有限公司 Model training method, device, equipment and medium based on federal learning
CN115718868A (en) * 2021-08-23 2023-02-28 华为技术有限公司 Model training method, device and system
CN114880123A (en) * 2022-05-20 2022-08-09 苏州中桦科技有限公司 Federal learning method and system for industrial Internet of things communication control
CN115527090A (en) * 2022-08-25 2022-12-27 广东明创软件科技有限公司 Model training method, device, server and storage medium

Similar Documents

Publication Publication Date Title
CN110868336A (en) Data management method, device and computer readable storage medium
CN107390650A (en) A kind of data collecting system based on Internet of Things and the data compression method based on the system
CN109743356B (en) Industrial internet data acquisition method and device, readable storage medium and terminal
CN112804253B (en) Network flow classification detection method, system and storage medium
CN113452676B (en) Detector distribution method and Internet of things detection system
CN110650134B (en) Signal processing method and device, electronic equipment and storage medium
CN113111115A (en) Data information management system and method thereof
CN114024801B (en) Industrial edge computing service gateway
CN114039918A (en) Information age optimization method and device, computer equipment and storage medium
CN104717272A (en) Event stream processing system and method thereof
CN113612650A (en) Monitoring method for edge computing equipment
CN114444096B (en) Network data storage encryption detection system based on data analysis
CN116614565B (en) Multi-protocol fusion communication method, platform, system and medium for scene law enforcement
CN117857647A (en) Federal learning communication method and system based on MQTT oriented to industrial Internet of things
CN117669699A (en) Digital twinning-oriented semantic information federation learning method and system in industrial Internet of things scene
CN116545871A (en) Multi-mode network traffic prediction method, device and medium
WO2019127502A1 (en) Monitoring and prediction apparatus, system and method for industrial internet of things apparatus
CN115134849A (en) Data acquisition algorithm based on 5G gateway
CN113114661A (en) Cloud-edge collaborative lightweight data processing method for intelligent building Internet of things equipment
CN113779808A (en) Big data based policy simulation analysis method and system
CN110855602B (en) Internet of things cloud platform event identification method and system
CN117235549B (en) Unmanned aerial vehicle anomaly detection method based on memory enhancement self-encoder integrated structure
CN108984614A (en) A kind of visible image method for quickly identifying under the environment based on big data
CN115842814B (en) Internet of things gateway data processing method and device based on instruction association pushing
CN112153448B (en) Audio processing method and system in video communication

Legal Events

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