Vector retrieval technique combining spatial partitioning tree and proximity graph

CN110110186BActive Publication Date: 2026-10-30MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810064350.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-01-23
Publication Date
2026-10-30
Estimated Expiration
2038-01-23

AI Technical Summary

Benefits of technology

[0004]上述说明仅是本公开技术方案的概述,为了能够更清楚了解本公开的技术手段,而可依照说明书的内容予以实施,并且为了让本公开的上述和其它目的、特征和优点能够更明显易懂,以下特举本公开的具体实施方式。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110110186B_ABST
    Figure CN110110186B_ABST
Patent Text Reader

Abstract

The disclosed vector retrieval technology combining the space division tree with the proximity graph comprehensively utilizes the space division tree and the proximity graph based technology, constructs a vector retrieval scheme based on a joint index, performs coarse-grained positioning by using the space division tree index, and then performs further vector retrieval by using the proximity graph index, so as to improve the efficiency of vector retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Background Technology

[0001] With the development of internet technology, search engines have become increasingly powerful, offering a wider range of searchable content. Search engines also provide information to many applications, serving as an essential service for many. In this era of rapid information development, there is a massive amount of documents, and the number of documents is growing rapidly. Simultaneously, users' demand for information is constantly increasing. Therefore, how to provide faster, more efficient, and more accurate search services remains a constant challenge for current search engine technology. Summary of the Invention

[0002] The embodiments of the present invention are provided to introduce, in a concise form, some concepts that will be further described in the following detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter.

[0003] The publicly available vector retrieval technology combining spatial partition trees and neighborhood graphs integrates two techniques to construct a vector retrieval scheme based on a joint index. It first uses the spatial partition tree index for coarse-grained positioning, and then uses the neighborhood graph index for further vector retrieval, thereby improving the efficiency of vector retrieval.

[0004] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, specific embodiments of this disclosure are described below. Attached Figure Description

[0005] The subject matter is specifically pointed out and explicitly claimed in the concluding section of this specification. The above and other features of this disclosure will become more fully apparent from the following description taken in conjunction with the accompanying drawings and the appended claims. It is to be understood that these drawings only illustrate various embodiments according to this disclosure and are therefore not to be considered as limiting the scope of this disclosure, which will be described with additional features and details using the drawings. In the drawings:

[0006] Figure 1 This is an application example block diagram of one of the retrieval processing devices according to an embodiment of the present invention;

[0007] Figure 2 This is a schematic diagram of the spatial partitioning tree index structure according to an embodiment of the present invention;

[0008] Figure 3This is a schematic diagram of the structure of the first proximity graph index according to an embodiment of the present invention;

[0009] Figure 4 This is a schematic diagram of the combined structure of the spatial partitioning tree index and the first proximity graph index according to an embodiment of the present invention;

[0010] Figure 5 This is a schematic diagram of the vector distribution leading to a local optimum in an embodiment of the present invention;

[0011] Figure 6 This is a flowchart illustrating one of the retrieval processing methods according to an embodiment of the present invention.

[0012] Figure 7 This is an application example block diagram of the second retrieval processing device according to an embodiment of the present invention;

[0013] Figure 8 This is a flowchart illustrating a second retrieval processing method according to an embodiment of the present invention.

[0014] Figure 9 This is an application example block diagram of the retrieval processing device three according to an embodiment of the present invention;

[0015] Figure 10 This is a flowchart illustrating a third retrieval processing method according to an embodiment of the present invention.

[0016] Figure 11 This is a structural block diagram of an electronic device 1100 according to an embodiment of the invention.

[0017] The above figures are arranged according to at least some of the embodiments described herein. Detailed Implementation

[0018] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0019] Furthermore, the following description sets forth specific details of various examples to provide a complete understanding of the subject matter recited in the claims. However, those skilled in the art will understand that the subject matter recited in the claims can be implemented in some or more cases without this specific disclosure. Moreover, in some cases, well-known methods, processes, systems, components, and / or circuits have not been described in detail to avoid unnecessarily obscuring the subject matter recited in the claims.

[0020] In the following detailed description, reference is made to the accompanying drawings, which form part of this specification. In the drawings, like symbols generally identify like parts unless the context otherwise requires. The illustrative embodiments described in the specific description, drawings, and claims are not intended to be limiting. Other embodiments and changes may be utilized without departing from the spirit or scope of the subject matter presented herein. It will be readily understood that the various aspects of this disclosure, as generally described herein and illustrated in the drawings, can be arranged, substituted, combined, and designed in a variety of different configurations, as is expressly contemplated herein.

[0021] Among other things, this disclosure is generally described as a method, apparatus, system, device, and computer program product relating to recommendations for use in mobile devices.

[0022] In this document, the term “technology” may refer to, for example, one or more systems, one or more methods, computer-readable instructions, one or more modules, algorithms, hardware logic (e.g., field-programmable gate arrays (FPGAs)), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chips (SOCs), complex programmable logic devices (CPLDs), and / or other technologies permitted throughout this document.

[0023] With the continuous development of vectorization technology, various documents can be converted into vectors, thus providing a technical foundation for vector-based retrieval. The advantage of vectorization is that it allows documents to be represented by multi-dimensional feature elements, not just the document content itself, enabling more accurate and flexible comparison of similarity between vectors. The distance between vectors effectively reflects the similarity between the documents they correspond to, offering greater flexibility and accuracy compared to traditional symbol-based retrieval methods. The distance between vectors can be Euclidean distance, cosine approximation, etc. Furthermore, it should be noted that in this embodiment of the invention, the concept of a document includes various information or data units that can be vectorized and used as retrieval objects, such as text documents, web page documents, images, data, and messages.

[0024] The retrieval scheme involved in the embodiments of this invention may involve the K-Nearest Neighbor (KNN) retrieval technique. The basic principle of K-Nearest Neighbor retrieval is: assuming a set of N points... Represent the set as in, And query point The purpose of the search is to obtain from Find a point p such that the distance from q to p, dist(p,q), is min.n dist(x i The search term is defined as finding the nearest neighbor of the query point q. Similarly, K nearest neighbors can be defined, thus changing the search objective to find the nearest neighbor of the query point q. We obtain the K nearest neighbors to the query point q. These points can be mapped to vectors in a vector space. For the entire vector space, the above retrieval process can be called K-nearest neighbor retrieval for a vector. The distance mentioned above can be various distance definitions in the vector space, such as Euclidean distance, cosine approximation, etc. In addition, during the above query process, a distance threshold can be defined, that is, only if dist(p,q) is less than a preset distance threshold will it be output as a valid result.

[0025] In the field of vector retrieval, each of the above points can correspond to a vector. For example, the N points mentioned above... It can be N document vectors generated from N documents. It is a vector space consisting of N document vectors. A query point q can correspond to a query vector generated based on the user's query content.

[0026] Traditional K-nearest neighbor (KNN) retrieval techniques are unsuitable for big data scenarios due to their high computational complexity and query latency. This invention addresses this issue by improving the retrieval process to increase efficiency and better adapt to big data applications.

[0027] To address the aforementioned vector retrieval requirements, this invention combines two techniques—Spatial Partition Trees and Neighborhood Graph—to construct a vector retrieval scheme based on a joint index, thereby improving the efficiency of vector retrieval.

[0028] This invention uses spatial partitioning trees and proximity graphs to index vectors in a vector space. The index built using spatial partitioning trees is called a spatial partitioning tree index, and the index built using proximity graphs is called a proximity graph index.

[0029] Spatial Partition Tree Index

[0030] A spatial partitioning tree index performs a coarse-grained partitioning of vectors in a vector space. Specifically, it can cluster vectors in the vector space to form multiple sub-vector spaces, with each leaf node corresponding to one sub-vector space. Each leaf node can store the center vector or its identifier for that sub-vector space. If the spatial partitioning tree index is a multi-level tree structure, each intermediate node can also correspond to a sub-vector space. The sub-vector space corresponding to an intermediate node that is a parent node can include the sub-vector spaces corresponding to intermediate nodes that are child nodes or leaf nodes. Intermediate nodes can also store the center vector or its identifier for their corresponding sub-vector space.

[0031] Based on the structure of the spatial partitioning tree index described above, during the retrieval process, the query vector can be compared layer by layer with the center vectors corresponding to the intermediate nodes and leaf nodes, the distance between the query vector and the center vector can be calculated, and then, according to the preset retrieval conditions, the process can be carried out layer by layer until the sub-vector space corresponding to one or more leaf nodes is located, and the center vector stored in the one or more leaf nodes is also obtained.

[0032] Nearest Neighbor Graph Index

[0033] A neighborhood graph index is an index of vectors in a vector space, presented in the form of a graph. Each point in the neighborhood graph index corresponds to a vector in the vector space. In practical applications, a relevance neighborhood graph (RNG) can be used to build the neighborhood graph index. The characteristic of a relevance neighborhood graph is that it is defined on a set of points in the Euclidean plane by connecting points p and q with edges, provided that there is no third point r closer to them than their distance to each other. Based on this principle, an index is built for all vectors in the vector space, thus forming the neighborhood graph index.

[0034] The connectivity (edge ​​relationships) between points in the nearest neighbor graph index reflects the distance relationships between the vectors corresponding to each point. For any given point, the points connected to it by edges are called neighboring points, and the vectors corresponding to these neighboring points are called the neighboring vectors of the vector corresponding to any given point. Each point in the nearest neighbor graph index stores the vector identifier of the vector corresponding to that point and the vector identifiers of the vectors corresponding to its neighboring points. As an optional approach, if sufficient storage resources are available, each point in the nearest neighbor graph index can also directly store the vector corresponding to that point and / or the vectors corresponding to its neighboring points.

[0035] Based on the structure of the proximity graph index described above, during the retrieval process, the K nearest neighbor vectors of one or more center vectors obtained by retrieval based on the spatial partitioning tree index can be used as seeds to perform vector distance iteration calculation, thereby obtaining one or more vectors that are closest to the query vector.

[0036] Processing of composite indexes

[0037] In the retrieval process based on the combination of spatial partitioning tree index and proximity graph index in this embodiment of the invention, coarse-grained positioning is first performed based on the spatial partitioning tree index, and then precise retrieval is performed based on the proximity graph index. Since the spatial partitioning tree index has a smaller data volume, it can quickly locate the query vector into a specific sub-vector space, achieving coarse-grained querying. Then, precise vector retrieval is performed through the proximity graph index, specifically by iteratively calculating vector distances in multiple rounds based on the proximity graph index to obtain one or more vectors closest to the query vector.

[0038] This retrieval method effectively combines the characteristics of spatial partitioning trees and proximity graphs, significantly improving retrieval efficiency and the quality of search results. On one hand, compared to relying solely on proximity graph indexes for vector retrieval, spatial partitioning tree indexes can quickly locate the query vector in a suitable sub-vector space, thus avoiding iterative vector distance calculations across the entire proximity graph index. On the other hand, proximity graph indexes can also overcome the regional limitations of spatial partitioning tree indexes. In this embodiment, the proximity graph index is constructed for vectors throughout the entire vector space, and the connectivity between points in the proximity graph index is not limited by the set range of leaf nodes in the spatial partitioning tree index. Therefore, when a query vector falls on the edge of a subspace boundary, the structure of the proximity graph index can overcome the regional limitations of the spatial partitioning tree index, thereby finding a more preferred approximate vector.

[0039] The following section will provide a detailed example of the vector retrieval technology solution based on the composite index.

[0040] like Figure 1The diagram shown is an application example block diagram 100 of one of the retrieval processing devices according to an embodiment of the present invention. The retrieval processing device 101 can be implemented as or located on a server on the Internet. This server can be implemented through one or more computer systems (distributed server) or as a cloud-based server. These servers can connect to user terminals via the Internet, receive query requests input by the user terminals, process them through the retrieval processing device, and generate query results to return to the user terminals. The user terminals mentioned here can be laptops or desktop computers that communicate with the aforementioned server via mobile networks or wired networks, or small portable (or mobile) electronic devices (e.g., tablet computers, smartphones, personal data assistants (PDAs), media player devices, wireless network viewing devices, personal head-mounted devices, dedicated devices, or hybrid devices including any of the above functions).

[0041] Furthermore, the retrieval processing device 101 in the figure can also be implemented or installed in a small portable (or mobile) electronic device (e.g., tablet computer, smartphone, personal data assistant (PDA), media player device, wireless network viewing device, personal head-mounted device, dedicated device, or hybrid device including any of the above functions). The retrieval processing device 101 can also be implemented or installed in a laptop computer or desktop computer.

[0042] As an example of an application scenario, Figure 1 The retrieval processing device 101 shown is located in a server 102 on a network. The server 102 is connected to the user terminal 104 via the Internet 103 to provide retrieval services to the user. The retrieval processing device 101 includes a spatial partitioning tree retrieval processing module 105 and a first proximity graph retrieval processing module 106.

[0043] Spatial partitioning tree retrieval processing module 105

[0044] The spatial partitioning tree retrieval processing module 105 is used to retrieve one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index. Each leaf node can store the center vector or the vector identifier of its corresponding sub-vector space. During vector retrieval based on the spatial partitioning tree index, the vector distance between the query vector and the center vector is calculated, and the closest one or more leaf nodes are determined based on this distance, i.e., the one or more sub-vector spaces closest to the query vector are identified. The number of leaf nodes determined by the vector distance calculation can be determined according to actual needs; this number can be preset (e.g., M), and then the top M leaf nodes are obtained by sorting the vector distances. Alternatively, a distance threshold can be set to select leaf nodes.

[0045] The structure of a spatial partitioning tree index can be as follows: Figure 2 As shown, Figure 2 This is a schematic diagram 200 of the spatial partitioning tree index according to an embodiment of the present invention. Each node in the spatial partitioning tree index corresponds to a different vector space. The root node 201 can correspond to the entire vector space, and the nodes other than the root node correspond to sub-vector spaces within the vector space. The spatial partitioning tree index may include only the root node 201 and leaf nodes 203, or it may include the root node 201, at least one level of intermediate nodes 202, and leaf nodes 203. Figure 2 The structure shown is a case involving multiple layers of intermediate nodes, although Figure 2 Only three layers of nodes are shown, but those skilled in the art will understand that the number of layers and the number of nodes in each layer can be increased according to actual circumstances. Each intermediate node 202 and leaf node 203 corresponds to a different sub-vector space. The sub-vector space corresponding to the parent node 202 includes the sub-vector space corresponding to the child node 202 or leaf node 203. The intermediate node 202 and leaf node 203 store the center vector 204 or the vector identifier of the center vector 204 of their corresponding sub-vector space. During the vector retrieval based on the spatial partitioning tree index, the vector distance between the query vector and the center vector 204 of the sub-vector space corresponding to the intermediate node 202 of each layer is calculated layer by layer, narrowing the range of the sub-vector space layer by layer until the leaf node 203 is reached. Then, based on the vector distance between the query vector and the center vector 204 corresponding to the leaf node 203, one or more closest leaf nodes 203 are determined.

[0046] The aforementioned spatial partitioning tree index is generated by clustering vectors in the vector space. Through the clustering process, multiple sub-vector spaces can be generated, and the center vector of each sub-vector space can be obtained. Then, the center vector or the vector identifier of the center vector is stored in the spatial partitioning tree index.

[0047] The spatial partitioning tree index described above can employ a Balanced K-means Tree (BKT). A BKT tree is a balanced hierarchical tree structure; its balance comes from balanced clustering, where each cluster contains approximately the same number of items. Using a BKT tree allows for more uniform clustering of vectors, resulting in more efficient and effective query results.

[0048] In addition, the aforementioned spatial partitioning tree index can be stored in the memory or hard disk of server 102, or in a database connected to server 102.

[0049] First Proximity Graph Retrieval Processing Module 106

[0050] The first proximity graph retrieval processing module 106 is used to perform vector retrieval based on the first proximity graph index for the subvector space corresponding to one or more leaf nodes that are closest to the query vector, and to obtain one or more first vectors that are closest to the query vector. In order to distinguish it from the proximity graph index in other technical solutions described later in this document, the terms "first proximity graph index", "first proximity graph retrieval processing module" and "first vector" are used here.

[0051] like Figure 3 As shown, it is a schematic diagram 300 of the structure of the first proximity graph index according to an embodiment of the present invention. Figure 3 Each point in the first neighboring graph represents a vector in the vector space, and an edge between any two points represents their proximity. Each point in the first neighboring graph can store the vector identifier of the vector corresponding to that point and the vector identifiers of the neighboring vectors of its neighboring points. This allows for easy retrieval of the vector identifiers of its neighboring points after determining any point, facilitating subsequent vector distance iteration calculations. Alternatively, with sufficient storage resources, each point can store the vectors of its neighboring points. This eliminates the need to retrieve the vectors from their identifiers during vector distance iteration calculations, thus improving efficiency. Furthermore, Figure 3 The first nearest neighbor graph index is constructed based on vectors throughout the entire vector space and is unaffected by... Figure 2 The limitations of the spatial partitioning tree index are shown. In terms of storage format, the first nearest neighbor graph index and the spatial partitioning tree index can be stored separately.

[0052] Vector retrieval based on the first proximity graph index primarily involves iteratively calculating the vector distance between the query vector and vectors in the sub-vector space to obtain one or more vectors closest to the query vector as the retrieval result. Each round of distance iteration extends along the proximity relationships of points in the first proximity graph index, recording one or more vectors closest to the query vector. As the distance iteration progresses, the recorded closest vectors are continuously updated. After reaching a preset number of rounds, the vector distance iteration stops, and the recorded results are output as the retrieval result.

[0053] The aforementioned distance iteration calculation requires selecting some starting points in the sub-vector space as seeds to begin the distance iteration calculation. After the spatial partitioning tree retrieval processing module 105 determines one or more leaf nodes, the sub-vector space for the first neighbor graph retrieval processing module 106 to perform retrieval based on the first neighbor graph index vector is also determined. During the vector retrieval process, the center vector corresponding to the aforementioned leaf node can be used to determine the seeds for the vector distance iteration calculation. Specifically, one or more neighbor vectors corresponding to the aforementioned center vector in the first neighbor graph index can be used as the seeds for the vector distance iteration calculation, which are the starting points for the first round of vector iteration calculation.

[0054] During the vector distance iteration calculation, a priority queue can be maintained. This queue stores the distance calculation results between the vectors involved in the calculation and the query vector in the sub-vector space, ordered by distance magnitude. After each round of distance iteration, one or more vectors closest to the query vector are selected, and a predetermined number of their neighboring vectors (e.g., K) are used as the targets for the next round of distance iteration. After each round of distance iteration, the priority queue is dynamically adjusted, always placing the vector closest to the query vector at the front.

[0055] The first proximity graph retrieval processing module 106 performs the above-mentioned vector distance iterative calculation on the sub-vector spaces corresponding to one or more leaf nodes output by the spatial partitioning tree retrieval processing module 105. It generates one or more vectors that are closest to the query vector for each sub-vector space. Based on this, the first proximity graph retrieval processing module 106 can comprehensively sort the one or more vectors that are closest to the query vector in each sub-vector space and select one or more first vectors that are closest to the query vector as the retrieval result output.

[0056] The aforementioned proximity graph retrieval can be stored in the memory or hard disk of server 102, or in database 107 connected to server 102.

[0057] The above describes the retrieval processes executed by the spatial partitioning tree retrieval processing module 105 and the first proximity graph retrieval processing module 106, respectively. For example... Figure 4 As shown, it is a schematic diagram 400 of the joint structure of the spatial partitioning tree index and the first proximity graph index in an embodiment of the present invention.

[0058] Figure 4In the diagram, the upper tree structure is the spatial partitioning tree index 401, which includes a root node 201, intermediate nodes 202, and leaf nodes 203. The lower planar topology is the first neighbor graph index 402, which is a neighbor graph composed of multiple points, corresponding to the entire vector space. To illustrate the relationship between the first neighbor graph index 402 and the spatial partitioning tree index 401, ellipses are used to identify the sub-vector spaces 403 corresponding to each leaf node 203, and dashed lines connect the sub-vector spaces 403 to the leaf nodes 203.

[0059] In this embodiment of the invention, the first neighbor graph retrieval processing module 106 first performs a coarse-grained query using the spatial partitioning tree index 401 to achieve fast coarse-grained vector positioning. After determining one or more sub-vector spaces 403, it performs further retrieval processing based on the first neighbor graph index 402. During the retrieval process using the spatial partitioning tree index 401, the center vector of the located sub-vector space can also be obtained, thus providing a seed for the retrieval processing performed by the first neighbor graph retrieval processing module 106. The first neighbor graph retrieval processing module 106 performs vector distance iterative calculation based on the first neighbor graph index 402 for the sub-vector spaces located by the spatial partitioning tree retrieval processing module 105, and can use the neighbor vectors of the center vector provided by the spatial partitioning tree retrieval processing module 105 as seeds to start the vector distance iterative calculation, thereby making the vector distance iterative calculation more efficient. By combining the application of the spatial partitioning tree index 401 and the first neighbor graph index 402, the efficiency of vector retrieval can be significantly improved. Furthermore, the generation of the first neighbor graph index 402 is not limited by the spatial partitioning tree index 401. During the retrieval process performed by the first neighbor graph retrieval processing module 106, it will not be affected by the partitioning of the sub-vector space 403 by the spatial partitioning tree index 401. When the query vector falls at the edge of the sub-vector space 403, it can also break through the boundary of the sub-vector space 403 through the structure of the first neighbor graph retrieval 402, extend the vector distance iterative calculation to other sub-vector spaces 403, and thus find a vector that is closer to the query vector.

[0060] Furthermore, for retrieval based on the first nearest neighbor graph index, there may be a local optimum problem, such as... Figure 5As shown, this is a vector distribution diagram 500 leading to a local optimum in an embodiment of the present invention. The points of the triangles correspond to the query vector, the points of the squares correspond to the center vector, and the points of the circles correspond to general vectors outside the center vector. As shown, in two adjacent sub-vector spaces, the vector distribution in sub-vector space 501 is denser, and the center vector in sub-vector space 501 is farther from the query vector 503. The query vector 503 is located at the edge of sub-vector space 501, and compared to the vectors in sub-vector space 501, the query vector 503 is closer to the vectors in region 504 of sub-vector space 502. However, during the retrieval process based on the first proximity graph index, the neighboring vectors of the center vector of vector space 501 are used as seeds to begin iterative calculation. Because the vectors surrounding the center vector of vector space 501 are denser, the points for vector distance iterative calculation will be concentrated in the dense region of vector space 501, making it difficult to extend to points in the neighboring region. This situation results in a local optimum. Specifically, when a local optimum occurs, it happens that although the number of iterations in the vector distance calculation increases, one or more vectors closest to the query vector are not updated. For example, one or more vectors closest to the query vector recorded after the first round of vector distance calculation may not be updated after the second, third, or even multiple rounds. This situation is considered a local optimum because... Figure 5 This is caused by the vector distribution shown in the figure.

[0061] To address this situation, the spatial partitioning tree retrieval processing module 105 can record the retrieval path during the process of retrieving one or more leaf nodes closest to the query vector based on the spatial partitioning tree index. When the first neighbor graph retrieval processing module encounters a local optimum during a preset number of vector distance iterations, it extracts the previously recorded retrieval path, selects the sub-vector space where vector retrieval based on the first neighbor graph index has not yet been performed, and then performs vector retrieval based on the first neighbor graph index. Combined with... Figure 5 As can be seen from the situation, if a local optimum occurs, the nearest sub-vector space 502 can be selected for retrieval processing based on the first neighbor graph, so that the vector distance iteration calculation can be extended to the vectors in region 504, thereby finding the first vector that is closer to the query vector 503 as the retrieval result.

[0062] like Figure 6 As shown, this is a flowchart of a retrieval processing method according to an embodiment of the present invention, 600. The processing flow performed by the retrieval processing device 101 is shown in flowchart 600, and may include:

[0063] S601: Based on the spatial partitioning tree index, retrieve one or more leaf nodes that are closest to the query vector. The leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space. This step can be performed by the spatial partitioning tree retrieval processing module 105.

[0064] Furthermore, the leaf nodes can store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. Accordingly, based on the spatial partitioning tree index, retrieving one or more leaf nodes that are closest to the query vector can include: calculating the vector distance between the query vector and the center vector of the sub-vector space corresponding to one or more leaf nodes, and determining the one or more closest leaf nodes based on the vector distance.

[0065] A spatial partitioning tree index can also include at least one level of intermediate nodes. Each intermediate node and leaf node corresponds to a different sub-vector space. The sub-vector space corresponding to an intermediate node that is a parent node includes the sub-vector spaces corresponding to intermediate nodes or leaf nodes that are child nodes. The intermediate nodes and leaf nodes store the center vector or vector identifier of their corresponding sub-vector spaces. In this case, retrieving one or more leaf nodes closest to the query vector based on the spatial partitioning tree index can include: calculating the vector distance between the query vector and the center vector of the sub-vector space corresponding to each intermediate node or leaf node at each level, and determining the one or more closest leaf nodes based on the vector distance.

[0066] S602: For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector. This step can be performed by the first proximity graph retrieval processing module 106.

[0067] In the first proximity graph index, each point stores the vector identifiers of its neighboring points. During vector retrieval based on the first proximity graph index, the vector identifiers of neighboring points are retrieved from each point, and then the corresponding vectors are obtained based on these identifiers. Finally, the distance between the retrieved vector and the query vector is calculated. If storage resources are sufficient, each point in the first proximity graph index can also store the vectors of its neighboring points. In this case, during vector retrieval based on the first proximity graph index, the vectors of neighboring points can be directly retrieved from each point, and the distance between the retrieved vector and the query vector can be calculated, thereby further improving retrieval efficiency.

[0068] Furthermore, for the subvector space corresponding to each leaf node, one or more neighboring vectors of the center vector stored in one or more leaf nodes determined in step S601 can be used as seeds to perform a preset number of rounds of vector distance iteration calculation to obtain one or more first vectors that are closest to the query vector.

[0069] Furthermore, as mentioned earlier, for the case of local optima, the retrieval path can be recorded during the process of retrieving one or more leaf nodes closest to the query vector based on the spatial partitioning tree index in step S601. Then, in step S602, during the execution of a preset number of vector distance iterations, if a local optimum occurs, the retrieval path is extracted, and the sub-vector space where vector retrieval based on the first proximity graph index has not been performed is selected to perform vector retrieval based on the first proximity graph index.

[0070] The above describes the retrieval processing scheme of the combined index based on spatial partitioning tree index and proximity graph index according to embodiments of the present invention. In practical applications, the vector retrieval technical scheme can be further improved by making reasonable use of memory and hard disk storage resources based on the above technical ideas.

[0071] Specifically, the aforementioned first proximity graph index may correspond to only a subset of vectors in the vector space. These subset vectors can be high-quality vectors selected from the entire vector space, and these vectors can be typical or representative. In addition, a second proximity graph index is constructed, corresponding to all vectors in the vector space. This creates a three-layer index structure: a spatial partitioning tree index, a first proximity graph index, and a second proximity graph index. The spatial partitioning tree index performs a coarse-grained partition of the vectors in the vector space, and the first proximity graph index performs a further coarse-grained partition. These two layers of coarse-grained partitioning are designed to more accurately locate the query vector to the appropriate position in the second proximity graph index, which is constructed based on all vectors, thereby enabling more efficient vector distance iteration calculations based on the proximity graph index.

[0072] Based on the above index structure, the spatial partitioning tree index and the first proximity graph index, since they only involve a portion of the vectors in the vector space, occupy less storage space and can be stored in memory. The second proximity graph index, however, is constructed based on all vectors in the vector space, resulting in a larger data volume; therefore, it is stored on disk. In some cases, if the record vectors in the first proximity index match the query vector well, the record vectors in the first proximity index can be directly used as the search result. Specifically, a threshold for vector distance can be set to determine the matching degree between the record vectors in the first proximity index and the query vector, thereby deciding whether a vector retrieval based on the second proximity graph index is necessary.

[0073] In the above technical solution, the spatial partitioning tree index and the first proximity graph index stored in memory can undertake part of the retrieval task, thereby reducing the number of disk accesses. Even when disk access is required for the second proximity graph index, since one or more first vectors have already been obtained through the first proximity graph index, when performing vector retrieval based on the second proximity graph index, one or more first vectors can be directly used as seeds to perform the retrieval, thereby efficiently obtaining one or more second vectors that are closest to the query vector.

[0074] like Figure 7 The diagram shown is a block diagram 700 illustrating an application example of the second retrieval processing device according to an embodiment of the present invention. The retrieval processing device 701 can be implemented as or located on a server on the Internet. This server can be implemented through one or more computer systems (distributed server) or as a cloud-based server. These servers can connect to user terminals via the Internet, receive query requests input by user terminals, process them through the retrieval processing device, and generate query results to return to the user terminal. The user terminal mentioned here can be a laptop or desktop computer that communicates with the aforementioned server via a mobile network or wired network, or a small portable (or mobile) electronic device (e.g., tablet computer, smartphone, personal data assistant (PDA), media player device, wireless network viewing device, personal head-mounted device, dedicated device, or a hybrid device including any of the above functions).

[0075] Furthermore, the retrieval processing device 701 in the figure can also be implemented or installed in a small portable (or mobile) electronic device (e.g., tablet computer, smartphone, personal data assistant (PDA), media player device, wireless network viewing device, personal head-mounted device, dedicated device, or hybrid device including any of the above functions). The retrieval processing device 701 can also be implemented or installed in a laptop computer or desktop computer.

[0076] As an example of an application scenario, Figure 7 The retrieval processing device 701 shown is located in a server 702 in a network. The server 702 is connected to the user terminal 704 via the Internet 703 to provide retrieval services to the user.

[0077] The retrieval processing device 701 includes: a spatial partitioning tree retrieval processing module 705, a first neighbor graph retrieval processing module 706, and a second neighbor graph retrieval processing module 707.

[0078] The spatial partitioning tree retrieval processing module 705 and the first neighbor graph retrieval processing module 706 function essentially the same as previously described, except that they directly access memory 708 to obtain the spatial partitioning tree index and the first neighbor graph index. The second neighbor graph retrieval processing module 707, based on the retrieval results of the first neighbor graph retrieval processing module 706, performs further retrieval based on the second neighbor graph index, which needs to be retrieved from the hard disk 709. The retrieval method based on the second neighbor graph index is the same as the retrieval method based on the first neighbor graph index; however, the seed used for the retrieval based on the second neighbor graph index is the retrieval results output by the first neighbor graph retrieval processing module 706.

[0079] The aforementioned hard drives can be either traditional disk media or solid-state drives (SSDs). With the development of technology, more and more hard drives are adopting solid-state drive storage media.

[0080] like Figure 8 As shown, this is a flowchart 800 illustrating a second retrieval processing method according to an embodiment of the present invention. The processing flow executed by the aforementioned retrieval processing device 701, as shown in flowchart 800, may include:

[0081] S801: Based on the spatial partitioning tree index, retrieve one or more leaf nodes that are closest to the query vector. Leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space. The spatial partitioning tree index is stored in memory. This step can be performed by the spatial partitioning tree retrieval processing module 705.

[0082] S802: For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector. The first proximity graph index corresponds to a subset of vectors in the vector space and is stored in memory. This step can be performed by the first proximity graph retrieval processing module 106.

[0083] S803: Using one or more first vectors as seeds, perform vector retrieval based on the second proximity graph index to obtain one or more second vectors that are closest to the query vector. The second proximity graph index corresponds to all vectors in the vector space and is stored on the hard disk. This step can be performed by the second proximity graph retrieval processing module 707.

[0084] The detailed process of vector retrieval processing in the above steps has been explained previously and will not be repeated here.

[0085] The above describes a retrieval technique based on the combination of spatial partitioning tree indexes and proximity graph indexes. From the perspective of using different index structures in memory and on disk, the following techniques can also be designed to improve the efficiency of vector retrieval.

[0086] It employs an associative retrieval structure that combines a first index structure stored in memory with a second index structure stored on the hard disk.

[0087] The first index structure is stored in memory and its purpose is to perform coarse-grained vector localization and provide seeds for retrieval based on the second index structure. The first index structure corresponds to a subset of vectors in the vector space. These subset vectors can be high-quality vectors selected from the entire vector space, and these vectors can be typical or representative. The first index structure can be a spatial partitioning tree index, a combined index of the aforementioned spatial partitioning tree index and the first proximity graph index, or a traditional index structure (such as a hash-based inverted index).

[0088] The second index structure is a proximity graph index, stored on the hard drive. This second index structure is built based on all vectors in the vector space. The purpose of searching based on the first index structure is to obtain a seed, which will be used in the search process based on the second index structure.

[0089] Based on the above technical concept, the embodiments of the present invention are designed as follows: Figure 9 The retrieval processing device shown, such as Figure 9 The diagram shown is an application example block diagram 900 of the retrieval processing device 901 according to an embodiment of the present invention. This retrieval processing device 901 can be implemented as or located on a server on the Internet. This server can be implemented through one or more computer systems (distributed server) or as a cloud-based server. These servers can connect to user terminals via the Internet, receive query requests input by the user terminals, process them through the retrieval processing device, and generate query results to return to the user terminals. The user terminals mentioned here can be laptops or desktop computers that communicate with the aforementioned server via mobile networks or wired networks, or small portable (or mobile) electronic devices (e.g., tablet computers, smartphones, personal data assistants (PDAs), media player devices, wireless network viewing devices, personal head-mounted devices, dedicated devices, or hybrid devices including any of the above functions).

[0090] Furthermore, the retrieval processing device 901 in the figure can also be implemented or installed in a small portable (or mobile) electronic device (e.g., tablet computer, smartphone, personal data assistant (PDA), media player device, wireless network viewing device, personal head-mounted device, dedicated device, or hybrid device including any of the above functions). The retrieval processing device 901 can also be implemented or installed in a laptop computer or desktop computer.

[0091] As an example of an application scenario, Figure 9 The retrieval processing device 901 shown is located in a server 902 on a network. The server 902 is connected to a user terminal 904 via the Internet 903 to provide retrieval services to the user. The retrieval processing device includes: a first index structure retrieval processing module 905 and a second index structure retrieval processing module 906.

[0092] First Index Structure Retrieval Processing Module 905

[0093] The first index structure retrieval processing module 905 is used to perform vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector. The first index structure corresponds to a portion of the vectors in the vector space and is stored in memory 907.

[0094] The first index structure described above can take the following forms:

[0095] 1) The first index structure includes a spatial partitioning tree index. The leaf nodes in the spatial partitioning tree correspond to the sub-vector spaces in the vector space. The leaf nodes store the center vector or the vector identifier of the center vector of the corresponding sub-vector space.

[0096] Accordingly, the above-mentioned process of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector may include: calculating the vector distance between the query vector and the center vector of the subvector space corresponding to one or more leaf nodes, and determining one or more leaf nodes that are closest based on the vector distance; and obtaining one or more center vectors from the one or more leaf nodes that are closest as third vectors.

[0097] The specific structure of the spatial partitioning tree can be as described above, including only a root node and leaf nodes, or it can include a root node, at least one level of intermediate nodes, and leaf nodes. When intermediate nodes exist, each intermediate node and leaf node corresponds to a different sub-vector space. The sub-vector space corresponding to an intermediate node that is a parent node includes the sub-vector spaces corresponding to intermediate nodes that are child nodes or leaf nodes. The intermediate nodes and leaf nodes store the center vector or vector identifier of their corresponding sub-vector spaces. During vector retrieval based on the spatial partitioning tree index, the vector distance between the query vector and the center vector of the sub-vector space corresponding to each intermediate node is calculated layer by layer, narrowing the range of the sub-vector space layer by layer until the leaf nodes are reached. Then, based on the vector distance between the query vector and the center vector corresponding to the leaf node, one or more closest leaf nodes are determined.

[0098] 2) The first index structure includes a third nearest-neighbor graph index corresponding to a subset of vectors in the vector space. These subset vectors can be high-quality vectors selected from the entire vector space; they can be typical or representative. Since it only indexes a subset of vectors, the data volume is not large, making it suitable for storage in memory (907 bytes).

[0099] Accordingly, the process of performing vector retrieval based on the first index structure to obtain one or more third vectors closest to the query vector can include: performing vector retrieval based on the third neighbor graph index to obtain one or more third vectors closest to the query vector. Since only a portion of the vectors are stored, the third neighbor graph index is not very large, and distance iteration calculation can start from any point in the third neighbor graph index. Of course, it is also possible to select vectors corresponding to points at specific locations to start distance iteration calculation.

[0100] 3) The first index structure includes a spatial partitioning tree index and a third neighbor graph index. The leaf nodes in the spatial partitioning tree correspond to the sub-vector spaces in the vector space, and the third neighbor graph index corresponds to the partial vectors in the vector space.

[0101] Accordingly, the above-mentioned process of performing vector retrieval based on the first index structure to obtain one or more third vectors closest to the query vector may include: calculating the vector distance between the query vector and the center vector of the sub-vector space corresponding to one or more leaf nodes, and determining one or more leaf nodes closest to the query vector based on the vector distance; performing vector retrieval based on the third proximity graph index for the sub-vector space corresponding to the one or more leaf nodes closest to the query vector to obtain one or more third vectors closest to the query vector.

[0102] The first index structure described above is essentially the same as the combined index of the spatial partitioning tree index and the first proximity graph index introduced earlier, except that the third proximity graph index structure described above only corresponds to a sub-vector space in the vector space. Since the specific retrieval process of this combined index has been described in detail above, it will not be repeated here.

[0103] Second Index Structure Retrieval Processing Module 906

[0104] The second index structure retrieval processing module 906 is used to perform vector retrieval based on the second index structure using one or more third vectors as seeds, and to obtain one or more fourth vectors that are closest to the query vector. The second index structure is the fourth nearest neighbor graph index corresponding to all vectors in the vector space. The second index structure is stored in the hard disk 908.

[0105] The specific processing procedure for vector retrieval based on the fourth proximity graph index can be as follows: starting with one or more third vectors obtained from the first index structure retrieval processing module 905 as seeds, vector distance iteration calculation is performed. The distance iteration calculation in each round extends along the proximity relationship of points in the fourth proximity graph index and records one or more vectors that are closest to the query vector. As the distance iteration calculation proceeds, the recorded closest vectors are continuously updated. After reaching the preset number of rounds, the vector distance iteration calculation is stopped, and the recorded results are output as the retrieval results.

[0106] In the fourth neighbor graph index, each point stores the vector identifier of the vector corresponding to that point and the vector identifiers of the vectors corresponding to its nearest neighbor points. Since the fourth neighbor graph index is stored on hard disk 908, in order to reduce the number of accesses to hard disk 908, if the storage resources of hard disk 908 are sufficient, the vector corresponding to that point and / or the vectors corresponding to its nearest neighbor points can be directly stored in each point of the neighbor graph index.

[0107] The spatial partitioning tree index mentioned above can be a balanced K-means tree (BKT), and the third and fourth proximity graph indexes can be relative proximity graphs (RNG). The hard drive 908 mentioned above can be a traditional disk medium or a solid-state drive (SSD) storage medium.

[0108] The above-described technical solution of this invention fully utilizes the storage characteristics of memory 907 and hard disk 908 and combines different index structures for reasonable storage. During the retrieval process, a fast coarse-grained positioning is first performed based on the first index structure in memory 907, providing a seed for subsequent retrieval processing. Then, based on this seed, a vector distance iterative calculation based on the second index structure is performed in hard disk 908, thereby accelerating the overall retrieval efficiency.

[0109] like Figure 10 As shown, this is a flowchart 1000 illustrating a third retrieval processing method according to an embodiment of the present invention. The processing flow executed by the aforementioned retrieval processing device 901, as shown in flowchart 1000, may include:

[0110] S1001: Perform vector retrieval based on the first index structure to obtain one or more third vectors closest to the query vector. The first index structure corresponds to a subset of vectors in the vector space and is stored in memory. This step can be performed by the first index structure retrieval processing module 905. As previously described, the first index structure may include a spatial partitioning tree index, or a third proximity graph index corresponding to a subset of vectors in the vector space, or both a spatial partitioning tree index and a third proximity graph index. The specific processing in step S1001 will differ depending on these different structural designs. Please refer to the previous description of the first index structure retrieval processing module 905 for details, which will not be repeated here.

[0111] S1002: Using one or more third vectors as seeds, perform vector retrieval based on the second index structure to obtain one or more fourth vectors that are closest to the query vector. The second index structure is a fourth nearest neighbor graph index corresponding to all vectors in the vector space, and the second index structure is stored on the hard disk. This step can be performed by the second index structure retrieval processing module 906.

[0112] The detailed process of vector retrieval processing in the above steps has been explained previously and will not be repeated here.

[0113] Specific implementation example

[0114] In some examples, the above Figures 1 to 10The one or more modules, steps, or processes involved can be implemented through software programs, hardware circuits, or a combination of both. For example, the aforementioned components or modules, as well as one or more steps, can be implemented in a System-on-a-Chip (SoC). An SoC may include an integrated circuit chip comprising one or more of the following: processing units (such as a central processing unit (CPU), microcontroller, microprocessor unit, digital signal processing unit (DSP), etc.), memory, one or more communication interfaces, and / or further circuitry for performing its functions and optionally embedded firmware.

[0115] like Figure 11 The diagram shown is a structural block diagram of an electronic device 1100 according to an embodiment of the invention. The electronic device 1100 includes a memory 1101 and a processor 1102.

[0116] Memory 1101 is used to store programs. In addition to the programs described above, memory 1101 may also be configured to store various other data to support operation on electronic device 1100. Examples of such data include instructions for any application or method operating on electronic device 1100, contact data, phonebook data, messages, pictures, videos, etc.

[0117] The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0118] Memory 1101 is coupled to processor 1102 and contains instructions stored thereon, which, when executed by processor 1102, cause the electronic device to perform actions. As an embodiment of the electronic device, these actions may include:

[0119] Based on the spatial partitioning tree index, retrieve one or more leaf nodes that are closest to the query vector. The leaf nodes in the spatial partitioning tree correspond to the sub-vector spaces in the vector space.

[0120] For the subvector space corresponding to one or more leaf nodes that are closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors that are closest to the query vector.

[0121] The leaf nodes store the center vector or the vector identifier of the center vector in their corresponding subvector space.

[0122] Accordingly, based on the spatial partitioning tree index, retrieving one or more leaf nodes that are closest to the query vector can include:

[0123] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance.

[0124] The spatial partitioning tree index can include at least one level of intermediate nodes. Each intermediate node and leaf node corresponds to a different sub-vector space. The sub-vector space corresponding to an intermediate node that is a parent node includes the sub-vector space corresponding to an intermediate node that is a child node or a leaf node. The intermediate nodes and leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space.

[0125] Accordingly, based on the spatial partitioning tree index, retrieving one or more leaf nodes that are closest to the query vector can include:

[0126] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the intermediate node or leaf node of each layer, and determine the one or more closest leaf nodes based on the vector distance.

[0127] The leaf nodes can store either the center vector of their corresponding subvector space or the vector identifier of the center vector.

[0128] Accordingly, for the subvector space corresponding to one or more leaf nodes closest to the query vector, a vector retrieval based on the first proximity graph index is performed to obtain one or more first vectors closest to the query vector, which may include:

[0129] For each leaf node's corresponding subvector space, one or more neighboring vectors of the center vector stored in the leaf node are obtained based on the first neighbor graph index. Using the neighboring vector as a seed, a preset number of vector distance iterations are performed to obtain one or more first vectors that are closest to the query vector.

[0130] The aforementioned actions may also include:

[0131] During the process of retrieving one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index, the retrieval path is recorded.

[0132] During the vector distance iteration calculation in the preset rounds, if a local optimum occurs, the retrieval path is extracted, and the sub-vector space that has not performed vector retrieval based on the first neighbor graph index is selected to perform vector retrieval based on the first neighbor graph index.

[0133] Each point in the first neighbor graph index can store a vector or vector identifier corresponding to its neighboring points;

[0134] Accordingly, during the vector retrieval process based on the first proximity graph index, the vectors of neighboring points can be obtained from each point to perform distance calculation with the query vector, or the vector identifiers of neighboring points can be obtained from each point, and then the corresponding vectors can be obtained based on the vector identifiers before performing distance calculation with the query vector.

[0135] This may further include a second nearest-neighbor graph index, where the first nearest-neighbor graph index corresponds to a subset of vectors in the vector space, and the second nearest-neighbor graph index corresponds to all vectors in the vector space. The spatial partitioning tree index and the first nearest-neighbor graph index are stored in memory, while the second nearest-neighbor graph index is stored on disk.

[0136] Accordingly, the above actions may also include:

[0137] Using one or more first vectors as seeds, perform vector retrieval based on the second proximity graph index to obtain one or more second vectors that are closest to the query vector.

[0138] As another embodiment of an electronic device, the above-described actions may include:

[0139] Vector retrieval is performed based on the first index structure to obtain one or more third vectors that are closest to the query vector. The first index structure corresponds to a portion of the vectors in the vector space and is stored in memory.

[0140] Using one or more third vectors as seeds, a vector retrieval based on the second index structure is performed to obtain one or more fourth vectors that are closest to the query vector. The second index structure is a fourth nearest neighbor graph index corresponding to all vectors in the vector space, and the second index structure is stored on the hard disk.

[0141] The first index structure may include a spatial partitioning tree index, where the leaf nodes of the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the leaf nodes store the center vector or vector identifier of the corresponding sub-vector space.

[0142] Accordingly, performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector may include:

[0143] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0144] Obtain one or more center vectors from the nearest one or more leaf nodes as the third vector.

[0145] The first index structure may include a third nearest-neighbor graph index corresponding to a subset of vectors in the vector space.

[0146] Accordingly, performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector may include:

[0147] Perform a vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0148] The first index structure includes a spatial partitioning tree index and a third proximity graph index. The leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the third proximity graph index corresponds to a subset of vectors in the vector space.

[0149] Accordingly, performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector may include:

[0150] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0151] For the subvector space corresponding to one or more leaf nodes that are closest to the query vector, perform vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0152] The processing operations described above have been described in detail in the embodiments of the methods and apparatus above. The detailed content of the processing operations described above also applies to the electronic device 1100. That is, the specific processing operations mentioned in the previous embodiments can be written into the memory 1101 in the form of a program and executed by the processor 1102.

[0153] Furthermore, such as Figure 11 As shown, the electronic device 1100 may also include other components such as a communication component 1103, a power supply component 1104, an audio component 1105, a display 1106, and a chipset 1107. Figure 11 The diagram only shows some components and does not imply that electronic device 1100 only includes... Figure 11 The components shown.

[0154] Communication component 1103 is configured to facilitate wired or wireless communication between electronic device 1100 and other devices. The electronic device can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 1103 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1103 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0155] Power supply component 1104 provides power to various components of an electronic device. Power supply component 1104 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0156] Audio component 1105 is configured to output and / or input audio signals. For example, audio component 1105 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1101 or transmitted via communication component 1103. In some embodiments, audio component 1105 also includes a speaker for outputting audio signals.

[0157] Display 1106 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.

[0158] The aforementioned memory 1101, processor 1102, communication component 1103, power supply component 1104, audio component 1105, and display 1106 can be connected to chipset 1107. Chipset 1107 provides an interface between processor 1102 and the other components in electronic device 1100. Furthermore, chipset 1107 also provides an interface for each component in electronic device 1100 to access memory 1101 and a communication interface for communication between components.

[0159] Example Terms

[0160] A: A method including:

[0161] Based on the spatial partitioning tree index, one or more leaf nodes that are closest to the query vector are retrieved, where the leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space;

[0162] For the subvector space corresponding to one or more leaf nodes that are closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors that are closest to the query vector.

[0163] B: According to the method described in paragraph A, the leaf node stores the center vector of its corresponding sub-vector space or the vector identifier of the center vector.

[0164] The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes:

[0165] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance.

[0166] C: According to the method described in paragraph A, the spatial partitioning tree index includes at least one level of intermediate nodes, each intermediate node and leaf node corresponds to a different sub-vector space, and the sub-vector space corresponding to an intermediate node as a parent node includes the sub-vector space corresponding to an intermediate node as a child node or a leaf node. The intermediate nodes and leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space.

[0167] The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes:

[0168] The vector distance between the query vector and the center vector of the subvector space corresponding to the intermediate node or leaf node of each layer is calculated layer by layer, and the closest one or more leaf nodes are determined based on the vector distance.

[0169] D: According to the method described in paragraph A, the leaf node stores the center vector or the vector identifier of the center vector of its corresponding sub-vector space.

[0170] For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector, including:

[0171] For each leaf node's corresponding subvector space, one or more neighboring vectors of the center vector stored in the leaf node are obtained based on the first neighbor graph index. Using the neighboring vector as a seed, a preset number of vector distance iterations are performed to obtain one or more first vectors that are closest to the query vector.

[0172] E: According to the method described in paragraph A, it further includes:

[0173] During the process of retrieving one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index, the retrieval path is recorded.

[0174] During the vector distance iteration calculation in the preset rounds, if a local optimum occurs, the retrieval path is extracted, and the sub-vector space that has not performed vector retrieval based on the first neighbor graph index is selected to perform vector retrieval based on the first neighbor graph index.

[0175] F: According to the method described in paragraph A, each point in the first neighbor graph index stores a vector or vector identifier corresponding to a neighbor point.

[0176] During the vector retrieval process based on the first proximity graph index, the vectors of neighboring points are obtained from each point to perform distance calculation with the query vector, or the vector identifiers of neighboring points are obtained from each point, and then the corresponding vectors are obtained based on the vector identifiers before performing distance calculation with the query vector.

[0177] G: According to the method described in paragraph A, it further includes a second neighbor graph index, where the first neighbor graph index corresponds to a portion of the vectors in the vector space, the second neighbor graph index corresponds to all vectors in the vector space, the spatial partitioning tree index and the first neighbor graph index are stored in memory, and the second neighbor graph index is stored on disk.

[0178] The method further includes:

[0179] Using the one or more first vectors as seeds, perform vector retrieval based on the second proximity graph index to obtain one or more second vectors that are closest to the query vector.

[0180] H: An apparatus comprising:

[0181] The spatial partitioning tree retrieval processing module is used to retrieve one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index. The leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space.

[0182] The first proximity graph retrieval processing module is used to perform vector retrieval based on the first proximity graph index for the subvector space corresponding to one or more leaf nodes that are closest to the query vector, and to obtain one or more first vectors that are closest to the query vector.

[0183] I: According to the apparatus described in paragraph H, the leaf nodes store the center vector or vector identifier of the center vector in the corresponding sub-vector space.

[0184] The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes:

[0185] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance.

[0186] J: According to the apparatus described in paragraph H, the spatial partitioning tree index includes at least one level of intermediate nodes, each intermediate node and leaf node corresponding to a different sub-vector space. The sub-vector space corresponding to an intermediate node as a parent node includes the sub-vector space corresponding to an intermediate node as a child node or a leaf node. The intermediate nodes and leaf nodes store the center vector or vector identifier of the center vector of their corresponding sub-vector space.

[0187] The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes:

[0188] The vector distance between the query vector and the center vector of the subvector space corresponding to the intermediate node or leaf node of each layer is calculated layer by layer, and the closest one or more leaf nodes are determined based on the vector distance.

[0189] K: According to the apparatus described in paragraph H, the leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space.

[0190] For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector, including:

[0191] For each leaf node's corresponding subvector space, one or more neighboring vectors of the center vector stored in the leaf node are obtained based on the first neighbor graph index. Using the neighboring vector as a seed, a preset number of vector distance iterations are performed to obtain one or more first vectors that are closest to the query vector.

[0192] L: The apparatus described in paragraph H, wherein...

[0193] The spatial partitioning tree retrieval processing module is also used to record the retrieval path during the process of retrieving one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index.

[0194] The first neighbor graph retrieval processing module is further configured to, during the process of performing a preset number of vector distance iteration calculations, if a local optimum occurs, extract the retrieval path, select the sub-vector space where vector retrieval based on the first neighbor graph index has not been performed, and perform vector retrieval based on the first neighbor graph index.

[0195] M: According to the apparatus described in paragraph H, each point in the first proximity graph index stores a vector or vector identifier corresponding to a neighboring point;

[0196] During the vector retrieval process based on the first proximity graph index, the vectors of neighboring points are obtained from each point to perform distance calculation with the query vector, or the vector identifiers of neighboring points are obtained from each point, and then the corresponding vectors are obtained based on the vector identifiers before performing distance calculation with the query vector.

[0197] N: According to the apparatus described in paragraph H, it further includes a second neighbor graph index, the first neighbor graph index corresponding to a portion of the vectors in the vector space, the second neighbor graph index corresponding to all vectors in the vector space, the spatial partitioning tree index and the first neighbor graph index being stored in memory, and the second neighbor graph index being stored on disk.

[0198] The device further includes:

[0199] The second proximity graph retrieval processing module is used to perform vector retrieval based on the second proximity graph index using the one or more first vectors as seeds, and to obtain one or more second vectors that are closest to the query vector.

[0200] O: An electronic device comprising:

[0201] Processing unit; and

[0202] A memory, coupled to the processing unit and containing instructions stored thereon, which, when executed by the processing unit, cause the device to perform actions, including:

[0203] Based on the spatial partitioning tree index, one or more leaf nodes that are closest to the query vector are retrieved, where the leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space;

[0204] For the subvector space corresponding to one or more leaf nodes that are closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors that are closest to the query vector.

[0205] P: According to the electronic device described in paragraph O, the leaf nodes store the center vector or the vector identifier of the center vector of the corresponding sub-vector space.

[0206] The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes:

[0207] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance.

[0208] Q: According to the electronic device described in paragraph O, the spatial partitioning tree index includes at least one level of intermediate nodes, each intermediate node and leaf node corresponds to a different sub-vector space, and the sub-vector space corresponding to an intermediate node as a parent node includes the sub-vector space corresponding to an intermediate node as a child node or a leaf node. The intermediate nodes and leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space.

[0209] The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes:

[0210] The vector distance between the query vector and the center vector of the subvector space corresponding to the intermediate node or leaf node of each layer is calculated layer by layer, and the closest one or more leaf nodes are determined based on the vector distance.

[0211] R: According to the electronic device described in paragraph O, wherein the leaf node stores the center vector or the vector identifier of the center vector of its corresponding sub-vector space.

[0212] For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector, including:

[0213] For each leaf node's corresponding subvector space, one or more neighboring vectors of the center vector stored in the leaf node are obtained based on the first neighbor graph index. Using the neighboring vector as a seed, a preset number of vector distance iterations are performed to obtain one or more first vectors that are closest to the query vector.

[0214] S: According to the electronic device described in paragraph O, the action further includes:

[0215] During the process of retrieving one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index, the retrieval path is recorded.

[0216] During the vector distance iteration calculation in the preset rounds, if a local optimum occurs, the retrieval path is extracted, and the sub-vector space that has not performed vector retrieval based on the first neighbor graph index is selected to perform vector retrieval based on the first neighbor graph index.

[0217] T: According to the electronic device described in paragraph O, wherein,

[0218] Each point in the first neighbor graph index stores a vector or vector identifier corresponding to its neighboring point.

[0219] During the vector retrieval process based on the first proximity graph index, the vectors of neighboring points are obtained from each point to perform distance calculation with the query vector, or the vector identifiers of neighboring points are obtained from each point, and then the corresponding vectors are obtained based on the vector identifiers before performing distance calculation with the query vector.

[0220] A1: A method comprising:

[0221] Vector retrieval is performed based on the first index structure to obtain one or more third vectors that are closest to the query vector. The first index structure corresponds to a portion of the vectors in the vector space and is stored in memory.

[0222] Using the one or more third vectors as seeds, a vector retrieval based on the second index structure is performed to obtain one or more fourth vectors that are closest to the query vector. The second index structure is a fourth proximity graph index corresponding to all vectors in the vector space, and the second index structure is stored on the hard disk.

[0223] B1: According to the method described in paragraph A1, the first index structure includes a spatial partitioning tree index, where the leaf nodes of the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the leaf nodes store the center vector or vector identifier of the corresponding sub-vector space.

[0224] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0225] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0226] One or more center vectors are obtained from the nearest one or more leaf nodes as the third vector.

[0227] C1: According to the method described in paragraph A1, the first index structure includes a third nearest-neighbor graph index corresponding to a subset of vectors in the vector space.

[0228] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0229] Perform a vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0230] D1: According to the method described in paragraph A1, the first index structure includes a spatial partitioning tree index and a third proximity graph index, wherein the leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the third proximity graph index corresponds to a portion of the vector space.

[0231] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0232] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0233] For the subvector space corresponding to one or more leaf nodes that are closest to the query vector, perform vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0234] E1: An apparatus comprising:

[0235] The first index structure retrieval processing module is used to perform vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector. The first index structure corresponds to a portion of the vectors in the vector space, and the first index structure is stored in memory.

[0236] The second index structure retrieval processing module is used to perform vector retrieval based on the second index structure using the one or more third vectors as seeds, and to obtain one or more fourth vectors that are closest to the query vector. The second index structure is a fourth proximity graph index corresponding to all vectors in the vector space, and the second index structure is stored in the hard disk.

[0237] F1: According to the apparatus described in paragraph E1, the first index structure includes a spatial partitioning tree index, wherein the leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the leaf nodes store the center vector or vector identifier of the corresponding sub-vector space.

[0238] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0239] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0240] One or more center vectors are obtained from the nearest one or more leaf nodes as the third vector.

[0241] G1: According to the apparatus described in paragraph E1, wherein the first index structure includes a third nearest-neighbor graph index corresponding to a subset of vectors in the vector space.

[0242] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0243] Perform a vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0244] H1: According to the apparatus described in paragraph E1, the first index structure includes a spatial partitioning tree index and a third proximity graph index, wherein the leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the third proximity graph index corresponds to a subset of vectors in the vector space.

[0245] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0246] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0247] For the subvector space corresponding to one or more leaf nodes that are closest to the query vector, perform vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0248] I1: An electronic device comprising:

[0249] Processing unit; and

[0250] A memory, coupled to the processing unit and containing instructions stored thereon, which, when executed by the processing unit, cause the device to perform actions, including:

[0251] Vector retrieval is performed based on the first index structure to obtain one or more third vectors that are closest to the query vector. The first index structure corresponds to a portion of the vectors in the vector space and is stored in memory.

[0252] Using the one or more third vectors as seeds, a vector retrieval based on the second index structure is performed to obtain one or more fourth vectors that are closest to the query vector. The second index structure is a fourth proximity graph index corresponding to all vectors in the vector space, and the second index structure is stored on the hard disk.

[0253] J1: In the electronic device described in paragraph I1, the first index structure includes a spatial partitioning tree index, wherein the leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the leaf nodes store the center vector or vector identifier of the corresponding sub-vector space.

[0254] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0255] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0256] One or more center vectors are obtained from the nearest one or more leaf nodes as the third vector.

[0257] K1: The electronic device according to paragraph I1, wherein the first index structure includes a third proximity graph index corresponding to a subset of vectors in the vector space.

[0258] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0259] Perform a vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0260] L1: According to the electronic device described in paragraph I1, the first index structure includes a spatial partitioning tree index and a third proximity graph index, wherein the leaf nodes in the spatial partitioning tree correspond to sub-vector spaces in the vector space, and the third proximity graph index corresponds to a portion of the vector space.

[0261] The step of performing vector retrieval based on the first index structure to obtain one or more third vectors that are closest to the query vector includes:

[0262] Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance;

[0263] For the subvector space corresponding to one or more leaf nodes that are closest to the query vector, perform vector retrieval based on the third proximity graph index to obtain one or more third vectors that are closest to the query vector.

[0264] Conclusion

[0265] The differences between the hardware and software implementations of various aspects of the system are not significant; the choice between hardware and software is typically (but not always, as the choice can become significant in certain contexts) a design choice representing a cost-efficiency trade-off. Various carriers exist that can implement the processing and / or system and / or other technologies (e.g., hardware, software, and / or firmware) described herein, and the preferred carrier will vary depending on the context in which the processing and / or system and / or other technologies are deployed. For example, if the implementer determines that speed and accuracy are most important, the implementer may choose a primary hardware and / or firmware carrier; if flexibility is most important, the implementer may choose a primary software implementation; or, alternatively, the implementer may choose some combination of hardware, software, and / or firmware.

[0266] The foregoing detailed description has illustrated various implementations of the apparatus and / or process using block diagrams, flowcharts, and / or examples. As such block diagrams, flowcharts, and / or examples contain one or more functions and / or operations, those skilled in the art will understand that each function and / or operation within such block diagrams, flowcharts, or examples can be implemented individually and / or collectively by a wide range of hardware, software, firmware, or virtually any combination thereof. In one implementation, several parts of the main themes described herein can be implemented via application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), or other integration formats. However, those skilled in the art will recognize that some aspects of the embodiments disclosed herein can be implemented entirely or partially equivalently in an integrated circuit, implemented as one or more computer programs running on one or more computers (e.g., implemented as one or more programs running on one or more computer systems), implemented as one or more programs running on one or more processors (e.g., implemented as one or more programs running on one or more microprocessors), implemented as firmware, or actually implemented as any combination thereof, and that designing circuits and / or writing code for software and / or firmware according to this disclosure is entirely within the skill of those skilled in the art. Furthermore, those skilled in the art will understand that the mechanisms of the subject matter described herein can be distributed as program products in various forms, and that the exemplary embodiments of the subject matter described herein apply regardless of the specific type of signal-bearing medium used to actually perform such distribution. Examples of signal-bearing media include, but are not limited to, the following: recordable media, such as floppy disks, hard disk drives (HDDs), CDs, digital universal discs (DVDs), digital magnetic tapes, computer memory, etc.; and transmission media, such as digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).

[0267] Those skilled in the art will recognize that it is common in the art to describe devices and / or processes in the manner set forth herein, and thereafter to integrate such described devices and / or processes into data processing systems using engineering practice. That is, at least a portion of the devices and / or processes described herein can be integrated into data processing systems through a reasonable amount of experimentation. Those skilled in the art will recognize that a typical data processing system generally includes one or more of the following: a system unit housing, a video display device, a memory such as volatile and non-volatile memory, a processor such as a microprocessor and a digital signal processor, a computing entity such as an operating system, drivers, a graphical user interface, and applications, one or more interactive devices such as a touchpad or touchscreen, and / or a control system including feedback loops and control motors (e.g., feedback for sensing position and / or speed; control motors for moving and / or adjusting components and / or quantities). Typical data processing systems can be implemented using any suitable commercially available components, such as those commonly found in data computing / communication and / or network communication / computing systems.

[0268] The topics described herein sometimes exemplify different components contained within or connected to other components. It is to be understood that the architectures depicted are merely exemplary, and in reality, many other architectures can be implemented to achieve the same functionality. Conceptually, any arrangement of components used to achieve the same functionality is effectively “associated” to achieve the desired functionality. Therefore, any two components combined here to achieve a specific function can be considered “associated” with each other to achieve the desired functionality, regardless of the architecture or intermediate components. Similarly, any two such associated components can also be considered “operably connected” or “operably coupled” to each other to achieve the desired functionality, and any two components that can be suchly associated can also be considered “operably coupled” to each other to achieve the desired functionality. Specific examples of operably coupled components include, but are not limited to, physically matable and / or physically interactive components and / or wirelessly interactive components and / or logically interactive and / or logically interactive components.

[0269] For any plural and / or singular terms used herein, those skilled in the art can translate them from plural to singular and / or from singular to plural as appropriate for the context and / or application. For clarity, various singular / plural substitutions can be precisely described herein.

[0270] Those skilled in the art will understand that, in general, the terms used herein, and especially in the appended claims (e.g., the body of the appended claims), are intended as “open-ended” language (e.g., the term “including” should be interpreted as “including but not limited to,” the term “having” should be interpreted as “at least having,” the term “include” should be interpreted as “including but not limited to,” etc.). Those skilled in the art will also understand that if a specific number of introductory claims are desired, this intention will be explicitly stated in the claims, and without such an introductory list, this intention does not exist. For example, to aid understanding, the appended claims may contain introductory phrases such as “at least one” and “one or more” to introduce the list of claims. However, the use of such phrases should not be construed as implying that a list of claims introduced by the indefinite article "a(a)" or "an" limits any particular claim containing such an introductory list to an invention containing only one such list, even if the same claim includes the introductory phrases "one or more" or "at least one" and indefinite articles such as "a(a)" or "an" (e.g., "a(a)" or "an" should generally be interpreted as meaning "at least one" or "one or more"); this also remains true for the use of definite articles for introductory list of claims. Furthermore, even if a specific number of introductory list of claims is explicitly stated, those skilled in the art should recognize that such a list should generally be interpreted as meaning at least the stated number (e.g., "two lists" in the absence of other modifiers generally means at least two lists, or two or more lists). Furthermore, in instances where the convention of "at least one of A, B, and C" is used, generally, this syntactic structure is intended to be understood by those skilled in the art in terms of meaning (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, systems having a single A, a single B, a single C, A and B together, A and C together, B and C together, and / or A, B, and C together, etc.). In instances where the convention of "at least one of A, B, or C" is used, generally, this syntactic structure is intended to be understood by those skilled in the art in terms of meaning (e.g., "a system having at least one of A, B, or C" should include, but is not limited to, systems having a single A, a single B, a single C, A and B together, A and C together, B and C together, and / or A, B, and C together, etc.).Those skilled in the art should also understand that, in practice, any transition words and / or phrases presenting two or more alternative terms (whether in the description, claims, or drawings) should be understood to imply the possibility of including these terms, any one of these terms, or both terms. For example, the phrase "A or B" should be understood to include the possibility of including "A" or "B" or "A and B".

[0271] In this specification, references to "implementation method," "one implementation method," "some implementation methods," or "other implementation methods" may indicate that a particular feature, structure, or characteristic described in conjunction with one or more implementation methods may be included in at least some implementation methods, but not necessarily in all implementation methods. Different appearances of "implementation method," "one implementation method," or "some implementation methods" in the foregoing description need not all refer to the same implementation method.

[0272] While specific exemplary techniques have been described and illustrated using different methods and systems, those skilled in the art will understand that various other modifications can be made and equivalents can be substituted without departing from the claimed subject matter. Furthermore, many modifications can be made to adapt to specific circumstances of the teachings regarding the claimed subject matter without departing from the central concepts described herein. Therefore, the claimed subject matter is not limited to the specific examples disclosed, but can also include all implementations falling within the scope of the appended claims and their equivalents.

[0273] Although the subject matter has been described using language specific to structural features and / or methodological actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described. Rather, these specific features and actions are disclosed as illustrative forms of implementing the claims.

[0274] Unless otherwise specifically stated, conditional language (such as "can," "able," "may," or "may") is understood in context and is generally used to indicate that a particular example includes a particular feature, element, and / or step that other examples do not. Therefore, such conditional language is not generally intended to imply that features, elements, and / or steps are required in any way for one or more examples, or that one or more examples necessarily include logic for making a decision, have or do not have user input or prompts, or whether such features, elements, and / or steps are to be included or performed in any particular embodiment.

[0275] Unless otherwise specifically stated, it should be understood that joint language (such as the phrase "at least one of X, Y or Z") terms, words, etc., can be any one of X, Y or Z or a combination thereof.

[0276] Any routine description, element, or box in the flowcharts described herein and / or in the accompanying drawings should be understood as potentially representing a module, segment, or portion of code comprising one or more executable instructions for implementing a specific logical function or element in that routine. Alternative examples are included within the scope of the examples described herein, wherein elements or functions may be removed or performed inconsistently with the order shown or discussed, including substantially synchronous or reverse order execution, depending on the functionality involved, as will be understood by one skilled in the art.

[0277] It should be emphasized that many variations and modifications can be made to the above examples, and the elements therein should be understood as in other acceptable examples. All such modifications and variations are intended to be included within the scope of this disclosure and protected by the following claims.

[0278] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0279] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method comprising: Based on the spatial partitioning tree index, retrieve one or more leaf nodes that are closest to the query vector. The leaf nodes in the spatial partitioning tree correspond to the sub-vector spaces in the vector space. For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on a first proximity graph index to obtain one or more first vectors closest to the query vector. The first proximity graph index corresponds to a subset of vectors in the vector space, and each point in the first proximity graph index stores a vector corresponding to a neighboring point or a vector identifier of that vector. The neighboring points and the current point have edge connections. Using the one or more first vectors as seeds, a vector retrieval based on a second proximity graph index is performed to obtain one or more second vectors that are closest to the query vector, wherein the second proximity graph index corresponds to all vectors in the vector space.

2. The method according to claim 1, wherein, The leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes: Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance.

3. The method according to claim 1, wherein, The spatial partitioning tree index includes at least one level of intermediate nodes. Each intermediate node and leaf node corresponds to a different sub-vector space. The sub-vector space corresponding to an intermediate node that is a parent node includes the sub-vector space corresponding to an intermediate node that is a child node or a leaf node. The intermediate nodes and leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes: The vector distance between the query vector and the center vector of the subvector space corresponding to the intermediate node or leaf node of each layer is calculated layer by layer, and the closest one or more leaf nodes are determined based on the vector distance.

4. The method according to claim 1, wherein, The leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector, including: For each leaf node's corresponding subvector space, one or more neighboring vectors of the center vector stored in the leaf node are obtained based on the first neighbor graph index. Then, using the neighboring vector as a seed, a preset number of vector distance iterations are performed to obtain one or more first vectors that are closest to the query vector.

5. The method according to claim 1, further comprising: During the process of retrieving one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index, the retrieval path is recorded. During the vector distance iteration calculation in the preset rounds, if a local optimum occurs, the retrieval path is extracted, and the sub-vector space that has not performed vector retrieval based on the first neighbor graph index is selected, and vector retrieval based on the first neighbor graph index is performed.

6. The method according to claim 1, further comprising: During the vector retrieval process based on the first proximity graph index, the vectors of neighboring points are obtained from each point, and the distance between the obtained vector and the query vector is calculated. Alternatively, the vector identifiers of neighboring points are obtained from each point, and the corresponding vectors are obtained based on the vector identifiers, and the distance between the obtained vector and the query vector is calculated.

7. The method according to claim 1, wherein, The spatial partitioning tree index and the first neighbor graph index are stored in memory, and the second neighbor graph index is stored on the hard disk.

8. An apparatus comprising: The spatial partitioning tree retrieval processing module is used to retrieve one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index. The leaf nodes in the spatial partitioning tree correspond to the sub-vector spaces in the vector space. The first proximity graph retrieval processing module is configured to perform vector retrieval based on the first proximity graph index for the subvector space corresponding to one or more leaf nodes closest to the query vector, to obtain one or more first vectors closest to the query vector, wherein the first proximity graph index corresponds to a portion of the vectors in the vector space, and each point in the first proximity graph index stores a vector corresponding to a neighboring point or a vector identifier of the vector, and the neighboring point and the point have an edge connection relationship; and The second proximity graph retrieval processing module is used to perform vector retrieval based on the second proximity graph index using the one or more first vectors as seeds, and to obtain one or more second vectors that are closest to the query vector, wherein the second proximity graph index corresponds to all vectors in the vector space.

9. The apparatus according to claim 8, wherein, The leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes: Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance.

10. The apparatus according to claim 8, wherein, The spatial partitioning tree index includes at least one level of intermediate nodes. Each intermediate node and leaf node corresponds to a different sub-vector space. The sub-vector space corresponding to an intermediate node that is a parent node includes the sub-vector space corresponding to an intermediate node that is a child node or a leaf node. The intermediate nodes and leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes: The vector distance between the query vector and the center vector of the subvector space corresponding to the intermediate node or leaf node of each layer is calculated layer by layer, and the closest one or more leaf nodes are determined based on the vector distance.

11. The apparatus according to claim 8, wherein, The leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector, including: For each leaf node's corresponding subvector space, one or more neighboring vectors of the center vector stored in the leaf node are obtained based on the first neighbor graph index. Then, using the neighboring vector as a seed, a preset number of vector distance iterations are performed to obtain one or more first vectors that are closest to the query vector.

12. The apparatus according to claim 8, wherein, The spatial partitioning tree retrieval processing module is also used to record the retrieval path during the process of retrieving one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index, and The first neighbor graph retrieval processing module is further configured to extract the retrieval path and select the sub-vector space that has not performed vector retrieval based on the first neighbor graph index during the process of performing a preset number of vector distance iteration calculations, and perform vector retrieval based on the first neighbor graph index.

13. The apparatus according to claim 8, wherein, The first neighbor graph retrieval processing module is further configured to: during the vector retrieval process based on the first neighbor graph index, obtain the vectors of neighboring points from each point, and perform distance calculation between the obtained vector and the query vector; or obtain the vector identifiers of neighboring points from each point, obtain the corresponding vectors according to the vector identifiers, and then perform distance calculation between the obtained vectors and the query vector.

14. The apparatus according to claim 8, wherein, The spatial partitioning tree index and the first neighbor graph index are stored in memory, and the second neighbor graph index is stored on the hard disk.

15. An electronic device comprising: Processing unit; as well as A memory, coupled to the processing unit and containing instructions stored thereon, which, when executed by the processing unit, cause the electronic device to perform actions, including: Based on the spatial partitioning tree index, retrieve one or more leaf nodes that are closest to the query vector. The leaf nodes in the spatial partitioning tree correspond to the sub-vector spaces in the vector space. For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on a first proximity graph index to obtain one or more first vectors closest to the query vector. The first proximity graph index corresponds to a subset of vectors in the vector space, and each point in the first proximity graph index stores a vector corresponding to a neighboring point or a vector identifier of that vector. The neighboring points and the current point have edge connections. Using the one or more first vectors as seeds, a vector retrieval based on a second proximity graph index is performed to obtain one or more second vectors that are closest to the query vector, wherein the second proximity graph index corresponds to all vectors in the vector space.

16. The electronic device according to claim 15, wherein, The leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes: Calculate the vector distance between the query vector and the center vector of the subvector space corresponding to the one or more leaf nodes, and determine the one or more closest leaf nodes based on the vector distance.

17. The electronic device according to claim 15, wherein, The spatial partitioning tree index includes at least one level of intermediate nodes. Each intermediate node and leaf node corresponds to a different sub-vector space. The sub-vector space corresponding to an intermediate node that is a parent node includes the sub-vector space corresponding to an intermediate node that is a child node or a leaf node. The intermediate nodes and leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. The spatial partitioning tree index, which retrieves one or more leaf nodes that are closest to the query vector, includes: The vector distance between the query vector and the center vector of the subvector space corresponding to the intermediate node or leaf node of each layer is calculated layer by layer, and the closest one or more leaf nodes are determined based on the vector distance.

18. The electronic device according to claim 15, wherein, The leaf nodes store the center vector or the vector identifier of the center vector of their corresponding sub-vector space. For the subvector space corresponding to one or more leaf nodes closest to the query vector, perform vector retrieval based on the first proximity graph index to obtain one or more first vectors closest to the query vector, including: For each leaf node's corresponding subvector space, one or more neighboring vectors of the center vector stored in the leaf node are obtained based on the first neighbor graph index. Then, using the neighboring vector as a seed, a preset number of vector distance iterations are performed to obtain one or more first vectors that are closest to the query vector.

19. The electronic device according to claim 15, wherein, The action also includes: During the process of retrieving one or more leaf nodes that are closest to the query vector based on the spatial partitioning tree index, the retrieval path is recorded. During the vector distance iteration calculation in the preset rounds, if a local optimum occurs, the retrieval path is extracted, and the sub-vector space that has not performed vector retrieval based on the first neighbor graph index is selected, and vector retrieval based on the first neighbor graph index is performed.

20. The electronic device according to claim 15, wherein, The action also includes: During the vector retrieval process based on the first proximity graph index, the vectors of neighboring points are obtained from each point, and the distance between the obtained vector and the query vector is calculated. Alternatively, the vector identifiers of neighboring points are obtained from each point, and the corresponding vectors are obtained based on the vector identifiers, and the distance between the obtained vector and the query vector is calculated.