A method for detecting and locating abnormal nodes in wireless sensor networks
By building a graph signal model and using graph high-pass filters, combined with historical and current data analysis, the accuracy and efficiency of abnormal node detection and positioning in wireless sensor networks are solved, and efficient abnormal node detection and positioning are achieved.
Patent Information
- Application Number
- CN202111232474.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-10-22
AI Technical Summary
The existing wireless sensor network abnormal node detection methods are difficult to accurately detect and locate abnormal nodes, and are computationally efficient, especially when a large amount of data is required.
By constructing a graph signal model, using Euclidean distance and graph high-pass filters to detect and locate abnormal nodes, combined with the analysis of historical data and current data, the detection accuracy and computing efficiency are improved.
It realizes efficient detection of abnormal nodes and accurately determines their locations in wireless sensor networks, improves computing efficiency, avoids the calculation overhead of graph Fourier transform and inverse transform, and enhances the accuracy of detection results.
Smart Images

Figure CN114205766B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a wireless sensor network technology, and in particular to a method for detecting and locating abnormal nodes in a wireless sensor network, which detects and locates abnormal nodes by analyzing historical data and current data. Background Art
[0002] Wireless sensor networks are distributed sensor networks composed of a large number of static or dynamic sensor nodes in a self-organizing and multi-hop manner, and the sensor nodes can communicate with each other. With the development of wireless communication and electronic technology, sensor nodes with small size, low cost and low power consumption have been widely used in many important fields such as environmental monitoring, target tracking and military battlefield monitoring. However, sensor nodes have low security, limited energy storage, complex detection environment and no one to take care of them. As a result, sensor nodes often have abnormal conditions due to their own factors such as poor quality and low security or external factors such as complex deployment environment. Sensor nodes with abnormal conditions are called abnormal nodes. Abnormal nodes will affect the authenticity and stability of the data collected by them and generate abnormal data. If the abnormal data is not distinguished during the data analysis process, it may lead to wrong decisions. This requires the detection of abnormal nodes, but it is very difficult to detect abnormal nodes directly. Abnormal nodes can be detected by analyzing the data collected by sensor nodes.
[0003] At present, there are many types of methods for detecting abnormal nodes by analyzing the data collected by sensor nodes. For example, the statistical method was proposed earlier. This method has a high detection rate, but it requires corresponding prior knowledge to establish a statistical probability model. However, in many practical situations, the prior knowledge of the distribution of sensor nodes is difficult to obtain. Another example: the classification-based abnormal sensor node detection algorithm mainly finds the similarity between sensor nodes through the distance between sensor nodes, and classifies the sensor nodes according to the similarity to find abnormal nodes. The advantage of this method is that it does not require a statistical probability model. Another example: In 2014, Sandryhaila and Moura proposed a graph frequency domain method in the document Discrete Signal Processing on Graphs: Frequency Analysis. The graph high-pass filter extracts high-frequency components to detect abnormal nodes. This method first passes the collected data through a high-pass filter to obtain filtered data, and then judges whether the wireless sensor network is abnormal based on the graph frequency of the filtered data. However, this method can only detect whether the wireless sensor network contains abnormal nodes, but cannot detect the location of the abnormal nodes. For example: In 2018, Jiang Junzheng, Yang Jie, et al. published an article in the Journal of Electronics and Information Technology titled "A New Algorithm for Abnormal Node Detection and Positioning in Wireless Sensor Networks". A method based on local subgraph processing and node domain-graph frequency domain joint analysis was proposed. The graph model was divided into multiple subgraphs, and then through high-pass filters, graph Fourier transforms, and graph inverse Fourier transforms, suspected abnormal nodes were identified, and the suspected abnormal nodes were matched with the subgraphs to finally obtain the location of the abnormal nodes. This method can detect and locate, but the graph Fourier transform and graph inverse Fourier transform operations used greatly reduce the computational efficiency. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method for detecting and locating abnormal nodes in a wireless sensor network, which can detect whether there are abnormal nodes and can further accurately determine the location of the abnormal nodes, and has high calculation efficiency.
[0005] The technical solution adopted by the present invention to solve the above technical problems is: a method for detecting and locating abnormal nodes in a wireless sensor network, characterized by comprising the following steps:
[0006] Step 1: define the wireless sensor network to be detected and located as the current wireless sensor network, and assume that the current wireless sensor network has N sensor nodes; where N ≥ 6;
[0007] Step 2: For any sensor node in the current wireless sensor network, take it as the current sensor node, first calculate the Euclidean distance between the current sensor node and each sensor node except itself, then sort the N-1 Euclidean distances related to the current sensor node from small to large, find the K sensor nodes corresponding to the first K Euclidean distances, and then connect an edge between the current sensor node and each found sensor node; where the value of K is in the interval [5,10], K<N;
[0008] Step 3: Construct the graph signal model of the current wireless sensor network, which is described as: G = (V, E, W); where G represents the graph signal model of the current wireless sensor network, V represents a row vector of dimension 1×N composed of N sensor nodes, and V = [v1, v2, …v n ,…,v N ],v1,v2,…v n ,…,v N Correspondingly represents the first sensor node, the second sensor node, ..., the nth sensor node, ..., the Nth sensor node, 1≤n≤N, E is a matrix with a dimension of N×N, e 1,1 、e 1,j 、e 1,N 、e i,1 、e i,j 、e i,N 、e N,1 、e N,j 、e N,N Correspondingly represents the element in the 1st row and 1st column of E, the element in the 1st row and jth column of E, the element in the 1st row and Nth column of E, the element in the ith row and 1st column of E, the element in the ith row and jth column of E, the element in the ith row and Nth column of E, the element in the Nth row and 1st column of E, the element in the Nth row and jth column of E, the element in the Nth row and Nth column of E, e i,j The value of is 0 or 1. When there is no edge between the i-th sensor node and the j-th sensor node, let e i,j = 0, when there is an edge between the i-th sensor node and the j-th sensor node, let e i,j =1, 1≤i≤N, 1≤j≤N, W is a weight matrix with dimension N×N, w 1,1 、w 1,j 、w 1,N 、w i,1 、w i,j 、w i,N 、w N,1 、w N,j 、w N,NCorrespondingly represent the element in the 1st row and 1st column of W, the element in the 1st row and jth column of W, the element in the 1st row and Nth column of W, the element in the ith row and 1st column of W, the element in the ith row and jth column of W, the element in the ith row and Nth column of W, the element in the Nth row and 1st column of W, the element in the Nth row and jth column of W, and the element in the Nth row and Nth column of W. When i=j, let w i,j =0, when i≠j, let When there is no edge between the i-th sensor node and the j-th sensor node, a i,j The value of is 0, when there is an edge between the i-th sensor node and the j-th sensor node i,j The value of dist is 1. i,j represents the Euclidean distance between the i-th sensor node and the j-th sensor node. When i≠j and there is an edge between the i-th sensor node and the j-th sensor node, w i,j represents the weight between the i-th sensor node and the j-th sensor node;
[0009] Then, the network topology of the graph signal model of the current wireless sensor network is obtained and represented by a graph Laplacian matrix L with a dimension of N×N, where L=DW; wherein D represents a degree matrix with a dimension of N×N, d 1,1 is the element in the first row and first column of D, which is also the first element on the main diagonal of D. i,i is the element in the i-th row and i-th column of D, which is also the i-th element on the main diagonal of D. N,N is the element in the Nth row and Nth column of D, which is also the Nth element on the main diagonal of D.
[0010] Step 4: Make each sensor node in the current wireless sensor network collect data at T moments; then obtain the graph signal matrix of the graph signal model of the current wireless sensor network, denoted as F, F = [f1,…,f t ,…f T-1 ,f T ]; where T represents the total number of times each sensor node collects data, T ≥ 5, the dimension of F is N × T, f1, f t 、f T-1 、f T The dimension is N×1, f1 represents the column vector composed of the data collected by all sensor nodes at the first moment, and f t represents the column vector consisting of the data collected by all sensor nodes at the tth moment, f t (1) represents the data collected by the first sensor node at time t, f t (i) represents the data collected by the i-th sensor node at the t-th time, ft (N) represents the data collected by the Nth sensor node at the tth time, f T-1 represents the column vector composed of the data collected by all sensor nodes at the T-1th time, f T Represents the column vector composed of the data collected by all sensor nodes at the Tth time, 1≤t≤T;
[0011] Step 5: Pass F through a graph high-pass filter H with dimension N×N, and record the output signal after filtering as in, The dimension is N×T;
[0012] Step 6: Randomly select a moment from T moments as the current moment, and set the current moment as the gth moment; then define the data collected by all sensor nodes at the current moment as the current data, and define the data collected by all sensor nodes from the gmth moment to the g-1th moment as the historical data; then calculate the maximum residual of the current data, recorded as θ, And calculate the average residual of historical data, recorded as Among them, 5<g≤T, m is 4 or 5, and the symbol “|||| ∞ ” is the symbol of infinite norm, express The g-th column vector in , 1≤k≤m, express The gk-th column vector in , 1≤i≤m, 1≤j≤m, i≠j, express The gi-th column vector in , express The gj-th column vector in , The dimension is N×1;
[0013] Step 7: Judgement Is it true? If so, it is determined that there are abnormal nodes in the current wireless sensor network at the current moment, and then step 8 is executed; if not, it is determined that there are no abnormal nodes in the current wireless sensor network at the current moment; where γ is the weighting coefficient, γ∈[1.2,1.8];
[0014] Step 8: Calculation Sort the N values in z from large to small, and record the column vector obtained after sorting as Then from Find the change point among the N values in and record the change point as b * , Then The first value to the bth value in * The value of b * The sensor nodes are determined as abnormal nodes to realize abnormal node location; where z is the introduced intermediate variable, z and The dimensions of b are all N×1, * ∈[1,N], Indicates that The value of b when the value is the largest, 1≤b≤N, express The length of The value of is equal to N, express The average of the first b-1 values in , represents the first value in z, express The second value in express The b-1th value in represents the average of the last N-b+1 values in , express The bth value in express The b+1th value in express The Nth value in .
[0015] In step 2, the value of K is 5 or 6.
[0016] In step 7, the value of γ is 1.5.
[0017] Compared with the prior art, the advantages of the present invention are:
[0018] 1) The method of the present invention establishes a graph signal model of a wireless sensor network. In the process of abnormal node detection, not only the time correlation of the data itself is considered, but also the network topology structure of the graph signal model is fully considered, so that the detection result is more accurate.
[0019] 2) The method of the present invention passes the graph signal matrix of the graph signal model through a graph high-pass filter. The filtering operation is performed on the vertex domain. Therefore, there is no need to perform graph Fourier transform and graph inverse Fourier transform operations during data processing, which saves a lot of computing time and improves computing efficiency.
[0020] 3) The method of the present invention can not only detect whether there are multiple abnormal sensor nodes, namely abnormal nodes, in the wireless sensor network by analyzing historical data and current data, but also can further accurately determine the location of the abnormal nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a flowchart of the method of the present invention;
[0022] Figure 2 In order to compare the positioning performance of abnormal nodes in the same data set using the method of the present invention and the existing method based on local subgraph processing and node domain-graph frequency domain joint analysis. DETAILED DESCRIPTION
[0023] The present invention is further described in detail below with reference to the accompanying drawings.
[0024] The present invention proposes a method for detecting and locating abnormal nodes in a wireless sensor network, and its flowchart is as follows: Figure 1 As shown, it includes the following steps:
[0025] Step 1: Define the wireless sensor network to be detected and located as the current wireless sensor network, and assume that the current wireless sensor network has N sensor nodes; wherein N≥6, for example, N=100.
[0026] Step 2: For any sensor node in the current wireless sensor network, take it as the current sensor node, first calculate the Euclidean distance between the current sensor node and each sensor node except itself, then sort the N-1 Euclidean distances related to the current sensor node from small to large, find the K sensor nodes corresponding to the first K Euclidean distances, and then connect an edge between the current sensor node and each of the found sensor nodes; where the value of K is in the interval [5,10], K<N, and generally K is 5 or 6.
[0027] For example, assuming that the current wireless sensor network has 10 sensor nodes, for the first sensor node, the Euclidean distance between the first sensor node and each of the second to tenth sensor nodes is calculated, and a total of 9 Euclidean distances are obtained. Suppose that after the 9 Euclidean distances are sorted from small to large, the sensor nodes corresponding to the first 5 (K=5) Euclidean distances are the 4th, 6th, 3rd, 10th, and 7th sensor nodes, respectively. Then, an edge is connected between the first and the 4th sensor nodes, an edge is connected between the first and the 6th sensor nodes, an edge is connected between the first and the 3rd sensor nodes, an edge is connected between the first and the 10th sensor nodes, and an edge is connected between the first and the 7th sensor nodes; for each of the second to the 10th sensor nodes, they are also processed in the same way as the first sensor node.
[0028] Step 3: Construct the graph signal model of the current wireless sensor network, which is described as: G = (V, E, W); where G represents the graph signal model of the current wireless sensor network, V represents a row vector of dimension 1×N composed of N sensor nodes, and V = [v1, v2, …v n ,…,v N ],v1,v2,…v n ,…,v N Correspondingly represents the first sensor node, the second sensor node, ..., the nth sensor node, ..., the Nth sensor node, 1≤n≤N, E is a matrix with a dimension of N×N, e 1,1 、e 1,j 、e 1,N 、e i,1 、e i,j 、e i,N 、e N,1 、e N,j 、e N,N Correspondingly represents the element in the 1st row and 1st column of E, the element in the 1st row and jth column of E, the element in the 1st row and Nth column of E, the element in the ith row and 1st column of E, the element in the ith row and jth column of E, the element in the ith row and Nth column of E, the element in the Nth row and 1st column of E, the element in the Nth row and jth column of E, the element in the Nth row and Nth column of E, e i,j The value of is 0 or 1. When there is no edge between the i-th sensor node and the j-th sensor node, let e i,j = 0, when there is an edge between the i-th sensor node and the j-th sensor node, let e i,j =1, 1≤i≤N, 1≤j≤N, W is a weight matrix with dimension N×N, w 1,1 、w 1,j 、w 1,N 、w i,1 、w i,j 、w i,N 、w N,1 、w N,j 、w N,N Correspondingly represent the element in the 1st row and 1st column of W, the element in the 1st row and jth column of W, the element in the 1st row and Nth column of W, the element in the ith row and 1st column of W, the element in the ith row and jth column of W, the element in the ith row and Nth column of W, the element in the Nth row and 1st column of W, the element in the Nth row and jth column of W, and the element in the Nth row and Nth column of W. When i=j, let w i,j =0, when i≠j, let When there is no edge between the i-th sensor node and the j-th sensor node, a i,j The value of is 0, when there is an edge between the i-th sensor node and the j-th sensor node i,jThe value of dist is 1. i,j represents the Euclidean distance between the i-th sensor node and the j-th sensor node. When i≠j and there is an edge between the i-th sensor node and the j-th sensor node, w i,j represents the weight between the i-th sensor node and the j-th sensor node.
[0029] Then, the network topology of the graph signal model of the current wireless sensor network is obtained and represented by a graph Laplacian matrix L with a dimension of N×N, where L=DW; wherein D represents a degree matrix with a dimension of N×N, d 1,1 is the element in the first row and first column of D, which is also the first element on the main diagonal of D. i,i is the element in the i-th row and i-th column of D, which is also the i-th element on the main diagonal of D. N,N is the element in the Nth row and Nth column of D, which is also the Nth element on the main diagonal of D.
[0030] Step 4: Make each sensor node in the current wireless sensor network collect data at T moments; then obtain the graph signal matrix of the graph signal model of the current wireless sensor network, denoted as F, F = [f1,…,f t ,…f T-1 ,f T ]; where T represents the total number of times each sensor node collects data, T ≥ 5. For example, if T = 100, the dimension of F is N × T, f1, f t 、f T-1 、f T The dimension is N×1, f1 represents the column vector composed of the data collected by all sensor nodes at the first moment, f t represents the column vector consisting of the data collected by all sensor nodes at the tth moment, f t (1) represents the data collected by the first sensor node at time t, f t (i) represents the data collected by the i-th sensor node at the t-th time, f t (N) represents the data collected by the Nth sensor node at the tth time, f T-1 represents the column vector composed of the data collected by all sensor nodes at the T-1th time, f T Represents the column vector consisting of the data collected by all sensor nodes at the Tth time, 1≤t≤T.
[0031] Step 5: Pass F through a graph high-pass filter H with dimension N×N, and record the output signal after filtering as in, The dimension is N×T; the graph high-pass filter H can filter out the high-frequency components of the graph signal and suppress the low-frequency components.
[0032] Step 6: Randomly select a moment from T moments as the current moment, and set the current moment as the gth moment; then define the data collected by all sensor nodes at the current moment as current data, and define the data collected by all sensor nodes from the gmth moment to the g-1th moment (a total of m moments) as historical data; then calculate the maximum residual of the current data, recorded as θ, And calculate the average residual of historical data, recorded as Among them, 5<g≤T, m is 4 or 5, and the symbol “|||| ∞ ” is the symbol of infinite norm, express The g-th column vector in represents the current data, 1≤k≤m, express The gk-th column vector in represents a part of historical data, 1≤i≤m, 1≤j≤m, i≠j, express The gi-th column vector in , express The gj-th column vector in , The dimension is N×1.
[0033] Step 7: If the sensor node is abnormal at the current moment, the abnormality will cause a large oscillation, and the maximum residual of the current data will be greatly different from the average residual of the historical data, so it is judged Is it true? If so, it is determined that there are abnormal nodes in the current wireless sensor network at the current moment, and then step 8 is executed; if not, it is determined that there are no abnormal nodes in the current wireless sensor network at the current moment; where γ is the weighting coefficient, γ∈[1.2,1.8], and γ=1.5 in this embodiment.
[0034] Step 8: Calculation Sort the N values in z from large to small, and record the column vector obtained after sorting as Then from Find the change point among the N values in and record the change point as b * , Then The first value to the bth value in * The value of b * The sensor nodes are determined as abnormal nodes to realize abnormal node location; where z is the introduced intermediate variable, z and The dimensions of b are all N×1, * ∈[1,N], Indicates that The value of b when the value is the largest, 1≤b≤N, express The length of The value of is equal to N, express The average of the first b-1 values in , express The first value in express The second value in express The b-1th value in represents the average of the last N-b+1 values in , express The bth value in express The b+1th value in express The Nth value in .
[0035] The feasibility and effectiveness of the method of the present invention are further illustrated by simulation below.
[0036] The simulation experiment uses a pressure sensor network composed of some global sea level measurement sites. The pressure sensor network has 500 measurement sites, that is, 500 sensor nodes. Each sensor node collects data at 4599 moments, ranging from 94.71kPa to 10.51kPa. All collected data constitute a data set. In the simulation experiment, two different scenarios are simulated for abnormal situations. First, according to the location characteristics of the sensor node, any sensor node is connected to the six sensor nodes with the closest geographical distance to form a graph signal model; secondly, in the first scenario, 5 abnormal nodes are considered, and 5 sensor nodes are randomly selected as abnormal nodes each time. In the second scenario, 10 abnormal nodes are considered, and 10 sensor nodes are randomly selected as abnormal nodes each time. In both cases, the abnormal pressure value added by the abnormal node is 10kPa. In both cases, 20,000 simulation experiments are conducted.
[0037] The above datasets are subjected to abnormal node detection using the method of the present invention and the existing graph frequency domain detection method (i.e., the graph frequency domain method proposed by Sandryhaila and Moura in the document Discrete Signal Processing on Graphs: Frequency Analysis in 2014). Table 1 shows the comparison of the detection performance of abnormal node detection using the method of the present invention and the existing graph frequency domain detection method for the same dataset in two different scenarios.
[0038] Table 1 Comparison of detection performance of abnormal nodes detected by the proposed method and the existing frequency domain detection method for the same data set in two different scenarios
[0039]
[0040] The detection rate in Table 1 represents the ratio of the total number of successful detections to the total number of experiments (40,000 times). It can be seen from Table 1 that the detection rate of the method of the present invention is significantly higher than that of the existing image frequency domain detection method.
[0041] The method of the present invention and the existing method based on local subgraph processing and node domain-graph frequency domain joint analysis (i.e., the article "A New Abnormal Node Detection and Positioning Algorithm in Wireless Sensor Networks" published by Jiang Junzheng, Yang Jie, etc. in the Journal of Electronics and Information Technology in 2018) are used to locate abnormal nodes in the above data set. Figure 2 A comparison of the positioning performance of abnormal nodes in two different scenarios using the method of the present invention and an existing method based on local subgraph processing and node domain-graph frequency domain joint analysis for the same data set is given.
[0042] Figure 2 It is the performance curve of the ratio of the number of experiments with judgment results less than or equal to n abnormal nodes to the total number of experiments as the number n changes. Figure 2It can be seen from the figure that in the first scenario, when the number of abnormal nodes is set to 5, the ratio of the number of experiments to the total number of experiments reaches 1 when the number of abnormal nodes is determined to be n≤5. Similarly, in the second scenario, when the number of abnormal nodes is set to 10, the ratio of the number of experiments to the total number of experiments also reaches 1 when the number of abnormal nodes is determined to be n≤10. That is, the method of the present invention can accurately locate abnormal nodes in both cases, but the existing method based on local subgraph processing and node domain-graph frequency domain joint analysis has a large judgment error, and its performance is far inferior to that of the method of the present invention. Moreover, the method of the present invention has good performance even when the number of abnormal nodes is small, while the existing method based on local subgraph processing and node domain-graph frequency domain joint analysis has lower performance than the method of the present invention under different numbers of abnormal nodes. Therefore, the abnormal node location positioning performance of the method of the present invention is better than the existing graph frequency domain detection method and the method based on local subgraph processing and node domain-graph frequency domain joint analysis.
Claims
1. A method for detecting and locating abnormal nodes in a wireless sensor network, characterized in that The following steps are involved: Step 1: define the wireless sensor network to be detected and located as the current wireless sensor network, and assume that the current wireless sensor network has N sensor nodes; where N ≥ 6; Step 2: For any sensor node in the current wireless sensor network, take it as the current sensor node, first calculate the Euclidean distance between the current sensor node and each sensor node except itself, then sort the N-1 Euclidean distances related to the current sensor node from small to large, find the K sensor nodes corresponding to the first K Euclidean distances, and then connect an edge between the current sensor node and each found sensor node; where the value of K is in the interval [5,10], K<N; Step 3: Construct the graph signal model of the current wireless sensor network, which is described as: G = (V, E, W); where G represents the graph signal model of the current wireless sensor network, V represents a row vector of dimension 1×N composed of N sensor nodes, and V = [v1, v2, …v n ,…,v N ],v1,v2,…v n ,…,v N Correspondingly represents the first sensor node, the second sensor node, ..., the nth sensor node, ..., the Nth sensor node, 1≤n≤N, E is a matrix with a dimension of N×N, e 1,1 、e 1,j 、e 1,N 、e i,1 、e i,j 、e i,N 、e N,1 、e N,j 、e N,N Correspondingly represents the element in the 1st row and 1st column of E, the element in the 1st row and jth column of E, the element in the 1st row and Nth column of E, the element in the ith row and 1st column of E, the element in the ith row and jth column of E, the element in the ith row and Nth column of E, the element in the Nth row and 1st column of E, the element in the Nth row and jth column of E, the element in the Nth row and Nth column of E, e i,j The value of is 0 or 1. When there is no edge between the i-th sensor node and the j-th sensor node, let e i,j = 0, when there is an edge between the i-th sensor node and the j-th sensor node, let e i,j =1, 1≤i≤N, 1≤j≤N, W is a weight matrix with dimension N×N, w 1,1 、w 1,j 、w 1,N 、w i,1 、w i,j 、w i,N 、w N,1 、w N,j 、w N,N Correspondingly represent the element in the 1st row and 1st column of W, the element in the 1st row and jth column of W, the element in the 1st row and Nth column of W, the element in the ith row and 1st column of W, the element in the ith row and jth column of W, the element in the ith row and Nth column of W, the element in the Nth row and 1st column of W, the element in the Nth row and jth column of W, and the element in the Nth row and Nth column of W. When i=j, let w i,j =0, when i≠j, let When there is no edge between the i-th sensor node and the j-th sensor node, a i,j The value of is 0, when there is an edge between the i-th sensor node and the j-th sensor node i,j The value of dist is 1. i,j represents the Euclidean distance between the i-th sensor node and the j-th sensor node. When i≠j and there is an edge between the i-th sensor node and the j-th sensor node, w i,j represents the weight between the i-th sensor node and the j-th sensor node; Then, the network topology of the graph signal model of the current wireless sensor network is obtained and represented by a graph Laplacian matrix L with a dimension of N×N, where L=DW; wherein D represents a degree matrix with a dimension of N×N, d 1,1 is the element in the first row and first column of D, which is also the first element on the main diagonal of D. i,i is the element in the i-th row and i-th column of D, which is also the i-th element on the main diagonal of D. N,N is the element in the Nth row and Nth column of D, which is also the Nth element on the main diagonal of D. Step 4: Make each sensor node in the current wireless sensor network collect data at T moments; then obtain the graph signal matrix of the graph signal model of the current wireless sensor network, denoted as F, F = [f1,…,f t ,…f T-1 ,f T ]; where T represents the total number of times each sensor node collects data, T ≥ 5, the dimension of F is N × T, f1, f t 、f T-1 、f T The dimension is N×1, f1 represents the column vector composed of the data collected by all sensor nodes at the first moment, f t represents the column vector consisting of the data collected by all sensor nodes at the tth moment, f t (1) represents the data collected by the first sensor node at time t, f t (i) represents the data collected by the i-th sensor node at the t-th time, f t (N) represents the data collected by the Nth sensor node at the tth time, f T-1 represents the column vector composed of the data collected by all sensor nodes at the T-1th time, f T Represents the column vector composed of the data collected by all sensor nodes at the Tth time, 1≤t≤T; Step 5: Pass F through a graph high-pass filter H with dimension N×N, and record the output signal after filtering as in, The dimension is N×T; Step 6: Randomly select a moment from T moments as the current moment, and set the current moment as the gth moment; then define the data collected by all sensor nodes at the current moment as the current data, and define the data collected by all sensor nodes from the gmth moment to the g-1th moment as the historical data; then calculate the maximum residual of the current data, recorded as θ, And calculate the average residual of historical data, recorded as Where 5<g≤T, m is 4 or 5, and the symbol "|| || ∞ ” is the symbol of infinite norm, express The g-th column vector in , 1≤k≤m, express The gk-th column vector in , 1≤i≤m, 1≤j≤m, i≠j, express The gi-th column vector in , express The gj-th column vector in , The dimension is N×1; Step 7: Judgement Is it true? If so, it is determined that there are abnormal nodes in the current wireless sensor network at the current moment, and then step 8 is executed; if not, it is determined that there are no abnormal nodes in the current wireless sensor network at the current moment; where γ is the weighting coefficient, γ∈[1.2,1.8]; Step 8: Calculation Sort the N values in z from large to small, and record the column vector obtained after sorting as Then from Find the change point among the N values in and record the change point as b * , Then The first value to the bth value in * The value of b * The sensor nodes are determined as abnormal nodes to realize abnormal node location; where z is the introduced intermediate variable, z and The dimensions of b are all N×1, * ∈[1,N], Indicates that The value of b when the value is the largest, 1≤b≤N, express The length of The value of is equal to N, express The average of the first b-1 values in , express The first value in express The second value in express The b-1th value in represents the average of the last N-b+1 values in , express The bth value in express The b+1th value in express The Nth value in .
2. A method for detecting and locating abnormal nodes in a wireless sensor network according to claim 1, characterized in that In step 2, the value of K is 5 or 6.
3. A method for detecting and locating abnormal nodes in a wireless sensor network according to claim 1, characterized in that In step 7, the value of γ is 1.5.
