Sensor vulnerability detection method and system based on common mode signal ground wire injection
Technical Field
The invention belongs to the field of sensor vulnerability detection, and particularly relates to a sensor vulnerability detection method and system based on common mode signal ground wire injection.
Background
In the process of the rapid development of the environment of the Internet of things and the intellectualization of the terminal equipment, the sensor serves as a first ring for the terminal equipment to receive the external information and plays an important role in receiving, sensing and transmitting the external information. However, with the increasing sophistication and wide application of the internet of things, the security risks faced by the sensors are also increasing. At present, safety consideration of sensors in many internet of things systems is insufficient, and data acquired by the sensors are generally trusted by default, so that vulnerability of the sensors is not fully evaluated and protected. This situation results in the possibility of tampering with the data, leakage of information and even paralysis of the system once the sensor is subjected to a malicious attack or other security breach. Therefore, in order to ensure the reliability and safety of the internet of things system, it is important to conduct intensive research and evaluation on the vulnerability of the sensor. Besides the risk of tampering data caused by coupling electromagnetic radiation, the sensor module also has the risk of interference by conducted signals, for example, a touch screen may malfunction when a mobile phone is charged, and the possible cause of the malfunction is that common mode noise appearing at the output end of a charger affects the normal operation of the touch screen. It is explained that a sensor with perceived vulnerability will generate a differential mode signal inside the sensor when receiving a certain level of common mode signal, due to the structural asymmetry characteristic of its internal electronic and electrical circuit, resulting in an output signal error. In the touch screen, the number and arrangement structure of electronic components, the production process and the like may cause structural asymmetry of internal electronic and electric circuits.
In the existing electromagnetic compatibility (EMC) test, a high-current common-mode coupling injection method is often used, but in order to improve the coupling efficiency of the coil, a higher signal frequency is required, usually at hundreds of megahertz. For the detection of the vulnerability of the wired common mode, if a relatively low-frequency signal exploration is required, a method similar to the two-end injection of the signal line and the ground line in the EMC test is used to cause the short circuit of the sensor transmission line, and the method is not suitable for the actual ground line interference scene.
Disclosure of Invention
The invention aims to provide a sensor vulnerability detection method and system based on common mode signal ground wire injection, which are used for detecting the vulnerability of a sensor by using the asymmetry of an internal circuit of the sensor and a simple ground wire injection common mode signal detection mode, and aims to provide a novel interference detection mode and evaluation method for the performance detection of the existing sensor, so that the reliability and stability of the sensor applied to terminal equipment of the Internet of things are improved, and the sensor is suitable for the fields of various industrial automation and intelligent monitoring and the like.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for detecting vulnerability of a sensor based on common mode signal ground line injection, including the following steps:
Step 1, inputting an electric signal required by a sensor, enabling the sensor to normally work under the condition of no common mode signal injection, and collecting normal work data of the sensor;
step 2, designing control parameters of the periodic test signal, including test signal frequency, test signal amplitude and test signal type;
Step 3, generating a periodic test signal according to the control parameter of the test signal, and amplifying the power of the periodic test signal; the periodic test signal and a power supply of the target sensor are not grounded together;
Step 4, injecting the periodic test signal generated in the step 3 into the normally working sensor by adopting a ground wire injection technology, and collecting and screening abnormal working data of the sensor;
Step 5: modifying the periodic test signal control parameters in the step 2, and repeatedly executing the steps 3 and 4 to obtain abnormal working data of the sensor under the interference of periodic test signals with different parameters;
Step 6: segmenting positive sample images and negative sample images according to normal working data and abnormal working data of the sensor, wherein the positive sample images and the negative sample images are waveform diagrams of the working data in the same time period;
step 7: training a deep convolutional neural network model by adopting a positive sample image and a negative sample image;
step 8: and detecting the vulnerability of the sensors of the same type by using the trained deep convolutional neural network model.
Further, the normal operation data and the abnormal operation data of the sensor are electrical signal data.
Further, the test signal types include sine signals, cosine signals and square wave signals.
Further, the ground wire injection technology is as follows: and (3) connecting the positive electrode of the periodic test signal obtained in the step (3) to the floating ground of the target sensor, and suspending the negative electrode.
Further, the collecting and screening abnormal working data of the sensor includes:
Collecting working data of the sensor after the periodic test signal is injected;
Comparing the difference between the amplitude and the waveform of the working data injected with the periodic test signal and the normal working data, if the difference proportion of the amplitude is higher than the threshold value or the similarity of the waveform is lower than the threshold value, the working data injected with the periodic test signal is considered to be abnormal working data, and the abnormal working data is reserved, otherwise, the abnormal working data is deleted.
Further, when the trained deep convolutional neural network model is used for detecting the vulnerability of the same type of sensor, after the periodic test signal generated by any control parameter is subjected to power amplification, the periodic test signal is injected into the same type of sensor to be detected by adopting a ground wire injection mode, a sample to be detected is obtained by segmentation according to working data output by the sensor to be detected, the sample to be detected is input into the trained deep convolutional neural network model, the vulnerability probability of the sensor is generated, and the greater the vulnerability probability is, the higher the vulnerability of the sensor to be detected under the signal attack of the control parameter is indicated.
Further, the method also comprises the step of generating a vulnerability detection report according to the test result, and the method comprises the following steps:
When the vulnerability of the sensor is tested, the control parameters of the test signals under the preset amplitude range, the frequency range and the signal type are traversed, and a vulnerability detection report is generated according to the vulnerability result under the signal attack of each control parameter, wherein the vulnerability detection report content comprises the test signal injection object, the signal type, the signal amplitude range, the signal frequency range, the vulnerability frequency point and the sensor waveform information under the vulnerability frequency point.
In a second aspect, the present invention proposes a sensor vulnerability detection system based on common mode signal ground injection, which is characterized by comprising:
The test signal generation module is used for designing control parameters of the periodic test signal, including test signal frequency, test signal amplitude and test signal type; generating a periodic test signal according to the test signal control parameter, and performing power amplification on the periodic test signal; the periodic test signal and a power supply of the target sensor are not grounded together;
the ground wire injection module is used for injecting the generated periodic test signal into the sensor which works normally by adopting a ground wire injection technology;
The working data acquisition module is used for acquiring working data of the sensor under the condition of no common mode signal injection and after the periodic test signal is injected, screening normal working data and abnormal working data, and dividing the working data into waveform diagrams of the working data in the same time period;
The deep convolution neural network model module is used for training a deep convolution neural network model based on the positive sample image and the negative sample image obtained by segmentation in the training stage, and detecting the vulnerability of the sensors of the same type based on the trained deep convolution neural network model in the detection stage.
Further, the normal operation data and the abnormal operation data of the sensor are electrical signal data.
Further, the method further comprises the following steps:
The vulnerability detection report generation module is used for traversing the control parameters of the test signals under the preset amplitude range, the frequency range and the signal type when the vulnerability of the sensor is tested, and generating a vulnerability detection report according to the vulnerability result under the signal attack of each control parameter, wherein the vulnerability detection report content comprises the test signal injection object, the signal type, the signal amplitude range, the signal frequency range, the vulnerability frequency point and the sensor waveform information under the vulnerability frequency point.
The detection system for detecting the vulnerability of the sensor based on the common mode signal ground wire injection technology is reasonable in design, simple in structure, convenient to operate, strong in generalization capability and reliable in detection result. The main beneficial effects include:
(1) The invention provides a new approach for quality control and fault diagnosis of the sensor aiming at an asymmetric detection system of the internal circuit of the sensor, and the method has higher sensitivity and reliability and can effectively solve the problem of limitation in the traditional sensor detection mode.
(2) The method adopts the mode of injecting the common mode signal into the ground wire to detect the vulnerability of the sensor, and directly applies the test signal to the sensor to be detected through the ground wire injection technology, so that a corresponding deep convolutional neural network model can be established for each type of sensor, and the internal vulnerability detection of the sensor in the category 104 of the acoustic, optical, electric, magnetic, thermal and chemical 6 can be covered.
Drawings
FIG. 1 is a schematic overall flow diagram of a sensor vulnerability detection method based on common mode signal ground injection of the present invention;
FIG. 2 is a block diagram of the structure of the present invention;
FIG. 3 is a schematic diagram of sensor output signals prior to disturbance signal injection;
fig. 4 is a schematic diagram of the sensor output signal after injection of the disturbance signal.
Detailed Description
The invention will be further described with reference to the drawings and examples. The figures are only schematic illustrations of the invention, some of the block diagrams shown in the figures are functional entities, not necessarily corresponding to physically or logically separate entities, which may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor systems and/or microcontroller systems.
The invention provides a sensor vulnerability detection method based on common mode signal ground wire injection, which can realize performance detection of the existing sensor, thereby improving the reliability and stability of the terminal equipment of the Internet of things. As shown in fig. 1-2, the specific implementation process is as follows:
Step one, a sensor works normally: and inputting an electric signal required by the sensor, so that the sensor can work normally under the condition of no common mode signal injection, and normal working data of the sensor can be obtained. The operation data of the sensor is the electric signal (e.g. voltage signal, current signal) output by the sensor.
Step two, a test signal generation stage: the signal source is used to output any periodic electric signal, any type of signal such as sine wave, cosine wave, square wave and the like is generated, and the proper frequency is selected.
Step three, a test signal amplifying stage: and (3) connecting the electric signal generated by the signal source to a power amplifier, amplifying to proper strength, and obtaining a signal with high strength which is not commonly grounded with the power supply of the test sensor. This signal is subsequently used as an interference signal to be injected into the sensor to test its vulnerability.
Fourth, common mode signal ground wire injection stage: injecting common mode signals into a normally working sensor, and collecting and screening abnormal working data of the sensor; the process of injecting the common mode signal is as follows: and (3) connecting the positive electrode of the signal obtained in the step (III) to the floating ground of the target sensor, suspending the negative electrode, and injecting the signal obtained in the step (III) into the target sensor in a wired mode.
And fifthly, changing the signal frequency and the waveform type in the second step, and repeatedly executing the third step and the fourth step to obtain abnormal working data under signal interference of different signal frequencies and waveforms.
Step six, constructing a deep convolutional neural network model, constructing a normal sample and an abnormal sample by using normal working data and abnormal working data, and training the deep convolutional neural network model; the normal sample and the abnormal sample are in an image format;
and seventhly, aiming at the sensor to be detected, carrying out vulnerability detection by using a trained model.
In one embodiment of the invention, the working data collection mode is: the output of the sensor is observed and acquired by using modes including but not limited to a differential probe, a serial port and the like, and the data acquisition mode is determined according to the characteristics and the output mode of the target sensor.
In one embodiment of the present invention, the method for constructing the abnormal sample and the normal sample comprises: and cutting the samples according to the normal working data and the abnormal working data, and ensuring that the length of the abnormal samples is the same as that of the normal samples. Specifically, in the fourth step, abnormal working data needs to be further screened according to the collected working data of the sensor, and an optional screening mode is as follows:
Collecting working data of the sensor after the periodic test signal is injected;
Comparing the difference between the amplitude value and the waveform of the working data injected with the periodic test signal and the normal working data, if the difference ratio of the amplitude values is higher than a first threshold value or the similarity of the waveform is lower than a second threshold value, the working data injected with the periodic test signal is considered to be abnormal working data, and the abnormal working data are reserved, or else the abnormal working data are deleted.
As shown in fig. 3 and fig. 4, where fig. 3 is a graph of output signals of a certain sensor before injection of an interference signal, and fig. 4 is a graph of output signals of the same sensor after injection of an interference signal, it can be seen that the waveform of fig. 4 has been significantly changed on the basis of fig. 3, and the similarity is lower than a threshold value of two. In addition, for the working data of the voltage signal type, data screening can be performed by comparing the duty ratio.
In one implementation of the present invention, when the deep convolutional neural network is constructed in step six, the output is a mapping, according to the input data, the interference degree of the test signal to the sensor is obtained through the mapping, the greater the value is, the greater the interference degree to the sensor is, the greater the vulnerability of the sensor under the test signal is.
In one embodiment of the present invention, the input layer of the deep convolutional neural network is a convolutional layer, the input of the deep convolutional neural network is a waveform diagram, and the hidden layer comprises a convolutional layer, a pooling layer, a full connection layer, a neuron discarding layer, a full connection layer and a neuron discarding layer which are sequentially arranged. The convolution layer of the input layer of the deep convolution neural network model comprises an activation function and 32 convolution neurons, and the convolution width is 8. Each convolution layer of the hidden layers of the deep convolutional neural network model comprises an activation function and 32 convolutional neurons, the convolution width is 8, and the pooling coefficient of the pooling layer is 8. Each of the fully connected layers of the hidden layer of the deep convolutional neural network model includes 80 neurons and an activation function, and a drop probability of each of the neuron drop layers is 0.2. When the trained deep convolutional neural network model is utilized to detect the vulnerability of the sensors of the same type, after the periodic test signal generated by any control parameter is subjected to power amplification, the periodic test signal is injected into the sensors to be tested of the same type in a ground wire injection mode, a sample to be tested is obtained by segmentation according to working data output by the sensors to be tested, the sample to be tested is input into the trained deep convolutional neural network model, the vulnerability probability of the sensors is generated, the greater the vulnerability probability is, the higher the vulnerability of the sensors to be tested under the signal attack of the control parameter is, and in the embodiment, the test frequency is considered to be the vulnerability frequency point of the sensors when the vulnerability probability is greater than 50%.
In one implementation of the present invention, the method further includes a step eight of generating a detection report according to the detection result; when the vulnerability of the sensor is tested, the control parameters of the test signals under the preset amplitude range, the frequency range and the signal type are traversed, and a vulnerability detection report is generated according to the vulnerability result under the signal attack of each control parameter, wherein the vulnerability detection report content comprises the test signal injection object, the signal type, the signal amplitude range, the signal frequency range, the vulnerability frequency point and the sensor waveform information under the vulnerability frequency point.
Corresponding to the method for detecting the vulnerability of the sensor based on the common mode signal ground wire injection provided by the embodiment, the application further provides an embodiment of a system for detecting the vulnerability of the sensor based on the common mode signal ground wire injection.
The sensor vulnerability detection system comprises:
The test signal generation module is used for designing control parameters of the periodic test signal, including test signal frequency, test signal amplitude and test signal type; generating a periodic test signal according to the test signal control parameter, and performing power amplification on the periodic test signal; the periodic test signal and a power supply of the target sensor are not grounded together;
the ground wire injection module is used for injecting the generated periodic test signal into the sensor which works normally by adopting a ground wire injection technology;
The working data acquisition module is used for acquiring working data of the sensor under the condition of no common mode signal injection and after the periodic test signal is injected, screening normal working data and abnormal working data, and dividing the working data into waveform diagrams of the working data in the same time period;
The deep convolution neural network model module is used for training a deep convolution neural network model based on the positive sample image and the negative sample image obtained by segmentation in the training stage, and detecting the vulnerability of the sensors of the same type based on the trained deep convolution neural network model in the detection stage.
May further comprise:
The vulnerability detection report generation module is used for traversing the control parameters of the test signals under the preset amplitude range, the frequency range and the signal type when the vulnerability of the sensor is tested, and generating a vulnerability detection report according to the vulnerability result under the signal attack of each control parameter, wherein the vulnerability detection report content comprises the test signal injection object, the signal type, the signal amplitude range, the signal frequency range, the vulnerability frequency point and the sensor waveform information under the vulnerability frequency point.
For the system embodiment, since the system embodiment basically corresponds to the method embodiment, the relevant parts only need to be referred to in the description of the method embodiment, and the implementation methods of the remaining modules are not repeated herein. The system embodiments described above are merely illustrative, in that the units described as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present invention. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Embodiments of the system of the present invention may be applied to any device having data processing capabilities, such as a computer or the like. The system embodiment may be implemented by software, or may be implemented by hardware or a combination of hardware and software. Taking software implementation as an example, the device in a logic sense is formed by reading corresponding computer program instructions in a nonvolatile memory into a memory by a processor of any device with data processing capability.
It will be understood by those skilled in the art that the embodiments of the present invention described above and shown in the drawings are merely illustrative and not restrictive of the current invention, and that this invention has been shown and described with respect to the functional and structural principles thereof, without departing from such principles, and that any modifications or adaptations of the embodiments of the invention may be possible and practical.