Method, system, computer device and storage medium for generating intrusion data of Internet of Things

By using a hybrid model of quantum generative neural network and classical discriminant neural network in IoT intrusion data processing, the problem of inefficiency of classical neural networks in processing IoT intrusion data is solved, and faster and more efficient IoT intrusion data are achieved. generation and recognition.

CN118428418BActive Publication Date: 2025-01-21BEIJING ZHONGKE ARCLIGHT QUANTUM SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410357255.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2025-01-21
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

When processing data in IoT intrusion in the existing technology, classic neural networks may not be able to learn some pattern information in the data due to the limitations of their implementation mechanism, and require more complex neural network model design and hyperparameter adjustment, with large amounts of data and iterative. Many times, long time.

Method used

A hybrid model of quantum generative neural network and classical discriminant neural network based on the principles of quantum mechanics is used. By loading the intrusion type label information and classical random noise in the IoT intrusion data set into quantum states, the quantum generative neural network is used to generate IoT intrusion characteristics. information, and is trained and discriminated through the classic discriminant neural network to realize the generation and identification of IoT intrusion data.

Benefits of technology

The quantum generative neural network is superior to the classical neural network in the extraction and convergence speed of global features of IoT intrusion, reducing the demand for real quantum computer hardware resources and improving the efficiency and effect of IoT intrusion data generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118428418B_ABST
    Figure CN118428418B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, computer equipment and storage medium for generating intrusion data of the Internet of Things, and relates to the field of quantum Internet of Things technology. The present invention adopts a brand-new computing mode based on the basic principles of quantum mechanics, namely quantum computing. Since the quantum neural network has strong parallelism and non-local characteristics, the generating neural network in the present invention is superior to the classical neural network in the extraction and convergence speed of the global features of the Internet of Things intrusion. Moreover, the present invention adopts the classical neural network to perform the discriminator task, and only uses the quantum neural network to realize the generating neural network, so that the present invention reduces the hardware resource requirements for the real quantum computer, and is used for the task of generating intrusion feature data of the Internet of Things, so that the currently developed quantum computer can be better utilized in the real field, and the present invention can generate the intrusion feature data of the Internet of Things corresponding to different intrusion types.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The Internet of Things is an important trend in the development of modern science and technology. It connects various objects through the network to achieve information sharing and exchange. However, with the popularization of the Internet of Things, its security issues have become increasingly prominent, especially the problem of network intrusion. First of all, the security of IoT devices is poor. The security design of many IoT devices is not perfect and they are easily attacked by hackers. Once the device is hacked, the hacker can gain control of the device and even obtain the user's personal information. For example, if a smart home device is hacked, it may threaten the safety of the family. Secondly, there are many IoT devices and they are of various types. This poses a huge challenge to network security protection. Hackers can affect the entire network system by attacking a certain device.

[0003] IoT devices often involve the privacy information of users. Once the device is hacked, the user's privacy information may be leaked. Therefore, effective measures need to be taken to prevent network intrusion. Currently, IoT intrusions are mainly handled by classical machine learning, while the task of generating IoT intrusion data using quantum machine learning using quantum computers has not yet been involved.

[0004] Existing technologies process IoT intrusion data based on machine learning models on classical computers. Classical computers perform calculations based on classical bits, which is quite different from the information processing methods and logic based on quantum bits on quantum computers. Under the same bit conditions, quantum computers can process more data due to their huge Hilbert space. Classical neural networks may not be able to learn some pattern information in the data due to the limitations of their implementation mechanism. At present, the use of classical neural networks for learning requires the design of more complex neural network models and the adjustment of hyperparameters. In addition, the amount of data required for training is large, the number of iterations is large, and the time is long. Summary of the invention

[0005] The technical problem to be solved by the present invention is to address the deficiencies of the prior art and specifically provide a method, system, computer device and storage medium for generating intrusion data of the Internet of Things, as follows:

[0006] 1) In the first aspect, the present invention provides a method for generating intrusion data of the Internet of Things, and the specific technical scheme is as follows:

[0007] S1, load the intrusion type label information and classical random noise in the IoT intrusion dataset into quantum states;

[0008] S2. Processing the loaded quantum state through the quantum generative neural network to measure the quantum bits of the quantum system corresponding to the quantum generative neural network to obtain classical information;

[0009] S3, input the classical information into a single-layer fully connected neural network and output the generated IoT intrusion feature information;

[0010] S4, inputting the generated IoT intrusion feature information and the intrusion type label information corresponding to the generated IoT intrusion feature information into the classical discriminant neural network to obtain a first prediction result, and inputting the real intrusion feature information in the IoT intrusion data set and the intrusion type label information corresponding to the real intrusion feature information in the IoT intrusion data set into the classical discriminant neural network to obtain a second prediction result;

[0011] S5, combining the first prediction result and the second prediction result into a first loss function for training a classical discriminant neural network, and updating parameters of the classical discriminant neural network according to the first loss function;

[0012] S6. When the number of times the parameters of the classical discriminant neural network are updated reaches a preset number threshold, the generated IoT intrusion feature information and the intrusion type label corresponding to the generated IoT intrusion feature information are combined and input into the current classical discriminant neural network to obtain a prediction result, and a second loss function for training the quantum generative neural network is constructed according to the prediction result. The parameters of the quantum generative neural network are updated according to the second loss function, so that the current classical discriminant neural network discriminates the generated IoT intrusion feature information as true;

[0013] S7, return to execute S1, until the latest obtained classic discriminant neural network cannot determine whether it is the generated IoT intrusion feature information;

[0014] S8. Use the latest quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

[0015] The beneficial effects of the method for generating intrusion data of the Internet of Things provided by the present invention are as follows:

[0016] The invention uses a new computing model based on the basic principles of quantum mechanics, namely quantum computing. Since quantum neural networks have strong parallelism and non-local characteristics, the quantum generative neural network in the present invention is superior to classical neural networks in terms of extraction and convergence speed of global features of IoT intrusion. Moreover, the present invention uses classical discriminant neural networks to perform discrimination tasks, and only uses quantum neural networks to achieve the task of generating IoT intrusion data, reducing the hardware resource requirements for real quantum computers.

[0017] On the basis of the above scheme, the method for generating intrusion data of the Internet of Things of the present invention can also be improved as follows.

[0018] Further, S1 includes: loading the IoT intrusion type label information and classical random noise in the IoT intrusion dataset into quantum states by means of angle encoding.

[0019] Further, S8 includes: inputting classical random noise and IoT intrusion type labels into the latest quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

[0020] Furthermore, before updating the parameters of the quantum generative neural network according to the second loss function, it also includes: fixing the parameters of the current classical discriminant neural network.

[0021] 2) In the second aspect, the present invention also provides an IoT intrusion data generation system, and the specific technical solution is as follows:

[0022] It includes quantum state loading module, training module and IoT intrusion data generation module;

[0023] The quantum state loading module is used to: load the intrusion type label information and classical random noise in the IoT intrusion dataset into quantum states;

[0024] The training module is used to: process the loaded quantum state through a quantum generative neural network to measure the quantum bits of the quantum system corresponding to the quantum generative neural network to obtain classical information; input the classical information into a single-layer fully connected neural network to output the generated Internet of Things intrusion feature information; input the generated Internet of Things intrusion feature information and the intrusion type label information corresponding to the generated Internet of Things intrusion feature information into a classical discriminant neural network to obtain a first prediction result, input the real intrusion feature information in the Internet of Things intrusion data set and the intrusion type label information corresponding to the real intrusion feature information in the Internet of Things intrusion data set into the classical discriminant neural network to obtain a second prediction result; combine the first prediction result and the second prediction result into a neural network for training the classical discriminant neural network. The first loss function of the network is used to update the parameters of the classical discriminant neural network according to the first loss function; when the number of times the parameters of the classical discriminant neural network are updated reaches a preset number threshold, the generated IoT intrusion feature information and the intrusion type label corresponding to the generated IoT intrusion feature information are combined and input into the current classical discriminant neural network to obtain a prediction result, and a second loss function for training the quantum generative neural network is constructed according to the prediction result, and the parameters of the quantum generative neural network are updated according to the second loss function, so that the current classical discriminant neural network judges the generated IoT intrusion feature information as true; and the quantum state loading module is re-called until the latest classical discriminant neural network cannot judge whether it is the generated IoT intrusion feature information;

[0025] The IoT intrusion data generation module is used to generate IoT intrusion data corresponding to the intrusion type label information using the latest quantum generative neural network.

[0026] Based on the above solution, the IoT intrusion data generation system of the present invention can also be improved as follows.

[0027] Furthermore, the quantum state loading module is specifically used to load the IoT intrusion type label information and classical random noise in the IoT intrusion dataset into quantum states by means of angle encoding.

[0028] Furthermore, the IoT intrusion data generation module is specifically used for:

[0029] The classical random noise and IoT intrusion type labels are input into the newly obtained quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

[0030] Furthermore, the training module is also specifically used to: use the latest quantum generative neural network to generate Internet of Things intrusion data corresponding to the intrusion type label information.

[0031] 3) In a third aspect, the present invention further provides a computer device, comprising a processor, the processor being coupled to a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor, so that the computer device implements any one of the above-mentioned methods for generating IoT intrusion data.

[0032] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor so that a computer implements any of the above-mentioned methods for generating IoT intrusion data.

[0033] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0035] Figure 1 A schematic diagram of a flow chart of a method for generating intrusion data of an Internet of Things according to an embodiment of the present invention;

[0036] Figure 2 A quantum circuit for loading a quantum state;

[0037] Figure 3 Generate an overall architecture of adversarial neural networks for hybrid quantum classical conditions;

[0038] Figure 4The network structure is the basic building block;

[0039] Figure 5 Generate network structures for quantum neural networks;

[0040] Figure 6 It is the network structure of the classic discriminant neural network;

[0041] Figure 7 The figure is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0043] like Figure 1 As shown, a method for generating IoT intrusion data according to an embodiment of the present invention includes the following steps:

[0044] S1. Load the intrusion type label information and classical random noise in the IoT intrusion dataset into a quantum state. Specifically, load the IoT intrusion type label information and classical random noise in the IoT intrusion dataset into a quantum state through angle encoding.

[0045] Download the IoT Intrusion Detection dataset. Each real intrusion feature information in the IoT Intrusion Detection dataset contains 46 data features, and some data features are normalized.

[0046] The intrusion type label information is divided into 0 and 1. The two IoT attack types, DDOS and DOS, are taken as labels. The intrusion type label information of DDOS is marked as 1, and the intrusion type label information of DOS is marked as 0.

[0047] Through angle encoding, the intrusion type label information and classical random noise in the IoT intrusion dataset are loaded into quantum states. The specific process is as follows:

[0048] The intrusion type label information and the classic random noise are combined to obtain the feature vector r, r = [r 1 …r 29 r 30 ], randomly select 29 numbers from the standard normal distribution as classic random noise, the last element r in the feature vector r 30 Represents the intrusion type label information, r in the feature vector r 1 …r 29Represents classic random noise, and takes the inverse tangent of each element in the intrusion type label information and the characteristic vector r of classic random noise, that is, through the formula θ i =arctan(r i ), and obtain the rotation angle θ of the quantum gate i , r i represents the i-th element in the feature vector r, i is a positive integer ranging from 1 to 30, θ i Represents r i The corresponding rotation angle of the quantum gate. After obtaining the rotation angle of the quantum gate, the rotation angle of the quantum gate is obtained by R y (θ) and R x (θ) Rotating the angle encoding method of the quantum gate, the characteristic vector r that integrates the intrusion type label information and classical random noise is loaded onto the amplitude of the quantum state. Here, 10 quantum bits are used. The specific quantum circuit is as follows Figure 2 shown.

[0049] S2. Processing the loaded quantum state through the quantum generative neural network to measure the quantum bits of the quantum system corresponding to the quantum generative neural network to obtain classical information;

[0050] S3. Input the classical information into a single-layer fully connected neural network, and output the generated IoT intrusion feature information, wherein the generated IoT intrusion feature information is false IoT intrusion feature information.

[0051] S4. Input the generated IoT intrusion feature information and the intrusion type label information corresponding to the generated IoT intrusion feature information into the classical discriminant neural network to obtain a first prediction result, and input the real intrusion feature information in the IoT intrusion data set and the intrusion type label information corresponding to the real intrusion feature information in the IoT intrusion data set into the classical discriminant neural network to obtain a second prediction result.

[0052] The hybrid quantum classical conditional generative adversarial neural network includes a classical discriminant neural network and a quantum generative neural network. The classical discriminant neural network is also called a discriminator, and the quantum generative neural network is also called a generator. The overall architecture is as follows Figure 3 As shown, Figure 3 In the above figure, DNN represents the classical discriminative neural network, QGNN represents the quantum generative neural network, Figure 3The real data in refers to: the real intrusion feature information obtained based on the IoT intrusion data set, the label associated with the real data refers to the intrusion type label information corresponding to the real intrusion feature information, the label associated with QGNN refers to the intrusion type label information corresponding to the generated IoT intrusion feature information, the generated 46-dimensional fake IoT intrusion feature information and the intrusion type label information corresponding to the generated IoT intrusion feature information are combined and input into the classical discriminant neural network to obtain the first prediction result, the 46-dimensional real intrusion feature information and the intrusion type label information corresponding to the real intrusion feature information are combined and input into the classical discriminant neural network to obtain the second prediction result.

[0053] Among them, based on the basic quantum gate operation R supported by quantum computers y (θ), R z (θ), etc., to build a basic building block for a quantum generative neural network, such as Figure 3 Based on this basic building block, the quantum generative neural network is constructed. Its network structure is as follows: Figure 5 As shown, 10 qubits are used here.

[0054] Figure 5 U is Figure 2 The basic building blocks shown in the figure. The dotted box part in the figure realizes quantum entanglement and quantum operations on quantum states loaded with intrusion type label information and classical random noise, which can be repeated many times to enhance the performance of the generator, i.e., the quantum generated neural network. Here, the number of repetitions l=3 is selected, and finally, each quantum bit of the generator, i.e., the quantum generated neural network, i.e., 10 quantum bits, is measured, and a total of 1024 probability amplitudes of the calculated ground state are calculated. Then, the probability amplitudes of the 1024 calculated ground states are input into a single-layer fully connected neural network, and 46-dimensional generated IoT intrusion feature information is output, i.e., 46-dimensional fake IoT intrusion feature information is generated.

[0055] After obtaining the fake IoT intrusion feature information, the generated 46-dimensional fake IoT intrusion feature information and the intrusion type label information corresponding to the generated IoT intrusion feature information are combined and input into the classic discriminant neural network to obtain the first prediction result, and the 46-dimensional real intrusion feature information and the intrusion type label information corresponding to the real intrusion feature information are combined and input into the classic discriminant neural network to obtain the second prediction result. The network structure of the classic discriminant neural network is as follows: Figure 6As shown, the classic discriminant neural network includes a multi-layer classic fully connected neural network, and the number of nodes of each layer of the classic fully connected neural network is [47,400,50,1]. The dimension of the input layer is 47, which is used to input the 46-dimensional generated IoT intrusion feature information and the generated IoT intrusion feature information and the corresponding intrusion type label information combined to obtain the feature vector, as well as the real intrusion feature information and the intrusion type label information corresponding to the real intrusion feature information. The dimension of the output layer is 1, and a sigmoid function is executed on the output as the prediction result of the input IoT intrusion feature data. If the input is the generated IoT intrusion feature information, the corresponding result is the first prediction result, and if the input is the real intrusion feature information, the corresponding result is the second prediction result; for each prediction result in the first prediction result and the second prediction result, the prediction result of 1 indicates that the classic discriminant neural network determines that the input feature vector is the real IoT intrusion feature information, and the prediction result of 0 indicates that the classic discriminant neural network determines that the input is the generated IoT intrusion feature information.

[0056] S5, combining the first prediction result and the second prediction result into a first loss function for training a classical discriminant neural network, and updating parameters of the classical discriminant neural network according to the first loss function;

[0057] The generated IoT intrusion feature information and the intrusion type label information corresponding to the generated IoT intrusion feature information are combined to obtain a feature vector, which is input into the classical discriminant neural network to obtain a first prediction result. The real intrusion feature information in the IoT intrusion data set and the intrusion type label information corresponding to the real intrusion feature information in the IoT intrusion data set are combined to obtain a feature vector, which is input into the classical discriminant neural network to obtain a second prediction result. According to the first prediction result and the second prediction result, a first loss function is obtained. The first loss function LD is: LD = -E x [log(D(x))]-E z [log(1-D(G(z)))],E x [log(D(x))] represents: the average value of the second prediction result D(x) of the classic discriminant neural network, i.e., the discriminator predicts the real intrusion feature information x composed of each real intrusion feature information and its intrusion type label information in the training data set batch, E z [log(1-D(G(z)))] represents: the average value of the first prediction result D(G(z)) of the classic discriminant neural network, i.e., the discriminator, predicting each false feature vector z composed of false intrusion feature information and its intrusion type label information in the training data set batch, with the batch size of 100, which can also be set according to actual conditions. Then, the parameters of the classic discriminant neural network are updated based on the first loss function.

[0058] S6. When the number of times the parameters of the classical discriminant neural network are updated reaches a preset number threshold, the generated IoT intrusion feature information and the intrusion type label corresponding to the generated IoT intrusion feature information are combined and input into the current classical discriminant neural network to obtain a prediction result, and a second loss function for training the quantum generative neural network is constructed according to the prediction result. The parameters of the quantum generative neural network are updated according to the second loss function, so that the current classical discriminant neural network discriminates the generated IoT intrusion feature information as true;

[0059] S7, return to execute S1, until the latest obtained classic discriminant neural network cannot determine whether it is the generated IoT intrusion feature information;

[0060] Among them, the preset number threshold can be set according to actual conditions.

[0061] Before updating the parameters of the quantum generative neural network according to the second loss function, the method also includes: fixing the parameters of the current classical discriminant neural network.

[0062] Among them, the second loss function LG is: LG = -E z [log(D(G(z)))], update the parameters of the quantum generative neural network according to the second loss function, so that the current classical discriminant neural network, i.e. the current discriminator, will identify the generated IoT intrusion feature information as true. The generator, i.e. the quantum generative neural network, and the discriminator, i.e. the classical discriminant neural network, are in an adversarial relationship. The purpose of the classical discriminant neural network is to distinguish whether the input is real intrusion feature information or generated IoT intrusion feature information, i.e. false IoT intrusion feature information. The purpose of the quantum generative neural network is to allow the classical discriminant neural network to recognize the IoT intrusion feature information it generates as true. In other words, the latest classical discriminant neural network cannot distinguish that the feature information obtained from the IoT intrusion feature information generated by the latest quantum generative neural network is false.

[0063] S8. Use the latest quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information. Specifically, input classical random noise and IoT intrusion type labels into the latest quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

[0064] The implementation method of updating the quantum generative neural network is: based on the finite difference method, the parameters of the quantum generative neural network are updated, specifically:

[0065] By formula Calculate the gradient of the second loss function with respect to the parameters of the quantum generative neural network, then use a classical computer to update the parameters of the quantum generative neural network through the gradient descent method, and use the back propagation algorithm to update the parameters of the single-layer fully connected neural network in the classical discriminant neural network and the quantum generative neural network. Finally, the classical discriminant neural network and the quantum generative neural network are trained against each other for multiple times until convergence.

[0066] The invention constructs an efficient hybrid quantum classical conditional generative adversarial neural network model to realize the generation of new Internet of Things intrusion data. Specifically, the invention adopts a self-designed hybrid quantum classical conditional generative adversarial neural network, first downloads an Internet of Things intrusion data set as feature information characterizing a real Internet of Things intrusion, then loads Internet of Things intrusion type label information and classical random noise into a quantum state by means of angle encoding, then processes the loaded quantum state by means of a quantum generative neural network, then measures each quantum bit, inputs the measured information into a single-layer fully connected neural network, outputs the generated Internet of Things intrusion feature information, then inputs the Internet of Things intrusion feature information generated by the quantum generative neural network and the downloaded real Internet of Things intrusion feature information and their respective corresponding intrusion type label information into a constructed classical discriminant neural network, then outputs the classical discriminant neural network to obtain prediction results of real data and data generated by the quantum generative neural network, combines the discrimination results of the real data and the generated data into a loss function for training a classical discriminant neural network, and updates the parameters of the classical discriminant neural network according to the obtained loss function corresponding to the classical discriminant neural network so that the discriminator can well identify whether the input is real Internet of Things intrusion or Internet of Things intrusion feature data generated by a generator. After the parameters of the classical discriminant neural network are updated for a set number of times, the IoT intrusion feature data generated by the quantum generative neural network and its corresponding IoT intrusion type label information are input into the classical discriminant neural network, and the loss function for training the quantum generative neural network is constructed according to the prediction results of the generated data output by the classical discriminant neural network. Then, the parameters of the discriminator are fixed according to this loss function, and the parameters of the generator are updated so that the discriminator can judge the generated IoT intrusion feature data as true. Through the continuous confrontation between the generator and the discriminator, the discriminator will not be able to distinguish whether the input is the generated IoT intrusion or the real IoT intrusion feature data. Finally, the trained generator can be used to generate new IoT intrusion feature data corresponding to the IoT intrusion type label information that is different from the real IoT intrusion and similar. The beneficial effects are as follows:

[0067] 1) Based on the existing IoT intrusion attack data and the IoT intrusion data generation method based on the hybrid quantum classical conditional generative adversarial neural network proposed in the present invention, new IoT attack data with different features is generated, which is of great significance for the detection and identification of IoT intrusion attacks. It allows us to use the generated intrusion data features corresponding to different intrusion types to identify the corresponding types of malicious attacks on the IoT.

[0068] 2) The hybrid quantum classical conditional generative adversarial neural network proposed in the present invention adopts a brand-new computing mode based on the basic principles of quantum mechanics, namely quantum computing. Due to the strong parallelism and non-local characteristics of quantum neural networks, the model in the present invention is superior to classical neural networks in the extraction and convergence speed of global features of IoT intrusion. It is expected to surpass the classical machine learning algorithm in terms of the effect of IoT intrusion generation. In addition, the present invention uses classical neural networks to perform discriminator tasks and only uses quantum neural networks to implement generators, so that the present invention reduces the hardware resource requirements for real quantum computers and is used for IoT intrusion feature data generation tasks, so that we can better utilize the currently developed quantum computers in the real field. In addition, the present invention introduces conditional information corresponding to the IoT intrusion type in the quantum generative adversarial neural network, so that we can generate IoT intrusion feature data corresponding to different intrusion types.

[0069] 3) At present, there has been no specific research on the conditional generation task of IoT intrusion combined with quantum computing, and the training stability of hybrid quantum classical conditional generation adversarial neural networks is expected to exceed that of pure classical machine learning algorithms.

[0070] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.

[0071] An IoT intrusion data generation system according to an embodiment of the present invention comprises a quantum state loading module, a training module and an IoT intrusion data generation module;

[0072] The quantum state loading module is used to: load the intrusion type label information and classical random noise in the IoT intrusion dataset into quantum states;

[0073] The training module is used to: process the loaded quantum state through a quantum generative neural network to measure the quantum bits of the quantum system corresponding to the quantum generative neural network to obtain classical information; input the classical information into a single-layer fully connected neural network to output the generated Internet of Things intrusion feature information; input the generated Internet of Things intrusion feature information and the intrusion type label information corresponding to the generated Internet of Things intrusion feature information into a classical discriminant neural network to obtain a first prediction result, input the real intrusion feature information in the Internet of Things intrusion data set and the intrusion type label information corresponding to the real intrusion feature information in the Internet of Things intrusion data set into the classical discriminant neural network to obtain a second prediction result; combine the first prediction result and the second prediction result into a neural network for training the classical discriminant neural network. The first loss function of the network is used to update the parameters of the classical discriminant neural network according to the first loss function; when the number of times the parameters of the classical discriminant neural network are updated reaches a preset number threshold, the generated IoT intrusion feature information and the intrusion type label corresponding to the generated IoT intrusion feature information are combined and input into the current classical discriminant neural network to obtain a prediction result, and a second loss function for training the quantum generative neural network is constructed according to the prediction result, and the parameters of the quantum generative neural network are updated according to the second loss function, so that the current classical discriminant neural network judges the generated IoT intrusion feature information as true; and the quantum state loading module is re-called until the latest classical discriminant neural network cannot judge whether it is the generated IoT intrusion feature information;

[0074] The IoT intrusion data generation module is used to generate IoT intrusion data corresponding to the intrusion type label information using the latest quantum generative neural network.

[0075] Optionally, in the above technical solution, the quantum state loading module is specifically used to: load the IoT intrusion type label information and classical random noise in the IoT intrusion data set into quantum states by means of angle encoding.

[0076] Optionally, in the above technical solution, the IoT intrusion data generation module is specifically used for:

[0077] The classical random noise and IoT intrusion type labels are input into the newly obtained quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

[0078] Optionally, in the above technical solution, the training module is also specifically used to: use the latest quantum generative neural network to generate Internet of Things intrusion data corresponding to the intrusion type label information.

[0079] It should be noted that the beneficial effects of the IoT intrusion data generation system provided by the above embodiment are the same as the beneficial effects of the IoT intrusion data generation method provided by the above embodiment, which will not be described in detail here. In addition, when the system provided by the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided by the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be described in detail here.

[0080] In another embodiment, it includes a real IoT intrusion data set data preprocessing and random noise quantum state encoding module, a generator and discriminator construction module, a training discriminator module, a training generator module, and a quantum circuit parameter updating module.

[0081] The real IoT intrusion data preprocessing and random noise quantum state encoding module is used to: download the IoT intrusion data set and normalize the corresponding features. The different label information of the corresponding intrusion types in the classic random noise and IoT intrusion data set are encoded into quantum states through angle encoding, so as to generate fake IoT intrusion data through the generator designed later.

[0082] The generator and discriminator building modules are used to: build generators and discriminators based on the characteristics of real data sets based on quantum operations supported by quantum computers, so as to generate fake IoT intrusion feature data and distinguish between real IoT intrusion data and generated IoT intrusion data.

[0083] The training discriminator module is used to: combine the discriminator's discrimination results of the real IoT intrusion data and the generated IoT intrusion data input into a loss function, and then update the discriminator's parameters based on the loss function, so that the discriminator can distinguish whether the input is real IoT intrusion data or IoT intrusion data generated by the generator.

[0084] The training generator module is used to: input the IoT intrusion feature data generated by the generator and the corresponding intrusion type label information into the classic discriminant neural network to obtain the prediction results, construct the loss function based on this result, and then fix the parameters of the discriminator. Based on this loss function, the parameters of the generator are updated so that the discriminator can judge the IoT intrusion data generated by the generator as true.

[0085] The Update Quantum Circuit Parameters module is used to:

[0086] Based on the finite difference method, the gradient of the generator's loss function with respect to the quantum circuit parameters is calculated. The parameters of the generator can be updated using a classical computer. The parameters of the fully connected neural network in the discriminator and the generator can be updated through the back-propagation algorithm of the machine learning framework. Finally, the discriminator and the generator are adversarially trained multiple times, so that the Internet of Things intrusion data generation method based on the hybrid quantum classical conditional generative adversarial neural network proposed in the present invention stops after convergence.

[0087] A more detailed explanation is provided below:

[0088] Real IoT intrusion data preprocessing and random noise quantum state encoding module:

[0089] Download the real IoT intrusion dataset IoT Intrusion Detection. Each IoT intrusion contains 46 features. Normalize some data features and take two IoT attack types, DDOS and DOS, as labels. The DDOS label is marked as 1 and the DOS label is marked as 0. Combine the IoT intrusion type label information with the classic random noise to obtain r = [r 1 …r 29 r 30 ], where the last element r 30 Represents the IoT intrusion type label information, and takes the inverse tangent of each element in the feature vector r that integrates the classic random noise and label information. i =arctan(r i ) to obtain the rotation angle of the quantum gate. Note that r i represents one of the feature vectors r, θ i represents the rotation angle of the i-th quantum gate in the generator, and i represents the sequence number of the element in the characteristic vector r.

[0090] Then, the R encoded by the alternating rotation angle y (θ) and R x (θ) The rotating quantum gate loads the characteristic vector r that integrates the classical random noise and label information onto the amplitude of the quantum state. Here, 10 quantum bits are used. The specific quantum circuit is as follows: Figure 2 shown.

[0091] Generator and discriminator building blocks:

[0092] The overall architecture of the hybrid quantum classical conditional generative adversarial neural network designed by the present invention is as follows Figure 3As shown, DNN represents a classical discriminative neural network, QGNN represents a quantum generative neural network, and based on the 46-dimensional feature vector of the real IoT intrusion data set in the previous module, the classical random noise and the IoT intrusion type label information are input into the generator through the quantum state encoding of the previous module to generate a 46-dimensional fake IoT intrusion feature vector. Then, the generated IoT intrusion feature vector and the real IoT intrusion feature vector are combined with their respective intrusion type labels and input into the discriminator to obtain the discriminator's prediction result for the input data.

[0093] Basic quantum gate operations supported by quantum computers R y (θ), R z (θ), etc., to build a basic building block for a quantum generative neural network such as Figure 4 Based on this basic building block, a quantum generative neural network is constructed. Its network structure is as follows Figure 5 As shown, 10 qubits are used here.

[0094] Figure 5 The encoding module in is the random noise and IoT intrusion type tag quantum state encoding module. The structure of U is as follows: Figure 4 As shown. The dotted box in the figure realizes quantum entanglement and quantum operations on classical random noise and IoT intrusion type label quantum states, which can be repeated many times to enhance the performance of the generator. Here, the number of repetitions l = 3 is selected, and finally each quantum bit of the generator is measured to obtain the probability amplitude of 10 quantum bits and 1024 calculation ground states, which are then input into a single-layer fully connected neural network to generate 46-dimensional fake IoT intrusion feature data information.

[0095] After obtaining the fake IoT intrusion data generated by the quantum generative neural network, the generated fake IoT intrusion and real IoT intrusion feature data can be combined with their respective IoT intrusion type labels and input into the discriminator. The structure of the discriminator is as follows: Figure 6 As shown in the figure, it is composed of a multi-layer classic fully connected neural network. The number of neural network nodes in each layer is [47,400,50,1]. The dimension of the input layer is 47, which is used to input 47-dimensional real and generated IoT intrusion feature data and its corresponding intrusion type label. The dimension of the output layer is 1. By executing a sigmoid function on the output as the prediction result of the input IoT intrusion feature data, it is judged whether the input IoT intrusion is real IoT intrusion or fake IoT intrusion feature data. The prediction result of 1 indicates that the input is real IoT intrusion feature information, and the result of 0 indicates that the input is fake IoT intrusion feature information.

[0096] Train the discriminator module:

[0097] Combine the 46-dimensional real IoT intrusion data features and the IoT intrusion feature data generated by the generator with their corresponding intrusion type label information, and input them as follows: Figure 6 In the discriminator shown, the prediction results of the discriminator for the real IoT intrusion input sample and the generated IoT intrusion feature data sample are obtained respectively, and then the two prediction results are combined into a loss function, namely the first loss function, as follows:

[0098] LD=-E x [log(D(x))]-E z [log(1-D(G(z)))]

[0099] The symbol E in the figure x / z [] represents the average of the training data set batch of the discriminator's prediction results for real or generated IoT intrusion feature data. Here, the batch size is 100, where x represents the combination of real IoT intrusion data features and their corresponding label information, z represents the combination of classical random noise and label information input to the generator, and G(z) represents the IoT intrusion feature data generated by the generator after operating the quantum state loaded with classical random noise and label information. D(x) represents the discriminator's prediction results for real IoT intrusion samples, and D(G(z)) represents the discriminator's prediction results for generated IoT intrusion samples. Then, based on the above-constructed loss function for the discriminator, the parameters of the discriminator are updated so that the discriminator can distinguish whether the input is real IoT intrusion or IoT intrusion data generated by the generator.

[0100] Training Generator Module:

[0101] Based on the real IoT intrusion data preprocessing and random noise quantum state encoding module, the combination of 30-dimensional random noise and IoT intrusion type label information is input into the generator, and then the generated IoT intrusion feature data and IoT intrusion type label information are input into the discriminator together to obtain the prediction result of the discriminator to construct the loss function of the generator, that is, the second loss function, as shown in the following formula:

[0102] LG=-E z [log(D(G(z)))]

[0103] Then, the parameters of the fixed discriminator are used to update the parameters of the generator based on this loss function, so that the discriminator identifies the IoT intrusion data generated by the generator as true. The generator and the discriminator are in an adversarial relationship. The purpose of the discriminator is to distinguish whether the input is true IoT intrusion data or false IoT intrusion data. The purpose of the generator is to allow the discriminator to recognize the IoT intrusion feature data it generates as true, that is, to make the discriminator unable to distinguish that the IoT intrusion feature data input by the generator into the discriminator is false.

[0104] Update quantum circuit parameter module:

[0105] The present invention uses a finite difference method to update quantum circuit parameters. The gradient realization formula of the loss function with respect to a parameter in the parameterized quantum circuit is as follows:

[0106]

[0107] The above formula θ i Represents the parameters in the generator U, and i represents the i-th parameter that constitutes the generator.

[0108] By using the finite difference method, the gradient of the second loss function of the previous module with respect to the generator parameters can be calculated. Then, the parameters of the generator are updated by the gradient descent method using a classical computer, and the parameters of the single-layer fully connected neural network in the discriminator and the generator are updated by the back propagation algorithm. Finally, by training the discriminator and the generator adversarially for multiple times, the method for generating IoT intrusion data based on hybrid quantum classical conditional generation adversarial neural network proposed by the present invention stops after convergence, so that the trained generator of the present invention can be used to generate new IoT intrusion data corresponding to different intrusion types by inputting IoT intrusion type labels and classical random noise.

[0109] like Figure 7 As shown, a computer device 300 according to an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the computer device 300 implements any of the above-mentioned methods for generating IoT intrusion data, specifically:

[0110] The computer device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the computer device 300 implements any of the IoT intrusion data generation methods provided in the above embodiments. Of course, the computer device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the computer device 300 may also include other components for implementing device functions, which will not be described in detail here.

[0111] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements any one of the above-mentioned methods for generating IoT intrusion data.

[0112] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0113] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any one of the above-mentioned methods for generating intrusion data of the Internet of Things.

[0114] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.

[0115] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.

[0116] Any combination of one or more computer-readable media can be used. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0117] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for generating intrusion data of the Internet of Things, characterized in that: include: S1, load the intrusion type label information and classical random noise in the IoT intrusion dataset into quantum states; S1 includes: loading the IoT intrusion type label information and classical random noise in the IoT intrusion dataset into quantum states by angle encoding, specifically: The intrusion type label information and the classical random noise are combined to obtain the feature vector r, r = [r1…r 29 r 30 ], randomly select 29 numbers from the standard normal distribution as classic random noise, the last element r in the feature vector r 30 Represents the intrusion type label information, r1…r in the feature vector r 29 Represents classic random noise, and takes the inverse tangent of each element in the intrusion type label information and the characteristic vector r of classic random noise, that is, through the formula θ i =arctan(r i ), and obtain the rotation angle θ of the quantum gate i , r i represents the i-th element in the feature vector r, i is a positive integer ranging from 1 to 30, θ i Represents r i The corresponding rotation angle of the quantum gate. After obtaining the rotation angle of the quantum gate, the rotation angle of the quantum gate is obtained by R y (θ) and R x (θ) The angle encoding method of rotating the quantum gate loads the characteristic vector r that integrates the intrusion type label information and classical random noise onto the amplitude of the quantum state; S2. Processing the loaded quantum state through a quantum generative neural network to measure the quantum bits of the quantum system corresponding to the quantum generative neural network to obtain classical information; S3, inputting the classical information into a single-layer fully connected neural network, and outputting the generated IoT intrusion feature information; S4, inputting the generated IoT intrusion feature information and the intrusion type label information corresponding to the generated IoT intrusion feature information into a classical discriminant neural network to obtain a first prediction result, and inputting the real intrusion feature information in the IoT intrusion data set and the intrusion type label information corresponding to the real intrusion feature information in the IoT intrusion data set into a classical discriminant neural network to obtain a second prediction result; S5, combining the first prediction result and the second prediction result into a first loss function for training the classical discriminant neural network, and updating the parameters of the classical discriminant neural network according to the first loss function; S6. When the number of times the parameters of the classical discriminant neural network are updated reaches a preset number threshold, the generated IoT intrusion feature information and the intrusion type label corresponding to the generated IoT intrusion feature information are combined and input into the current classical discriminant neural network to obtain a prediction result, and a second loss function for training the quantum generative neural network is constructed according to the prediction result. The parameters of the quantum generative neural network are updated according to the second loss function, so that the current classical discriminant neural network discriminates the generated IoT intrusion feature information as true; S7, returning to execute S1, until the latest obtained classical discriminant neural network cannot determine whether it is the generated IoT intrusion feature information; S8. Use the latest quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

2. The method for generating intrusion data of the Internet of Things according to claim 1, characterized in that: S8 includes: The classical random noise and IoT intrusion type labels are input into the newly obtained quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

3. The method for generating intrusion data of the Internet of Things according to claim 1, characterized in that: Before updating the parameters of the quantum generative neural network according to the second loss function, it also includes: fixing the parameters of the current classical discriminant neural network.

4. An IoT intrusion data generation system, characterized in that: It includes quantum state loading module, training module and IoT intrusion data generation module; The quantum state loading module is used to: load the intrusion type label information and classical random noise in the IoT intrusion data set into a quantum state; The quantum state loading module is specifically used to load the IoT intrusion type label information and classical random noise in the IoT intrusion data set into quantum states by means of angle encoding, specifically: The intrusion type label information and the classical random noise are combined to obtain the feature vector r, r = [r1…r 29 r 30 ], randomly select 29 numbers from the standard normal distribution as classic random noise, the last element r in the feature vector r 30 Represents the intrusion type label information, r1…r in the feature vector r 29 Represents classic random noise, and takes the inverse tangent of each element in the intrusion type label information and the characteristic vector r of classic random noise, that is, through the formula θ i =arctan(r i ), and obtain the rotation angle θ of the quantum gate i , r i represents the i-th element in the feature vector r, i is a positive integer ranging from 1 to 30, θ i Represents r i The corresponding rotation angle of the quantum gate. After obtaining the rotation angle of the quantum gate, the rotation angle of the quantum gate is obtained by R y (θ) and R x (θ) The angle encoding method of rotating the quantum gate loads the characteristic vector r that integrates the intrusion type label information and classical random noise onto the amplitude of the quantum state; The training module is used to: process the loaded quantum state through a quantum generative neural network to measure the quantum bits of the quantum system corresponding to the quantum generative neural network to obtain classical information; input the classical information into a single-layer fully connected neural network, and output the generated Internet of Things intrusion feature information; Input the generated IoT intrusion feature information and the intrusion type label information corresponding to the generated IoT intrusion feature information into the classical discriminant neural network to obtain a first prediction result, input the real intrusion feature information in the IoT intrusion data set and the intrusion type label information corresponding to the real intrusion feature information in the IoT intrusion data set into the classical discriminant neural network to obtain a second prediction result; combine the first prediction result and the second prediction result into a first loss function for training the classical discriminant neural network, and update the parameters of the classical discriminant neural network according to the first loss function; when the number of times the parameters of the classical discriminant neural network are updated reaches a preset number threshold, combine the generated IoT intrusion feature information and the intrusion type label corresponding to the generated IoT intrusion feature information into the current classical discriminant neural network to obtain a prediction result, construct a second loss function for training the quantum generated neural network according to the prediction result, and update the parameters of the quantum generated neural network according to the second loss function, so that the current classical discriminant neural network judges the generated IoT intrusion feature information as true; re-call the quantum state loading module until the latest classical discriminant neural network cannot determine whether it is the generated IoT intrusion feature information; The Internet of Things intrusion data generation module is used to generate Internet of Things intrusion data corresponding to the intrusion type label information using the latest quantum generative neural network.

5. The IoT intrusion data generation system according to claim 4, characterized in that: The IoT intrusion data generation module is specifically used for: The classical random noise and IoT intrusion type labels are input into the newly obtained quantum generative neural network to generate IoT intrusion data corresponding to the intrusion type label information.

6. The IoT intrusion data generation system according to claim 4, characterized in that: The training module is also specifically used to: use the latest quantum generative neural network to generate Internet of Things intrusion data corresponding to the intrusion type label information.

7. A computer device, characterized in that: The computer device includes a processor, the processor is coupled to a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the computer device implements the method for generating Internet of Things intrusion data as described in any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that the computer implements the method for generating Internet of Things intrusion data as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Intrusion detection network model generation method and data traffic intrusion detection method

    CN116015932A