Vector indexing method and device, electronic equipment and readable storage medium

Through hierarchical nearest neighbor graph indexing and inverted indexing processing, the problems of low recall and low index efficiency caused by the singularization of search patterns in the existing technology are solved, and the efficiency and accuracy of vector queries are achieved, and vector data of different sizes are adapted to vector data set.

CN119046285APending Publication Date: 2024-11-29BEIJING LONGZHI DIGITAL TECH CO LTD
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411146872.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the prior art, there are problems such as low recall rate and low index efficiency due to the singularization of the search mode.

Method used

By hierarchical nearest graph indexing of the vector to be queried, the cluster center is determined, and the cluster cluster is obtained based on the preset mapping table, and the target result vector sequence is obtained, and the return result vector is obtained through vector selection. Implement rapid conversion from vector space to clustering space.

Benefits of technology

It improves the efficiency and accuracy of vector query, enhances the recall and processing efficiency of vector indexes, adapts to vector data sets of different scales and characteristics, and improves scalability and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046285A_ABST
    Figure CN119046285A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vector indexing, and provides a vector indexing method and device, electronic equipment and a readable storage medium. The method comprises the following steps: inputting a to-be-queried vector into a target index structure, performing hierarchical neighbor graph index processing on the to-be-queried vector, and determining a clustering center corresponding to at least one to-be-queried vector; obtaining a corresponding mapping relationship from a preset mapping table based on the clustering center corresponding to each to-be-queried vector, and determining at least one target cluster according to each mapping relationship; performing reverse indexing processing on the at least one target cluster and the to-be-queried vector to obtain a target result vector sequence; and carrying out vector selection processing on the target result vector sequence to obtain at least one target return result vector, so that the vector query efficiency is improved, the query result accuracy is improved, and the expansibility and flexibility of a vector indexing process are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of vector indexing technology, and in particular to a vector indexing method, device, electronic device, and readable storage medium. Background Art

[0002] Vector retrieval, as an information retrieval technology based on the vector space model, has a wide range of practical applications. It can be used in important fields such as search engines, recommendation systems, text classification, and image retrieval. Conventional vector indexes mainly include inverted indexes, product quantization indexes, or nearest neighbor hierarchical graph indexes. The purpose of the inverted index is to reduce the number of calculations. The product quantization index is used to achieve high-dimensional vector compression and reduce memory usage. The nearest neighbor hierarchical graph index uses graph indexes to achieve efficient recall, fast query speed, and high recall rate. However, these single indexes cannot focus on efficiency at the same time under extremely large data sets, resulting in low recall rate and low indexing efficiency.

[0003] It can be seen that the existing technology has problems of low recall rate and low indexing efficiency due to the single retrieval mode. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure provide a vector indexing method, device, electronic device and readable storage medium to solve the problems of low recall rate and low indexing efficiency caused by the single retrieval mode in the prior art.

[0005] According to a first aspect of an embodiment of the present disclosure, a vector indexing method is provided, including: inputting a vector to be queried into a target index structure, performing hierarchical neighbor graph indexing processing on the vector to be queried, and determining at least one cluster center corresponding to the vector to be queried; obtaining corresponding mapping relationships from a preset mapping table based on the cluster centers corresponding to each vector to be queried, and determining at least one target cluster cluster according to the mapping relationship; performing inverted indexing processing on at least one target cluster cluster and the vector to be queried to obtain a target result vector sequence; performing vector selection processing on the target result vector sequence to obtain at least one target return result vector.

[0006] According to a second aspect of an embodiment of the present disclosure, a vector indexing device is provided, comprising: a first determination module, configured to input a vector to be queried into a target index structure, perform hierarchical neighbor graph indexing processing on the vector to be queried, and determine at least one cluster center corresponding to the vector to be queried; a second determination module, configured to obtain a corresponding mapping relationship from a preset mapping table based on the cluster centers corresponding to each vector to be queried, and determine at least one target cluster cluster according to the mapping relationship; a first processing module, configured to perform inverted indexing processing on at least one target cluster cluster and the vector to be queried, and obtain a target result vector sequence; and a second processing module, configured to perform vector selection processing on the target result vector sequence, and obtain at least one target return result vector.

[0007] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0008] According to a fourth aspect of an embodiment of the present disclosure, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0009] Compared with the prior art, the disclosed embodiment has the following beneficial effects: a target hierarchical neighbor graph index structure in a target index structure is used to process a query vector to obtain at least one cluster center corresponding to the query vector, and at least one target cluster cluster is determined according to a preset mapping table, and at least one target cluster cluster is processed through a target inverted index structure to obtain a target result vector sequence, and then at least one target return result vector can be obtained by screening from the target result vector sequence through vector selection, thereby mapping the cluster center to a specific cluster cluster through a preset mapping table, thereby realizing a rapid conversion from a vector space to a cluster space, improving the efficiency of vector queries, and improving the accuracy of query results, and by adjusting the number of layers of the hierarchical neighbor graph, the clustering algorithm, the mapping table structure and other parameters, it can adapt to vector data sets of different sizes and characteristics, enhance the scalability and flexibility of the vector indexing process, and by creating a composite vector index structure, improve the recall rate of the vector index and improve the processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0011] Figure 1 is a schematic diagram of an application scenario of an embodiment of the present disclosure;

[0012] Figure 2 is a flowchart of a vector indexing method provided by an embodiment of the present disclosure;

[0013] Figure 3 is a schematic diagram of a vector index structure provided by an embodiment of the present disclosure;

[0014] Figure 4 is a structural schematic diagram of a vector indexing device provided by an embodiment of the present disclosure;

[0015] Figure 5It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.

[0017] A vector indexing method and device according to an embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0018] Figure 1 Schematic diagram of an application scenario of an embodiment of the present disclosure. The application scenario may include terminal devices 1, 2 and 3, a server 4 and a network 5.

[0019] Terminal devices 1, 2 and 3 can be hardware or software. When terminal devices 1, 2 and 3 are hardware, they can be various electronic devices with display screens and supporting communication with server 4, including but not limited to smart phones, tablet computers, laptop portable computers and desktop computers, etc.; when terminal devices 1, 2 and 3 are software, they can be installed in the above electronic devices. Terminal devices 1, 2 and 3 can be implemented as multiple software or software modules, or as a single software or software module, and the embodiments of the present disclosure are not limited to this. Furthermore, various applications can be installed on terminal devices 1, 2 and 3, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.

[0020] The server 4 may be a server that provides various services, for example, a background server that receives a request sent by a terminal device that establishes a communication connection with the server, and the background server may receive and analyze the request sent by the terminal device, and generate a processing result. The server 4 may be a single server, or a server cluster composed of several servers, or a cloud computing service center, which is not limited in the embodiments of the present disclosure.

[0021] It should be noted that the server 4 can be hardware or software. When the server 4 is hardware, it can be various electronic devices that provide various services for the terminal devices 1, 2, and 3. When the server 4 is software, it can be multiple software or software modules that provide various services for the terminal devices 1, 2, and 3, or it can be a single software or software module that provides various services for the terminal devices 1, 2, and 3, and the embodiments of the present disclosure are not limited to this.

[0022] The network 5 can be a wired network connected by coaxial cable, twisted pair and optical fiber, or it can be a wireless network that can interconnect various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), infrared, etc., which is not limited in the embodiments of the present disclosure.

[0023] The user can establish a communication connection with the server 4 via the network 5 through the terminal devices 1, 2 and 3 to receive or send information, etc. Specifically, the server 4 can process the query vector with the target hierarchical neighbor graph index structure in the target index structure to obtain at least one cluster center corresponding to the query vector, determine at least one target cluster cluster according to the preset mapping table, process at least one target cluster cluster through the target inverted index structure to obtain a target result vector sequence, and then select the vector to select at least one target return result vector from the target result vector sequence.

[0024] It should be noted that the specific types, quantities and combinations of the terminal devices 1, 2 and 3, the server 4 and the network 5 can be adjusted according to the actual needs of the application scenario, and the embodiments of the present disclosure are not limited to this.

[0025] Figure 2 It is a flowchart of a vector indexing method provided by an embodiment of the present disclosure. Figure 2 The vector indexing method can be obtained by Figure 1 The server executes. Figure 2 As shown, the vector indexing method includes:

[0026] Step 201: input a vector to be queried into a target index structure, perform hierarchical neighbor graph indexing on the vector to be queried, and determine at least one cluster center corresponding to the vector to be queried.

[0027] Specifically, the query vector can be input into a pre-built target index structure, and the query vector can be processed by the hierarchical neighbor graph index processing technology contained in the target index structure. The hierarchical structure of the graph can be traversed layer by layer to find the cluster center that is closest to the query vector in the feature space. By determining the relevant cluster centers, the comparison operations are reduced, the query efficiency is improved, and the query accuracy is enhanced. Due to the structure of the hierarchical neighbor graph index, the scalability and flexibility of the vector indexing method are enhanced, and it can adapt to the processing needs of large-scale data sets.

[0028] Among them, the vector to be queried can be input data, and a similar or identical return result can be obtained through vector indexing. The target index structure can refer to a pre-set data structure. The target index structure can store the location information or mutual relationship of each data point in the data set, and can be used to respond to query requests, including but not limited to a single vector index structure or a compound vector index structure, etc. The cluster center corresponding to the vector to be queried can be one or more cluster centers in the target index structure whose distance to the vector to be queried in the feature space is less than or equal to a preset distance threshold. The cluster center corresponding to the vector to be queried can be used as the starting point for further query or analysis.

[0029] For example, the query vector a can be input into a pre-built target index structure, the query vector a can be processed by the hierarchical neighbor graph index processing technology contained in the target index structure, and the cluster center A whose distance to the query vector a in the feature space is less than or equal to a preset distance threshold can be found by traversing the hierarchical structure of the graph layer by layer.

[0030] Step 202: Obtain corresponding mapping relationships from a preset mapping table based on cluster centers corresponding to each to-be-queried vector, and determine at least one target cluster according to the mapping relationships.

[0031] Specifically, the preset mapping table records the associations between all cluster centers and their corresponding cluster clusters. The cluster cluster identifier and information corresponding to each cluster center can be obtained by searching the preset mapping table. According to the corresponding mapping relationship, each cluster center can be associated with its corresponding cluster cluster, and then the cluster cluster corresponding to each cluster center, that is, the target cluster cluster, can be determined, thereby improving the efficiency of determining the cluster cluster, reducing the system burden, and ensuring the accuracy of cluster cluster determination.

[0032] Among them, the preset mapping table can be a data structure for storing mapping relationships. By storing the mapping relationships between all cluster centers and their corresponding cluster clusters, the mapping relationship can be a corresponding relationship between cluster centers and cluster clusters. Each cluster center corresponds to a cluster cluster, and the cluster cluster corresponding to the cluster center can be a set of data points whose distance from the cluster center in the feature space is less than or equal to a preset distance threshold. This group of data points share similar features or attributes, that is, they are the same cluster cluster.

[0033] For example, the cluster information corresponding to the cluster centers X, Y, and Z can be obtained by looking up the preset mapping table. According to the corresponding mapping relationship, each cluster center is associated with its corresponding cluster cluster, and then three target cluster clusters can be determined. The determination result is that the cluster center X corresponds to the target cluster cluster x, the cluster center Y corresponds to the target cluster cluster x, and the cluster center Z corresponds to the target cluster cluster z.

[0034] Step 203: perform inverted index processing on at least one target cluster and the query vector to obtain a target result vector sequence.

[0035] Specifically, the inverted index can be used to retrieve a set of vectors with the highest similarity or the shortest distance to the internal vectors of the target cluster. Then, the retrieved query vectors can be organized into a target result vector sequence according to the sorting of similarity or distance, which is not limited here. This enhances the efficiency and accuracy of data retrieval and improves the ability to quickly locate vectors related to or similar to the query vector in large-scale data sets. The application of the inverted index reduces the amount of calculation in the query process and improves the response speed.

[0036] Among them, the target result vector sequence can be a vector set obtained by inverted index processing and sorting. The similarity value between the target result vector and the query vector is greater than or equal to the preset similarity threshold or the distance is less than or equal to the preset distance threshold, which can be used as the output result of the query. The target result vector sequence can be used in application scenarios such as product recommendation in recommendation system, document sorting in information retrieval, and similar image retrieval in image recognition. There is no limitation here. The target result vector sequence can be in the form of a list containing vector identifiers and similarity scores or distance values, where each element corresponds to a vector in a target cluster cluster that has a higher similarity with the query vector and its similarity score or distance value.

[0037] For example, an inverted index can be used to retrieve a set of vectors whose similarity values ​​with the internal vectors of the target cluster are greater than or equal to a preset similarity threshold, and then the retrieved vectors can be organized into a target result vector sequence according to the similarity sorting. The target result vector can include vector e, vector f, and vector g.

[0038] Step 204: perform vector selection processing on the target result vector sequence to obtain at least one target return result vector.

[0039] Specifically, the target result vector sequence can be screened and analyzed, and the vectors can be selected and processed according to preset thresholds, sorting positions, or specific conditions, which are not limited here, and then at least one target return result vector can be obtained from the target result vector sequence, thereby enhancing the pertinence and quality of the results and improving the effectiveness of the vector indexing system. By selecting the target result vector sequence, the accuracy and relevance of the returned results are improved.

[0040] Among them, the target return result vector can be a vector that is screened out from the target result vector sequence, has a specific value or meets specific conditions. The target return result vector can be a list or array containing vector data and related information. The related information may include but is not limited to vector identification, description, or score data. The target return result vector can be used in application scenarios such as target recommended products in a recommendation system or target documents in information retrieval. No limitation is made here. For example, in a recommendation system, the target return result vector can be a collection of product vectors that the user may be interested in. The target return result vector can be directly used to generate a recommendation list and display it to the user.

[0041] According to the technical solution provided by the embodiment of the present disclosure, the target hierarchical neighbor graph index structure in the target index structure is used to process the query vector to obtain at least one cluster center corresponding to the query vector, and at least one target cluster cluster is determined according to the preset mapping table, and the at least one target cluster cluster is processed by the target inverted index structure to obtain a target result vector sequence, and then at least one target return result vector can be obtained by vector selection from the target result vector sequence, so that the cluster center is mapped to a specific cluster cluster through the preset mapping table, thereby realizing a fast conversion from vector space to cluster space, improving the efficiency of vector query, and improving the accuracy of query results. By adjusting the number of layers of the hierarchical neighbor graph, the clustering algorithm, the mapping table structure and other parameters, it can adapt to vector data sets of different sizes and characteristics, enhance the scalability and flexibility of the vector indexing process, and by creating a composite vector index structure, improve the recall rate of the vector index and improve the processing efficiency.

[0042] In some embodiments, before the query vector is input into the target index structure, hierarchical neighbor graph index processing is performed on the query vector, and at least one cluster center corresponding to the query vector is determined, it also includes: obtaining the query data; vectorizing the query data to obtain the vector corresponding to the query data; and performing dimensionality reduction processing on the vector corresponding to the query data to obtain the query vector.

[0043] Specifically, the data to be queried can be obtained from the database. The data to be queried can be in various formats such as text, image, or audio, which is not limited here. The data to be queried can be converted into a vector form through vectorization processing, that is, the vector corresponding to the data to be queried. Then, the vector corresponding to the converted data to be queried can be subjected to dimensionality reduction processing, thereby retaining key information while reducing the data dimension to obtain the vector to be queried.

[0044] The data to be queried may be the original data to be retrieved or queried according to the task requirements. The data to be queried may be in various forms such as text, image, or audio, which are not limited here. The vector corresponding to the data to be queried may be a vector representation in a mathematical space that is converted into the data to be queried through vectorization processing, which may be used for subsequent indexing and query processing.

[0045] For example, the data to be queried q can be obtained from the database, and the data to be queried q can be converted into a vector form through vectorization processing, that is, the vector corresponding to the data to be queried q, and the vector corresponding to the data to be queried q is a 128-dimensional vector. Then, the vector corresponding to the converted data to be queried q can be subjected to dimensionality reduction processing, thereby retaining key information while reducing the data dimension, and obtaining a 64-dimensional vector Q to be queried.

[0046] According to the technical solution provided by the embodiments of the present disclosure, by obtaining the data to be queried from the database, the data to be queried can be converted into a vector form through vectorization processing, that is, the vector corresponding to the data to be queried, and then the vector corresponding to the converted data to be queried can be subjected to dimensionality reduction processing, thereby retaining key information while reducing the data dimension to obtain the vector to be queried, thereby enhancing the flexibility and efficiency of data processing, improving the processing capability and query speed of the index structure for high-dimensional data, reducing data redundancy through dimensionality reduction processing, and improving the accuracy and response speed of the index.

[0047] In some embodiments, before the query vector is input into the target index structure, the query vector is subjected to hierarchical neighbor graph index processing, and the cluster center corresponding to at least one query vector is determined, it also includes: obtaining multiple vectors to be constructed; clustering the multiple vectors to be constructed to obtain multiple cluster clusters to be constructed; performing center point selection processing on the multiple cluster clusters to be constructed to obtain cluster centers corresponding to each cluster cluster to be constructed; performing hierarchical neighbor graph index construction processing on the cluster centers corresponding to the cluster clusters to be constructed to obtain a target hierarchical neighbor graph index structure; performing inverted index construction processing on each cluster cluster to be constructed to obtain a target inverted index structure corresponding to each cluster cluster to be constructed; and determining the target index structure according to the target hierarchical neighbor graph index structure and the target inverted index structure corresponding to each cluster cluster to be constructed.

[0048] Specifically, multiple vectors to be constructed can be obtained, and the vectors to be constructed can be original vectors to be indexed. The vectors to be constructed can be clustered to obtain multiple clusters to be constructed, and each cluster to be constructed contains multiple vectors to be constructed. Then, center points can be selected from each cluster to be constructed as cluster centers corresponding to each cluster to be constructed. A hierarchical neighbor graph index structure can be constructed through the cluster centers corresponding to the clusters to be constructed to obtain a target hierarchical neighbor graph index structure. An inverted index structure can be constructed inside each cluster to be constructed to obtain a target inverted index structure corresponding to each cluster to be constructed. The target index structure can be obtained by splicing the constructed target neighbor graph index structure and the target inverted index structure.

[0049] Among them, the vector to be constructed can be the original data vector that needs to be indexed for subsequent retrieval, and the cluster to be constructed can be a set of vectors obtained by grouping the vectors to be constructed through a clustering algorithm, wherein the clustering algorithm includes but is not limited to a K-means clustering algorithm, a density-based clustering algorithm, or a hierarchical clustering algorithm, etc. The similarity value between the vectors to be constructed in the same cluster to be constructed is greater than or equal to a preset similarity threshold, and the cluster center corresponding to the cluster to be constructed can be a representative vector selected from each cluster to be constructed, which can be used to characterize the characteristics of the cluster to be constructed and can be used as the basis for constructing a hierarchical neighbor graph index. The target hierarchical neighbor graph index structure can be constructed based on the cluster center corresponding to the cluster to be constructed, and can characterize the proximity relationship between the cluster centers corresponding to each cluster to be constructed in the form of a graph. The target inverted index structure corresponding to the cluster to be constructed can be an index constructed separately for each cluster to be constructed, which can allow the vector to be constructed in the cluster to be constructed to be determined by specific attributes or characteristics.

[0050] For example, 20 vectors to be constructed can be obtained, and then the vectors to be constructed can be clustered to obtain 4 clusters to be constructed, and the number of vectors to be constructed contained in each cluster to be constructed is 2, 5, 6, and 7 respectively. Then, one center point can be selected from each cluster to be constructed as the cluster center corresponding to each cluster to be constructed. A hierarchical neighbor graph index structure can be constructed by the cluster centers corresponding to the clusters to be constructed to obtain a target hierarchical neighbor graph index structure, and an inverted index structure can be constructed inside each cluster to be constructed to obtain a target inverted index structure corresponding to each cluster to be constructed. The target index structure can be obtained by splicing the constructed target neighbor graph index structure and the target inverted index structure.

[0051] According to the technical solution provided by the embodiment of the present disclosure, by obtaining multiple vectors to be constructed, the vectors to be constructed can be clustered to obtain multiple cluster clusters to be constructed, each cluster cluster to be constructed contains multiple vectors to be constructed, and then a center point can be selected from each cluster cluster to be constructed as the cluster center corresponding to each cluster cluster to be constructed. A hierarchical neighbor graph index structure can be constructed by the cluster center corresponding to the cluster cluster to be constructed to obtain a target hierarchical neighbor graph index structure, and an inverted index structure can be constructed inside each cluster cluster to be constructed to obtain a target inverted index structure corresponding to each cluster cluster to be constructed. The target index structure can be obtained by splicing the constructed target neighbor graph index structure and the target inverted index structure, thereby enhancing the organization and management capabilities of vector data and improving the efficiency and accuracy of vector retrieval. The query speed is accelerated by combining clustering processing with the hierarchical neighbor graph index, and the construction of the inverted index improves the flexibility and response speed of the retrieval.

[0052] In some embodiments, a hierarchical neighbor graph index construction process is performed on the cluster centers corresponding to the clusters to be constructed to obtain a target hierarchical neighbor graph index structure, including: obtaining an initial graph structure; determining the number of layers of the cluster centers corresponding to each cluster to be constructed through an exponential decay probability function to obtain the number of insertion layers corresponding to each cluster center; and inserting nodes into the cluster centers corresponding to each cluster to be constructed based on the number of insertion layers corresponding to each cluster center to obtain a target hierarchical neighbor graph index structure.

[0053] Specifically, an initial graph structure can be obtained as the basic framework of the target hierarchical neighbor graph index structure, and then an insertion layer number can be assigned to the cluster center corresponding to each cluster to be constructed through an exponential decay probability function according to the characteristics of the cluster centers corresponding to each cluster to be constructed. The number of insertion layers corresponding to the cluster center determines the depth of the cluster center in the hierarchical neighbor graph, wherein the characteristics of the cluster center corresponding to the cluster to be constructed include but are not limited to distance or density, etc. Based on the number of insertion layers corresponding to the cluster center, the cluster centers corresponding to each cluster to be constructed are inserted as nodes into the corresponding levels of the hierarchical neighbor graph, and then the target hierarchical neighbor graph index structure can be constructed.

[0054] Among them, the initial graph structure can be an empty graph structure framework containing a small number of basic elements used as a starting point before constructing the target hierarchical neighbor graph index structure. The exponential decay probability function can be a mathematical function. The output value of the exponential decay probability function can decrease at an exponential rate as the input value increases. It can be used in the process of constructing the target hierarchical neighbor graph index structure to determine the number of layers to be inserted according to the characteristics of the cluster centers corresponding to each cluster to be constructed. The number of insertion layers corresponding to the cluster center can be the specific level at which the cluster centers corresponding to each cluster to be constructed should be inserted in the hierarchical neighbor graph, which is calculated according to the exponential decay probability function. The level determines the relative position and importance of the cluster centers corresponding to each cluster to be constructed in the target hierarchical neighbor graph index structure.

[0055] For example, the initial graph structure can be obtained as the basic framework of the target hierarchical neighbor graph index structure, and then the exponential decay probability function can be used to obtain that the number of insertion layers corresponding to the cluster center r is 1, and the number of insertion layers corresponding to the cluster center t is 2. The cluster centers corresponding to each cluster to be constructed can be inserted as nodes into the corresponding levels of the hierarchical neighbor graph, and then the target hierarchical neighbor graph index structure can be constructed.

[0056] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the initial graph structure as the basic framework of the target hierarchical neighbor graph index structure, an insertion layer number can be assigned to the cluster center corresponding to each cluster to be constructed through an exponential decay probability function. Based on the insertion layer number corresponding to the cluster center, the cluster center corresponding to each cluster to be constructed can be inserted as a node into the corresponding level of the hierarchical neighbor graph, and then the target hierarchical neighbor graph index structure can be constructed, thereby enhancing the efficiency and accuracy of data retrieval. Through the construction of the target hierarchical neighbor graph index structure, the query speed of large-scale vector data sets is improved, and the application of the exponential decay probability function improves the effectiveness and stability of the target hierarchical neighbor graph index structure.

[0057] In some embodiments, an inverted index construction process is performed on each cluster to be constructed to obtain a target inverted index structure corresponding to each cluster to be constructed, including: performing feature extraction processing on the vector to be constructed corresponding to each cluster to be constructed to obtain a feature description vector corresponding to each vector to be constructed; determining the inverted index list corresponding to each cluster to be constructed based on the feature description vector corresponding to the vector to be constructed; performing data structure storage processing on the inverted index list corresponding to each cluster to be constructed to obtain a target inverted index structure corresponding to each cluster to be constructed.

[0058] Specifically, feature extraction processing can be performed on the vectors to be constructed corresponding to each cluster to be constructed, and the vectors to be constructed can be converted into more representative feature description vectors, wherein feature extraction can be achieved through standardization and normalization technology, one-hot encoding technology, bag-of-words model, or principal component analysis technology, etc., which are not limited here. Based on the feature description vectors corresponding to the vectors to be constructed, a corresponding inverted index list can be constructed for each cluster to be constructed. Through the inverted index list corresponding to the cluster to be constructed, the feature description vector corresponding to the vector to be constructed can be associated with the vector identifier containing the feature, and then the inverted index list corresponding to the cluster to be constructed can be stored in the form of a preset data structure to obtain the target inverted index structure corresponding to each cluster to be constructed.

[0059] Among them, the feature description vector corresponding to the vector to be constructed can be a vector or a set of vectors extracted from the vector to be constructed by a feature extraction algorithm, the feature description vector corresponding to the vector to be constructed can be used to characterize the main characteristics of the vector to be constructed, and the dimension of the feature description vector corresponding to the vector to be constructed is lower than the dimension of the vector to be constructed, and the inverted index list corresponding to the cluster to be constructed can be a data structure constructed based on the feature description vectors corresponding to all vectors to be constructed in the cluster to be constructed, which can be used to obtain a vector with the feature according to the feature search, and the inverted index list corresponding to the cluster to be constructed can map the feature to a list of vector identifiers containing the feature.

[0060] For example, feature extraction processing can be performed on the vectors to be constructed corresponding to each cluster to be constructed, and the vectors to be constructed can be converted into feature description vectors corresponding to the vectors to be constructed. Based on the feature description vectors corresponding to the vectors to be constructed, a corresponding inverted index list can be constructed for each cluster to be constructed, and the inverted index list contains identifiers of the feature description vectors in the cluster to be constructed. Then, the inverted index list corresponding to the cluster to be constructed can be stored in the form of a preset data structure to obtain a target inverted index structure corresponding to each cluster to be constructed.

[0061] According to the technical solution provided by the embodiments of the present disclosure, by performing feature extraction processing on the vectors to be constructed corresponding to each cluster to be constructed, the vectors to be constructed can be converted into feature description vectors, and based on the feature description vectors corresponding to the vectors to be constructed, a corresponding inverted index list can be constructed for each cluster to be constructed, and then the inverted index list corresponding to the cluster to be constructed can be stored in the form of a preset data structure to obtain a target inverted index structure corresponding to each cluster to be constructed, thereby enhancing the retrieval efficiency and flexibility of vector data, and by constructing an inverted index structure, the retrieval speed of specific feature vectors in large-scale vector data sets is improved, thereby improving the performance and scalability of the overall system.

[0062] In some embodiments, a target clustering cluster includes a vector to be constructed corresponding to at least one target clustering cluster; performing inverted index processing on at least one target clustering cluster and a vector to be queried to obtain a target result vector sequence, including: performing similarity calculation processing on the query vector and the vector to be constructed corresponding to each target clustering cluster to obtain a similarity value corresponding to each vector to be constructed; performing screening processing on the similarity values ​​corresponding to each vector to be constructed, and sorting the screening results to obtain a sequence corresponding to the target similarity value; determining the vector to be constructed corresponding to each target similarity value according to the sequence corresponding to the target similarity value; and sorting the vector to be constructed corresponding to each target similarity value to obtain a target result vector sequence.

[0063] Specifically, similarity calculations can be performed on the query vector and the vector to be constructed corresponding to each target cluster cluster, respectively, to obtain similarity values ​​between the vector to be constructed corresponding to each target cluster cluster and the query vector, wherein the similarity value calculation method includes but is not limited to cosine similarity, Pearson correlation coefficient, Euclidean distance, or Manhattan distance, etc., the similarity values ​​corresponding to the vector to be constructed can be screened, and the similarity values ​​corresponding to the vector to be constructed obtained after screening can be sorted to obtain a sequence corresponding to the target similarity values, and then the vector to be constructed corresponding to each target similarity value can be determined according to the similarity values ​​in the sequence corresponding to the target similarity values, and the vector to be constructed corresponding to the target similarity value can be sorted from high to low based on the similarity values ​​corresponding to the vector to be constructed to obtain a target result vector sequence.

[0064] Among them, the vector to be constructed corresponding to the target clustering cluster can be a vector in the set of vectors to be indexed divided by the clustering algorithm, and the vector to be constructed corresponding to the target clustering cluster belongs to the same target clustering cluster, the similarity value corresponding to the vector to be constructed can be a similarity value obtained by calculating the similarity between the vector to be queried and all the vectors to be constructed in the target clustering cluster, the similarity value corresponding to the vector to be constructed can be used to characterize the degree of similarity between the vector to be constructed and the vector to be queried, the sequence corresponding to the target similarity value can be a sequence obtained after screening and sorting the similarity values ​​of all the vectors to be constructed, each similarity value in the sequence corresponding to the target similarity value has a corresponding vector to be constructed, the vector to be constructed corresponding to the target similarity value can be a vector to be constructed determined according to each similarity value in the sequence corresponding to the target similarity value, and the vector to be constructed corresponding to the target similarity value belongs to the target clustering cluster corresponding to the similarity value.

[0065] For example, similarity calculation is performed on the query vector i and the vectors j, k, and l to be constructed contained in the target cluster, respectively, and the similarity value corresponding to the vector j to be constructed is 0.7, the similarity value corresponding to the vector k to be constructed is 0.8, and the similarity value corresponding to the vector l to be constructed is 0.9. The above three similarity values ​​are sorted to obtain a sequence corresponding to the target similarity values. Based on the sequence corresponding to the target similarity values, all the corresponding vectors to be constructed are determined, and the obtained vectors to be constructed are sorted to obtain a target result vector sequence of vector l to be constructed, vector k to be constructed, and vector j to be constructed.

[0066] According to the technical solution provided by the embodiments of the present disclosure, by respectively calculating the similarity between the vector to be queried and the vector to be constructed corresponding to each target clustering cluster, the similarity value between each vector to be constructed and the vector to be queried can be obtained, the similarity value corresponding to the vector to be constructed can be screened, and the similarity values ​​corresponding to the vector to be constructed obtained after screening can be sorted to obtain a sequence corresponding to the target similarity value, and then the vector to be constructed corresponding to each target similarity value can be determined according to the similarity value in the sequence corresponding to the target similarity value, and the vector to be constructed corresponding to the target similarity value can be sorted from high to low based on the similarity value corresponding to the vector to be constructed to obtain a target result vector sequence, thereby enhancing the accuracy and relevance of vector retrieval, and the retrieval method based on the clustering cluster improves the retrieval efficiency and shortens the retrieval time.

[0067] In some embodiments, a vector to be queried is input into a target index structure, a hierarchical neighbor graph index is performed on the vector to be queried, and at least one cluster center corresponding to the vector to be queried is determined, including: performing a layer-by-layer search process on the vector to be queried to obtain at least one candidate cluster center corresponding to the vector to be queried; performing a distance calculation process on the candidate cluster centers corresponding to each of the vectors to be queried and the vector to be queried to obtain distance values ​​corresponding to the candidate cluster centers; sorting the distance values ​​corresponding to the candidate cluster centers to obtain a candidate cluster center sequence; and screening the candidate cluster center sequence to obtain at least one cluster center corresponding to the vector to be queried.

[0068] Specifically, the vector to be queried can be searched layer by layer in the target hierarchical neighbor graph index structure to find at least one candidate cluster center, that is, the candidate cluster center corresponding to the vector to be queried, and the distance value between the candidate cluster center corresponding to the vector to be queried and the vector to be queried is calculated, and the similarity is quantified to obtain the distance value corresponding to the candidate cluster center, and then the candidate cluster centers can be sorted according to the distance values ​​corresponding to the candidate cluster centers to obtain a candidate cluster center sequence, and the cluster center with the smallest distance value can be screened from the candidate cluster center sequence, that is, the cluster center corresponding to the vector to be queried.

[0069] Among them, the candidate cluster center corresponding to the query vector can be a cluster center searched in the target hierarchical neighbor graph index structure, the distance value between the candidate cluster center corresponding to the query vector and the query vector is less than or equal to the preset candidate cluster center distance value, the candidate cluster center corresponding to the query vector can be obtained by gradually narrowing the search range through the hierarchical relationship of the target hierarchical neighbor graph index structure, and can be used to evaluate the distance value with the query vector, the distance value corresponding to the candidate cluster center can be a value obtained by calculating the distance measurement between the candidate cluster center and the query vector, wherein the distance value calculation method includes but is not limited to Euclidean distance or cosine similarity, etc., the distance value corresponding to the candidate cluster center can be used to quantify the similarity or difference between the candidate cluster center corresponding to the query vector and the query vector, the distance value corresponding to the candidate cluster center can be used for subsequent sorting and screening processing, the candidate cluster center sequence can be a sequence obtained by sorting according to the distance value between the candidate cluster center corresponding to each query vector and the query vector, and the candidate cluster center sequence can be used in a variety of scenarios, including but not limited to data classification, anomaly detection, or recommendation system.

[0070] For example, the query vector is searched layer by layer to obtain three candidate cluster centers corresponding to the query vector, and the distance between each candidate cluster center and the query vector is calculated to obtain three distance values ​​of 0.3, 0.4, and 0.5. Based on the three distance values, a candidate cluster center sequence is obtained through sorting. The minimum distance value of 0.3 can be selected as the target distance value, and the corresponding candidate cluster center can be used as the cluster center corresponding to the query vector obtained after screening.

[0071] According to the technical solution provided by the embodiment of the present disclosure, the query vector is searched layer by layer in the target hierarchical neighbor graph index structure to find at least one candidate cluster center corresponding to the query vector, and the distance value between the candidate cluster center corresponding to the query vector and the query vector is calculated to obtain the distance value corresponding to the candidate cluster center. Then, the candidate cluster centers can be sorted according to the distance values ​​corresponding to the candidate cluster centers to obtain a candidate cluster center sequence. The cluster center corresponding to the query vector can be screened from the candidate cluster center sequence, thereby enhancing the accuracy and efficiency of data retrieval. Through the target hierarchical neighbor graph index structure processing, the speed and accuracy of vector retrieval in large-scale data sets are improved.

[0072] Figure 3 Schematic diagram of a vector index structure provided by an embodiment of the present disclosure. Figure 3 As shown, the vector index structure includes:

[0073] The target hierarchical neighbor graph index structure 301 can be used to process the query vector to be queried and determine at least one cluster center corresponding to the query vector;

[0074] The target inverted index structure 302 can be used to process at least one target cluster and a vector to be queried to obtain a target result vector sequence.

[0075] According to the technical solution provided by the embodiment of the present disclosure, the target hierarchical neighbor graph index structure 301 in the target index structure is used to process the query vector to obtain at least one cluster center corresponding to the query vector, and at least one target cluster cluster is determined according to the preset mapping table, and the at least one target cluster cluster is processed by the target inverted index structure 302 to obtain a target result vector sequence, and then at least one target return result vector can be obtained from the target result vector sequence by vector selection, so that the cluster center is mapped to a specific cluster cluster through the preset mapping table, thereby realizing a fast conversion from vector space to cluster space, improving the efficiency of vector query, and improving the accuracy of query results. By adjusting the number of layers of the hierarchical neighbor graph, the clustering algorithm, the mapping table structure and other parameters, it can adapt to vector data sets of different sizes and characteristics, enhance the scalability and flexibility of the vector indexing process, and by creating a composite vector index structure, improve the recall rate of the vector index and improve the processing efficiency.

[0076] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0077] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0078] Figure 4 Schematic diagram of a vector indexing device provided by an embodiment of the present disclosure. Figure 4 As shown, the vector indexing device comprises:

[0079] A first determination module 401 is used to input a query vector into a target index structure, perform hierarchical neighbor graph indexing on the query vector, and determine at least one cluster center corresponding to the query vector;

[0080] A second determination module 402 is used to obtain a corresponding mapping relationship from a preset mapping table based on the cluster center corresponding to each query vector, and determine at least one target cluster according to the mapping relationship;

[0081] A first processing module 403 is used to perform inverted index processing on at least one target cluster and a vector to be queried to obtain a target result vector sequence;

[0082] The second processing module 404 is used to perform vector selection processing on the target result vector sequence to obtain at least one target return result vector.

[0083] According to the technical solution provided by the embodiment of the present disclosure, the target hierarchical neighbor graph index structure in the target index structure is used to process the query vector to obtain at least one cluster center corresponding to the query vector, and at least one target cluster cluster is determined according to the preset mapping table, and the at least one target cluster cluster is processed by the target inverted index structure to obtain a target result vector sequence, and then at least one target return result vector can be obtained by vector selection from the target result vector sequence, so that the cluster center is mapped to a specific cluster cluster through the preset mapping table, thereby realizing a fast conversion from vector space to cluster space, improving the efficiency of vector query, and improving the accuracy of query results. By adjusting the number of layers of the hierarchical neighbor graph, the clustering algorithm, the mapping table structure and other parameters, it can adapt to vector data sets of different sizes and characteristics, enhance the scalability and flexibility of the vector indexing process, and by creating a composite vector index structure, improve the recall rate of the vector index and improve the processing efficiency.

[0084] In some embodiments, the above-mentioned vector indexing device is also used to obtain the data to be queried; vectorize the data to be queried to obtain the vector corresponding to the data to be queried; and perform dimensionality reduction processing on the vector corresponding to the data to be queried to obtain the vector to be queried.

[0085] In some embodiments, the above-mentioned vector indexing device is also used to obtain multiple vectors to be constructed; perform clustering processing on the multiple vectors to be constructed to obtain multiple cluster clusters to be constructed; perform center point selection processing on the multiple cluster clusters to be constructed to obtain cluster centers corresponding to each cluster cluster to be constructed; perform hierarchical neighbor graph index construction processing on the cluster centers corresponding to the cluster clusters to be constructed to obtain a target hierarchical neighbor graph index structure; perform inverted index construction processing on each cluster cluster to be constructed to obtain a target inverted index structure corresponding to each cluster cluster to be constructed; determine the target index structure according to the target hierarchical neighbor graph index structure and the target inverted index structure corresponding to each cluster cluster to be constructed.

[0086] In some embodiments, a hierarchical neighbor graph index construction process is performed on the cluster centers corresponding to the clusters to be constructed, and a target hierarchical neighbor graph index structure is obtained, which is specifically used to obtain an initial graph structure; the number of layers of the cluster centers corresponding to each cluster to be constructed is determined through an exponential decay probability function, and the number of insertion layers corresponding to each cluster center is obtained; based on the number of insertion layers corresponding to each cluster center, a node insertion process is performed on the cluster centers corresponding to each cluster to be constructed, and a target hierarchical neighbor graph index structure is obtained.

[0087] In some embodiments, an inverted index construction process is performed on each cluster to be constructed to obtain a target inverted index structure corresponding to each cluster to be constructed, which is specifically used to perform feature extraction processing on the vector to be constructed corresponding to each cluster to be constructed to obtain a feature description vector corresponding to each vector to be constructed; determine the inverted index list corresponding to each cluster to be constructed based on the feature description vector corresponding to the vector to be constructed; perform data structure storage processing on the inverted index list corresponding to each cluster to be constructed to obtain a target inverted index structure corresponding to each cluster to be constructed.

[0088] In some embodiments, the second processing module 404 is specifically used to perform similarity calculation processing on the query vector and the vectors to be constructed corresponding to each target cluster cluster to obtain the similarity value corresponding to each vector to be constructed; filter the similarity value corresponding to each vector to be constructed, and sort the filtering results to obtain a sequence corresponding to the target similarity value; determine the vector to be constructed corresponding to each target similarity value according to the sequence corresponding to the target similarity value; sort the vector to be constructed corresponding to each target similarity value to obtain a target result vector sequence.

[0089] In some embodiments, the first determination module 401 is specifically used to perform layer-by-layer search processing on the query vector to obtain at least one candidate cluster center corresponding to the query vector; perform distance calculation processing on the candidate cluster center corresponding to each query vector and the query vector to obtain the distance value corresponding to the candidate cluster center; sort the distance values ​​corresponding to the candidate cluster centers to obtain a candidate cluster center sequence; and screen the candidate cluster center sequence to obtain at least one cluster center corresponding to the query vector.

[0090] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.

[0091] Figure 5 Schematic diagram of an electronic device 5 provided in an embodiment of the present disclosure. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 503, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0092] The electronic device 5 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 The electronic device 5 is merely an example and does not limit the electronic device 5 , and may include more or less components than those shown in the figure, or different components.

[0093] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0094] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. The memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device.

[0095] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0096] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, the present disclosure implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0097] The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be included in the protection scope of the present disclosure.

Claims

1. A vector indexing method, characterized in that: include: Inputting a vector to be queried into a target index structure, performing hierarchical neighbor graph indexing processing on the vector to be queried, and determining at least one cluster center corresponding to the vector to be queried; Acquire corresponding mapping relationships from a preset mapping table based on the cluster centers corresponding to the vectors to be queried, and determine at least one target cluster according to the mapping relationships; Performing inverted index processing on at least one of the target clusters and the vector to be queried to obtain a target result vector sequence; Perform vector selection processing on the target result vector sequence to obtain at least one target return result vector.

2. The vector indexing method according to claim 1, characterized in that: Before inputting the query vector into the target index structure, performing hierarchical neighbor graph indexing on the query vector, and determining at least one cluster center corresponding to the query vector, the method further includes: Get the data to be queried; Performing vectorization processing on the data to be queried to obtain a vector corresponding to the data to be queried; Perform dimensionality reduction processing on the vector corresponding to the data to be queried to obtain the vector to be queried.

3. The vector indexing method according to claim 1, characterized in that: Before inputting the query vector into the target index structure, performing hierarchical neighbor graph indexing on the query vector, and determining at least one cluster center corresponding to the query vector, the method further includes: Get multiple vectors to be constructed; Performing clustering processing on the plurality of vectors to be constructed to obtain a plurality of clusters to be constructed; Performing center point selection processing on the plurality of clusters to be constructed to obtain cluster centers corresponding to the clusters to be constructed; Performing hierarchical neighbor graph index construction processing on the cluster centers corresponding to the clusters to be constructed to obtain a target hierarchical neighbor graph index structure; Performing inverted index construction processing on each of the clusters to be constructed to obtain a target inverted index structure corresponding to each of the clusters to be constructed; The target index structure is determined according to the target hierarchical neighbor graph index structure and the target inverted index structures corresponding to the clusters to be constructed.

4. The vector indexing method according to claim 3, characterized in that: The step of performing hierarchical neighbor graph index construction processing on the cluster centers corresponding to the clusters to be constructed to obtain a target hierarchical neighbor graph index structure includes: Get the initial graph structure; By using an exponential decay probability function, the number of layers of the cluster centers corresponding to the clusters to be constructed is determined to obtain the number of insertion layers corresponding to the cluster centers; Based on the number of insertion layers corresponding to each cluster center, node insertion processing is performed on the cluster center corresponding to each cluster to be constructed to obtain the target hierarchical neighbor graph index structure.

5. The vector indexing method according to claim 3, characterized in that: The performing inverted index construction processing on each of the clusters to be constructed to obtain a target inverted index structure corresponding to each of the clusters to be constructed includes: Performing feature extraction processing on the vectors to be constructed corresponding to each of the clusters to be constructed to obtain feature description vectors corresponding to each of the vectors to be constructed; Determine, according to the feature description vector corresponding to the vector to be constructed, an inverted index list corresponding to each cluster to be constructed; The inverted index lists corresponding to the clusters to be constructed are processed for data structure storage to obtain target inverted index structures corresponding to the clusters to be constructed.

6. The vector indexing method according to claim 1, characterized in that: The target cluster includes at least one vector to be constructed corresponding to the target cluster; The performing inverted index processing on at least one of the target clusters and the vector to be queried to obtain a target result vector sequence includes: Performing similarity calculation processing on the query vector and the vectors to be constructed corresponding to each of the target clusters to obtain similarity values ​​corresponding to each of the vectors to be constructed; Screening the similarity values ​​corresponding to the vectors to be constructed, and sorting the screening results to obtain a sequence corresponding to the target similarity value; Determining, according to the sequence corresponding to the target similarity values, the vectors to be constructed corresponding to the respective target similarity values; The vectors to be constructed corresponding to the target similarity values ​​are sorted to obtain the target result vector sequence.

7. The vector indexing method according to claim 1, characterized in that: The step of inputting the query vector into the target index structure, performing hierarchical neighbor graph indexing on the query vector, and determining at least one cluster center corresponding to the query vector includes: Performing layer-by-layer search processing on the vector to be queried to obtain at least one candidate cluster center corresponding to the vector to be queried; Performing distance calculation processing on the candidate cluster centers corresponding to each of the query vectors and the query vector to obtain distance values ​​corresponding to the candidate cluster centers; Sorting the distance values ​​corresponding to the candidate cluster centers to obtain a candidate cluster center sequence; The candidate cluster center sequence is screened to obtain at least one cluster center corresponding to the query vector.

8. A vector indexing device, characterized in that: include: A first determination module is used to input a vector to be queried into a target index structure, perform hierarchical neighbor graph indexing on the vector to be queried, and determine at least one cluster center corresponding to the vector to be queried; A second determination module, configured to obtain a corresponding mapping relationship from a preset mapping table based on the cluster center corresponding to each of the query vectors, and determine at least one target cluster according to the mapping relationship; A first processing module, configured to perform inverted index processing on at least one of the target clusters and the vector to be queried to obtain a target result vector sequence; The second processing module is used to perform vector selection processing on the target result vector sequence to obtain at least one target return result vector.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Risk identification method, device and equipment

    CN119293600A

  • Data query method and device, computer equipment and program product

    CN120448437A

  • A data query method and device, computer device and program product

    CN120448437B

  • Filtering vector retrieval method, system and equipment and storage medium

    CN121009183A

  • Filtering vector retrieval method, system, device and storage medium

    CN121009183B