Method for safely transmitting data from Internet of Things equipment to cloud based on LSTM and dynamic watermark
By using LSTM and dynamic watermarking methods in data transmission of IoT devices and cloud, security issues in data transmission of IoT devices are solved, and data security, reliable transmission and traceability are achieved.
Patent Information
- Application Number
- CN202510020939.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-15
AI Technical Summary
IoT devices face security issues such as data tampering, information leakage, and malicious attacks when data is transmitted from the device to the cloud, making it difficult to guarantee the authenticity, integrity and confidentiality of the data.
The data security transmission method based on LSTM and dynamic watermark is adopted. By assigning a unique device code to each IoT device, a key is generated, and the original signal is processed using the LSTM model, and dynamic watermark signals are embedded to ensure the security of the data during transmission.
It effectively guarantees the security and reliability of IoT data transmission, prevents data from being tampered with and forged, and realizes the traceability of problems, ensuring the authenticity, integrity and confidentiality of data.
Smart Images

Figure CN119835062A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Internet of Things data security, and relates to a method for securely transmitting data from an Internet of Things device to the cloud based on LSTM and dynamic watermark. Background Art
[0002] With the rapid development of information technology, the Internet of Things (IoT) has emerged and rapidly expanded its application areas. The IoT aims to connect a large number of devices to each other, realize data interaction and collaborative work between devices, and plays an important role in many fields such as healthcare, smart grids, drones, and industrial monitoring. For example, in the healthcare field, IoT devices can be used to monitor patients' physiological parameters in real time; in smart grids, they can realize intelligent management and optimized scheduling of power systems; drones use IoT technology for precise flight control and data transmission; and in industrial monitoring, the operating status of production equipment can be remotely monitored.
[0003] However, the widespread use of the Internet of Things has also brought many security challenges. IoT devices usually need to transmit messages in real time, reliably, securely and with low complexity. However, due to their own characteristics, such as simple devices and limited resources (limited computing power and storage capacity), it is extremely difficult to ensure the security of IoT signals. Especially during the data transmission process, IoT devices are vulnerable to various network attacks, among which security threats such as data injection, eavesdropping and man-in-the-middle attacks are particularly prominent. These attacks may cause data to be tampered with or leaked, seriously affecting the reliability and stability of the IoT system and the privacy security of users.
[0004] Existing studies have proposed a variety of physical layer security technologies for IoT scenarios, such as optimal sensor review, channel-based bit flipping, probabilistic encryption of quantized IoT signals, and artificial noise signal transmission. In some IoT monitoring scenarios with high requirements for data confidentiality, such as environmental monitoring IoT systems around military facilities, artificial noise signal transmission technology can interfere with potential attackers' acquisition of real data and increase the security of data transmission. Although these physical layer security technologies help to protect data security in IoT applications to a certain extent, their computational complexity is still high for devices deployed in the IoT perception layer. IoT devices usually have limited resources and are difficult to undertake complex computing tasks, which limits the feasibility of these methods in practical applications.
[0005] Watermarking technology is a potential direction for IoT data security, but static watermarking technology has serious security vulnerabilities and is vulnerable to eavesdropping attacks. Since the bit stream embedded in all time windows is static and unchanged, attackers can potentially reveal its key sequence by recording the transmission data from IoTD for a long time. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a method for secure data transmission from an IoT device to the cloud based on LSTM and dynamic watermark. It is mainly used to solve security issues such as data tampering, information leakage, and malicious attacks when data is transmitted from an IoT device to the cloud, ensure the authenticity, integrity, and confidentiality of the data, and promote the safe and reliable application of IoT technology in various industries. The present invention is applicable to, but not limited to, many fields that rely on the interaction of IoT devices with cloud data, such as smart homes, industrial IoT, medical health monitoring, and smart transportation.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] A method for securely transmitting data from an IoT device to the cloud based on LSTM and dynamic watermark, the method comprising the following steps:
[0009] S1. Obtain the corresponding key according to the unique device code assigned to each IoT device, and map the device code and the corresponding key;
[0010] S2, using the original signal of the IoT device and performing segmented preprocessing on the original signal;
[0011] S3, extracting feature values from the original signal after segment preprocessing, mapping the feature values to a bit stream, and then embedding the bit stream into the original signal to obtain a feature signal;
[0012] S4, superimposing the obtained key and the characteristic signal to obtain a watermark signal;
[0013] S5. Establish a terminal LSTM model and a cloud LSTM model, and train the model by obtaining the watermark signal of historical IoT devices;
[0014] S6. The IoT device information collected in real time is transmitted through the trained terminal LSTM model and the cloud LSTM model.
[0015] Further, in step S1, it includes the following steps:
[0016] S11. Pre-assign a unique device code SN to each IoT device t , where the set of all IoT devices is:
[0017] SN={SN1,SN2,…,SN t ,…,SN T}
[0018] Where, SN t is the device code of the t-th IoT device, and T is the total number of IoT devices;
[0019] S12, using the device code SN of each IoT device as noise t Processing is performed to obtain the corresponding key, wherein the linear feedback shift register LSFR is used to perform pseudo-noise processing on the device code to generate the key. LSFR is a pseudo-random sequence generator that generates a sequence through a linear feedback mechanism. The longest period that an n-level LFSR may generate is equal to 2n-1:
[0020] p(t)=2 n -1
[0021] Where n is the number of stages of the linear feedback shift register;
[0022] S13. Device code SN for the same IoT device t And the key is mapped:
[0023] k=f(SN t )
[0024] In the formula, k is the key, SNt is the device code, and the specific mapping function f can be designed according to actual needs, such as a simple XOR operation or a more complex encryption mapping function, etc. t represents the tth IoT device.
[0025] Further, in step S2, the original signal y(t) of the device status information of each IoT device is obtained to obtain the segmented signal y s (t):
[0026] y s (t) = {y(tN s ),y(tN s +1),...,y((t+1)N s -1)}
[0027] In the formula, y s (t) represents the t-th segment signal, NN s is the length of each segmented signal after segmentation, N represents the number of samples of the original signal used to hide a single bit, N s is the number of samples of the bitstream defined for each IoT device.
[0028] Further, in step S3, it includes:
[0029] S31, segmented signal y after segmentation processing s (t), the extracted features include: spectral flatness, mean, variance, skewness and kurtosis features, and the method of extracting features is:
[0030] Spectral flatness:
[0031]
[0032] Where P(n) is the power spectrum and N is the signal length;
[0033] Mean:
[0034]
[0035] Among them, y s (t) is the segment signal;
[0036] variance:
[0037]
[0038] Skewness:
[0039]
[0040] Kurtosis:
[0041]
[0042] S32, mapping the extracted features to a bit stream of length N, and embedding the mapped bit stream into the segmented signal y s (t), and obtain the characteristic signal. Let the extracted characteristic vector be F = {f1,f2,...,f m} (m is the number of features), and maps it into a bit stream B = {b1, b2, ..., b N} , and then embed the bit stream into the segmented signal to obtain the characteristic signal:
[0043] y f (t) = y s (t)+B=α
[0044] Where α is the embedding strength, y f (t) is the characteristic signal.
[0045] Further, in step S4, the key p(t) is embedded into the characteristic signal y f (t), and get the watermark signal W(t):
[0046] W(t)=y f (t)+βbp(t),t=1......N
[0047] Where β is the relative power of the key relative to the original signal, and b is the hidden bit in the signal, which can be +1 or -1.
[0048] Further, in step S5, the terminal LSTM model is trained with the original signal y(t) and the key p(t) as input and the watermark signal W(t) as output; the cloud LSTM model is trained with the key p(t) and the watermark signal W(t) as input and the original signal y(t) and the eigenvalue as output.
[0049] Further, in step S6, the trained terminal LSTM model and cloud LSTM model are deployed in the IoT device and cloud server respectively, so as to collect the real-time status information original signal of the IoT device in real time for secure transmission. The process is as follows:
[0050] S61, the IoT device collects the current device information to obtain the original signal, and sends the key and the original signal to the device-side LSTM model;
[0051] S62, the device-side model takes the key p(t) and the original signal y(t) as input, outputs the watermark signal W(t) and sends it to the cloud;
[0052] S63, the cloud LSTM model takes the watermark signal W(t) and the key p(t) as input, and outputs the eigenvalue and the original signal y(t);
[0053] S64, the cloud obtains an estimated feature value according to the original signal output by the cloud LSTM model;
[0054] S65. The cloud compares the generated estimated eigenvalues with the eigenvalues output by the cloud LSTM model. If the eigenvalues match, the signal has not been tampered with. If the eigenvalues do not match, the signal is abnormal, a warning signal is sent, and the problem is traced based on the device code information contained in the key.
[0055] The beneficial effects of the present invention are:
[0056] The present invention allocates a unique device code to each IoT device, and the device code is processed by pseudo-noise to obtain a key to protect the device code information; the device end collects its own information to obtain the original signal, and the original signal and the key are used as the input of the device end LSTM model, and the device end model outputs a watermark signal to achieve data protection and send the watermark signal to the cloud; the cloud end LSTM model uses the watermark signal and the key as input, and the characteristic value and the original signal as output; then the cloud end performs a signal integrity check. If the check passes, the signal has not been tampered with; otherwise, a warning is sent and the abnormal signal is traced through the device code information in the key. The present invention effectively ensures the security and reliability of IoT data transmission, prevents data from being tampered with and forged, and realizes problem tracing.
[0057] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0059] Figure 1 A schematic diagram of data transmission between the IoT device and the cloud of the present invention;
[0060] Figure 2 Generate a schematic diagram for a training data set of the present invention;
[0061] Figure 3 This is a schematic diagram of the device-side LSTM model training of the present invention;
[0062] Figure 4 This is a schematic diagram of the cloud LSTM model training of the present invention;
[0063] Figure 5 A schematic diagram of data interaction between an IoT device and the cloud of the present invention;
[0064] Figure 6 It is a schematic diagram of key generation of the present invention;
[0065] Figure 7 This is an overall flow chart of the method for securely transmitting data from an IoT device to the cloud based on LSTM and dynamic watermarking of the present invention. DETAILED DESCRIPTION
[0066] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0067] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0068] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0069] See also Figure 1 to Figure 7 , which is a secure data transmission method from IoT devices to the cloud based on LSTM and dynamic watermark.
[0070] Example
[0071] like Figure 1 The figure shows a schematic diagram of data transmission between IoT devices and the cloud. IoT devices collect raw data through sensors. After obtaining the raw data, the raw data is pre-processed to make the data a transmittable signal. The signal will be transmitted by the device to the cloud, and the cloud will receive the signal for the next step of processing.
[0072] like Figure 2 As shown in the figure, it is a schematic diagram for generating a training data set; the specific steps are as follows:
[0073] Step S1: The IoT device will be assigned a unique device code, which is processed by pseudo-noise to obtain a key.
[0074] S11. Pre-assign a unique device code SN to each IoT device t , where the set of all IoT devices is:
[0075] SN={SN1,SN2,…,SN t ,…,SN T}
[0076] Where, SN t is the device code of the t-th IoT device, and T is the total number of IoT devices;
[0077] S12, using the device code SN of each IoT device as noise t Processing is performed to obtain the corresponding key, wherein the linear feedback shift register LSFR is used to perform pseudo-noise processing on the device code to generate the key. LSFR is a pseudo-random sequence generator that generates a sequence through a linear feedback mechanism. The longest period that an n-level LFSR may generate is equal to 2n-1:
[0078] p(t)=2 n -1
[0079] Where n is the number of stages of the linear feedback shift register;
[0080] S13. Device code SN for the same IoT device t And the key is mapped:
[0081] k=f(SN t )
[0082] In the formula, k is the key, SNt is the device code, and the specific mapping function f can be designed according to actual needs, such as a simple XOR operation or a more complex encryption mapping function, etc. t represents the tth IoT device.
[0083] Step S2: The IoT device collects device status information to obtain the original signal y(t). In the entire signal processing process, in order to facilitate operations such as feature extraction and watermark embedding, the original signal is segmented and the length of each segment is NN. s Where N represents the number of samples (frame length) of the original signal used to hide a single bit; s is the number of samples of the bitstream defined for each IoT device (IoTD).
[0084] Get the original signal y(t) of the device status information of each IoT device and get the segmented signal y s (t):
[0085] y s (t) = {y(tN s ),y(tN s +1),...,y((t+1)N s -1)}
[0086] In the formula, y s (t) represents the t-th segment signal, NN s is the length of each segmented signal after segmentation, N represents the number of samples of the original signal used to hide a single bit, N s is the number of samples of the bitstream defined for each IoT device.
[0087] Step S3, extracting spectral flatness, mean, variance, skewness and kurtosis from the original signal y(t) to obtain eigenvalues;
[0088] Spectral flatness:
[0089] (where P(n) is the power spectrum and N is the signal length);
[0090] Mean:
[0091] (where y s (t) is the segment signal);
[0092] variance:
[0093]
[0094] Skewness:
[0095]
[0096] Kurtosis:
[0097]
[0098] The characteristic value is mapped into a bit stream of length N, and the bit stream is embedded into the original signal to obtain the characteristic signal.
[0099] Assume that the extracted feature vector is F = {f1,f2,...,f m} (m is the number of features), and maps it into a bit stream B = {b1, b2, ..., b N} , and then embed the bit stream into the segmented signal to obtain the characteristic signal:
[0100] y f (t) = y s (t)+B×α
[0101] Where α is the embedding strength, y f (t) is the characteristic signal.
[0102] Step S4: embed the characteristic signal into the key p(t) to obtain the watermark signal W(t). W(t)=y(t)+βbp(t)(t=1......N(where W(t) is the watermark signal, p(t) is the key obtained after the device code is processed by pseudo-noise, β is the relative power of the key relative to the original signal, b is the hidden bit in the signal, and its value can be +1 and -1, and N is the number of samples (frame length) of the original signal used to hide a single bit)
[0103] After the above steps, the data set used for training the model of this method is obtained.
[0104] Step S5: Train the device-side LSTM model and the cloud-side LSTM model according to the established data set.
[0105] like Figure 3 The figure shows the training diagram of the device-side LSTM model. LSTM is one of the deep recurrent neural networks (RNNs) that can store information for a long time and thus learn the long-term dependencies of a given sequence. LSTM processes the input (y(1), ..., y(NN)) by adding new information to the memory. s )), and use gates to control how much new information should be remembered, how much old information should be forgotten, and how much current information should be used. It is implemented by the forget gate, input gate, and output gate. Therefore, the output of LSTM will be affected by the network activation in the previous time step. In the present invention, the parameters of the algorithm are debugged according to the training data sets of different time periods, such as accelerometers, gyroscopes, and positioning devices. In order to train the device-side LSTM model, we use the original signal y(t) and the key p(t) as input, and the watermark signal W(t) as output. After the model training is completed, the model is deployed on the terminal IoT device.
[0106] like Figure 4 The figure shows a schematic diagram of cloud LSTM model training; it uses the key p(t) and watermark signal W(t) as the input of the LSTM model, and takes the eigenvalue and the original signal y(t) as the output. After the model training is completed, the model is deployed on the cloud server.
[0107] like Figure 5 The figure shows the data interaction between IoT devices and the cloud. Each IoT device will get a unique device code for tracing the source of the problem when the signal is abnormal.
[0108] like Figure 6 As shown in the figure, it is a schematic diagram of key generation; LSFR (Linear Feedback Shift Register) is used to perform pseudo-noise processing on the device code to generate the key. LFSR is a commonly used pseudo-random sequence generator, which generates sequences through a linear feedback mechanism. The longest period that an n-level LFSR can generate is equal to 2n-1. First, set the initial state of the shift register, for example, a n-4 =1,a n-3 =0,a n-2 =0,a n-1 = 0. Then, through feedback logic (such as XOR operation) and clock signal, the state of the shift register is continuously updated, and the final output bits form a pseudo-random sequence. Finally, after a certain period of time, the output sequence is the required key.
[0109] Step S6: deploy the trained model on the terminal IoT device and the cloud server respectively, collect the device status information of the current IoT device, and complete the secure transmission of data from the IoT device to the cloud.
[0110] like Figure 7 As shown in the figure, it is a flow chart of a method for secure data transmission from IoT devices to the cloud based on LSTM and dynamic watermark. The IoT device collects the current device status information to obtain the original signal y(t), and uses the original signal y(t) and the key p(t) as the input of the device-side LSTM model. The device-side model uses the watermark signal as the output and sends it to the cloud. After the cloud receives the watermark signal, the cloud-side LSTM model uses the watermark signal W(t) and the key p(t) as input, outputs the original signal y(t) and the eigenvalue, and then the cloud extracts the eigenvalue of the original signal y(t) output by the cloud model to obtain the estimated eigenvalue, and performs a consistency check on the estimated eigenvalue and the eigenvalue output by the cloud model; if the two are consistent, the signal has not been tampered with; if the two are inconsistent, the signal is abnormal, a warning signal is sent, and the source of the abnormal signal is traced according to the device code.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for secure data transmission from IoT devices to the cloud based on LSTM and dynamic watermark, characterized by: The method comprises the following steps: S1. Obtain the corresponding key according to the unique device code assigned to each IoT device, and map the device code and the corresponding key; S2, using the original signal of the IoT device and performing segmented preprocessing on the original signal; S3, extracting feature values from the original signal after segment preprocessing, mapping the feature values to a bit stream, and then embedding the bit stream into the original signal to obtain a feature signal; S4, superimposing the obtained key and the characteristic signal to obtain a watermark signal; S5. Establish a terminal LSTM model and a cloud LSTM model, and train the model by obtaining the watermark signal of historical IoT devices; S6. The IoT device information collected in real time is transmitted through the trained terminal LSTM model and the cloud LSTM model.
2. According to claim 1, a method for secure data transmission from an Internet of Things device to the cloud based on LSTM and dynamic watermark, characterized in that: In step S1, it includes the following steps: S11. Pre-assign a unique device code SN to each IoT device t , where the set of all IoT devices is: SN={SN1,SN2,…,SN t ,…,SN T } Where, SN t is the device code of the t-th IoT device, and T is the total number of IoT devices; S12, using the device code SN of each IoT device as noise t Processing is performed to obtain the corresponding key, wherein the linear feedback shift register LSFR is used to perform pseudo-noise processing on the device code to generate the key. LSFR is a pseudo-random sequence generator that generates a sequence through a linear feedback mechanism. The longest period that an n-level LFSR can generate is equal to 2n-1: p(t)=2 n -1 Where n is the number of stages of the linear feedback shift register; S13. Device code SN for the same IoT device t And the key is mapped: k=f(SN t ) Where k is the key, SNt is the device code, f(·) is the designed mapping function, and t represents the tth IoT device.
3. According to claim 2, a method for secure data transmission from an Internet of Things device to the cloud based on LSTM and dynamic watermark, characterized in that: In step S2, the original signal y(t) of the device status information of each IoT device is obtained to obtain a segmented signal: y s (t)={y(tN s ),y(tN s +1),...,y((t+1)N s -1)} In the formula, y s (t) represents the tth segment signal, NN s is the length of each segmented signal after segmentation, N represents the number of samples of the original signal used to hide a single bit, N s is the number of samples of the bitstream defined for each IoT device.
4. According to claim 3, a method for secure data transmission from an Internet of Things device to the cloud based on LSTM and dynamic watermark, characterized in that: In step S3, it includes: S31, segmented signal y after segmentation processing s (t), the extracted features include: spectral flatness, mean, variance, skewness and kurtosis features, and the method of extracting features is: spectral flatness: Where P(n) is the power spectrum and N is the signal length; Mean: Among them, y s (t) is the segment signal; variance: Skewness: Kurtosis: S32, mapping the extracted features to a bit stream of length N, and embedding the mapped bit stream into the segmented signal y s (t), and obtain the characteristic signal; let the extracted characteristic vector be F = {f1,f2,...,f m }, m is the number of features, which is mapped into a bit stream B = {b1, b2, ..., b N} , and then embed the bit stream into the segmented signal to obtain the characteristic signal: y f (t)=y s (t)+B×α Where α is the embedding strength, y f (t) is the characteristic signal.
5. According to claim 4, a method for secure data transmission from an Internet of Things device to the cloud based on LSTM and dynamic watermark, characterized in that: In step S4, the key p(t) is embedded into the characteristic signal y f (t), and get the watermark signal W(t): W(t)=y f (t)+βbp(t),t=1......N Where β is the relative power of the key relative to the original signal, and b is the hidden bit in the signal, which is +1 or -1.
6. According to claim 5, a method for secure data transmission from an Internet of Things device to the cloud based on LSTM and dynamic watermark, characterized in that: In step S5, the terminal LSTM model is trained with the original signal y(t) and the key p(t) as input and the watermark signal W(t) as output; The cloud-based LSTM model training takes the key p(t) and watermark signal W(t) as input, and the original signal y(t) and eigenvalues as output.
7. According to claim 6, a method for secure data transmission from an Internet of Things device to the cloud based on LSTM and dynamic watermark, characterized in that: In step S6, the trained terminal LSTM model and cloud LSTM model are deployed in the IoT device and cloud server respectively, and then the real-time status information original signal of the IoT device is collected in real time for secure transmission. The process is as follows: S61, the IoT device collects the current device information to obtain the original signal, and sends the key and the original signal to the device-side LSTM model; S62, the device-side model takes the key p(t) and the original signal y(t) as input, outputs the watermark signal W(t) and sends it to the cloud; S63, the cloud LSTM model takes the watermark signal W(t) and the key p(t) as input, and outputs the eigenvalue and the original signal y(t); S64, the cloud obtains an estimated feature value according to the original signal output by the cloud LSTM model; S65, the cloud compares the generated estimated feature value with the feature value output by the cloud LSTM model. If the feature values match, the signal has not been tampered with; If the characteristic values do not match, the signal is abnormal, a warning signal is sent, and the problem is traced based on the device code information contained in the key.
Citation Information
Patent Citations
Traceable block chain system and tracing method
CN115329384A
Data encryption method and system, electronic equipment and data tracing method
CN117439736A
Data watermark tracing method in Internet of Things access control based on RBAC
CN117675350A
Fingerprint identification system and method for power Internet of Things equipment, and computer readable storage medium
CN118300817A