Security detection method, device and equipment of power wireless sensor network and medium
By using a pre-trained security detection model in the power wireless sensor network, combining the convolutional neural network and the Chaos Levi Flying Osprey optimization algorithm, the problem of low security detection accuracy of the power wireless sensor network is solved, and higher detection accuracy and data security are achieved.
Patent Information
- Application Number
- CN202510501930.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-07-22
AI Technical Summary
In the prior art, the safety detection accuracy of power wireless sensor networks is poor, resulting in serious challenges in data security.
The pre-trained security detection model is adopted, and the intrusion data of the power wireless sensor network is safely detected by using the convolutional neural network and the Chaos Levi Flying Osprey optimization algorithm. The initial convolutional neural network is trained through the backpropagation algorithm, and its parameters are optimized to improve detection accuracy.
It improves the security detection accuracy and accuracy of the power wireless sensor network, effectively protecting the security of network data.
Smart Images

Figure CN120358487A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wireless sensor networks, and particularly to a security detection method, device, equipment and medium for a power wireless sensor network. Background Art
[0002] A power wireless sensor network is a distributed sensing network that connects multiple sensor nodes through wireless communication technology to monitor various parameters of the power system in real time, providing monitoring in aspects such as transmission lines, substations, power quality, and equipment status. It has the advantages of wireless communication, real-time monitoring, distributed processing, and flexible expansion, and is an important means for China to implement a low-carbon, safe, and sustainable energy development strategy in the future. A large amount of data circulates on the power wireless sensor network, such as energy production information, energy equipment information, and user information. As an important resource of the power wireless sensor network, the security of such data is the core content of the power wireless sensor network.
[0003] Currently, the technology of power wireless sensor networks is still not mature enough, and there are many security hazards. Some network hackers take advantage of the loopholes and defects in the power wireless sensor network to enter the power wireless sensor network and steal and damage the energy data transmitted on the power wireless sensor network. In the prior art, the security detection of intrusion data in the power wireless sensor network is mainly carried out manually, with poor accuracy, resulting in a serious challenge to the data security in the power wireless sensor network. Summary of the Invention
[0004] The present invention provides a security detection method, device, equipment and medium for a power wireless sensor network to solve the defect that in the prior art, the security detection of intrusion data in the power wireless sensor network is carried out manually with poor accuracy, resulting in a serious challenge to the data security in the power wireless sensor network. The technical solution of the present invention performs security detection on intrusion data through a pre-trained security detection model, improving the accuracy and accuracy of security detection, and thus being able to better protect the data security of the power wireless sensor network.
[0005] The present invention provides a security detection method for a power wireless sensor network, including the following steps.
[0006] Obtain network intrusion data in the power wireless sensor network; Input the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
[0007] A security detection method for a power wireless sensor network provided by the present invention, the security detection model is obtained by training through the following steps: Obtain the initial historical intrusion data corresponding to the power wireless sensor network, and preprocess the initial historical intrusion data to obtain the historical intrusion data corresponding to the initial historical intrusion data; Input the historical intrusion data and the historical labels into the initial convolutional neural network, and train the initial convolutional neural network through the backpropagation algorithm to obtain the initial security detection model corresponding to the initial convolutional neural network; Optimize and adjust the parameters in the initial security detection model through the chaotic Lévy flight osprey optimization algorithm to obtain the security detection model corresponding to the initial security detection model.
[0008] According to a security detection method for a power wireless sensor network provided by the present invention, the inputting the historical intrusion data and the historical labels into the initial convolutional neural network and training the initial convolutional neural network through the backpropagation algorithm includes: Input the historical intrusion data into the first convolutional layer of the initial convolutional neural network to obtain the intrusion data feature map output by the first convolutional layer; the first convolutional layer is used to extract the local features of the historical intrusion data, and calculate the output of each convolutional kernel based on the local features, apply an activation function and introduce non-linearity to generate the intrusion data feature map; Input the intrusion data feature map into the pooling layer of the initial convolutional neural network to obtain the pooling feature map output by the pooling layer; the pooling layer is used to perform a pooling operation on the intrusion data feature map to generate the pooling feature map; Input the pooling feature map into the second convolutional layer or the first fully connected layer of the initial convolutional neural network to obtain the integrated feature map output by the second convolutional layer or the first fully connected layer; Flatten the integrated feature map into a one-dimensional vector, and input the one-dimensional vector into the target fully connected layer of the initial convolutional neural network to obtain the initial detection result output by the target fully connected layer; Input the initial detection result and the historical labels into the output layer of the initial convolutional neural network to obtain the target error between the initial detection result calculated by the output layer and the historical labels; Based on the target error, train the initial convolutional neural network through the backpropagation algorithm.
[0009] According to a safety detection method for a power wireless sensor network provided by the present invention, the parameters in the initial safety detection model are optimized and adjusted by using a chaotic Levy flying osprey optimization algorithm to obtain the safety detection model corresponding to the initial safety detection model, including: For each osprey in the chaotic Levy flying osprey optimization algorithm, iteratively updating the position corresponding to the osprey, and determining the target position of the osprey in each iteration round; When the iteration termination condition is reached, the parameters in the initial safety detection model are optimized based on the position parameters of the target position corresponding to the osprey with the smallest fitness value in the last iteration round to obtain the safety detection model corresponding to the initial safety detection model; the fitness value is determined based on the detection accuracy and recall rate corresponding to the initial safety detection model.
[0010] According to a safety detection method for a power wireless sensor network provided by the present invention, the iterative updating of the position corresponding to the osprey to determine the target position of the osprey in each iteration round includes: In each iteration round, for each osprey, a first position of the osprey after the hunting stage is determined based on the target position of the osprey in the previous iteration round; and a position with a smaller corresponding fitness value between the first position and the target position of the previous iteration round is determined as the first target position; Determine a second position of the osprey after the prey movement stage based on the first target position of the osprey; determine the position with a smaller corresponding fitness value between the second position and the first target position as the target position of the osprey in the current iteration round; The target position of the osprey in the initial iteration round is an initial position predetermined based on the Tent chaotic mapping method.
[0011] According to a safety detection method for a power wireless sensor network provided by the present invention, the first position of the osprey after the hunting stage is determined based on the target position of the osprey in the previous iteration round, including: in, Indicates the calculation of intermediate values. Indicates Osprey No. The first position of the dimension, Indicates the preset flight step length. Indicates Osprey No. The dimension is the target position of the previous iteration round, Representation interval The random numbers in Indicates an osprey The Position of the prey selected in the dimension, Indicates a set Random number in; Indicates the current iteration round; Indicates the Lower bound of the dimension, Indicates the Upper bound of the dimension; Determining the second position of the osprey after the prey movement stage based on the first target position of the osprey includes: Among them, Indicates calculating an intermediate value, Indicates the osprey The Second position of the dimension, Indicates the osprey The First target position of the dimension.
[0012] According to a security detection method for a power wireless sensor network provided by the present invention, preprocessing the initial historical intrusion data to obtain the historical intrusion data corresponding to the initial historical intrusion data includes: Filling in the missing values in the initial historical intrusion data, and removing the duplicate values and outliers in the initial historical intrusion data to obtain the first intrusion data corresponding to the initial historical intrusion data; Performing data standardization processing on the first intrusion data to obtain the second intrusion data after standardization; Performing normalization processing on the second intrusion data to obtain the normalized historical intrusion data.
[0013] The present invention also provides a security detection device for a power wireless sensor network, including the following modules: An acquisition module for acquiring network intrusion data in the power wireless sensor network; A detection module for inputting the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the security detection method of the power wireless sensor network as described in any one of the above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the security detection method of the power wireless sensor network as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the security detection method of the power wireless sensor network as described in any one of the above is implemented.
[0017] The security detection method, device, equipment, and medium of the power wireless sensor network provided by the present invention obtain network intrusion data in the power wireless sensor network; input the network intrusion data into a security detection model to obtain a security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data. The technical solution of the present invention performs security detection on intrusion data through a pre-trained security detection model, improves the accuracy and precision of security detection, and thus can better protect the data security of the power wireless sensor network. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is a schematic flowchart of the security detection method of the power wireless sensor network provided by the present invention.
[0020] Figure 2 It is a schematic flowchart of the training process of the security detection model provided by the present invention.
[0021] Figure 3 It is a schematic diagram of the experimental data of the security detection model provided by the present invention.
[0022] Figure 4 It is a schematic structural diagram of the security detection device of the power wireless sensor network provided by the present invention.
[0023] Figure 5 It is a schematic structural diagram of the electronic device provided by the present invention. Detailed implementation manners
[0024] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0025] In view of the above problems in the prior art, the present invention provides a security detection method for a power wireless sensor network. Figure 1 It is a schematic flowchart of the security detection method for a power wireless sensor network provided by the present invention. As Figure 1 shown, the method includes the following steps 110 and 120.
[0026] Step 110: Obtain network intrusion data in the power wireless sensor network.
[0027] Specifically, the network intrusion data in the power wireless sensor network can be obtained from the environmental parameters and network communication data collected by each wireless sensor node in the power wireless sensor network. The network intrusion data can be in various forms. For example, the network intrusion data can be energy production information, energy equipment information, user information, log records, etc. The network intrusion data can be a single piece of data or a data set aggregated from multiple pieces of data. The present invention embodiment does not make specific limitations on the content and form of the network intrusion data.
[0028] Step 120: Input the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
[0029] Specifically, the security detection model can be constructed based on a convolutional neural network (CNN). CNN can automatically learn and extract complex data features, improve the recognition accuracy of the security detection model for network intrusion data, and thus improve the correct rate of detecting network intrusion data. The security monitoring result of the power wireless sensor network output by the security detection model can accurately reflect whether the data of the power wireless sensor network is secure.
[0030] The security detection method for the power wireless sensor network provided by the present invention acquires network intrusion data in the power wireless sensor network; inputs the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data. The technical solution of the present invention performs security detection on intrusion data through a pre-trained security detection model, improving the accuracy and precision of security detection, and thus being able to better protect the data security of the power wireless sensor network.
[0031] Figure 2 is a schematic diagram of the training process of the security detection model provided by the present invention. As Figure 2 shown, in one embodiment, the security detection model is trained through the following steps: Step 210: Acquire the initial historical intrusion data corresponding to the power wireless sensor network, and preprocess the initial historical intrusion data to obtain the historical intrusion data corresponding to the initial historical intrusion data.
[0032] Specifically, the initial historical intrusion data corresponding to the power wireless sensor network can be acquired from sources such as network traffic, system logs, and application logs, and the initial historical intrusion data is preprocessed to obtain the historical intrusion data corresponding to the initial historical intrusion data. Among them, the preprocessing of the initial historical intrusion data can include removing noise and irrelevant data, handling missing values and outliers. The historical intrusion data can also be labeled to obtain historical labels corresponding to the historical intrusion data.
[0033] In one embodiment, the preprocessing of the initial historical intrusion data to obtain the historical intrusion data corresponding to the initial historical intrusion data includes: Filling the missing values in the initial historical intrusion data, and removing duplicate values and outliers in the initial historical intrusion data to obtain the first intrusion data corresponding to the initial historical intrusion data; Performing data standardization processing on the first intrusion data to obtain the second intrusion data after standardization; Performing normalization processing on the second intrusion data to obtain the normalized historical intrusion data.
[0034] Specifically, the records with missing values in the initial historical intrusion data can be deleted, and one of the average value, median, and mode corresponding to the initial historical intrusion data can be used to fill the missing values in the initial historical intrusion data. The interpolation method or prediction method can also be used to fill the missing values in the initial historical intrusion data. After filling the missing values, duplicate values and outliers in the initial historical intrusion data can be removed to obtain the first intrusion data corresponding to the initial historical intrusion data.
[0035] Further, the first intrusion data can be subjected to data standardization processing to obtain the second intrusion data after standardization. Furthermore, the second intrusion data can be normalized to obtain the historical intrusion data after normalization. This normalization process can, for example, normalize the second intrusion data to the interval [0, 1].
[0036] In the above embodiments, the preprocessing methods of filling in missing values, removing duplicate values and outliers make the initial historical intrusion data more perfect. The standardization processing can avoid the dependence of data on the selection of measurement units and eliminate the negative impact caused by the differences in attribute measurements. The normalization processing further improves the consistency of the data, improves the storage efficiency, and improves the stability during the process of training the model.
[0037] Step 220: Input the historical intrusion data and the historical labels into the initial convolutional neural network, and train the initial convolutional neural network through the backpropagation algorithm to obtain the initial security detection model corresponding to the initial convolutional neural network.
[0038] Specifically, the network architecture of the initial convolutional neural network can be determined in advance, and the initial convolutional neural network can be built. Further, the historical intrusion data and the historical labels can be input into the initial convolutional neural network, and the initial convolutional neural network can be trained through the backpropagation algorithm (Backpropagation Algorithm) to obtain the initial security detection model corresponding to the initial convolutional neural network. The backpropagation algorithm is a common algorithm used to train artificial neural networks. It updates the weights by calculating the gradient of the loss function with respect to the weights of each neuron, so as to minimize the loss function.
[0039] In one embodiment, the inputting the historical intrusion data and the historical labels into the initial convolutional neural network and training the initial convolutional neural network through the backpropagation algorithm includes: Input the historical intrusion data into the first convolutional layer of the initial convolutional neural network to obtain the intrusion data feature map output by the first convolutional layer; the first convolutional layer is used to extract the local features of the historical intrusion data, and calculate the output of each convolutional kernel based on the local features, apply an activation function and introduce nonlinearity to generate the intrusion data feature map; Input the intrusion data feature map into the pooling layer of the initial convolutional neural network to obtain the pooling feature map output by the pooling layer; the pooling layer is used to perform a pooling operation on the intrusion data feature map to generate the pooling feature map; Input the pooling feature map into the second convolutional layer or the first fully connected layer of the initial convolutional neural network to obtain the integrated feature map output by the second convolutional layer or the first fully connected layer; Flatten the integrated feature map into a one-dimensional vector, and input the one-dimensional vector into the target fully-connected layer of the initial convolutional neural network to obtain the initial detection result output by the target fully-connected layer; Input the initial detection result and the historical label into the output layer of the initial convolutional neural network to obtain the target error between the initial detection result calculated by the output layer and the historical label; Train the initial convolutional neural network by the backpropagation algorithm based on the target error.
[0040] Specifically, historical intrusion data can be input into the first convolutional layer of the initial convolutional neural network. The first convolutional layer can perform a convolution operation on the historical intrusion data using a convolution kernel to extract local features of the historical intrusion data. Both the convolution kernel and the convolutional layer are core components of the convolutional neural network (CNN). Among them, the convolution kernel is a learnable weight matrix used to extract local features from the input data. After extracting the local features of the historical intrusion data, the convolutional layer can apply an activation function to the local features and introduce non-linearity to generate an intrusion data feature map, and transfer the intrusion data feature map to the pooling layer. The pooling layer can perform a pooling operation on the intrusion data feature map. The pooling layer can also perform downsampling on the result after the pooling operation to reduce the size of the feature map and retain the main features of the feature map, generating a pooled feature map. The layer next to the pooling layer in the initial convolutional neural network can be the second convolutional layer or a fully-connected layer, and the embodiments of the present invention do not make specific limitations here. The second convolutional layer or the first fully-connected layer can integrate the pooled feature map and output the integrated integrated feature map.
[0041] Furthermore, the integrated feature map can be flattened into a one-dimensional vector, and the one-dimensional vector is input into the target fully-connected layer of the initial convolutional neural network. The target fully-connected layer can calculate and output and apply an activation function to generate an initial detection result. It is easy to understand that the target fully-connected layer is all the fully-connected layers in the initial convolutional neural network except the first fully-connected layer (the initial convolutional neural network may not include the first fully-connected layer either). The target fully-connected layer can be a single fully-connected layer or include multiple fully-connected layers. After obtaining the initial detection result, the initial detection result and the historical label can be input into the output layer of the initial convolutional neural network, and the output layer can calculate the target error between the initial detection result and the historical label. Thus, based on the target error, the initial convolutional neural network can be trained by the backpropagation algorithm to obtain an initial security detection model.
[0042] In the above embodiment, an initial security detection model is obtained by initially training the initial convolutional neural network based on the backpropagation algorithm. This initial security detection model can already perform relatively accurate security detection.
[0043] Step 230: Optimize and adjust the parameters in the initial security detection model through the chaotic Lévy flight osprey optimization algorithm to obtain the security detection model corresponding to the initial security detection model.
[0044] Specifically, the parameters of the chaotic Lévy flight osprey optimization algorithm can be initialized. These parameters can include the scale of the osprey population, the maximum number of iterations, and the problem dimension corresponding to the osprey, etc. When initializing the osprey population, each osprey in the space needs to be encoded and the initial loss function in the initial convolutional neural network is determined as the initial fitness value in the osprey population. Then, the parameters in the initial security detection model can be optimized and adjusted through the chaotic Lévy flight osprey optimization algorithm to obtain the security detection model corresponding to the initial security detection model. For example, can be used to represent the osprey numbered Each osprey includes dimensions, which is also the number of problem variables. The osprey population can be represented as a matrix where , represents the total number of ospreys in the osprey population.
[0045] In one embodiment, the step of optimizing and adjusting the parameters in the initial security detection model through the chaotic Lévy flight osprey optimization algorithm to obtain the security detection model corresponding to the initial security detection model includes: For each osprey in the chaotic Lévy flight osprey optimization algorithm, iteratively update the position corresponding to the osprey to determine the target position of the osprey in each iteration round; When the iteration termination condition is reached, optimize the parameters in the initial security detection model based on the position parameters of the target position corresponding to the osprey with the minimum fitness value in the last iteration round to obtain the security detection model corresponding to the initial security detection model; the fitness value is determined based on the detection accuracy rate and recall rate corresponding to the initial security detection model.
[0046] Specifically, the osprey population in the chaotic Lévy flight osprey optimization algorithm is pre-initialized. For example, the osprey population can include 30 ospreys. For each osprey in the osprey population, the position of the osprey can be updated in each iteration round to determine the target position of the osprey in each iteration round. When the iteration termination condition is reached, the fitness values of each osprey in the last iteration round can be compared, and the parameters in the initial safety detection model can be optimized based on the position parameters of the target position corresponding to the osprey with the smallest fitness value. Among them, the iteration termination condition can be reaching the maximum number of iteration rounds. For example, the maximum number of iteration rounds can be 200. The iteration termination condition can also be that the smallest fitness value in a certain iteration round has satisfied the preset value. The fitness value corresponding to the target position of the osprey can be determined by the following formula: Among them, represents the fitness value corresponding to the target position of the osprey , represents the detection accuracy rate corresponding to the initial safety detection model optimized according to the position parameters corresponding to the target position of the osprey , represents the harmonic mean of the detection accuracy rate and the recall rate.
[0047] In the above embodiment, the chaotic Lévy flight osprey optimization algorithm adopted has the advantages of strong global search ability, fast convergence speed, few parameters and easy implementation, and further improves the detection accuracy of the initial safety detection model.
[0048] In one embodiment, the iterative update of the position corresponding to the osprey to determine the target position of the osprey in each iteration round includes: In each iteration round, for each of the ospreys, based on the target position of the osprey in the previous iteration round, determine the first position of the osprey after the hunting stage; determine the position with the smaller corresponding fitness value among the first position and the target position in the previous iteration round as the first target position; Based on the first target position of the osprey, determine the second position of the osprey after the prey movement stage; determine the position with the smaller corresponding fitness value among the second position and the first target position as the target position of the osprey in the current iteration round; Among them, the target position of the osprey in the initial iteration round is the initial position pre-determined based on the Tent chaotic mapping method.
[0049] Specifically, in each iteration round, each osprey needs to go through two update processes: the hunting phase and the prey movement phase. In each iteration round, for each osprey, the first position of the osprey after the hunting phase can be determined based on the target position of the osprey in the previous iteration round. Then, the fitness values corresponding to the first position and the target position of the previous iteration round can be compared. If the fitness value decreases, it is updated, otherwise it is not updated. Finally, the position with the smaller fitness value is determined as the first target position. This process can be expressed by the following formula: in, Indicates that in the iteration round Chinese Osprey The first target position, Indicates Osprey The first position, Indicates Osprey The fitness value corresponding to the first position of Indicates Osprey At the target position of the previous iteration, Indicates Osprey The fitness value corresponding to the target position in the previous iteration round.
[0050] Furthermore, the second position of the osprey after the prey movement stage can be determined based on the first target position of the osprey. Then, the fitness values corresponding to the second position and the first target position can be compared. If the fitness value decreases, it is updated, otherwise it is not updated. Finally, the position with the smaller fitness value is determined as the target position of the osprey in the current iteration round. This process can be expressed by the following formula: in, Indicates that in the iteration round Chinese Osprey The target location, Indicates Osprey The second position, Indicates Osprey The fitness value corresponding to the second position of Indicates Osprey In the iteration round Osprey The fitness value corresponding to the first target position.
[0051] It should be noted that in the initial iteration round, since there is no "previous iteration round", the corresponding "target position of the previous iteration round" in the initial iteration round is the initial position predetermined based on the Tent chaotic mapping method. The initial position can be expressed by the following formula: Among them, represents the position of the osprey in the osprey population at the cycle round, represents the position of the osprey in the osprey population at the cycle round, and
[0052] represents the chaotic parameter that controls the segmentation rule of the Tent chaotic map. It should be noted that the cycle round is the cycle round in the process of determining the initial position, and this cycle round is a completely different concept from the iteration round in the iterative training process of the chaotic Lévy flight osprey optimization algorithm.
[0053] In one embodiment, determining the first position of the osprey after the hunting stage based on the target position of the osprey in the previous iteration round includes: Among them, represents the calculated intermediate value, represents the osprey at the first position of the dimension, represents the preset flight step length, represents the osprey at the target position of the dimension in the previous iteration round, represents the random number in the interval represents the osprey at the position of the prey selected by the dimension, represents the random number in the set represents the current iteration round; represents the lower bound of the dimension, represents the upper bound of the Among them, represents the calculated intermediate value, represents the osprey the second position of the dimension of the osprey, the first target position of the
[0054] Specifically, for each osprey in the osprey population, the positions of other ospreys with better objective function values (fitness values) in the search space are regarded as underwater fish. An osprey randomly detects the position of one of the fish and attacks it. Before calculating the first position of the osprey after the hunting stage, it is also necessary to determine the position of the fish corresponding to each osprey. The set of positions of the fish corresponding to the osprey can be represented by the following formula: can be represented by the following formula: Among them, represents the osprey , represents the osprey the fitness value corresponding to the position of, represents the best candidate solution.
[0055] It is easy to understand that represents the osprey the first position of the dimension. Based on the first position of the osprey in all dimensions, the first position of the osprey can be obtained. represents the osprey the second position of the dimension. Based on the second position of the osprey in all dimensions, the second position of the osprey can be obtained.
[0056] In the above embodiment, the Levy flight strategy is introduced. That is, in the calculation process of the position changed by each osprey during the hunting stage and the prey movement stage, a random number in the Levy strategy is introduced as the step factor, which increases the performance of the algorithm in the search space, avoids falling into the local optimal solution, and improves the convergence speed of the algorithm.
[0057] Optionally, after training the security detection model, the security detection model can also be tested to determine whether its model detection accuracy is better than that of the traditional model. Figure 3It is a schematic diagram of experimental data of the security detection model provided by the present invention. As Figure 3 shown, the abscissa is the number of iteration rounds, and the ordinate is the model detection accuracy. 10% of the data in the KDD99 dataset is used to test the security detection model. From Figure 3 it can be seen that the detection accuracy of the security detection model after fine-tuning and optimizing the parameters by using the chaotic Lévy flight osprey optimization algorithm provided by the present invention is significantly higher than that of ordinary CNNs, indicating that the performance and detection accuracy of the model are significantly enhanced.
[0058] Next, the security detection device for the power wireless sensor network provided by the present invention will be described. The security detection device for the power wireless sensor network described below can be mutually referred to corresponding to the security detection method for the power wireless sensor network described above.
[0059] Figure 4 It is a schematic structural diagram of the security detection device for the power wireless sensor network provided by the present invention. As Figure 4 shown, the security detection device 400 for the power wireless sensor network includes the following modules: An acquisition module 410, configured to acquire network intrusion data in the power wireless sensor network; A detection module 420, configured to input the network intrusion data into a security detection model to obtain a security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
[0060] In one embodiment, the security detection device for the power wireless sensor network further includes a model training module, and the model training module is specifically configured to: Acquire initial historical intrusion data corresponding to the power wireless sensor network, and perform preprocessing on the initial historical intrusion data to obtain the historical intrusion data corresponding to the initial historical intrusion data; Input the historical intrusion data and the historical labels into an initial convolutional neural network, and train the initial convolutional neural network through a backpropagation algorithm to obtain an initial security detection model corresponding to the initial convolutional neural network; Optimize and adjust parameters in the initial security detection model through a chaotic Lévy flight osprey optimization algorithm to obtain the security detection model corresponding to the initial security detection model.
[0061] In one embodiment, the model training module is specifically further configured to: Input the historical intrusion data into the first convolutional layer of the initial convolutional neural network to obtain the intrusion data feature map output by the first convolutional layer; the first convolutional layer is used to extract the local features of the historical intrusion data, calculate the output of each convolutional kernel based on the local features, apply an activation function and introduce non-linearity to generate the intrusion data feature map; Input the intrusion data feature map into the pooling layer of the initial convolutional neural network to obtain the pooled feature map output by the pooling layer; the pooling layer is used to perform a pooling operation on the intrusion data feature map to generate the pooled feature map; Input the pooled feature map into the second convolutional layer or the first fully connected layer of the initial convolutional neural network to obtain the integrated feature map output by the second convolutional layer or the first fully connected layer; Flatten the integrated feature map into a one-dimensional vector, and input the one-dimensional vector into the target fully connected layer of the initial convolutional neural network to obtain the initial detection result output by the target fully connected layer; Input the initial detection result and the historical label into the output layer of the initial convolutional neural network to obtain the target error between the initial detection result calculated by the output layer and the historical label; Train the initial convolutional neural network through the backpropagation algorithm based on the target error.
[0062] In one embodiment, the model training module is further specifically configured to: For each osprey in the chaotic Lévy flight osprey optimization algorithm, iteratively update the position corresponding to the osprey to determine the target position of the osprey in each iteration round; When the iteration termination condition is reached, optimize the parameters in the initial security detection model based on the position parameters of the osprey corresponding to the minimum fitness value in the last iteration round to obtain the security detection model corresponding to the initial security detection model; the fitness value is determined based on the detection accuracy rate and recall rate corresponding to the initial security detection model.
[0063] In one embodiment, the model training module is further specifically configured to: In each iteration round, for each osprey, determine the first position of the osprey after the hunting stage based on the target position of the osprey in the previous iteration round; determine the position with the smaller corresponding fitness value among the first position and the target position in the previous iteration round as the first target position; Determine the second position of the osprey after the prey movement stage based on the first target position of the osprey; determine the position with the smaller corresponding fitness value among the second position and the first target position as the target position of the osprey in the current iteration round; Among them, the target position of the osprey in the initial iteration round is the initial position determined in advance based on the Tent chaos mapping method.
[0064] In one embodiment, the model training module is further specifically configured to: Among them, represents the calculated intermediate value, represents the osprey the first position of the dimension, represents the preset flight step size, represents the osprey the target position of the in the previous iteration round of the dimension, represents the osprey the position of the prey selected by the dimension, random number in the set; represents the current iteration round; represents the lower bound of the dimension, upper bound of the In one embodiment, the model training module is further specifically configured to: Among them, represents the calculated intermediate value, represents the osprey the second position of the dimension, represents the osprey first target position of the
[0065] In one embodiment, the model training module is further specifically configured to: Fill in the missing values in the initial historical intrusion data, and remove the duplicate values and outliers in the initial historical intrusion data to obtain the first intrusion data corresponding to the initial historical intrusion data; Perform data standardization processing on the first intrusion data to obtain the second intrusion data after standardization; Perform normalization processing on the second intrusion data to obtain the normalized historical intrusion data.
[0066] The security detection device of the power wireless sensor network provided by the present invention acquires network intrusion data in the power wireless sensor network; inputs the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data. The technical solution of the present invention performs security detection on intrusion data through a pre-trained security detection model, improving the accuracy and precision of security detection, and thus being able to better protect the data security of the power wireless sensor network.
[0067] Figure 5 An example of the physical structure diagram of an electronic device is shown as Figure 5 shown. The electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 complete mutual communication through the communication bus 540. The processor 510 can call logic instructions in the memory 530 to execute the security detection method of the power wireless sensor network, and this method includes: Acquire network intrusion data in the power wireless sensor network; Input the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
[0068] In addition, when the logic instructions in the above-mentioned memory 530 can be implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs and other various media that can store program codes.
[0069] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the security detection method of the power wireless sensor network provided by each of the above methods. The method includes: Obtain network intrusion data in the power wireless sensor network; Input the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model. The security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
[0070] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it realizes the security detection method of the power wireless sensor network provided by each of the above methods. The method includes: Obtain network intrusion data in the power wireless sensor network; Input the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model. The security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
[0071] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0072] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solutions, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A security detection method for a power wireless sensor network, characterized in that Including: Obtain network intrusion data in the power wireless sensor network; Input the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
2. The security detection method for the power wireless sensor network according to claim 1, characterized in that, The security detection model is trained through the following steps: Obtain the initial historical intrusion data corresponding to the power wireless sensor network, and preprocess the initial historical intrusion data to obtain the historical intrusion data corresponding to the initial historical intrusion data; Input the historical intrusion data and the historical labels into an initial convolutional neural network, and train the initial convolutional neural network through the backpropagation algorithm to obtain an initial security detection model corresponding to the initial convolutional neural network; Optimize and adjust the parameters in the initial security detection model through the chaotic Lévy flight osprey optimization algorithm to obtain the security detection model corresponding to the initial security detection model.
3. The security detection method of the power wireless sensor network according to claim 2, wherein The step of inputting the historical intrusion data and the historical labels into the initial convolutional neural network and training the initial convolutional neural network through the backpropagation algorithm includes: Input the historical intrusion data into the first convolutional layer of the initial convolutional neural network to obtain an intrusion data feature map output by the first convolutional layer; the first convolutional layer is used to extract local features of the historical intrusion data, and calculate the output of each convolutional kernel based on the local features, apply an activation function and introduce non-linearity to generate the intrusion data feature map; Input the intrusion data feature map into the pooling layer of the initial convolutional neural network to obtain a pooled feature map output by the pooling layer; the pooling layer is used to perform a pooling operation on the intrusion data feature map to generate the pooled feature map; Input the pooled feature map into the second convolutional layer or the first fully connected layer of the initial convolutional neural network to obtain an integrated feature map output by the second convolutional layer or the first fully connected layer; Flatten the integrated feature map into a one-dimensional vector, and input the one-dimensional vector into the target fully connected layer of the initial convolutional neural network to obtain an initial detection result output by the target fully connected layer; Input the initial detection result and the historical label into the output layer of the initial convolutional neural network to obtain a target error between the initial detection result calculated by the output layer and the historical label; Based on the target error, train the initial convolutional neural network through the backpropagation algorithm.
4. The security detection method of the power wireless sensor network according to claim 2, characterized in that The step of optimizing and adjusting the parameters in the initial security detection model through the chaotic Lévy flight osprey optimization algorithm to obtain the security detection model corresponding to the initial security detection model includes: For each osprey in the chaotic Lévy flight osprey optimization algorithm, iteratively update the position corresponding to the osprey to determine the target position of the osprey in each iteration round; When the iteration termination condition is reached, optimize the parameters in the initial security detection model based on the position parameters of the osprey corresponding to the minimum fitness value in the last iteration round to obtain the security detection model corresponding to the initial security detection model; the fitness value is determined based on the detection accuracy and recall rate corresponding to the initial security detection model.
5. The security detection method of the power wireless sensor network according to claim 4, wherein The iterative update of the position corresponding to the osprey to determine the target position of the osprey in each iteration round includes: In each iteration round, for each osprey, determine the first position of the osprey after the hunting stage based on the target position of the osprey in the previous iteration round; determine the position with the smaller corresponding fitness value among the first position and the target position in the previous iteration round as the first target position; Determine the second position of the osprey after the prey movement stage based on the first target position of the osprey; determine the position with the smaller corresponding fitness value among the second position and the first target position as the target position of the osprey in the current iteration round; Among them, the target position of the osprey in the initial iteration round is the initial position determined in advance based on the Tent chaotic mapping method.
6. The security detection method for the power wireless sensor network according to claim 5, characterized in that, The determining of the first position of the osprey after the hunting stage based on the target position of the osprey in the previous iteration round includes: Among them, represents the calculated intermediate value, represents the osprey at the first position of the th dimension, represents the preset flight step length, represents the osprey at the target position of the th dimension in the previous iteration round, represents the interval in the random number, represents the osprey at the position of the prey selected in the th dimension, represents the set in the random number; represents the current iteration round; represents the lower bound of the th dimension, represents the upper bound of the th dimension; The determining of the second position of the osprey after the prey movement stage based on the first target position of the osprey includes: Among them, represents the calculated intermediate value, represents the osprey, the second position of the osprey's the first target position of the 7. The security detection method of the power wireless sensor network according to any one of claims 2 to 6, characterized in that The preprocessing of the initial historical intrusion data to obtain the historical intrusion data corresponding to the initial historical intrusion data includes: Fill in the missing values in the initial historical intrusion data, and remove the duplicate values and outliers in the initial historical intrusion data to obtain the first intrusion data corresponding to the initial historical intrusion data; Perform data standardization processing on the first intrusion data to obtain the second intrusion data after standardization; Perform normalization processing on the second intrusion data to obtain the normalized historical intrusion data.
8. A security detection device for a power wireless sensor network, characterized in that, It includes: An acquisition module, configured to acquire network intrusion data in a power wireless sensor network; A detection module, configured to input the network intrusion data into a security detection model to obtain the security monitoring result of the power wireless sensor network output by the security detection model; the security detection model is trained based on historical intrusion data and historical labels corresponding to the historical intrusion data.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the security detection method of the power wireless sensor network according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the security detection method of the power wireless sensor network according to any one of claims 1 to 7.