Database vector index construction method and related product

By clustering the database vector set and building a composite index, the problem of taking into account the accuracy of memory usage and retrieval in the existing technology is solved, and more efficient memory usage and retrieval accuracy is achieved.

CN120123341APending Publication Date: 2025-06-10CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510193083.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing database vector indexing methods have shortcomings in taking into account memory usage and retrieval accuracy. Hierarchical navigation small world graph index requires large memory, while the retrieval accuracy of inverted file index is poor.

Method used

By clustering the vector set to be constructed, multiple cluster clusters are generated, and hierarchical navigation small world graph index and inverted file index are constructed based on the central vector of the cluster cluster, combining the two to form a composite index.

Benefits of technology

It reduces the memory usage of hierarchical navigation small world graph index, improves the retrieval accuracy of database vector index, and achieves a balance between memory usage and retrieval accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123341A_ABST
    Figure CN120123341A_ABST
Patent Text Reader

Abstract

The invention provides a database vector index construction method and a related product. The construction method comprises the following steps: clustering a vector set to be constructed to obtain a plurality of clusters; wherein the vector number of each cluster is smaller than or equal to a preset vector threshold value; generating hierarchical navigable small-world graph indexes corresponding to a plurality of inverted files according to the center vectors of the plurality of clustering clusters; wherein the inverted files are in one-to-one correspondence with the center vectors, and the hierarchical navigable small-world graph index comprises all the center vectors. According to the construction method, the retrieval efficiency and the retrieval accuracy of the database vector index can be improved, and the effect of considering the memory use and the retrieval accuracy of the database vector index is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of databases, and in particular to a method for constructing a database vector index, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the explosive growth of digital information, databases need to handle storage services and query services for a large amount of vector data. In related technologies, an approximate nearest neighbor search method (Approximate Nearest Neighbor Search, abbreviated as ANNS) is usually used to construct and retrieve a database vector index. This method can quickly obtain multiple target vectors similar to a query vector in a database storing a large amount of vector data with a limited accuracy loss.

[0003] The approximate nearest neighbor search method includes a hierarchical navigable small world graph index (Hierarchical Navigable Small World, abbreviated as HNSW), an inverted file index (Inverted File, abbreviated as IvF), etc. Among them, the vector index constructed based on the hierarchical navigable small world graph index has a relatively high retrieval accuracy, is good at processing high-dimensional data, has a relatively fast retrieval speed in high-dimensional space, and supports incremental indexing. However, due to the need to maintain graph structures at multiple levels, the vector index based on the hierarchical navigable small world graph index requires a large amount of memory, resulting in a large database overhead. The vector index constructed based on the inverted file index has a relatively fast retrieval speed and uses less memory. However, the retrieval accuracy of the vector index based on the inverted file index is poor, and the construction speed of the vector index is slow. Summary of the Invention

[0004] An object of the present invention is to provide a method for constructing a database vector index, a computer-readable storage medium, and a computer program product, so as to balance the memory usage and retrieval accuracy of the database vector index.

[0005] Specifically, according to one aspect of the present invention, the present invention provides a method for constructing a database vector index, including:

[0006] Clustering the vector set to be constructed to obtain multiple clustering clusters; where the number of vectors in each of the clustering clusters is less than or equal to a preset vector threshold;

[0007] Generating a hierarchical navigable small world graph index corresponding to multiple inverted files according to the central vectors of the multiple clustering clusters; where the inverted files and the central vectors correspond one by one, and the hierarchical navigable small world graph index includes all the central vectors.

[0008] Optionally, clustering the vector set to be constructed to obtain multiple clustering clusters, including:

[0009] Taking the preset vector threshold as the target, performing hierarchical clustering on the vector set to be constructed, so that the number of vectors of any leaf node obtained after hierarchical clustering is less than or equal to the preset vector threshold;

[0010] Regarding the leaf nodes as the clustering clusters.

[0011] Optionally, taking the preset vector threshold as the target and performing hierarchical clustering on the vector set to be constructed includes:

[0012] Performing split-type hierarchical clustering with the vector set to be constructed as the root node until the number of vectors of all leaf nodes is less than or equal to the preset vector threshold.

[0013] Optionally, the step of performing split-type hierarchical clustering with the vector to be constructed as the root node includes:

[0014] Regarding the root node as the parent node;

[0015] Clustering the parent node into K child nodes, where K is a preset value;

[0016] For each child node, determining whether the number of vectors of the child node is less than or equal to the preset vector threshold;

[0017] If so, regarding the child node as a leaf node;

[0018] If not, regarding the child node as the parent node and returning to execute the step of clustering the parent node into K child nodes.

[0019] Optionally, each parent node is configured to execute the step of clustering the parent node into K child nodes in parallel.

[0020] Optionally, K is less than or equal to 10.

[0021] Optionally, the preset vector threshold is less than or equal to 20.

[0022] Optionally, after the step of generating a hierarchical navigable small world graph index corresponding to multiple inverted files, it further includes:

[0023] Querying the vector to be retrieved in the hierarchical navigable small world graph index to obtain M center vectors and the corresponding M inverted files; M is a positive integer;

[0024] Querying the vector to be retrieved in each inverted file to obtain at least one target vector in each inverted file.

[0025] According to another aspect of the present invention, there is also provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above-mentioned database vector index construction methods are implemented.

[0026] According to still another aspect of the present invention, there is also provided a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned database vector index construction methods are implemented.

[0027] The database vector index construction method of the present invention combines a hierarchical navigable small world graph index and an inverted file index, uses the hierarchical navigable small world graph index as the main index, and constructs a composite index with the inverted file index as the secondary index. This construction method makes full use of the advantages of the two index methods, reduces the memory usage of the hierarchical navigable small world graph index, improves the retrieval accuracy of the database vector index, and achieves the effect of taking into account both the memory usage and retrieval accuracy of the database vector index. On the other hand, by restricting the number of vectors in the clustering clusters during the construction process of the inverted file index, all the vectors in the vector set to be constructed are classified into very small classes, improving the clustering quality of the inverted file index, enabling the inverted file index and the hierarchical navigable small world graph index to support and cooperate with each other, and further improving the retrieval efficiency and retrieval accuracy of the database vector index.

[0028] Those skilled in the art will become more apparent about the above and other objects, advantages and features of the present invention according to the following detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings. Description of the Drawings

[0029] Some specific embodiments of the present invention will be described in detail hereinafter with reference to the accompanying drawings in an exemplary but non-limiting manner. The same reference numerals in the drawings denote the same or similar components or parts. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:

[0030] Figure 1 is a schematic flowchart of the construction method according to an embodiment of the present invention;

[0031] Figure 2 is a schematic flowchart of hierarchical clustering of the vector set to be constructed by the construction method according to an embodiment of the present invention;

[0032] Figure 3 is a schematic flowchart of divisive hierarchical clustering of the vector set to be constructed by the construction method according to an embodiment of the present invention;

[0033] Figure 4It is a schematic flowchart of obtaining leaf nodes through iterative clustering in the construction method according to an embodiment of the present invention;

[0034] Figure 5 It is a schematic flowchart of querying the vector to be retrieved in the construction method according to an embodiment of the present invention;

[0035] Figure 6 It is a schematic structural diagram of a hierarchical navigable small world graph in the construction method according to an embodiment of the present invention;

[0036] Figure 7 It is a schematic tree diagram of a split-type hierarchical clustering algorithm in the construction method according to an embodiment of the present invention;

[0037] Figure 8 It is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; and

[0038] Figure 9 It is a schematic diagram of a computer program product according to an embodiment of the present invention. Detailed implementation manners

[0039] The purpose of the construction method of the database vector index in this embodiment is to balance the memory usage and retrieval accuracy of the database vector index, so as to find a balance between the two.

[0040] Figure 1 It is a schematic flowchart of the construction method according to an embodiment of the present invention, and the method generally may include:

[0041] S100, clustering the vector set to be constructed to obtain a plurality of clustering clusters; where the number of vectors in each clustering cluster is less than or equal to a preset vector threshold;

[0042] S200, generating a hierarchical navigable small world graph index corresponding to a plurality of inverted files according to the central vectors of the plurality of clustering clusters; where the inverted files and the central vectors are in one-to-one correspondence, and the hierarchical navigable small world graph index contains all the central vectors.

[0043] The inverted file index (Inverted File, abbreviated as IvF) is an approximate nearest neighbor search method (Approximate Nearest Neighbor Search, abbreviated as ANNS). Its core idea is to cluster all vectors into many clustering clusters in the vector space. Each clustering cluster has its own central vector (also called the clustering center). The multiple vectors in each clustering cluster form an inverted file. That is to say, the inverted file index divides all vectors into multiple inverted files.

[0044] When performing vector retrieval using an inverted file index, several central vectors that are the nearest neighbors to the vector to be retrieved are first found. Then, in the inverted file corresponding to each central vector, vectors that are the nearest neighbors to the vector to be retrieved are searched. The several vectors finally obtained are the target vectors.

[0045] The inverted file index has a relatively fast retrieval speed and uses less memory when in use. However, the retrieval accuracy of the inverted file index depends on the quality of clustering. If the clustering quality is poor (such as uneven distribution between classes, large intra-class distances, etc.), it will affect the retrieval efficiency and cause a significant drop in the retrieval accuracy. Additionally, during retrieval, the user needs to set the number of central vectors to be searched, which requires the user to have corresponding prior knowledge and is not conducive to popularization and use.

[0046] The Hierarchical Navigable Small World (HNSW) graph index is another approximate nearest neighbor search method. Its core idea is to organize all vectors into a pyramid-shaped multi-layer graph structure, where the bottom layer graph contains all vectors, and other layer graphs only contain some vectors. The higher the layer, the fewer vectors the graph contains, and the top layer graph usually only contains a few vectors.

[0047] When performing vector retrieval using the Hierarchical Navigable Small World graph index, it starts from the starting point of the top layer graph, approaches the vector to be retrieved layer by layer, and then searches for several nearest neighbor vectors in the bottom layer graph. Among them, the number of vectors obtained in the bottom layer graph is a preset value and does not need to be set by the user.

[0048] The Hierarchical Navigable Small World graph index has a relatively high retrieval accuracy, is good at processing high-dimensional data, has a relatively fast retrieval speed in high-dimensional space, and supports incremental indexing. However, due to the need to maintain a multi-layer graph structure, the Hierarchical Navigable Small World graph index requires a large amount of memory, resulting in a large database overhead.

[0049] In this embodiment, the Hierarchical Navigable Small World graph index and the inverted file index are combined to form a primary index and a secondary index.

[0050] Specifically, the inverted file index is used as the secondary index. First, the vector set to be constructed is clustered into multiple clustering clusters through a clustering algorithm. The clustering algorithm can be a hierarchical clustering algorithm, a k-means clustering algorithm, etc. In this embodiment, the iterative target of the clustering algorithm is a preset vector threshold. That is to say, the clustering algorithm will continuously iterate and cluster the vector set to be constructed to form multiple candidate clustering clusters until the number of vectors in each candidate clustering cluster is less than or equal to the preset vector threshold, and then stop the iteration to obtain multiple clustering clusters. An inverted file is generated for all vectors within each clustering cluster.

[0051] In this embodiment, the preset vector threshold can be 20, 25, 30, etc. By restricting the number of vectors in the clustering cluster, all vectors in the vector set to be constructed will be assigned to very small classes, thereby improving the clustering quality of the inverted file index, and further improving the retrieval efficiency and retrieval accuracy.

[0052] In the inverted file index, the central vector can be a vector near the center in the clustering cluster, or the average vector or weighted average vector of the vectors in the clustering cluster.

[0053] After the inverted file index is constructed, a hierarchical navigable small world graph index can be constructed based on the central vector as the main index. Specifically, the bottom layer graph of the hierarchical navigable small world graph index does not contain all vectors in the vector set to be constructed, but contains the central vectors of each clustering cluster.

[0054] As Figure 7 shown, Figure 7 schematically shows a three-layer hierarchical navigable small world graph, where the 0th layer is the bottom layer, containing all 8 central vectors (each black dot represents a central vector). The 1st layer is the middle layer, containing 3 of the 8 central vectors in the 0th layer. The 2nd layer is the top layer, containing 2 of the 3 central vectors in the 1st layer. The retrieval entry point is set at the top layer.

[0055] The number of central vectors is usually much less than the number of vectors in the vector set to be constructed. Taking the preset vector threshold of 20 as an example, the number of central vectors may be 1 / 20 to 1 times the number of vectors in the vector set to be constructed; generally, the number of central vectors is less than 1 / 10 of the number of vectors in the vector set to be constructed. In this way, when constructing and using the hierarchical navigable small world graph index, the vector data volume can be significantly reduced, and the memory used can be significantly reduced, especially when the number of vectors and / or vector dimensions in the vector set to be constructed are large, the memory used can be greatly reduced.

[0056] On the other hand, based on the algorithm characteristics of the hierarchical navigable small world graph index, several central vectors closest to the vector to be retrieved can be retrieved more accurately during retrieval, so as to maintain a high retrieval accuracy.

[0057] When using the database vector index constructed by the construction method of this embodiment, first, the vector to be retrieved is retrieved in the hierarchical navigable small world graph index to obtain several central vectors closest to the vector to be retrieved. Then, the inverted file index is used to retrieve at least one nearest neighbor vector in the inverted file corresponding to each obtained central vector, and this vector is the target vector. The inverted file index can obtain multiple target vectors in total.

[0058] In some embodiments of the construction method of the present invention, such as Figure 2As shown, clustering the vector set to be constructed results in multiple clustering clusters, including:

[0059] S110. Targeting a preset vector threshold, perform hierarchical clustering on the vector set to be constructed, so that the number of vectors in any leaf node after hierarchical clustering is less than or equal to the preset vector threshold; and use the leaf nodes as clustering clusters.

[0060] In this embodiment, the clustering algorithm is a hierarchical clustering algorithm. Specifically, a divisive hierarchical clustering algorithm, an agglomerative hierarchical clustering algorithm, etc. can be used. In actual use, it can be selected according to needs without limitation here. Compared with other clustering algorithms, the hierarchical clustering algorithm can improve the clustering quality and the clustering speed, thereby improving the speed of constructing the vector index of the database.

[0061] In some embodiments of the construction method of the present invention, as Figure 3 shown, targeting a preset vector threshold, performing hierarchical clustering on the vector set to be constructed includes:

[0062] S111. Perform divisive hierarchical clustering with the vector set to be constructed as the root node until the number of vectors in all leaf nodes is less than or equal to the preset vector threshold.

[0063] The divisive hierarchical clustering algorithm adopts a top-down clustering strategy. Its core idea is to start from a large cluster composed of all data points, gradually split the cluster into smaller clusters until each data point forms an independent cluster or meets the stop condition.

[0064] Specifically, in this embodiment, taking the vector set to be constructed as the root node, cluster downward into multiple child nodes, then take each child node as the parent node and cluster downward into multiple child nodes again, and iterate continuously until the number of vectors in the child nodes is less than or equal to the preset vector threshold and then stop iterating, and use the child nodes as leaf nodes. After clustering is completed, the leaf nodes will be written to disk, used as a class, and stored in a storage medium (such as a disk).

[0065] As Figure 6 shown, Figure 6 schematically shows a tree diagram of a divisive hierarchical clustering algorithm, where the top layer is the root node, clustering downward from the root node into multiple branch nodes (3 branch nodes are schematically shown in the middle layer of the figure), and each branch node clusters downward into multiple leaf nodes (6 leaf nodes are schematically shown in the bottom layer of the figure). Each black dot in the figure represents a central vector. The number of vectors in each leaf node is less than or equal to 20.

[0066] The divisive hierarchical clustering algorithm can conveniently set the preset vector threshold, classifies the vector set with fewer categories relatively quickly, and does not depend on the selection of initial parameters, and is more suitable for the vector set to be constructed in the database.

[0067] In some embodiments of the construction method of the present invention, as Figure 4 shown, taking the vector to be constructed as the root node, performing split hierarchical clustering until the number of vectors in all leaf nodes is less than or equal to a preset vector threshold, including:

[0068] S311, taking the root node as the parent node;

[0069] S313, clustering the parent node into K child nodes, where K is a preset value;

[0070] S315, for each of the child nodes, determining whether the number of vectors in the child node is less than or equal to the preset vector threshold;

[0071] S317, if so, taking the child node as a leaf node;

[0072] S319, if not, taking the child node as the parent node and returning to execute step S313.

[0073] In this embodiment, K can be 5, 6, 7, 8, 9, 10, etc. By presetting the value of K, the number of child nodes formed by each clustering of the parent node can be restricted. Especially when there is a large amount of vector data in the vector set to be constructed, it can accelerate the iteration of split hierarchical clustering and speed up the construction of the inverted file index.

[0074] In some embodiments of the construction method of the present invention, each parent node is configured to execute the step of clustering the parent node into K child nodes in parallel.

[0075] By adopting the split hierarchical clustering algorithm, the clustering processes between the parent nodes are in a completely independent state. On this basis, by executing the clustering processes of the parent nodes in parallel in multiple processes, the construction of the inverted file index can be further accelerated.

[0076] In some embodiments of the construction method of the present invention, K is less than or equal to 10.

[0077] In this embodiment, by setting a smaller value of K, the clustering algorithm has strong universality and can be applied to vector data of various databases.

[0078] In some embodiments of the construction method of the present invention, the preset vector threshold is less than or equal to 20. By setting a smaller preset vector threshold, all vectors may be assigned to very small classes, thereby improving the clustering quality and accelerating the construction of the inverted file index.

[0079] In some embodiments of the construction method of the present invention, as Figure 5As shown, after the step of generating a hierarchical navigable small world graph index corresponding to multiple inverted files, the following steps are further included:

[0080] S500, query the vector to be retrieved in the hierarchical navigable small world graph index to obtain M central vectors and the corresponding M inverted files; M is a positive integer;

[0081] S600, query the vector to be retrieved in each inverted file to obtain at least one target vector in each inverted file.

[0082] In this embodiment, during retrieval, first retrieve in the main index, i.e., the hierarchical navigable small world graph index, to obtain M central vectors closest to the vector to be retrieved. After obtaining the central vectors, use the inverted file index to retrieve in the M inverted files corresponding to the obtained M central vectors. At least one nearest neighbor vector is retrieved from each inverted file, and this vector is the target vector. In total, at least M target vectors can be obtained from the inverted file index.

[0083] In this embodiment, by using the hierarchical navigable small world graph index as the main index and the inverted file retrieval as the secondary index, the advantages of the two indexes can be effectively utilized, the disadvantages of the two indexes can be compensated, and the effects of taking into account the memory usage and retrieval accuracy of the database vector index are achieved.

[0084] In this embodiment, M is a positive integer, which can be 5, 6, 7, etc., and can be built into the hierarchical navigable small world graph index as a preset parameter. That is to say, users do not need to have corresponding prior knowledge to obtain retrieval results with relatively high accuracy.

[0085] The flowchart provided in this embodiment is not intended to indicate that the operations of the method will be executed in any specific order, or that all operations of the method are included in every case. In addition, the method may include additional operations. Within the scope of the technical idea provided by the method in this embodiment, additional changes can be made to the above method.

[0086] It should be understood that in some embodiments, each part can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.

[0087] This embodiment also provides a computer program product 10 and a computer-readable storage medium 20. Figure 9 It is a schematic diagram of a computer program product 10 according to an embodiment of the present invention. Figure 8Schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention. The computer program product 10 includes a computer program 11 which, when executed by a processor 32, implements the steps of any one of the above-described construction methods. The computer-readable storage medium 20 stores thereon the above computer program 11 which, when executed by the processor 32, implements the steps of the construction method of any one of the above embodiments.

[0088] The computer program 11 for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, configuration data of an integrated circuit, or source code or object code written in any combination of one or more programming languages and procedural programming languages. The computer program 11 may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, in order to perform aspects of the present invention, an electronic circuit, including for example a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), may execute computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit.

[0089] For the description of this embodiment, the computer program product 10 is a related product containing the computer program 11.

[0090] For the purposes of the description of this embodiment, the computer-readable storage medium 20 is a tangible device capable of retaining and storing the computer program 11, which can be any device that can contain, store, communicate, propagate, or transport the computer program 11 for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable storage medium 20 include the following: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile discs (DVDs), memory sticks, floppy disks, mechanically encoded devices, and any suitable combination of the foregoing.

[0091] The computer program product 10 can run on a computer device. The computer device can include a memory, a processor 32, and a computer program 11 stored on the memory and running on the processor 32. The computer device can be, for example, a server, a desktop computer, a laptop computer, a tablet computer, or a smart phone. In some examples, the computer device can be a cloud computing node. The computer device can be described in the general context of computer system-executable instructions, such as program modules, executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer device can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0092] The computer device can include a processor 32 adapted to execute stored instructions and a memory that provides temporary storage space for the operation of the instructions during operation. The processor 32 can be a single-core processor, a multi-core processor, a computing cluster, or any number of other configurations. The memory can include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.

[0093] The computer device can also include a network adapter / interface and an input / output (I / O) interface. The I / O interface allows data to be input and output with external devices that can be connected to the computer device. The network adapter / interface can provide communication between the computer device and a network, which is typically shown as a communication network.

[0094] At this point, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived from the disclosed content of the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized as covering all such other variations or modifications.

Claims

1. A method for constructing a database vector index, characterized in that: include: Cluster the vector set to be constructed to obtain multiple clusters; The number of vectors of each cluster is less than or equal to a preset vector threshold; According to the central vectors of the plurality of clusters, a hierarchical navigable small-world graph index corresponding to the plurality of inverted files is generated; wherein the inverted files correspond to the central vectors one-to-one, and the hierarchical navigable small-world graph index contains all the central vectors.

2. The construction method according to claim 1, characterized in that: The vector set to be constructed is clustered to obtain multiple clusters, including: Taking the preset vector threshold as a target, hierarchical clustering is performed on the vector set to be constructed, so that the vector number of any leaf node among the multiple leaf nodes obtained after the hierarchical clustering is less than or equal to the preset vector threshold; The leaf nodes are used as the clusters.

3. The construction method according to claim 2, characterized in that: The step of performing hierarchical clustering on the vector set to be constructed with the preset vector threshold as the target includes: The vector to be constructed is used as a root node to perform splitting hierarchical clustering until the number of vectors of all leaf nodes is less than or equal to the preset vector threshold.

4. The construction method according to claim 3, characterized in that: The step of performing splitting hierarchical clustering with the vector to be constructed as the root node comprises: Taking the root node as a parent node; Clustering the parent node into K child nodes, where K is a preset value; For each of the child nodes, determining whether the vector number of the child node is less than or equal to the preset vector threshold; If yes, take the child node as a leaf node; If not, the child node is taken as the parent node, and the process returns to execute the step of clustering the parent node into K child nodes.

5. The construction method according to claim 4, characterized in that: Each of the parent nodes is configured to execute the step of clustering the parent node into K child nodes in parallel.

6. The construction method according to any one of claims 4 to 5, characterized in that: K is less than or equal to 10.

7. The construction method according to claim 1, characterized in that: The preset vector threshold is less than or equal to 20.

8. The construction method according to claim 1, characterized in that: After the step of generating a hierarchical navigable small-world graph index corresponding to a plurality of inverted files, the method further comprises: Querying the vector to be searched in the hierarchical navigable small-world graph index to obtain M center vectors and corresponding M inverted files; M is a positive integer; The vector to be searched is searched in each of the inverted files to obtain at least one target vector in each of the inverted files.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method for constructing a database vector index as described in any one of claims 1 to 8 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for constructing a database vector index as claimed in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Vector database index recommendation method and device, equipment and medium

    CN120336331A