A user behavior data storage optimization method based on an approximate nearest neighbor search algorithm

By constructing a weighted undirected graph parallel computing and depth-first search to optimize the data storage sequence of user behavior data, the problem of low retrieval efficiency caused by the growth of data scale in smart home systems is solved, thereby improving system response speed and user experience.

CN120803371BActive Publication Date: 2025-12-09QINGDAO TAPER ROBOTICS CO LTD +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511284798.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2025-12-09
Estimated Expiration
2045-09-10

AI Technical Summary

Technical Problem

In existing technologies for smart home systems, the increasing scale of user behavior data leads to read/write overhead between memory and hard drives, as well as network communication impacts retrieval efficiency and reduces system response speed.

Method used

By constructing a weighted undirected graph, the Kruskal algorithm is used to generate the maximum spanning tree, and parallel computation and depth-first search are performed to optimize the storage sequence of data blocks, thereby reducing the number of hard disk reads and network latency.

Benefits of technology

It significantly improved the retrieval speed of user behavior data and system stability, and enhanced the response speed and user experience of smart home systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803371B_ABST
    Figure CN120803371B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data storage optimization, and particularly relates to a user behavior data storage optimization method based on an approximate neighbor search algorithm, which specifically comprises the following steps: collecting user behavior data through various sensors and intelligent devices, analyzing data blocks involved in the historical query process of the user behavior data, constructing a historical use matrix of the data blocks, further constructing a weighted undirected graph according to the matrix information, then constructing a maximum spanning tree based on the weighted undirected graph using Kruskal's algorithm, generating the longest path of the tree through two depth-first searches, extracting the optimal data block storage sequence subsequence from the longest path, removing the related nodes of the subsequence from the weighted undirected graph, repeating the search and removal operations until the weighted undirected graph is empty, and generating a complete data block optimal storage sequence. Through the introduction of the approximate neighbor search and the graph optimization algorithm, the storage efficiency of the user behavior data can be improved, and the access delay during the query can be significantly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data storage optimization, and particularly relates to a user behavior data storage optimization method based on an approximate nearest neighbor search algorithm. BACKGROUND

[0002] With the maturity of technologies such as the Internet of Things and 5G, the smart home industry has entered a stage of vigorous development, and more and more families choose smart homes, driving the rapid growth of the market. However, in order to improve the user experience and increase user stickiness, it is necessary to collect, process and store user behavior data. Under the background of a large population base in China and the continuous use of smart homes by users, a large amount of user behavior data will be generated. How to efficiently and reasonably store these data and improve the speed of terminal reading data has become one of the problems that need to be solved at present. User behavior data is influenced by many factors, so there is a large difference in user behavior data. In the field of smart homes, user behavior data can be represented as a vector containing multiple dimensions, where each dimension represents a different aspect, in order to improve the compactness of storing user data and improve computing efficiency. Facing massive high-dimensional user behavior data, the approximate nearest neighbor algorithm (ANN) can find the possible nearest neighbor (NN) of the target node with high retrieval efficiency under the premise of ensuring retrieval accuracy. As a general algorithm for implementing large-scale data retrieval, ANN has been widely used in various information retrieval research and data mining research such as classification and clustering, and has obvious technical universality.

[0003] But with the overall outbreak of smart home, the size of user behavior data continues to grow, and user behavior data and its index structure cannot be stored in the relatively limited terminal memory at the same time, and only the index structure and a small part of the data can be stored in the terminal memory, and the majority of the data can be stored in the cloud hard disk; the traditional approximate nearest neighbor search algorithm will first represent the multi-modal user behavior data as a plurality of high-dimensional vectors when processing large-scale user data, then select the core data in the high-dimensional vector through clustering and other methods (hereinafter referred to as the head node, and the non-core data is referred to as the non-head node), then use the head node to build an index, then divide the non-head node according to the distance between the head node, and obtain the same number of non-head node data blocks as the head node; the index built by the head node is called head index, and the data block of the non-head node is called hard disk index, after the division is completed, the head index is stored in the terminal memory, and the hard disk index is stored in the cloud hard disk; in the process of finding the target user data, the query statement is represented as a high-dimensional vector in the previous manner, then a plurality of head nodes are queried in the head index, and the data block corresponding to the head node is loaded into the terminal memory through hard disk reading and writing or network communication; compared with the pure memory search method, this method significantly relieves the memory pressure and greatly improves the data processing scale, but the memory and hard disk reading and writing overhead and network communication caused by large-scale data sets will affect the overall efficiency of the search, and then affect the response speed of the smart home terminal system.

[0004] Therefore, the present application provides a user behavior data storage optimization method based on an approximate nearest neighbor search algorithm to solve the above problems. SUMMARY

[0005] The present application is directed to the deficiencies of the prior art, and a user behavior data storage optimization method based on an approximate nearest neighbor search algorithm is developed, which can improve the speed and stability of the approximate nearest neighbor search algorithm by determining the storage order of the data block in the hard disk according to the usage frequency, access order and spatiotemporal local features and generating a new efficient storage sequence, thereby greatly improving the user experience and system reliability of the smart home system.

[0006] The technical scheme for solving the technical problems of the present application is a user behavior data storage optimization method based on an approximate nearest neighbor search algorithm, comprising the following steps:

[0007] S1, collecting the behavior data of the user in different scenes through the sensors and intelligent devices in the smart home system, and then preprocessing the collected behavior data to construct a user behavior database;

[0008] S2. Analyze the data blocks involved in the historical query process of user behavior data in the smart home system, extract the access frequency of each data block and the correlation between data blocks, and then construct a historical usage matrix of data blocks;

[0009] S3. Construct a weighted undirected graph using a matrix based on the history of the data blocks. Treat all data blocks as nodes in the graph. If two data blocks are read simultaneously in the history, establish an edge between the two data blocks. The weight of the edge is determined by the frequency of co-occurrence. Then, construct the maximum spanning tree using Kruskal's algorithm and optimize the calculation process of the maximum spanning tree using parallel computing.

[0010] S4. Calculate the longest path of the maximum spanning tree using two depth-first search (DFS) operations. Extract the optimal data block storage sequence subsequence based on the longest path. Then remove the relevant nodes and edges of the subsequence from the weighted undirected graph. Repeat the above process multiple times until the weighted undirected graph is empty, and finally form the complete optimal data block storage sequence.

[0011] S1 is as follows:

[0012] The sensors include temperature sensors, light sensors, motion sensors, and door / window sensors;

[0013] Smart devices include smart light bulbs, smart speakers, and smart thermostats;

[0014] Preprocessing operations include data cleaning and normalization.

[0015] The preprocessed data is transformed into a high-dimensional vector form, and then a user behavior database is built based on the high-dimensional vector data.

[0016] S2 is as follows:

[0017] Historical query information is obtained through the system logs of the smart home system. Relevant data blocks are then derived from this historical query information based on user behavior data. The number of historical query records is represented as... , The number of data blocks read for each historical query is represented as , The historical usage matrix of the data blocks obtained from historical query information is represented as follows: , Representation matrix Middle data block The number.

[0018] The specific steps for constructing a weighted undirected graph using a matrix based on the history of data blocks are as follows:

[0019] Data block matrix Each data block in Add it as a node to the weighted undirected graph to be constructed, and then select the matrix row by row. A bidirectional edge is constructed between any two nodes. When a bidirectional edge already exists between the two nodes, its weight is incremented by 1, ultimately resulting in a weighted undirected graph. , Represents a set of nodes, i.e., a data block matrix. Data blocks in The set, This represents the set of edges, indicating the relationship between two different nodes. This represents the weight, which is the probability that two nodes are read simultaneously.

[0020] The specific steps for constructing a maximum spanning tree using Kruskal's algorithm are as follows:

[0021] Kruskal's algorithm is used based on the weighted undirected graph Construct the maximum spanning tree;

[0022] First, set the edges Sort all bidirectional edges according to their weights and create an empty set. Store the edges of the maximum spanning tree;

[0023] Then, create a disjoint-set data structure to manage the set of nodes. Connectivity of mid-vertex;

[0024] Iterate through each edge, for the current edge ,in and The set of vertices belonging to the graph Check vertices and Whether they belong to the same set; if a cycle exists, they belong to the same set.

[0025] If they do not belong to the same set, then the edges will be... Store to collection In the middle, and merged in the query set. and A set;

[0026] If they belong to the same set, skip this edge;

[0027] When set The number of edges in a weighted undirected graph is equal to the number of edges in the graph. When the number of mid-vertex is reduced by one, the set All edges together form the maximum spanning tree, thus completing the construction of the maximum spanning tree.

[0028] The operation of optimizing the calculation process of the maximum spanning tree is specifically as follows:

[0029] (1) The process of constructing the maximum spanning tree is optimized by using parallel computing:

[0030] Each node in the weighted undirected graph is regarded as an independent subtree, and the weight of the edge is taken as the opposite, and each node broadcasts the weight of its own edge to the neighbor nodes, if a node receives a smaller edge weight, the weight of its own edge is updated to a smaller value, and the updated edge weight is continuously broadcasted outward;

[0031] If two nodes both hope to be a part of an edge, the two nodes are merged on the edge, and after merging, the subtrees where the two nodes are located are merged into a larger subtree; during the merging process, if a loop is formed, the node will delete the edge with the smallest weight on the loop;

[0032] When all nodes are joined into the spanning tree, and there are no more edges to merge, the algorithm terminates, and the final generated tree is the maximum spanning tree of the entire graph;

[0033] (2) The generation of the diameter of the maximum spanning tree is accelerated by using parallel computing:

[0034] A node is selected as the root node, and the entire maximum spanning tree is divided into multiple subtrees, each containing the root node and its descendant nodes, an MPI message passing interface process is started, the subtrees are allocated to each process, and a depth-first search is performed in each process to calculate the diameter of the subtree, and the start and end points of the subtree are recorded;

[0035] For each process, the calculated diameter and start and end points of the subtree are sent to the root process, and the root process collects the diameters and start and end points of all subtrees;

[0036] The root process traverses all the start and end points to find the farthest two points as the start and end points of the diameter of the entire tree, and calculates the path length between them, which is the diameter of the entire tree;

[0037] The MPI process is ended, and the diameter of the entire tree is returned.

[0038] S4 is specifically as follows:

[0039] The diameter of the set is obtained by performing two depth-first searches, and the diameter of the set is the longest diameter of the maximum spanning tree;

[0040] First depth-first search: an initial node is arbitrarily selected , and a depth-first search is performed to find the the farthest node of ;

[0041] Second depth-first search: based on the farthest node of the farthest node of Again, the depth-first search is performed to find the farthest node of the farthest node of ;

[0042] The longest diameter of the maximum spanning tree is obtained, and the longest diameter of the maximum spanning tree is the path from the node to the node , all nodes and edges of the path;

[0043] The nodes contained in the longest diameter of the maximum spanning tree are saved in the order of the tree, which is a subsequence of the final storage sequence, and then the nodes and all edges related to the nodes contained in the subsequence are deleted from the weighted undirected graph , to obtain a new weighted undirected graph;

[0044] Then, a new maximum spanning tree is generated from the new weighted undirected graph by Kruskal algorithm, and then the above depth-first search operation is performed to obtain a new weighted undirected graph, and the operation is repeated multiple times until the weighted undirected graph is empty, and the subsequence obtained by each repeated operation constitutes the final storage sequence.

[0045] The effects provided in the summary are only the effects of the embodiments, not all the effects of the invention, and the above technical solutions have the following advantages or beneficial effects:

[0046] The application discloses a user behavior data storage optimization method based on an approximate neighbor search algorithm, which converts user behavior information into high-dimensional vector data in a large-scale approximate neighbor search algorithm scene, and can efficiently and quickly find the required data of a smart home system by searching for related user information through the approximate neighbor search algorithm, thereby solving problems such as slow user behavior data reading speed and low accuracy, and through optimization of a storage path and parallel computing technology, the system significantly reduces the reading frequency and reading time in the process of reading user vector data from a hard disk and transmitting data from the cloud; meanwhile, a complete smart home field search system can be constructed, the search algorithm is continuously improved, the running speed of a terminal can be further improved, real-time problems can be solved, user experience can be optimized, and the sales volume of the smart home can be increased.

[0047] The algorithm provided by the application greatly reduces the reading time of data in a hard disk in the process of searching for user vector data and the network delay in the process of transmitting data from the cloud to the terminal, further solves real-time problems, improves user experience, and can stably operate under high load and complex environment. Attached Figure Description

[0048] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0049] Figure 1 This is a schematic diagram of the method flow of the present invention.

[0050] Figure 2 This is a schematic diagram illustrating the practical application of the present invention. Detailed Implementation

[0051] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific implementation methods and in conjunction with the accompanying drawings.

[0052] Example 1

[0053] like Figure 1 As shown, a method for optimizing user behavior data storage based on an approximate nearest neighbor retrieval algorithm includes the following steps:

[0054] S1. Collect user behavior data in different scenarios through sensors and smart devices in the smart home system, and then build a user behavior database after preprocessing the collected behavior data;

[0055] S2. Analyze the data blocks involved in the historical query process of user behavior data in the smart home system, extract the access frequency of each data block and the correlation between data blocks, and then construct a historical usage matrix of data blocks;

[0056] The access frequency of a data block is the number of times a data block is read in the smart home system. The correlation between data blocks is the probability that two data blocks will be read at the same time. The greater the probability of being read at the same time, the greater the correlation between the data blocks.

[0057] S3. Construct a weighted undirected graph using a matrix based on the history of the data blocks. Treat all data blocks as nodes in the graph. If two data blocks are read simultaneously in the history, establish an edge between the two data blocks. The weight of the edge is determined by the frequency of co-occurrence. Then, construct the maximum spanning tree using Kruskal's algorithm and optimize the calculation process of the maximum spanning tree using parallel computing.

[0058] S4. Calculate the longest path of the maximum spanning tree using two depth-first search (DFS) operations. Extract the optimal data block storage sequence subsequence based on the longest path. Then remove the relevant nodes and edges of the subsequence from the weighted undirected graph. Repeat the above process multiple times until the weighted undirected graph is empty, and finally form the complete optimal data block storage sequence.

[0059] In the detailed description, S1 is specifically as follows:

[0060] The sensors include temperature sensors, light sensors, motion sensors and door and window sensors;

[0061] The smart devices include smart light bulbs, smart speakers and smart thermostats;

[0062] The preprocessing operations include data cleaning and normalization operations;

[0063] The preprocessed data is converted into a high-dimensional vector form, and then a user behavior database is constructed according to the high-dimensional vector data.

[0064] In the detailed description, S2 is specifically as follows:

[0065] The historical query information is obtained through the system log of the smart home system, the relevant data blocks are obtained from the historical query information according to the user behavior data, and the number of historical query information is represented as , The number of data blocks read by each historical query information is represented as , The historical use matrix of the data blocks obtained from the historical query information is represented as , represents the number of the data block in the matrix .

[0066] The operation of constructing a weighted undirected graph according to the historical use matrix of the data blocks is specifically as follows:

[0067] Each data block in the data block matrix is added to the weighted undirected graph to be constructed as a node, and then any two nodes in the matrix are selected row by row to construct a bidirectional edge, and when a bidirectional edge already exists between the two nodes, the weight of the bidirectional edge is increased by 1, and finally the weighted undirected graph , represents a node set, i.e. a set of data blocks in the data block matrix , represents an edge set, represents the reading relationship between two different nodes, represents the weight, i.e. the probability of two nodes being read at the same time.

[0068] In the detailed description, the operation of constructing a maximum spanning tree through Kruskal algorithm is specifically as follows:

[0069] The maximum spanning tree is constructed according to the weighted undirected graph using Kruskal algorithm;

[0070] Firstly, all the bidirectional edges in the edge set are sorted according to the weight, and an empty set is created to store the edges of the maximum spanning tree;

[0071] Then, a union-find set data structure is created to manage the connectivity of the vertices in the vertex set ;

[0072] Iterate through each edge, for the current edge , where and belong to the vertex set in the graph, check whether the vertices and belong to the same set, and a loop exists if they belong to the same set; If they do not belong to the same set, store the edge

[0073] in the set , and merge the sets of and in the union-find set; If they belong to the same set, skip this edge to avoid forming a loop;

[0074] When the number of edges in the set

[0075] is equal to the number of vertices in the weighted undirected graph minus one, all the edges in the set together form the maximum spanning tree, that is, the construction of the maximum spanning tree is completed. In the specific implementation, the operation of optimizing the calculation process of the maximum spanning tree is as follows:

[0076] (1) The parallel computing method is used to optimize the process of constructing the maximum spanning tree:

[0077] Each node in the weighted undirected graph is regarded as an independent sub-tree, and the weight of the edge is taken in reverse, and each node broadcasts the weight of its own edge to the neighbor nodes. If a node receives a smaller edge weight, it updates its own edge weight to a smaller value and continues to broadcast the updated edge weight to the outside;

[0078] If two nodes both want to be a part of an edge, the two nodes are merged on the edge. After merging, the sub-trees where the two nodes are located are merged into a larger sub-tree. During the merging process, if a loop is formed, the node deletes the edge with the smallest weight on the loop;

[0079]

[0080] ​When all nodes are joined into the spanning tree and no more edges can be merged, the algorithm terminates, and the final generated tree is the maximum spanning tree of the entire graph;

[0081] (2) The parallel computing method is used to accelerate the generation of the diameter of the maximum spanning tree:

[0082] A node is selected as the root node, and the entire maximum spanning tree is divided into multiple sub-trees, each sub-tree containing the root node and its descendant nodes, an MPI message passing interface process is started, the sub-trees are allocated to each process, and a depth-first search is performed in each process to calculate the diameter of the sub-tree, and the start point and end point of the sub-tree are recorded;

[0083] For each process, the calculated sub-tree diameter and start point and end point are sent to the root process, and the root process collects the diameters and start points and end points of all sub-trees;

[0084] The root process traverses all the start points and end points to find the farthest two points as the start point and end point of the diameter of the entire tree, and calculates the path length between them, which is the diameter of the entire tree;

[0085] The MPI process is ended, and the diameter of the entire tree is returned.

[0086] In the specific implementation, S4 is specifically as follows:

[0087] The diameter of the set is obtained by performing two depth-first searches, and the diameter of the set is the longest diameter of the maximum spanning tree;

[0088] First depth-first search: an initial node is selected arbitrarily , and then a depth-first search is performed to find the farthest node from the node ;

[0089] Second depth-first search: based on the farthest node from the node , a depth-first search is performed again to find the farthest node from the node ;

[0090] The longest diameter of the maximum spanning tree is obtained, and the longest diameter of the maximum spanning tree is the path of all nodes and edges from the node to the node ;

[0091] The nodes contained in the longest diameter of the maximum spanning tree are saved in the order of the tree, which is a sub-sequence of the final storage sequence, and then the nodes and all edges related to the nodes contained in the sub-sequence are saved from the weighted undirected graph The middle is deleted to obtain a new weighted undirected graph;

[0092] According to the new weighted undirected graph, a new maximum spanning tree is generated by the Kruskal algorithm, and then the above depth-first search operation is performed to obtain a new weighted undirected graph, and the operation is repeated multiple times until the weighted undirected graph is empty, and the final storage sequence is formed by the sub-sequences obtained by each repeated operation

[0093] Embodiment 2

[0094] In order to better prove the technical effect of the present application, based on the data in the user behavior database constructed according to the present application, the method in the present application is compared with the existing method IVFPQFS in different situations, and VFPQFS is a large-scale approximate nearest neighbor search algorithm, and the full name is the abbreviation of Inverted File System with Product Quantization and Fast Scan. This algorithm combines inverted file system (IVF), product quantization (PQ) and fast scan (FS) technology, and can be used for efficient processing and retrieval of large-scale high-dimensional vector data.

[0095] In the vector index construction process of the method of the present application and the IVFPQFS method, the entire vector space is first divided into n_list clustering regions, and the number of clustering regions actually searched during query is n_probe, n_list represents the number of clustering units, and n_probe represents the number of clustering units actually scanned.

[0096] As shown in Table 1, the storage sequence in the MST set of the present application and the default storage sequence used by the IVFPQFS algorithm are compared. Under the condition of obtaining the same data and completing the same query, the number of hard disk read times required for reading the storage sequence generated by the present application is significantly lower than that of the storage sequence generated by IVFPQFS. With the decrease of the number of read times, the time required for reading data is also greatly reduced. Therefore, it can be proved that the method in the present application can improve the efficiency of the large-scale approximate nearest neighbor search algorithm.

[0097] Table 1 Comparison of effects of the method of the present application and the existing method

[0098]

[0099] Embodiment 3

[0100] As Figure 2 shown, the actual application process of the method in the present application is as follows:

[0101] The smart home user behavior data includes smart home single-modal query data (i.e. data to be queried) and smart home multi-modal data (i.e. historical records of the smart home system), the smart home user behavior data is vector represented, the instruction to be queried is "turn off the light and the TV through the mobile phone", the instruction includes "mobile phone", "light" and "TV", therefore the instruction to be queried is a cross-modal query; the multi-modal data in the smart home system includes images, texts, videos and voices;

[0102] According to the data block involved in the historical records of the smart home system according to the user behavior data contained in the instruction to be queried, a history matrix of randomly stored data is obtained, then a vector index is constructed, a weighted undirected graph is generated, a maximum spanning tree is constructed through Kruskal algorithm, the longest path of the maximum spanning tree is calculated through twice depth-first search (DFS), and the optimal data block storage sequence sub-sequence is extracted according to the longest path, then the related nodes and edges of the sub-sequence are removed from the weighted undirected graph, the above process is repeated for multiple times until the weighted undirected graph is empty, and finally a complete optimal data block storage sequence is formed, i.e. the regularly stored data after rearrangement is obtained, the randomly stored data and the regularly stored data are stored in the computer hard disk;

[0103] Then the regularly stored data is searched to obtain a vector set composed of TopK query results, and a result set composed of the first K query results is selected.

Claims

1. A method for optimizing user behavior data storage based on an approximate nearest neighbor search algorithm, characterized by the steps of As follows: S1, collecting user behavior data in different scenes through sensors and intelligent devices in the smart home system, and then preprocessing the collected behavior data to construct a user behavior database; S2, analyzing the data blocks involved in the historical query process of the user behavior data in the user behavior database in the smart home system, extracting the access frequency of each data block and the correlation between the data blocks, and then constructing a historical usage matrix of the data blocks; S3, constructing a weighted undirected graph according to the historical usage matrix of the data blocks, regarding all data blocks as nodes in the graph, establishing an edge between two data blocks if they are read simultaneously in the historical record, and the weight of the edge is determined according to the frequency of co-occurrence, then constructing a maximum spanning tree through Kruskal algorithm, and optimizing the calculation process of the maximum spanning tree through parallel computing; S4, calculating the longest path of the maximum spanning tree through two depth-first searches (DFS), and extracting the optimal data block storage sequence subsequence according to the longest path, then removing the related nodes and edges from the weighted undirected graph, repeating the above process multiple times until the weighted undirected graph is empty, and finally forming a complete data block optimal storage sequence.

2. The method of claim 1, wherein the method is characterized by: S1 is as follows: The sensors include temperature sensors, light sensors, motion sensors, and door and window sensors; The intelligent devices include smart light bulbs, smart speakers, and smart thermostats; The preprocessing operations include data cleaning and normalization operations; Convert the preprocessed data into high-dimensional vector form, and then construct the user behavior database according to the high-dimensional vector data.

3. The method of claim 2, wherein the method is characterized by: S2 is as follows: The historical query information is acquired through a system log of the smart home system, the relevant data blocks are obtained from the historical query information according to user behavior data, the number of the historical query information is represented as , , the number of the data blocks read by each historical query information is represented as , , the historical use matrix of the data blocks obtained from the historical query information is represented as , , and the number of the data blocks in the matrix is represented as .

4. The method of claim 3, wherein the method is characterized by: The operation of constructing a weighted undirected graph according to the historical usage matrix of the data blocks is as follows: Each data block in the data block matrix is taken as a node to join in a weighted undirected graph to be constructed, and then any two nodes in the matrix are selected row by row to construct a bidirectional edge, and when a bidirectional edge already exists between the two nodes, the weight of the bidirectional edge is increased by 1, and finally a weighted undirected graph is obtained , , represents a node set, that is, a set of data blocks in the data block matrix , , represents an edge set, and represents a reading relationship between two different nodes, represents a weight, that is, a probability of two nodes being read simultaneously.

5. The method of claim 4, wherein the method is characterized by: The operation of constructing a maximum spanning tree through Kruskal algorithm is as follows: using the kruskal algorithm on a weighted undirected graph constructing a maximum spanning tree; First, sort all the bidirectional edges in the edge set by weight, and create an empty set to store the edges of the maximum spanning tree; Then, a union-find data structure is created to manage the set of nodes Connectivity of the central vertexes; For each edge, check if the vertices belong to the same set where and are vertices in the graph check if vertices and belong to the same set, a cycle exists if they belong to the same set If not, then the edge is stored in the set of edges to the set and the sets are merged in the union-find set and . If they belong to the same set, skip this edge; When the number of edges in the set is equal to the number of vertices in the weighted undirected graph minus one, all the edges in the set together constitute a maximum spanning tree, that is, the construction of the maximum spanning tree is completed.

6. The method of claim 5, wherein the method is characterized by: The operation of optimizing the calculation process of the maximum spanning tree is as follows: (1) Optimize the process of constructing the maximum spanning tree through parallel computing: Regarding each node in the weighted undirected graph as an independent subtree, and taking the inverse of the edge weight, while each node broadcasts its edge weight to its neighbor nodes, if a node receives a smaller edge weight, it updates its own edge weight to a smaller value, and continues to broadcast the updated edge weight; If two nodes both want to be part of an edge, merge the two nodes on this edge, after merging, the two nodes' subtrees will merge into a larger subtree; During the merging process, if a loop is detected, the node will delete the edge with the smallest weight on the loop; When all nodes are added to the spanning tree and there are no more edges to merge, the algorithm terminates, and the final generated tree is the maximum spanning tree of the entire graph; (2) Accelerate the generation of the diameter of the maximum spanning tree through parallel computing: Select a node as the root node, and divide the whole maximum spanning tree into multiple sub-trees, each of which contains the root node and its descendant nodes, start the MPI message passing interface process, allocate the sub-trees to each process, and perform a depth-first search in each process to calculate the diameter of the sub-tree, and record the start and end points of the sub-tree; For each process, the calculated sub-tree diameter and start and end points are sent to the root process, and the root process collects the diameters and start and end points of all sub-trees; The root process traverses all the start and end points to find the farthest two points as the start and end points of the diameter of the whole tree, and calculates the path length between them, which is the diameter of the whole tree; End the MPI process and return the diameter of the whole tree.

7. The method of claim 6, wherein the method is characterized by: S4 is specifically as follows: The diameter of the set is obtained by performing two depth-first searches The diameter of the set is obtained by performing two depth-first searches The diameter of the set is obtained by performing two depth-first searches First depth first search: arbitrarily choose a starting node Then perform a depth first search to find the furthest node from the node ; Second depth first search: based on node farthest node Again, do a depth first search to find the node farthest from node ; the longest diameter of the maximum spanning tree, the longest diameter of the maximum spanning tree being the nodes to the node and edges of the path; The nodes contained in the longest diameter of the maximum spanning tree are saved in the order in the tree, which is a subsequence of the final storage sequence, and then the nodes contained in the subsequence and all the edges related to the nodes are deleted from the weighted undirected graph to obtain a new weighted undirected graph; According to the new weighted undirected graph, a new maximum spanning tree is generated by Kruskal algorithm, and then the above depth-first search operation is performed to obtain a new weighted undirected graph, and the operation is repeated multiple times until the weighted undirected graph is empty, and a final storage sequence is formed by a subsequence obtained by each repeated operation.

Citation Information

Patent Citations

  • Approximate nearest neighbor search method combining VP tree and guide nearest neighbor graph

    CN112287185A

  • Field image splicing method based on Delauny algorithm and Kruskal maximum spanning tree algorithm

    CN117173224A