An incremental shared neighbor acquisition method based on asymmetric k-nearest neighbor matrix

Through the incremental shared nearest neighbor acquisition method of asymmetric k nearest neighbor matrix, the shared nearest neighbor matrix of the UAV flight data set is dynamically updated, solving the problems of high computational complexity and time-delay in traditional methods, and achieving efficient real-time response and big data processing.

CN115456072BActive Publication Date: 2025-08-22ARMY ENG UNIV OF PLA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211111968.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-13
Publication Date
2025-08-22
Estimated Expiration
2042-09-13

AI Technical Summary

Technical Problem

Traditional shared nearest neighbor computing methods consume a lot of computing power and are prolonged in the UAV flight dataset, making it difficult to apply to instant response scenarios, especially when the data volume increases, and cannot be effectively processed.

Method used

The incremental shared neighbor acquisition method based on asymmetric k-nearest neighbor matrix is ​​adopted. By initializing and updating the asymmetric k-nearest neighbor matrix, combining the k-nearest neighbor relationship of newly added data points, the shared neighbor matrix is ​​dynamically updated, reducing the computational complexity and adapting to the big data environment.

Benefits of technology

It realizes the reduction of computing power consumption and time delay while ensuring accuracy. It is suitable for instant response scenarios, adapts to big data environments, and improves the practicality and processing capabilities of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115456072B_ABST
    Figure CN115456072B_ABST
Patent Text Reader

Abstract

The present invention discloses an incremental shared neighbor acquisition method based on an asymmetric k-nearest neighbor matrix, which obtains the original shared neighbor matrix of the UAV flight data set D, updates the k-nearest neighbor distance vector and the asymmetric k-nearest neighbor matrix, calculates the upper triangular shared neighbor matrix and the original shared neighbor matrix corresponding to the UAV flight data set D; calculates the newly added data point d p k nearest neighbor row vector and inverse k nearest neighbor column vector, update the asymmetric k nearest neighbor matrix; assign the asymmetric k nearest neighbor matrix; assign the updated shared nearest neighbor matrix, replace some data points in the updated shared nearest neighbor matrix, and add new data points d p Insert the UAV flight data set D, replace the asymmetric k-nearest neighbor matrix and the original shared neighbor matrix, and repeat the above steps. The algorithm of the present invention realizes the incremental acquisition of shared neighbors, extending the existing static shared neighbor acquisition method to dynamic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This method belongs to the field of data mining, and specifically relates to an incremental shared neighbor acquisition method based on an asymmetric k-nearest neighbor matrix, which is suitable for neighbor analysis of UAV flight data. Background Art

[0002] Shared nearest neighbor is an algorithm for calculating similarity between data points with variable density. It explores the distribution of a dataset based on the number of shared nearest neighbors between each pair of data points. A greater number of shared nearest neighbors indicates greater similarity or closer distribution between two data points, while a lower number indicates lower similarity or more distant distribution. Shared nearest neighbor algorithms are often used as a foundational algorithm in conjunction with other algorithms and are currently widely used in fields such as data dimensionality reduction, cluster analysis, pattern recognition, data classification, fault diagnosis, and anomaly analysis.

[0003] In the drone flight dataset D, two data points d i , d j The shared neighbor calculation method is as follows: set k as the number of nearest neighbors of the data, NN k (d i ) is the data point d in the UAV flight data set D i The set of k nearest neighbors excluding itself, NN k (d j ) is the data point d in the UAV flight data set D j The k nearest neighbor sets except itself, then the data point d i , d j The shared neighbors of NN k (d i ) and NN k (d j ). Each data point in the UAV flight dataset D has multiple shared neighbors, called the shared neighbor set of the data point. The matrix composed of the shared neighbor sets of all data points is called the original shared neighbor matrix of the UAV flight dataset D.

[0004] In practice, as new data points d are added p The amount of data in the drone flight dataset D continues to increase due to the addition of new data points d p The addition of will break the distance relationship between the data points in the drone flight dataset D, so it is necessary to update the original shared neighbor matrix in the drone flight dataset D. In addition, in practical applications, it is often necessary to obtain the newly added data point d pThe traditional shared neighbor calculation method is a static algorithm that requires updating the shared neighbor set of all data and even the original shared neighbor matrix for each newly added data point. This method consumes a lot of computing power and takes a long time, making it difficult to apply to instant response scenarios. This is a problem that restricts the practicality of this algorithm. Summary of the Invention

[0005] In view of the above problems existing in the prior art, the present invention proposes an incremental shared neighbor acquisition method based on an asymmetric k-nearest neighbor matrix.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for obtaining incremental shared neighbors based on an asymmetric k-nearest neighbor matrix comprises the following steps:

[0008] Step 1: Get the original shared neighbor matrix of the UAV flight dataset D, assign the number of data points of the UAV flight dataset D to the data volume m, initialize and update the k-nearest neighbor distance vector k_distvector, initialize and update the asymmetric k-nearest neighbor matrix ak_matrix, calculate the upper triangular shared neighbor matrix us_matrix corresponding to the UAV flight dataset D, and obtain the original shared neighbor matrix s_matrix corresponding to the UAV flight dataset D according to the upper triangular shared neighbor matrix us_matrix;

[0009] Step 2: Calculate the newly added data point d p The k-nearest neighbor row vector pk_vector and the inverse k-nearest neighbor column vector rpk_vector are obtained, and the asymmetric k-nearest neighbor matrix ak_matrix is ​​updated; the asymmetric k-nearest neighbor matrix pk_matrix after dimensional expansion is initialized and assigned values;

[0010] Step 3: Initialize and assign the updated shared neighbor matrix ps_matrix, combined with the newly added data point d p Replace some data points in the shared neighbor matrix ps_matrix updated in step 3.2;

[0011] Step 4: Increase the data volume m by 1 and add a new data point d p Insert the drone flight dataset D to form a new drone flight dataset D, replace the asymmetric k-nearest neighbor matrix ak_matrix with the expanded asymmetric k-nearest neighbor matrix pk_matrix, replace the original shared neighbor matrix s_matrix with the updated shared neighbor matrix ps_matrix, take the next newly added data point and repeat steps 2 and 3.

[0012] Step 1 as described above includes the following steps:

[0013] Step 1.1: Input the UAV flight dataset D, assign the number of data points in the UAV flight dataset D to the data volume m, and calculate the k nearest neighbors of each data point in the UAV flight dataset D;

[0014] Step 1.2, initialize the asymmetric k-nearest-neighbor matrix ak_matrix to an all-zero matrix with m rows and m columns, and initialize the k-nearest-neighbor distance vector k_distvector to an all-zero vector with m rows and 1 column;

[0015] Step 1.3: Update the k-nearest-neighbor distance vector k_distvector in step 1.2 according to the following formula:

[0016]

[0017] Among them, k_distvector(i1) represents the data point in row i1 and column 1 of the k-nearest neighbor distance vector k_distvector, d t1 is the data point d i1 k nearest neighbor set NN k (d i1 ) in any data point, data point d i1 is the i1th data point in the UAV flight data set D, i1 represents the sequence number, i1∈[1,m];

[0018] Step 1.4: Update the asymmetric k-nearest neighbor matrix ak_matrix in step 1.2 according to the following formula:

[0019]

[0020] Among them, d i2 and d j2 They represent the i2th and j2th data points in the UAV flight dataset D, respectively, and NN k (d i2 ) is the data point d in the UAV flight data set D i2 The set of k nearest neighbors except itself, ak_matrix(i2,j2) represents the i2th row and j2th column data in the asymmetric k-nearest neighbor matrix ak_matrix, i2, j2∈[1,m];

[0021] Step 1.5: Calculate the upper triangular shared neighbor matrix us_matrix corresponding to the UAV flight dataset D based on the asymmetric k-nearest neighbor matrix ak_matrix obtained in step 1.4. The data us_matrix(i3,j3) in the i3th row and j3th column of the upper triangular shared neighbor matrix us_matrix is ​​obtained by the following formula:

[0022]

[0023] Among them, ak_matrix(i3,:) and ak_matrix(j3,:) T They represent the transposed vectors of the vector consisting of the i3th row data and the j3th row data in the asymmetric k-nearest neighbor matrix ak_matrix, i3, j3∈[1,m], i3≤j3;

[0024] The original shared neighbor matrix s_matrix corresponding to the drone flight dataset D is calculated according to the following formula:

[0025] s_matrix=us_matrix+us_matrix T .

[0026] Step 2 as described above includes the following steps:

[0027] Step 2.1, enter the newly added data point d p ;

[0028] Step 2.2, calculate the newly added data point d p The distance from each data point in the drone flight data set D is sorted to get the newly added data point d p k nearest neighbor set NN in the drone flight dataset D k (d p ), calculate the newly added data point d according to the following formula p The k-nearest neighbor row vector pk_vector and the inverse k-nearest neighbor column vector rpk_vector are obtained, and the asymmetric k-nearest neighbor matrix ak_matrix is ​​updated:

[0029] (1)

[0030] (2)

[0031] (3)

[0032] In the above formula, pk_vector(1,j4) represents the newly added data point d p The k nearest neighbor row vector of the data point in row 1 and column j4, d j4 represents the j4th data point in the UAV flight dataset D, j4∈[1,m],

[0033] rpk_vector(i4,1) indicates the newly added data point d p The data point in the i4th row and first column of the inverse k-nearest neighbor column vector, d i4represents the i4th data point in the UAV flight data set D, k_distvector(i4) represents the data point in the i4th row and 1st column of the k-nearest neighbor distance vector k_distvector, i4∈[1,m],

[0034] ak_matrix(i5,t5) represents the data point in row i5 and column t5 of the asymmetric k-nearest neighbor matrix, d t5 is the i5th data point d in the drone flight dataset D i5 k nearest neighbor set NN k (d i5 ), k_distvector(i5) represents the data point in the i5th row and the first column of the k-nearest neighbor distance vector k_distvector, i5, t5∈[1,m];

[0035] Step 2.3: Initialize the expanded asymmetric k-nearest neighbor matrix pk_matrix to an all-zero matrix with m+1 rows and m+1 columns. Assign values ​​to the expanded asymmetric k-nearest neighbor matrix pk_matrix according to the following formula:

[0036] pk_matrix(1:m,1:m)=ak_matrix

[0037] pk_matrix(m+1,1:m)=pk_vector

[0038] pk_matrix(1:m,m+1)=rpk_vector

[0039] pk_matrix(m+1,m+1)=0

[0040] In the above formula, pk_matrix(1:m,1:m) represents the data points of the 1st to mth rows and the 1st to mth columns of the expanded asymmetric k-nearest neighbor matrix pk_matrix, pk_matrix(m+1,1:m) represents the data points of the 1st to mth columns of the m+1th row of the expanded asymmetric k-nearest neighbor matrix pk_matrix, pk_matrix(1:m,m+1) represents the data points of the m+1th columns of the 1st to mth rows of the expanded asymmetric k-nearest neighbor matrix pk_matrix, and pk_matrix(m+1,m+1) represents the data points of the m+1th row and the m+1th column of the expanded asymmetric k-nearest neighbor matrix pk_matrix.

[0041] Step 3 as described above includes the following steps:

[0042] Step 3.1, initialize the updated shared neighbor matrix ps_matrix to an all-zero matrix with m+1 rows and m+1 columns;

[0043] Step 3.2: Assign values ​​to some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0044] ps_matrix(1:m,1:m)=s_matrix(1:m,1:m)

[0045] Step 3.3, combined with the newly added data point d p Replace some data points in the shared neighbor matrix ps_matrix updated in step 3.2.

[0046] Step 3.3 as described above includes the following steps:

[0047] Step 3.3.1, select the sequence number q of the data point that satisfies the following formula:

[0048]

[0049] Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0050] ps_matrix(i6,q)=pk_matrix(i6,:)×pk_matrix(q,:) T

[0051] ps_matrix(q,i6)=ps_matrix(i6,q)

[0052] In the above formula, ps_matrix(i6,q), pk_matrix(i6,:) and pk_matrix(q,:) T They represent the data point in the i6th row and qth column of the updated shared neighbor matrix ps_matrix, the vector composed of the i6th row data of the expanded asymmetric k-nearest neighbor matrix pk_matrix, and the transpose of the vector composed of the data points in the qth row of the expanded asymmetric k-nearest neighbor matrix pk_matrix. ps_matrix(q,i6) represents the data point in the qth row and i6th column of the updated shared neighbor matrix ps_matrix, i6∈[1,m+1], i6≠q.

[0053] Step 3.3.2, select the sequence number f of the data point that satisfies the following formula:

[0054]

[0055] Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0056] ps_matrix(i7,f)=pk_matrix(i7,:)×pk_matrix(f,:)T

[0057] ps_matrix(f,i7)=ps_matrix(i7,f)

[0058] In the above formula, pk_matrix(i7,:) and pk_matrix(f,:) T They represent the transpose of the vector consisting of the data points in the i7th row and the fth row in the expanded asymmetric k-nearest neighbor matrix pk_matrix, respectively. ps_matrix(i7,f) represents the data point in the i7th row and fth column in the updated shared neighbor matrix ps_matrix. ps_matrix(f,i7) represents the data point in the fth row and i7th column in the updated shared neighbor matrix ps_matrix, i7∈[1,m+1], i7≠f.

[0059] Step 3.3.3, filter the data point index l that satisfies the following formula:

[0060]

[0061] Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0062] ps_matrix(m+1,l)=pk_matrix(m+1,:)×pk_matrix(l,:) T

[0063] ps_matrix(l,m+1)=ps_matrix(m+1,l)

[0064] pk_matrix(m+1,:) and pk_matrix(l,:) T They respectively represent the transpose of the vector consisting of the data points in the m+1th row and the lth row in the expanded asymmetric k-nearest neighbor matrix pk_matrix. ps_matrix(m+1,l) represents the data point in the m+1th row and lth column in the updated shared neighbor matrix ps_matrix. ps_matrix(l,m+1) represents the data point in the lth row and m+1th column in the updated shared neighbor matrix ps_matrix.

[0065] Compared with the prior art, the present invention has the following advantages:

[0066] 1. Nearest neighbor acquisition methods for drone flight data are a prerequisite and key technology for fault diagnosis and remaining life prediction. Due to the high velocity and large volume of drone flight data, nearest neighbor acquisition algorithms consume a lot of computing power and struggle to respond promptly, severely impacting diagnostic and prediction accuracy and generalization capabilities.

[0067] 2. The algorithm of the present invention realizes the incremental acquisition of shared neighbors of UAV flight data, and extends the existing static shared neighbor acquisition method to dynamic.

[0068] 3. The algorithm of this invention converts the complex shared neighbor acquisition method into a logical operation of a matrix composed of 0s and 1s, conforming to the underlying logical operation rules of computers. The algorithm complexity is linearly proportional to the data size of the dataset. While maintaining the same accuracy as static algorithms, the algorithm of this invention reduces computing power consumption and significantly reduces algorithm latency. This overcomes the limitation of traditional algorithms that are not suitable for instant response scenarios, and has greater practicality.

[0069] 4. Traditional shared nearest neighbor algorithms are not suitable for big data. The shared nearest neighbor acquisition algorithm of the present invention is based on an asymmetric k-nearest neighbor matrix, which can be represented by a sparse matrix. Therefore, the algorithm has the ability to process big data. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 It is a schematic flow diagram of the present invention;

[0071] Figure 2 Nearest neighbor relationship diagram of the drone flight data set D when k=3;

[0072] Figure 3 is the asymmetric k-nearest neighbor matrix corresponding to the UAV flight dataset D when k = 3;

[0073] Figure 4 The upper triangular shared neighbor matrix (left) and the shared neighbor matrix (right) corresponding to the UAV flight dataset D when k = 3;

[0074] Figure 5 is the newly added data point d p The impact on the k-nearest neighbor graph of the UAV flight dataset D;

[0075] Figure 6 The asymmetric k-nearest neighbor matrix corresponding to the dynamically updated drone flight dataset D' (left figure) and the sparse representation method of this matrix (right figure);

[0076] Figure 7 is based on Figure 6 The step of incrementally updating the original shared nearest neighbor matrix using the asymmetric k-nearest neighbor matrix;

[0077] Figure 8 It is the shared neighbor matrix corresponding to the dynamically updated UAV flight dataset D' when k = 3. DETAILED DESCRIPTION

[0078] The technical solution of the present invention will be further specifically described below through embodiments and in conjunction with the accompanying drawings.

[0079] Example:

[0080] The algorithm of the present invention does not require the dimension and data volume of the UAV flight data set. However, in order to facilitate the demonstration of the algorithm principle, in this embodiment, the UAV flight data set D = [d1 d2 ... d i ...d m ], data volume m = 9, data dimension n = 2, that is, the UAV flight data set D contains 9 2-dimensional data, d i represents the i-th data point in the drone flight dataset D, i∈[1,m].

[0081] An incremental shared neighbor acquisition method based on an asymmetric k-nearest neighbor matrix includes the following steps: Figure 1 As shown:

[0082] Step 1: Obtain the original shared neighbor matrix of the UAV flight dataset D. This step is a static algorithm and is only run once.

[0083] Step 1.1: Input the drone flight data set D, which is a known data set and represents the newly added data point d. p The number of data points in the original data set before arrival, the UAV flight data set D, is assigned to the data volume m. The UAV flight data set D is processed using the k-nearest neighbor algorithm (the number of neighbors k in the algorithm is 3) to obtain the k nearest neighbors of each data point in the UAV flight data set D, as shown in Figure 2 As shown in the figure, the three nearest neighbors of each data point are indicated by arrows.

[0084] Step 1.2: Initialize the asymmetric k-nearest-neighbor matrix ak_matrix to an all-zero matrix with m rows and m columns (m=9 in this embodiment). Initialize the k-nearest-neighbor distance vector k_distvector to an all-zero vector with m rows and 1 column.

[0085] In step 1.3, based on the results of step 1.1, update the value of the k-nearest neighbor distance vector k_distvector in step 1.2 according to the following formula.

[0086]

[0087] In the above formula, k_distvector(i1) represents the data point in row i1 and column 1 of the k-nearest neighbor distance vector k_distvector, d t1 is the data point d i1 k nearest neighbor set NN k (d i1 ) in any data point, data point d i1is the i1th data point in the UAV flight dataset D, i1 represents the sequence number, i1∈[1,m].

[0088] In step 1.4, based on the results of step 1.1, update the values ​​in the asymmetric k-nearest neighbor matrix ak_matrix in step 1.2 according to the following formula.

[0089]

[0090] In the above formula, d i2 and d j2 Respectively represent the i2th and j2th data points in the UAV flight dataset D. k (d i2 ) is the data point d in the UAV flight data set D i2 The set of k nearest neighbors ak_matrix(i2,j2) except itself represents the data in the i2th row and j2th column of the asymmetric k nearest neighbor matrix ak_matrix. The above formula indicates that if the data point d j2 Belongs to data point d i2 The k nearest neighbor set is updated with the corresponding data in row i2 and column j2 of the asymmetric k nearest neighbor matrix ak_matrix to 1. The updated asymmetric k nearest neighbor matrix ak_matrix is ​​as follows Figure 3 As shown, i2 and j2 represent serial numbers, i2, j2∈[1,m].

[0091] Step 1.5, based on the asymmetric k-nearest neighbor matrix ak_matrix obtained in step 1.4, calculate the upper triangular shared nearest neighbor matrix us_matrix corresponding to the UAV flight data set D. The result is as follows Figure 4 (left) The data in row i3 and column j3 of the upper triangular shared neighbor matrix us_matrix, us_matrix(i3,j3), is obtained as follows:

[0092]

[0093] In the above formula, ak_matrix(i3,:) and ak_matrix(j3,:) T They respectively represent the transposed vectors of the vector consisting of the data in the i3th row and the vector consisting of the data in the j3th row in the asymmetric k-nearest neighbor matrix ak_matrix, where i3 and j3 represent serial numbers, i3, j3∈[1,m], i3≤j3.

[0094] The original shared neighbor matrix s_matrix corresponding to the UAV flight data set D can be obtained according to the following formula: Figure 4 (right) shows:

[0095] s_matrix=us_matrix+us_matrixT

[0096] Step 2: Dynamic update and dimension expansion of asymmetric k-nearest neighbor matrix

[0097] Step 2.1, enter the newly added data point d p ,like Figure 5 As shown in the figure, the dotted arrows indicate the disappearance of the neighbor relationship. It can be seen that the neighbor relationship of the original data points d7 and d8 has changed, but the neighbor relationship of other data points has not been affected.

[0098] Step 2.2, calculate the newly added data point d p The distance from each data point in the drone flight data set D is sorted to get the newly added data point d p k nearest neighbor set NN in the drone flight dataset D k (d p ) Calculate the newly added data point d according to the following formula p The k-nearest neighbor row vector pk_vector and the inverse k-nearest neighbor column vector rpk_vector are obtained, and the asymmetric k-nearest neighbor matrix ak_matrix is ​​updated:

[0099] (1)

[0100] (2)

[0101] (3)

[0102] In the above formula, pk_vector(1,j4) represents the newly added data point d p The k nearest neighbor row vector of the data point in row 1 and column j4, d j4 represents the j4th data point in the drone flight dataset D, j4∈[1,m]

[0103] rpk_vector(i4,1) indicates the newly added data point d p The data point in the i4th row and first column of the inverse k-nearest neighbor column vector, d i4 Represents the i4th data point in the drone flight dataset D, k_distvector(i4) represents the data point in the i4th row and 1st column of the k-nearest neighbor distance vector k_distvector, i4∈[1,m].

[0104] ak_matrix(i5,t5) represents the data point in row i5 and column t5 of the asymmetric k-nearest neighbor matrix, d t5 is the i5th data point d in the drone flight dataset D i5 k nearest neighbor set NN k (d i5), k_distvector(i5) represents the data point in the i5th row and 1st column of the k-nearest neighbor distance vector k_distvector.

[0105] i4, i5 and j4 represent serial numbers, i5, t5∈[1,m].

[0106] Step 2.3: Initialize the expanded asymmetric k-nearest neighbor matrix pk_matrix to an all-zero matrix with m+1 rows and m+1 columns. Assign values ​​to the expanded asymmetric k-nearest neighbor matrix pk_matrix according to the following formula:

[0107] pk_matrix(1:m,1:m)=ak_matrix

[0108] pk_matrix(m+1,1:m)=pk_vector

[0109] pk_matrix(1:m,m+1)=rpk_vector

[0110] pk_matrix(m+1,m+1)=0

[0111] In the above formula, pk_matrix(1:m,1:m) represents the data points of the 1st to mth rows and the 1st to mth columns of the expanded asymmetric k-nearest neighbor matrix pk_matrix, pk_matrix(m+1,1:m) represents the data points of the 1st to mth columns of the m+1th row of the expanded asymmetric k-nearest neighbor matrix pk_matrix, pk_matrix(1:m,m+1) represents the data points of the m+1th columns of the 1st to mth rows of the expanded asymmetric k-nearest neighbor matrix pk_matrix, and pk_matrix(m+1,m+1) represents the data points of the m+1th row and the m+1th column of the expanded asymmetric k-nearest neighbor matrix pk_matrix.

[0112] The asymmetric k-nearest neighbor matrix pk_matrix after dimension expansion in this embodiment is as follows Figure 6 (left). In particular, as new data points are added, the amount of data in the matrix will continue to increase. Since most of the data values ​​in the matrix are 0, it can be represented by a sparse matrix ( Figure 6 Right) to save data storage space, this method can improve the algorithm's ability to adapt to big data.

[0113] Step 3: Dynamic update of the original shared neighbor matrix

[0114] Step 3.1, initialize the updated shared neighbor matrix ps_matrix to an all-zero matrix with m+1 rows and m+1 columns.

[0115] Step 3.2: Assign values ​​to some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0116] ps_matrix(1:m,1:m)=s_matrix(1:m,1:m)

[0117] Step 3.3, due to the addition of new data point d p The addition of will modify some data of the asymmetric k-nearest neighbor matrix ak_matrix, thereby affecting the shared neighbor relationship between the data. Therefore, it is necessary to combine the newly added data point d p The influence domain of is to replace some data points in the shared neighbor matrix ps_matrix updated in step 3.2. Figure 7 As shown, this step includes the following three sub-steps:

[0118] Step 3.3.1, Step 2.2 Formula (3) has obtained the data point d that makes ak_matrix(i5,t5)=0 i5 and d t5 , where i5 and t5 correspond to the serial numbers of the data points whose row i5 and column t5 of the asymmetric k-nearest neighbor matrix ak_matrix are updated from 1 to 0. Based on this result, the serial number q of the data point that satisfies the following formula can be further selected:

[0119]

[0120] Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0121] ps_matrix(i6,q)=pk_matrix(i6,:)×pk_matrix(q,:) T

[0122] ps_matrix(q,i6)=ps_matrix(i6,q)

[0123] In the above formula, ps_matrix(i6,q), pk_matrix(i6,:) and pk_matrix(q,:) T They respectively represent the data point in the i6th row and qth column of the updated shared neighbor matrix ps_matrix, the vector composed of the i6th row data of the expanded asymmetric k-nearest neighbor matrix pk_matrix, and the transpose of the vector composed of the qth row data points of the expanded asymmetric k-nearest neighbor matrix pk_matrix. ps_matrix(q,i6) represents the data point in the qth row and i6th column of the updated shared neighbor matrix ps_matrix, i6∈[1,m+1], i6≠q.

[0124] Step 3.3.2: Formula (2) in step 2.2 has been obtained so that the newly added data point d p The data point d whose inverse k nearest neighbor column vector rpk_vector(i4,1)=1 i4 , where i4 corresponds to the newly added data point d p The number of the data point with a data point value of 1 in the inverse k-nearest neighbor column vector rpk_vector can be combined with this result to further filter the number f of the data point that meets the following formula:

[0125]

[0126] Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0127] ps_matrix(i7,f)=pk_matrix(i7,:)×pk_matrix(f,:) T

[0128] ps_matrix(f,i7)=ps_matrix(i7,f)

[0129] In the above formula, pk_matrix(i7,:) and pk_matrix(f,:) T They respectively represent the transpose of the vector consisting of the data points in the i7th row and the fth row in the expanded asymmetric k-nearest neighbor matrix pk_matrix. ps_matrix(i7,f) represents the data point in the i7th row and fth column in the updated shared neighbor matrix ps_matrix. ps_matrix(f,i7) represents the data point in the fth row and i7th column in the updated shared neighbor matrix ps_matrix, i7∈[1,m+1], i7≠f.

[0130] Step 3.3.3, formula (1) in step 2.2 has been obtained so that the newly added data point d p The k-nearest neighbor row vector pk_vector(1,j4)=1 of data point d j4 , where j4 corresponds to the newly added data point d p The sequence number of the data point with a data point value of 1 in the k-nearest neighbor row vector pk_vector can be further filtered based on this result to find the data point index l that satisfies the following formula:

[0131]

[0132] Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula:

[0133] ps_matrix(m+1,l)=pk_matrix(m+1,:)×pk_matrix(l,:) T

[0134] ps_matrix(l,m+1)=ps_matrix(m+1,l)

[0135] pk_matrix(m+1,:) and pk_matrix(l,:) T They respectively represent the transpose of the vector consisting of the data points in the m+1th row and the lth row in the expanded asymmetric k-nearest neighbor matrix pk_matrix. ps_matrix(m+1,l) represents the data point in the m+1th row and lth column in the updated shared neighbor matrix ps_matrix. ps_matrix(l,m+1) represents the data point in the lth row and m+1th column in the updated shared neighbor matrix ps_matrix.

[0136] In step 3.3 of this embodiment, the updated shared neighbor matrix ps_matrix is ​​obtained as follows Figure 8 As shown in the figure, the bold tilted data points are replaced data points. Figure 8 As can be seen from the figure, the method of the present invention only replaces some of the affected data points, thus saving computing power. It can be inferred that as the amount of data increases, the computing speed advantage of the method of the present invention will become more prominent.

[0137] Step 4: Increase the data volume m by 1, that is, m=m+1. Add a new data point d p Insert the UAV flight dataset D to form the dynamically updated UAV flight dataset D' as the new UAV flight dataset D. Replace the asymmetric k-nearest neighbor matrix ak_matrix with the expanded asymmetric k-nearest neighbor matrix pk_matrix, and replace the original shared neighbor matrix s_matrix with the updated shared neighbor matrix ps_matrix. Treat the above data as known data, take the next newly added data point, and repeat steps 2 and 3 to achieve incremental acquisition of shared neighbors.

Claims

1. A method for obtaining incremental shared neighbors based on an asymmetric k-nearest neighbor matrix, characterized in that: The following steps are involved: Step 1: Get the original shared neighbor matrix of the UAV flight dataset D, assign the number of data points of the UAV flight dataset D to the data volume m, initialize and update the k-nearest neighbor distance vector k_distvector, initialize and update the asymmetric k-nearest neighbor matrix ak_matrix, calculate the upper triangular shared neighbor matrix us_matrix corresponding to the UAV flight dataset D, and obtain the original shared neighbor matrix s_matrix corresponding to the UAV flight dataset D according to the upper triangular shared neighbor matrix us_matrix; Step 2: Calculate the newly added data point d p The k-nearest neighbor row vector pk_vector and the inverse k-nearest neighbor column vector rpk_vector are obtained, and the asymmetric k-nearest neighbor matrix ak_matrix is ​​updated; the asymmetric k-nearest neighbor matrix pk_matrix after dimensional expansion is initialized and assigned values; Step 3: Initialize and assign the updated shared neighbor matrix ps_matrix, combined with the newly added data point d p Replace some data points in the updated shared neighbor matrix ps_matrix; Step 4: Increase the data volume m by 1 and add a new data point d p Insert the drone flight data set D to form a new drone flight data set D, replace the asymmetric k-nearest neighbor matrix ak_matrix with the expanded asymmetric k-nearest neighbor matrix pk_matrix, replace the original shared neighbor matrix s_matrix with the updated shared neighbor matrix ps_matrix, take the next newly added data point and repeat steps 2 and 3, The step 2 comprises the following steps: Step 2.1, enter the newly added data point d p ; Step 2.2, calculate the newly added data point d p The distance from each data point in the drone flight data set D is sorted to get the newly added data point d p k nearest neighbor set NN in the drone flight dataset D k (d p ), calculate the newly added data point d according to the following formula p The k-nearest neighbor row vector pk_vector and the inverse k-nearest neighbor column vector rpk_vector are obtained, and the asymmetric k-nearest neighbor matrix ak_matrix is ​​updated: (1) (2) (3) In the above formula, pk_vector(1,j4) represents the newly added data point d p The k nearest neighbor row vector of the data point in row 1 and column j4, d j4 represents the j4th data point in the UAV flight dataset D, j4∈[1,m], rpk_vector(i4,1) indicates the newly added data point d p The data point in the i4th row and first column of the inverse k-nearest neighbor column vector, d i4 represents the i4th data point in the UAV flight data set D, k_distvector(i4) represents the data point in the i4th row and 1st column of the k-nearest neighbor distance vector k_distvector, i4∈[1,m], ak_matrix(i5,t5) represents the data point in row i5 and column t5 of the asymmetric k-nearest neighbor matrix, d t5 is the i5th data point d in the drone flight dataset D i5 k nearest neighbor set NN k (d i5 ), k_distvector(i5) represents the data point in the i5th row and the first column of the k-nearest neighbor distance vector k_distvector, i5, t5∈[1,m]; Step 2.3: Initialize the expanded asymmetric k-nearest neighbor matrix pk_matrix to an all-zero matrix with m+1 rows and m+1 columns. Assign values ​​to the expanded asymmetric k-nearest neighbor matrix pk_matrix according to the following formula: pk_matrix(1:m,1:m)=ak_matrix pk_matrix(m+1,1:m)=pk_vector pk_matrix(1:m,m+1)=rpk_vector pk_matrix(m+1,m+1)=0 In the above formula, pk_matrix(1:m,1:m) represents the data points of the 1st to mth rows and the 1st to mth columns of the expanded asymmetric k-nearest neighbor matrix pk_matrix, pk_matrix(m+1,1:m) represents the data points of the 1st to mth columns of the m+1th row of the expanded asymmetric k-nearest neighbor matrix pk_matrix, pk_matrix(1:m,m+1) represents the data points of the m+1th columns of the 1st to mth rows of the expanded asymmetric k-nearest neighbor matrix pk_matrix, and pk_matrix(m+1,m+1) represents the data points of the m+1th row and the m+1th column of the expanded asymmetric k-nearest neighbor matrix pk_matrix.

2. The incremental shared neighbor acquisition method based on an asymmetric k-nearest neighbor matrix according to claim 1, characterized in that: The step 1 comprises the following steps: Step 1.1: Input the UAV flight dataset D, assign the number of data points in the UAV flight dataset D to the data volume m, and calculate the k nearest neighbors of each data point in the UAV flight dataset D; Step 1.2, initialize the asymmetric k-nearest-neighbor matrix ak_matrix to an all-zero matrix with m rows and m columns, and initialize the k-nearest-neighbor distance vector k_distvector to an all-zero vector with m rows and 1 column; Step 1.3: Update the k-nearest-neighbor distance vector k_distvector in step 1.2 according to the following formula: Among them, k_distvector(i1) represents the data point in row i1 and column 1 of the k-nearest neighbor distance vector k_distvector, d t1 is the data point d i1 k nearest neighbor set NN k (d i1 ) in any data point, data point d i1 is the i1th data point in the UAV flight data set D, i1 represents the sequence number, i1∈[1,m]; Step 1.4: Update the asymmetric k-nearest neighbor matrix ak_matrix in step 1.2 according to the following formula: Among them, d i2 and d j2 They represent the i2th and j2th data points in the UAV flight dataset D, respectively, and NN k (d i2 ) is the data point d in the UAV flight data set D i2 The set of k nearest neighbors except itself, ak_matrix(i2,j2) represents the i2th row and j2th column data in the asymmetric k-nearest neighbor matrix ak_matrix, i2, j2∈[1,m]; Step 1.5: Calculate the upper triangular shared neighbor matrix us_matrix corresponding to the UAV flight dataset D based on the asymmetric k-nearest neighbor matrix ak_matrix obtained in step 1.

4. The data us_matrix(i3,j3) in the i3th row and j3th column of the upper triangular shared neighbor matrix us_matrix is ​​obtained by the following formula: Among them, ak_matrix(i3,:) and ak_matrix(j3,:) T They represent the transposed vectors of the vector consisting of the i3th row data and the j3th row data in the asymmetric k-nearest neighbor matrix ak_matrix, i3, j3∈[1,m], i3≤j3; The original shared neighbor matrix s_matrix corresponding to the drone flight dataset D is calculated according to the following formula: s_matrix=us_matrix+us_matrix T 。 3. The incremental shared neighbor acquisition method based on an asymmetric k-nearest neighbor matrix according to claim 1, characterized in that: The step 3 comprises the following steps: Step 3.1, initialize the updated shared neighbor matrix ps_matrix to an all-zero matrix with m+1 rows and m+1 columns; Step 3.2: Assign values ​​to some data points in the updated shared neighbor matrix ps_matrix according to the following formula: ps_matrix(1:m,1:m)=s_matrix(1:m,1:m) Step 3.3, combined with the newly added data point d p Replace some data points in the shared neighbor matrix ps_matrix updated in step 3.

2.

4. The incremental shared neighbor acquisition method based on an asymmetric k-nearest neighbor matrix according to claim 3, characterized in that: The step 3.3 includes the following steps: Step 3.3.1, select the sequence number q of the data point that satisfies the following formula: Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula: ps_matrix(i6,q)=pk_matrix(i6,:)×pk_matrix(q,:) T ps_matrix(q,i6)=ps_matrix(i6,q) In the above formula, ps_matrix(i6,q), pk_matrix(i6,:) and pk_matrix(q,:) T They represent the data point in the i6th row and qth column of the updated shared neighbor matrix ps_matrix, the vector composed of the i6th row data of the expanded asymmetric k-nearest neighbor matrix pk_matrix, and the transpose of the vector composed of the data points in the qth row of the expanded asymmetric k-nearest neighbor matrix pk_matrix. ps_matrix(q,i6) represents the data point in the qth row and i6th column of the updated shared neighbor matrix ps_matrix, i6∈[1,m+1], i6≠q. Step 3.3.2, select the sequence number f of the data point that satisfies the following formula: Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula: ps_matrix(i7,f)=pk_matrix(i7,:)×pk_matrix(f,:) T ps_matrix(f,i7)=ps_matrix(i7,f) In the above formula, pk_matrix(i7,:) and pk_matrix(f,:) T They represent the transpose of the vector consisting of the data points in the i7th row and the fth row in the expanded asymmetric k-nearest neighbor matrix pk_matrix, respectively. ps_matrix(i7,f) represents the data point in the i7th row and fth column in the updated shared neighbor matrix ps_matrix. ps_matrix(f,i7) represents the data point in the fth row and i7th column in the updated shared neighbor matrix ps_matrix, i7∈[1,m+1], i7≠f. Step 3.3.3, filter the data point index l that satisfies the following formula: Replace some data points in the updated shared neighbor matrix ps_matrix according to the following formula: ps_matrix(m+1,l)=pk_matrix(m+1,:)×pk_matrix(l,:) T ps_matrix(l,m+1)=ps_matrix(m+1,l) pk_matrix(m+1,:) and pk_matrix(l,:) T They respectively represent the transpose of the vector consisting of the data points in the m+1th row and the lth row in the expanded asymmetric k-nearest neighbor matrix pk_matrix. ps_matrix(m+1,l) represents the data point in the m+1th row and lth column in the updated shared neighbor matrix ps_matrix. ps_matrix(l,m+1) represents the data point in the lth row and m+1th column in the updated shared neighbor matrix ps_matrix.

Citation Information

Patent Citations

  • Online unsupervised anomaly detection

    US20210334673A1