Vector retrieval method and device based on neighbor graph

By using the integral function of a non-central chi-square distribution in vector retrieval to evaluate the centrality of a vector and dynamically adjust the structure of the nearest neighbor graph, the problem of low navigation accuracy in high-dimensional vector space is solved, and more efficient and reliable vector retrieval is achieved.

CN119917705AActive Publication Date: 2025-05-02HANGZHOU DIANZI UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510397237.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-05-02
Estimated Expiration
2045-04-01

AI Technical Summary

Technical Problem

The existing vector search method based on nearest neighbor graphs has the problem of low navigation accuracy in high-dimensional vector space, which leads to insufficient robustness and reliability of the search results.

Method used

By using the integral function of non-central chi-square distribution, the centrality degree of each vector in the vector data set is determined, and a neighbor graph is constructed based on this, the neighbor selection rules are dynamically adjusted, and the structure of the neighbor graph is optimized.

Benefits of technology

It improves the accuracy and efficiency of vector retrieval, enhances the robustness and reliability of search results, and adapts to different vector data sets and query scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917705A_ABST
    Figure CN119917705A_ABST
Patent Text Reader

Abstract

The invention discloses a vector retrieval method and device based on a neighbor graph, and relates to the field of vector retrieve.The method comprises the steps that according to a vector data set, an integral function of non-centrality chi-square distribution is adopted, and the centrality degree of each vector in the whole vector data set is determined; according to the centrality degrees of all the vectors, a centrality degree set # imgabs0 # is obtained; according to the similarity distance between the vectors in the vector data set and # imgabs 1 #, adopting a gradual vector adding method to construct a neighbor graph # imgabs 2 #; performing vector central degree traversal calculation on the # imgabs3 #; based on the central degree set # imgabs4 #, performing tuning and edge cutting operation on the neighbor graph to obtain a final result neighbor graph # imgabs5 #; and searching on # imgabs6 # by taking the feature vector of the query object as a query vector to obtain a vector retrieval result. According to the method, the precision and efficiency of vector retrieval based on the neighbor graph can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vector retrieval, and in particular to a vector retrieval method and device based on a nearest neighbor graph. Background Art

[0002] With the development of artificial intelligence technology, vector retrieval technology has been applied to fields such as information retrieval and retrieval enhancement generation (RAG) to process search tasks for massive unstructured data such as images and texts. As the best solution to vector data search tasks, vector retrieval technology based on neighbor graphs has become a research hotspot in academia and industry.

[0003] However, the vector space itself has a data aggregation effect, that is, the higher the dimension, the more concentrated the distance distribution between vectors will be. This phenomenon will significantly affect the effectiveness of the step of selecting the neighbor set in the current mainstream neighbor graph construction algorithm, thereby affecting the navigation accuracy of the resulting neighbor graph.

[0004] Therefore, in order to solve the above problems, it is urgent to provide a new vector retrieval method based on neighbor graph. Summary of the invention

[0005] The purpose of this application is to provide a vector retrieval method and device based on a nearest neighbor graph, which can improve the accuracy and efficiency of vector retrieval in specific scenarios.

[0006] To achieve the above objectives, this application provides the following solutions: In a first aspect, the present application provides a vector retrieval method based on a neighbor graph, and the vector retrieval method based on a neighbor graph includes: According to the vector data set, the integral function of the non-central chi-square distribution is used to determine the centrality of each vector in the entire vector data set; and according to the centrality of all vectors, the centrality degree set is obtained. ; The vector data set is , is the number of vectors, is the vector dimension; According to the similarity distance and centrality degree set between each vector in the vector data set , using the method of incrementally adding vectors to construct a neighbor graph ; Nearest Neighbor Graph Perform vector centrality degree traversal calculation to obtain the updated centrality degree set of all vectors ; Based on the updated centrality degree set of all vectors , for the nearest neighbor graph Perform trimming operations to obtain the final neighbor graph. ; The feature vector of the query object is used as the query vector, and the neighbor graph of the final result is Search on and get the vector retrieval results.

[0007] In a second aspect, the present application provides a vector retrieval device based on a neighbor graph, the vector retrieval device based on a neighbor graph comprising: The centrality determination module is used to determine the centrality of each vector in the entire vector data set based on the vector data set and the integral function of the non-central chi-square distribution; and obtain the centrality degree set based on the centrality degrees of all vectors. ; The vector data set is , is the number of vectors, is the vector dimension; The neighbor graph construction module is used to collect the similarity distance and centrality degree between each vector in the vector data set. , using the method of incrementally adding vectors to construct a neighbor graph ; The centrality degree set determination module is used to determine the neighbor graph Perform vector centrality degree traversal calculation to obtain the updated centrality degree set of all vectors , used to characterize the neighbor graph The central neighbor relationship; The final result neighbor graph determination module is used to determine the centrality degree set of all updated vectors , for the nearest neighbor graph Perform trimming operations to obtain the final neighbor graph. ; The vector retrieval result determination module is used to use the feature vector of the query object as the query vector and Search on and get the vector retrieval results.

[0008] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vector retrieval method based on a nearest neighbor graph.

[0009] According to the specific embodiments provided in this application, this application has the following technical effects: The present application provides a vector retrieval method and device based on a neighbor graph. By using the integral function of the non-central chi-square distribution according to the vector data set, the centrality of each vector in the entire vector data set is determined, and then a quantitative index is provided for each vector to characterize its centrality characteristics, so that when constructing the neighbor graph, the selected neighbors not only rely on the Euclidean distance, but also comprehensively consider the distribution characteristics of the data. Based on the updated set of centrality degrees of all vectors , for the nearest neighbor graph Perform trimming operations to obtain the final neighbor graph. By dynamically adjusting the neighbor selection rules, it can help find more representative neighbors, thereby forming a better neighbor graph in the vector space; effectively improve the global navigation performance, making the retrieval results more robust and reliable; and thus enable this application to adapt to different vector data sets and query scenarios. The high adaptability enables this application to maintain high performance in various application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0011] Figure 1 The figure is a flowchart of a vector retrieval method based on a neighbor graph in one embodiment of the present application. DETAILED DESCRIPTION

[0012] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0013] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0014] In an exemplary embodiment, Figure 1 As shown, a vector retrieval method based on a nearest neighbor graph is provided, and the method includes the following S101 to S105. Wherein: S101, based on the vector dataset , using the integral function of the non-central chi-square distribution, determine the centrality of each vector in the entire vector data set; and based on the centrality of all vectors, obtain the centrality set ; The vector data set is , is the number of vectors, is the vector dimension.

[0015] S101 specifically includes: S11, obtain vector data set Data distribution of the vector data set The mean center is .

[0016] S12, determine the Vector To the mean center Distance .

[0017] S13, determine all vectors to the mean center Sort by distance .

[0018] S14, sort Mapped to and the noncentrality parameter is The meaningful interval of the integral function of the noncentral chi-square distribution In, get the mapping value .

[0019] S15, according to the mapping value , using the integral function of the non-central chi-square distribution to determine the integral of each vector in the entire vector data set The degree of centrality , .

[0020] S102, based on the vector data set The similarity distance and centrality degree set between each vector in , using the method of incrementally adding vectors to construct a neighbor graph .

[0021] S102 specifically includes: Step 2.1, aggregate the centrality degree The vector corresponding to the maximum centrality degree in is used as the entry point of the neighbor graph .

[0022] Step 2.2, get the current vector to be inserted , with vector As the query vector in the construction of the neighbor graph Search on and maintain a capacity of An ordered candidate set queue , and the entry point Insert into candidate set queue middle.

[0023] Step 2.3, select candidate set queue Mid-range vector The nearest vector that has not been visited yet , get the vector Neighbors vector set , the marker vector is the visited vector; and the vector Neighbors vector set Each vector in is added to the candidate set queue , while keeping the candidate set queue The query vector The smallest distance vectors.

[0024] Step 2.4, repeat step 2.3 until the candidate set queue The vectors in are visited; and the current candidate set queue is As the current vector to be inserted The candidate neighbor set .

[0025] Step 2.5: Based on the candidate neighbor set, use the judgment condition to determine the current vector to be inserted Neighborhood set ; Neighborhood Set The upper limit of capacity is , Hyperparameters configured for building a neighbor graph; the judgment condition is the candidate neighbor vector currently traversed and any vector inserted into the neighbor set All meet the following requirements: .

[0026] in, According to the candidate neighbor vector The degree of centrality Determine the relaxation parameters, , The recommended setting for the hyperparameters configured to build the neighbor graph is 0.2. is the similarity distance function.

[0027] Step 2.6, traverse the vector to be inserted Neighborhood set , the vector to be inserted Add to neighbor set in reverse The neighbor set of each vector in the vector; the neighbor set after adding the neighbors in reverse The capacity limit is enlarged to ; After the reverse addition operation, the neighbor set The number of inner vectors is greater than the capacity When , the neighbor reselection operation is performed, and the candidate neighbor set The neighbor set whose capacity exceeds the limit , Hyperparameters configured for building the neighbor graph.

[0028] Step 2.7, repeat steps 2.2 to 2.6 to insert all vectors into the current neighbor graph to obtain the neighbor graph .

[0029] S103, for the neighbor graph Perform vector centrality degree traversal calculation to obtain the updated centrality degree set of all vectors .

[0030] S103 specifically includes: Step 3.1, traverse the neighbor graph , count each vector by its nearest neighbor graph The number of times other vectors are selected as neighbors in the neighbor graph The in-degree of .

[0031] Step 3.2, according to the minimum in-degree and the maximum in-degree , the range of the in-degree of all vectors is evenly divided into intervals; Step 3.3, let The number of vectors in the interval is , using the empirical cumulative distribution function to determine the vector in the neighborhood graph The degree of data centrality in: .

[0032] Among them, the interval The data centrality of all vector data in the interval is .

[0033] Step 3.4, traverse all vectors to obtain the updated centrality degree set , used to characterize the neighbor graph The central neighbor relationship.

[0034] S104, the centrality degree set of all vectors based on the current neighbor relationship , for the nearest neighbor graph Perform trimming operations to obtain the final neighbor graph. .

[0035] S104 specifically includes: The neighbor graph is optimized and trimmed according to the current neighbor relationship to obtain the final neighbor graph. . Traverse the neighbor graph For all vectors in , change the capacity of each vector's neighbor set from Zoom out to .

[0036] S105, using the feature vector of the query object as the query vector, in the final result neighbor graph Search on and get the vector retrieval results.

[0037] S105 specifically includes: Step 5.1, according to the nearest neighbor graph Determine the highest in-degree vectors, and vectors as candidate sets; with entry point As a search entry point, and select from the candidate set neighbors as the initial starting queue for the search, Initialize relaxation parameters for the search.

[0038] Step 5.2, let the query vector be , maintain a capacity of An ordered candidate set queue , and use the initial startup queue to fill the ordered candidate set queue .

[0039] Step 5.3, from the ordered candidate set queue Get and query vectors in The unvisited vector with the smallest distance , get the unvisited vector Neighbors vector set , and mark the unvisited vector is the visited vector.

[0040] Step 5.4, set the neighbor vector Each neighbor vector in is added to the ordered candidate set queue , and only keep the ordered candidate set queue The query vector The smallest distance vectors.

[0041] Step 5.5, repeat steps 5.3 and 5.4 until the ordered candidate set queue is All were visited.

[0042] Step 5.6: Order the candidate set queue With query vector The smallest distance vector as vector search result in .

[0043] The following is an explanation of the vector retrieval method based on the neighbor graph provided by the present application through a specific embodiment, wherein the acquired patent abstract dataset is used to generate corresponding vector data; the feature vector set of the patent abstract dataset is generated using a pre-trained model; the text data of the patent abstract can be trained using the existing BERT model to extract features and transform them into a vector dataset corresponding to the patent abstract features. , the vector dimension is , the number of vectors is .

[0044] Calculate the vector dataset corresponding to the patent abstract features The degree of data centrality of each vector data in the entire vector data set. Calculate the total vector data To the mean center of the data set Distance Then sort. and mean center Distance Sort order Mapped to and the noncentrality parameter is The meaningful interval of the integral function of the noncentral chi-square distribution In, get the mapping value . According to the mapping value , the integral function of the non-central chi-square distribution is used to determine the centrality of each vector in the entire vector data set .

[0045] .

[0046] in, is the central chi-square distribution integral function, ,! is the factorial, the centrality degree set for: .

[0047] According to the patent abstract feature vector set The similarity of each vector in constructs a neighbor graph , the similarity distance can be calculated as the Euclidean distance between vectors: .

[0048] in, For any dimensional vector, For vector No. Quantity, For vector No. Quantity, The function returns a vector The similarity distance.

[0049] Furthermore, construct a patent neighbor graph The specific process is as follows: Step 1: Select the data center value The largest vector data as a neighbor graph Entry point . With entry point As the starting point for building the neighbor graph, the neighbor graph is constructed by gradually adding vector data .

[0050] Step 2: From the patent feature vector set Select the vector to be inserted ,by To search for the query vector on the constructed neighbor graph, maintain a capacity of An ordered candidate set queue , will enter the point Insert into candidate set queue middle.

[0051] Step 3: Select the candidate set queue Medium distance vector to be inserted The most recent point that has not been visited yet , obtain the Neighbors vector set .

[0052] Step 4: Each vector in is added to , and only keep The vector to be inserted The smallest distance vectors.

[0053] Step 5: Repeat steps 3 and 4 until There is no vector that has not been visited. The candidate set queue obtained at this time As the vector to be inserted The candidate neighbor set .

[0054] Step 6: Set the vector data to be inserted The neighbor set of , the upper limit of capacity is , Hyperparameters configured for building the neighbor graph; traverse the neighbor candidate set queue in turn, and only add candidate neighbors that meet the following conditions to the neighbor set: Let the candidate neighbor vector currently traversed be , and any vector inserted into the neighbor set All meet the following requirements: .

[0055] in, Based on vector data Data Centrality The relaxation parameters are determined. , The recommended setting for the hyperparameters configured to build the nearest neighbor graph is 0.2. is the similarity distance function.

[0056] Step 7: Traverse the vector to be inserted Neighborhood set ,Will Reverse the value of each vector added to the neighbor set The neighbor set after adding neighbors in reverse The capacity limit is enlarged to After the reverse addition operation, the neighbor set The number of inner vectors is greater than the capacity When , the neighbor reselection operation is performed, and the candidate neighbor set The neighbor set whose capacity exceeds the limit , Hyperparameters configured for building the neighbor graph.

[0057] Step 8: Repeat steps 2 to 7 to insert all vectors into the neighbor graph, and finally obtain the neighbor graph based on the patent vector dataset. .

[0058] Step 9: Traverse the neighbor graph , count the number of times each vector in the statistical data set is selected as a neighbor by other vectors in the entire graph, that is, the in-degree of the vector in the neighbor graph, recorded as .

[0059] Step 10, according to the minimum in-degree and maximum Divide the in-degree range of all vectors in the data set evenly into interval. The number of vectors in the interval is , using the empirical cumulative distribution function to determine the vector in the neighborhood graph The degree of centrality of the data in; traverse all vectors to obtain the updated set of centrality degrees , used to characterize the neighbor graph The central neighbor relationship.

[0060] Step 11, let the The number of vectors in the interval is , using the empirical cumulative distribution function to determine the vector in the neighborhood graph The degree of data centrality in: .

[0061] Among them, the interval The data centrality of all vector data in the interval is Traverse all vectors in the data set to obtain their corresponding data centrality , and get the updated centrality degree set , used to characterize the neighbor graph The central neighbor relationship.

[0062] Step 12: The numerical set in the obtained vector data Perform trimming operations on the neighbor graph to obtain the final neighbor graph. . Traverse the neighbor graph All vectors in , the neighbor set of each vector The capacity from Zoom out to , which is a process of reselecting neighbors. At this time, the candidate neighbor set The neighbor set whose capacity exceeds the limit .

[0063] Step 13: At this point, the neighbor graph generation phase ends and the neighbor graph can be used First, generate a query object from the patent abstract to be queried as the query object. , which is the feature vector of the patent abstract text data to be queried generated by the pre-trained model.

[0064] Step 14: After the feature vector of the patent abstract text to be queried is generated, use the query vector In the neighbor graph based on patent abstract feature vector Query feature vectors, and finally returns the patent abstract text that is most similar to the query Patents.

[0065] By counting the degree of centrality of vectors, we can select neighbors that better reflect the data distribution characteristics in the process of constructing the neighbor graph, thereby reducing missed detections when performing searches. Higher-quality neighbor selection is based on the distribution characteristics of the vector data set, so that the resulting neighbor graph can better reflect the distribution characteristics of the vector data, thereby improving retrieval accuracy. In the process of constructing the neighbor graph, using the degree of centrality to appropriately relax or shrink neighbor selection can reduce unnecessary calculations, optimize the search process, and effectively reduce the common "curse of dimensionality" problem in vector space, thereby improving retrieval speed.

[0066] In an exemplary embodiment, a vector retrieval device based on a neighbor graph is provided, comprising: The centrality determination module is used to determine the centrality of each vector in the entire vector data set based on the vector data set and the integral function of the non-central chi-square distribution; and obtain the centrality degree set based on the centrality degrees of all vectors. ; The vector data set is , is the number of vectors, is the vector dimension, which is used to represent the degree of freedom.

[0067] The neighbor graph construction module is used to collect the similarity distance and centrality degree between each vector in the vector data set. , using the method of incrementally adding vectors to construct a neighbor graph .

[0068] The centrality degree set determination module is used to determine the neighbor graph Perform vector centrality degree traversal calculation to obtain the updated centrality degree set of all vectors , used to characterize the neighbor graph The central neighbor relationship.

[0069] The final result neighbor graph determination module is used to determine the centrality degree set of all vectors based on the current neighbor relationship , for the nearest neighbor graph Perform trimming operations to obtain the final neighbor graph. .

[0070] The vector retrieval result determination module is used to use the feature vector of the query object as the query vector and Search on and get the vector retrieval results.

[0071] In an exemplary embodiment, a computer device is provided, which may be a server or a terminal. The computer device includes a processor, a memory, an input / output interface (I / O for short), and a communication interface.

[0072] In this application, all actions to obtain signals, information or data are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

[0073] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0074] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A vector retrieval method based on a nearest neighbor graph, characterized in that: The vector retrieval method based on the nearest neighbor graph includes: According to the vector data set, the integral function of the non-central chi-square distribution is used to determine the centrality of each vector in the entire vector data set; and according to the centrality of all vectors, the centrality degree set is obtained. ; The vector data set is , is the number of vectors, is the vector dimension; According to the similarity distance and centrality degree set between each vector in the vector data set , using the method of incrementally adding vectors to construct a neighbor graph ; Nearest Neighbor Graph Perform vector centrality degree traversal calculation to obtain the updated centrality degree set of all vectors ; Based on the updated centrality degree set of all vectors , for the nearest neighbor graph Perform trimming operations to obtain the final neighbor graph. ; The feature vector of the query object is used as the query vector, and the neighbor graph of the final result is Search on and get the vector retrieval results.

2. The vector retrieval method based on neighbor graph according to claim 1, characterized in that: The method of determining the centrality of each vector in the entire vector data set by using the integral function of the non-central chi-square distribution according to the vector data set specifically includes: Get vector dataset Data distribution of the vector data set The mean center is ; Determine Vector To the mean center Distance ; Determine the center of all vectors to the mean Sort by distance ; Sort Mapped to and the noncentrality parameter is The mapping value is obtained within the meaningful value interval of the integral function of the non-central chi-square distribution. ; According to the mapping value , the integral function of the non-central chi-square distribution is used to determine the centrality of each vector in the entire vector data set .

3. The vector retrieval method based on neighbor graph according to claim 1, characterized in that: The similarity distance and centrality degree set between each vector in the vector data set , using the method of incrementally adding vectors to construct a neighbor graph , specifically including: Step 2.1, aggregate the centrality degree The vector corresponding to the maximum centrality degree in is used as the entry point of the neighbor graph ; Step 2.2, get the vector to be inserted , with vector As the query vector, search on the constructed neighbor graph and maintain a capacity of An ordered candidate set queue , and the entry point Insert into candidate set queue middle; Step 2.3, select the candidate set queue Mid-range vector The nearest vector that has not been visited yet , get the vector Neighbors vector set , the marker vector is the visited vector; and the vector Neighbors vector set Each vector in is added to the candidate set queue , while keeping the candidate set queue The query vector The smallest distance vectors; among them, for The first neighbor vector of for The number of neighbor vectors; Step 2.4, repeat step 2.3 until the candidate set queue The vectors in are visited; and the current candidate set queue is As the current vector to be inserted The candidate neighbor set ; Step 2.5: Based on the candidate neighbor set , use the judgment condition to determine the current vector to be inserted Neighborhood set ; Neighborhood Set The upper limit of capacity is , Hyperparameters configured for building a neighbor graph; the judgment condition is the candidate neighbor vector currently traversed and any vector inserted into the neighbor set All meet the following requirements: ; in, According to the candidate neighbor vector The degree of centrality Determine the relaxation parameters, , Hyperparameters configured for building the neighbor graph, is the similarity distance function; Step 2.6, traverse the vector to be inserted Neighborhood set , the vector to be inserted Add to neighbor set in reverse The neighbor set of each vector in the vector; the neighbor set after adding the neighbors in reverse The capacity limit is enlarged to ; After the reverse addition operation, the neighbor set The number of inner vectors is greater than the capacity When , the neighbor reselection operation is performed, and the candidate neighbor set The neighbor set whose capacity exceeds the limit , Hyperparameters configured for building the neighbor graph; Step 2.7, repeat steps 2.2 to 2.6 to insert all vectors into the current neighbor graph to obtain the neighbor graph .

4. The vector retrieval method based on neighbor graph according to claim 1, characterized in that: The neighbor graph Perform vector centrality degree traversal calculation to obtain the updated centrality degree set of all vectors , specifically including: Step 3.1, traverse the neighbor graph , count each vector by its nearest neighbor graph The number of times other vectors are selected as neighbors in the neighbor graph The in-degree of ; Step 3.2, according to the minimum in-degree and the maximum in-degree , the range of the in-degree of all vectors is evenly divided into intervals; Step 3.3, let The number of vectors in the interval is , using the empirical cumulative distribution function to determine the vector in the neighborhood graph The degree of centrality in Step 3.4, traverse all vectors to obtain the updated centrality degree set , used to characterize the neighbor graph The central neighbor relationship.

5. The vector retrieval method based on neighbor graph according to claim 4, characterized in that: The feature vector of the query object is used as the query vector in the final result neighbor graph. Search on , and get the vector search results, including: Step 5.1, according to the nearest neighbor graph Determine the highest in-degree vectors, and vectors as candidate sets; with entry points as the entry point and select from the candidate set neighbors as the initial starting queue for the search; Initialize relaxation parameters for the search; Step 5.2, let the query vector be , maintain a capacity of An ordered candidate set queue , and populate the initial startup queue ; Step 5.3, from the ordered candidate set queue Get and query vectors in The unvisited vector with the smallest distance , get the unvisited vector Neighbors vector set , and mark the unvisited vector is the visited vector; Step 5.4, set the neighbor vector Each neighbor vector in is added to the ordered candidate set queue , and only keep the ordered candidate set queue The query vector The smallest distance vectors; Step 5.5, repeat steps 5.3 and 5.4 until the ordered candidate set queue is All vectors in are accessed; Step 5.6: Order the candidate set queue With query vector The smallest distance vectors as vector search results, where .

6. A vector retrieval device based on a nearest neighbor graph, characterized in that: The vector retrieval device based on the nearest neighbor graph includes: The centrality determination module is used to determine the centrality of each vector in the entire vector data set based on the vector data set and the integral function of the non-central chi-square distribution; and obtain the centrality degree set based on the centrality degrees of all vectors. ; The vector data set is , is the number of vectors, is the vector dimension; The neighbor graph construction module is used to collect the similarity distance and centrality degree between each vector in the vector data set. , using the method of incrementally adding vectors to construct a neighbor graph ; The centrality degree set determination module is used to determine the neighbor graph Perform vector centrality degree traversal calculation to obtain the updated centrality degree set of all vectors , used to characterize the neighbor graph The central neighbor relationship; The final result neighbor graph determination module is used to determine the centrality degree set of all updated vectors , for the nearest neighbor graph Perform trimming operations to obtain the final neighbor graph. ; The vector retrieval result determination module is used to use the feature vector of the query object as the query vector and Search on and get the vector retrieval results.

7. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vector retrieval method based on a neighbor graph as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Construction method of dynamic k-nearest neighbor graph and rapid image retrieval method based on dynamic k-nearest neighbor graph

    CN112507149A

  • Multi-modal search method based on neighbor graph

    CN113656678A

  • Online retrieval method and system

    CN113761243A

  • Neighbor graph vector retrieval method and device combining hard disk and memory

    CN115408545A

  • Neighbor graph updating method for approximate nearest neighbor search

    CN117150082A