A Hybrid Query Method for a Vector Data Management System
By constructing a hybrid query index based on a proximity graph in the vector data management system and combining it with multi-objective Bayesian optimization to automatically tune parameters, the balance between attribute filtering and vector similarity search efficiency of the hybrid query index is solved, achieving efficient hybrid query responses.
Patent Information
- Application Number
- CN202511203419.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-27
AI Technical Summary
Existing technologies struggle to balance the efficiency of attribute filtering and vector similarity search in hybrid query index parameter tuning, resulting in low query efficiency and excessive storage consumption. Existing methods are inefficient in multi-dimensional parameter spaces and cannot accommodate multiple conflicting objectives.
A hybrid query method for a vector data management system is designed, which uses a distance metric that combines vectors and attributes to construct a proximity graph as a hybrid query index structure. The hybrid query index parameters are automatically tuned through multi-objective Bayesian optimization (MOBO). The method includes index construction and query response stages, calculates the fusion distance using a preset balance coefficient and attribute distance metric, and optimizes the parameter configuration using the MOBO method.
It significantly improves the performance of hybrid query responses, avoids the storage and computational overhead of maintaining both vector and attribute indexes simultaneously, and automatically tunes parameters to achieve an optimal balance under multiple conflicting performance objectives, thereby increasing the number of query requests per second and recall rate.
Smart Images

Figure CN120705162B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and database technology, and in particular to a hybrid query method for a vector data management system. Background Technology
[0002] With the rapid development of artificial intelligence and big data technologies, large-scale information retrieval and machine learning systems have become an indispensable part of our daily lives and work. One of the key infrastructures behind these systems is the Vector Data Management System (VDMS). VDMS efficiently manages large-scale vector data by converting multimedia data such as text, images, and audio into embedded vectors, and provides fast and accurate similarity search services through Approximate Nearest Neighbor Search (ANNS) technology. Nearest Neighbor Search (NNS) returns the k most similar known vectors stored in VDMS to the query vector specified by the user. To improve search efficiency, ANNS relaxes the restrictions on the returned results in NNS, only requiring the return of the k most similar known vectors to the query vector. For example, in an ANNS-based paper retrieval system, if a user expects to find papers most similar to the query text, the system converts the unstructured text of each paper and the query text into high-dimensional feature vectors and performs ANNS using vector indexing. In reality, the pure ANNS method still struggles to meet users' actual needs. For example, users might want to find data objects with feature vectors similar to the query object and that conform to structured attribute constraints such as paper topic, conference, and publication year. Such queries, combining ANNS and attribute constraints, are called hybrid queries (HQ). Answering hybrid queries is a key capability requirement of modern VDMS.
[0003] Currently, there are two main international methods for handling mixed query responses. The first method performs attribute filtering first, followed by vector similarity search. This method is efficient in the attribute filtering stage, narrowing down the data range quickly and reducing the amount of data required for vector similarity search (ANNS), thus improving query efficiency. However, this method struggles to utilize pre-built vector indexes based on all vector data, requiring the creation of new vector indexes for the filtered data, leading to low ANNS efficiency. Furthermore, offline pre-building of multiple filtered vector data indexes consumes excessive memory. Therefore, this method fails to fully leverage the efficiency advantages of vector indexes. The second method performs vector similarity search first, followed by attribute filtering. This method only requires attribute filtering on a small number of returned results after ANNS completion, typically more efficient than performing attribute filtering at every step, and requires no additional attribute indexes. However, this method needs to return far more than the user's required k candidate results to satisfy the final attribute filtering requirement, reducing ANNS efficiency. Simultaneously, it requires maintaining both vector and attribute indexes, increasing storage and computational overhead.
[0004] To address the limitations of the two methods mentioned above, a third solution can be devised: combining attribute filtering and vector similarity search to construct a hybrid query index. However, designing a suitable hybrid query index is extremely challenging. Firstly, this method cannot maintain both vector and attribute indexes simultaneously; instead, it uses only one combined vector and attribute index. This combined index needs to effectively balance attribute filtering and vector similarity search to support joint pruning during the hybrid query response process, minimizing intermediate candidate results and thus improving query efficiency. Secondly, this method requires consideration of various factors, such as parameters during the index construction phase and parameters during the query response phase, which significantly impact the performance of the hybrid query index. Parameter tuning for the hybrid query index needs to balance multiple objectives, such as queries per second (QPS) and recall. These objectives often conflict; for example, increasing QPS may decrease recall, and vice versa. While hybrid query index parameter tuning can utilize many existing techniques in the field, these techniques have several limitations in VDMS hybrid query index parameter tuning. For example, heuristic strategies such as rule-based and search-based methods, while effective in specific situations, struggle to adapt to the rapid changes and complex parameters of VDMS, easily getting trapped in local optima. Reinforcement learning is effective in high-dimensional parameter tuning, but inefficient when facing conflicting objectives, requiring large amounts of data for offline training. Overall, existing parameter tuning methods are inefficient in multi-dimensional parameter spaces and struggle to balance conflicting objectives.
[0005] Therefore, how to design a hybrid query index structure that can balance attribute filtering and vector similarity search, and automatically optimize the hybrid query index parameters to fully leverage the efficiency advantages of the hybrid query index, has become a key issue for the further industrialization of VDMS. Summary of the Invention
[0006] In view of this, the present invention provides a hybrid query method for a vector data management system.
[0007] The specific technical solution of the first embodiment of the present invention is as follows: a hybrid query method for a vector data management system, the method comprising an index building stage and a query response stage; the index building stage automatically optimizes the parameters of the hybrid query index based on a historical hybrid query set and a set of data objects stored in the vector data management system, and builds a hybrid query index with the data objects stored in the vector data management system as nodes based on the optimized parameters; the query response stage responds to each hybrid query request submitted online by a user using the hybrid query index output by the index building stage; the index building stage includes: obtaining all historical hybrid query requests and all data objects in the vector data management system, each historical hybrid query request being a hybrid query request submitted and saved by a user, and each data object consisting of a vector and multiple attribute values; setting a fusion distance metric between vectors and attributes of different data objects based on a preset balance coefficient, a preset attribute distance metric weight, a vector distance metric between data objects, and an attribute distance metric between data objects, the fusion distance metric being used to calculate the distance between any two data objects; obtaining all adjustable parameters and the value range of each adjustable parameter, and combining a specific value of all the adjustable parameters into a hybrid query index parameter. The process involves: configuring parameters; obtaining all evaluation metrics used in the automatic parameter tuning process; calling an automatic parameter tuning method based on multi-objective Bayesian optimization to determine the optimal hybrid query index parameter configuration; constructing a proximity graph of the data object based on the optimal hybrid query index parameter configuration, where the proximity graph is the hybrid query index output in the index building phase; the query response phase includes: obtaining the expected number of returned objects k, query vectors, and attribute constraints in the hybrid query request submitted online by the user; using a preset vector distance metric as the distance metric between the vectors in the data object and the query vectors in the hybrid query request, and then... The distance between the data object and the query vector in the mixed query request is simply referred to as the distance between the data object and the query vector; the candidate data object set is iteratively updated in the mixed query index output during the index building phase; during the iterative update process, the candidate data object set is always maintained to consist of k data objects; the candidate data object set output at the end of the iterative update process is called the target data object set; data objects that do not meet the attribute constraints are deleted from the target data object set, the remaining data objects in the target data object set are sorted in ascending order according to their distance from the query vector, and the sorted list of data objects is returned to the user as the query result.
[0008] In an optional embodiment of this application, the fusion distance metric is obtained using the following formula:
[0009]
[0010] in, It is the fusion distance metric between two data objects. It is a preset vector distance metric between two data objects. It is in the i A preset attribute distance metric between two data objects on a preset attribute subset. It is a preset balance coefficient. It is a minimal constant that guarantees the denominator is not zero. This is the preset number of attribute distance metrics. It is the first i Weights of a preset attribute distance metric. Represents data objects With data objects The fusion distance between them Represents data objects With data objects Vector distance between them Indicates the first i Data objects on a preset subset of attributes With data objects The distance between attributes.
[0011] In an optional embodiment of this application, the step of calling the automatic parameter tuning method based on multi-objective Bayesian optimization to determine the optimal hybrid query index parameter configuration includes: generating a preset number of initial hybrid query index parameter configurations based on the tuneable parameters and the value range; the tuneable parameters include the preset balance coefficient, the preset attribute distance metric weight, and the maximum number of neighbors per node in the proximity graph; constructing a proximity graph of the data object based on each initial hybrid query index parameter configuration, and answering all historical hybrid query requests using the query response phase method based on the proximity graph, obtaining the score vector of all evaluation indicators for each initial hybrid query index parameter configuration, where each component in the score vector of all evaluation indicators is the score of an evaluation indicator; using each initial hybrid query index parameter configuration as the input of a training sample and the score vector of all evaluation indicators corresponding to each initial hybrid query index parameter configuration as the output of the corresponding training sample to form a training set for a preset probabilistic proxy model, and training the preset probabilistic proxy model; obtaining the training... The following steps are taken: First, the recommended hybrid query index parameter configuration and its corresponding score vectors for all evaluation metrics are determined. Then, it is determined whether the score vectors for all evaluation metrics corresponding to the recommended hybrid query index parameter configuration meet a preset performance target. If the preset performance target is not met and the number of recommendations by the preset probabilistic proxy model does not exceed a preset recommendation frequency threshold, the recommended hybrid query index parameter configuration and its corresponding score vectors for all evaluation metrics are added as a training sample to the training set of the preset probabilistic proxy model. The preset probabilistic proxy model is trained again until the score vectors for all evaluation metrics corresponding to the hybrid query index parameter configuration recommended by the probabilistic proxy model after training meet the preset performance target, or the number of recommendations by the preset probabilistic proxy model equals the preset recommendation frequency threshold. Only then is the training of the preset probabilistic proxy model terminated. Finally, the parameter configuration that performs optimally on the preset primary evaluation metric under the premise of meeting preset constraints is selected from the final training set of the preset probabilistic proxy model and set as the optimal hybrid query index parameter configuration.
[0012] In an optional embodiment of this application, obtaining the hybrid query index parameter configuration recommended by the preset probabilistic proxy model after training and the corresponding score vectors of all evaluation metrics includes: using the standard expected hypervolume improvement as the acquisition function for multi-objective Bayesian optimization to evaluate the improvement of a new hybrid query index parameter configuration on the current Pareto front, wherein the current Pareto front is composed of the score vectors of all non-dominated evaluation metrics in the training set of the preset probabilistic proxy model, wherein the score vector Y in the training set is called non-dominated if and only if there is no other score vector Z in the training set, all components of Z are not inferior to the corresponding components of Y, and Z has at least one component that is superior to the corresponding component of Y; calculating a new hybrid query index parameter configuration that maximizes the expected hypervolume improvement through a preset optimization algorithm, and setting the new hybrid query index parameter configuration as the recommended hybrid query index parameter configuration; constructing a proximity graph of the data object according to the recommended hybrid query index parameter configuration, and answering all historical hybrid query requests using the query answering phase method based on the proximity graph to obtain the score vectors of all evaluation metrics corresponding to the recommended hybrid query index parameter configuration.
[0013] In an optional embodiment of this application, the step of constructing the neighborhood graph of the data object according to the optimal hybrid query index parameter configuration includes: dividing all N data objects into multiple clusters, each cluster containing no more than M data objects that are close to each other, where M is the maximum number of neighbors per node in the neighborhood graph in the hybrid query index parameter configuration; setting each data object as a node in the neighborhood graph; for each data object o, selecting a preset L cluster centers with the smallest fusion distance to o from the cluster centers of all clusters, the L cluster centers are called target cluster centers, and the clusters they belong to are called target clusters, and selecting M other data objects with the smallest fusion distance to o from the target clusters as neighbors of o in the neighborhood graph, that is, adding directed edges from the node corresponding to o to the nodes corresponding to the M other data objects in the neighborhood graph; after processing all N data objects as described above, the neighborhood graph of the data object is obtained.
[0014] In an optional embodiment of this application, the iterative update of the candidate data object set in the hybrid query index output during the index construction phase includes: randomly selecting a preset m data objects from the hybrid query index output during the index construction phase, where mk is a preset tunable non-negative parameter; dividing the set of the m data objects into a first subset and a second subset according to the attribute constraints in the hybrid query request, wherein the first subset consists of data objects that satisfy the attribute constraints in the hybrid query request, and the second subset consists of data objects that do not satisfy the attribute constraints in the hybrid query request; selecting k data objects from the first subset that have the smallest distance to the query vector in the hybrid query request to form a candidate data object set; if the candidate data object set... If there are fewer than k data objects, select multiple data objects from the second subset that have the smallest distance to the query vector in the mixed query request, and supplement the candidate data object set to k data objects. Iterate and update the candidate data object set. In each iteration, input the candidate data object set output by the previous iteration, and update the input candidate data object set with the k data objects that have the smallest distance to the query vector in the mixed query request, as the candidate data object set output by the current iteration. When the candidate data object set input by the current iteration is equal to the candidate data object set output by the current iteration, the iteration update process ends, and the candidate data object set input by the current iteration is output as the final candidate data object set output by the iteration update process; otherwise, continue to iterate and update the candidate data object set.
[0015] In an optional embodiment of this application, the step of inputting the candidate data object set output from the previous iteration in each iteration and updating the input candidate data object set with the k data objects that have the smallest distance to the query vector in the mixed query request as the candidate data object set output in the current iteration includes: calculating the union of the neighbor sets of all data objects in the input candidate data object set in the mixed query index output in the index construction stage, and dividing the union of the neighbor sets into a first subset and a second subset. The first subset consists of data objects that satisfy the attribute constraints in the mixed query request, and the second subset consists of data objects that do not satisfy the attribute constraints in the mixed query request; selecting the k data objects with the smallest distance to the query vector in the mixed query request from the first subset to form the candidate data object set output in the current iteration; if the candidate data object set has fewer than k data objects, selecting multiple data objects with the smallest distance to the query vector in the mixed query request from the second subset to supplement the candidate data object set output in the current iteration to the k data objects.
[0016] The specific technical solution of the second embodiment of the present invention is as follows: a hybrid query device for a vector data management system, comprising: an index building module, used to automatically optimize the parameters of the hybrid query index based on a historical hybrid query set and a set of data objects stored in the vector data management system, and to build a hybrid query index with the data objects stored in the vector data management system as nodes based on the optimized parameters; and a query answering module, used to answer each hybrid query request submitted online by a user using the hybrid query index output by the index building phase.
[0017] The specific technical solution of the third embodiment of the present invention is as follows: a computer device, including a processor and a memory; the processor is used to execute a computer program stored in the memory to implement the method as described in any one of the first embodiments of this application.
[0018] The specific technical solution of the fourth embodiment of the present invention is as follows: a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method as described in any one of the first embodiments of this application.
[0019] Implementing the embodiments of the present invention will have the following beneficial effects:
[0020] This invention uses a proximity graph constructed by fusing vector and attribute distance metrics as the sole hybrid query index structure, avoiding the storage and computational overhead of maintaining both vector and attribute indexes simultaneously. Furthermore, it automatically optimizes the hybrid query index parameters through MOBO technology, achieving an optimal balance between multiple conflicting performance objectives such as query requests per second and recall rate, thus significantly improving the performance of hybrid query responses. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A flowchart illustrating the steps of a hybrid query method for a vector data management system;
[0023] Figure 2 A flowchart of the steps in the index building phase;
[0024] Figure 3 A flowchart illustrating the steps involved in the query and response phase;
[0025] Figure 4 This is a schematic diagram of the hybrid query device for a vector data management system.
[0026] Figure 5 A schematic block diagram of the structure of a computer device;
[0027] Among them, 901 is the index building module; and 902 is the query answering module. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0029] The terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other steps or modules inherent to such processes, methods, products, or apparatus.
[0030] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] With the rapid development of artificial intelligence and big data technologies, large-scale information retrieval and machine learning systems have become an indispensable part of our daily lives and work. One of the key infrastructures behind these systems is the Vector Data Management System (VDMS). VDMS efficiently manages large-scale vector data by converting multimedia data such as text, images, and audio into embedded vectors, and provides fast and accurate similarity search services through Approximate Nearest Neighbor Search (ANNS) technology. Nearest Neighbor Search (NNS) returns the k most similar known vectors stored in VDMS to the query vector specified by the user. To improve search efficiency, ANNS relaxes the restrictions on the returned results in NNS, only requiring the return of the k most similar known vectors to the query vector. For example, in an ANNS-based paper retrieval system, if a user expects to find papers most similar to the query text, the system converts the unstructured text of each paper and the query text into high-dimensional feature vectors and performs ANNS using vector indexing. In reality, the pure ANNS method still struggles to meet users' actual needs. For example, users might want to find data objects with feature vectors similar to the query object and that conform to structured attribute constraints such as paper topic, conference, and publication year. Such queries, combining ANNS and attribute constraints, are called hybrid queries (HQ). Answering hybrid queries is a key capability requirement of modern VDMS.
[0032] Currently, there are two main international methods for handling mixed query responses. The first method performs attribute filtering first, followed by vector similarity search. This method is efficient in the attribute filtering stage, narrowing down the data range quickly and reducing the amount of data required for vector similarity search (ANNS), thus improving query efficiency. However, this method struggles to utilize pre-built vector indexes based on all vector data, requiring the creation of new vector indexes for the filtered data, leading to low ANNS efficiency. Furthermore, offline pre-building of multiple filtered vector data indexes consumes excessive memory. Therefore, this method fails to fully leverage the efficiency advantages of vector indexes. The second method performs vector similarity search first, followed by attribute filtering. This method only requires attribute filtering on a small number of returned results after ANNS completion, typically more efficient than performing attribute filtering at every step, and requires no additional attribute indexes. However, this method needs to return far more than the user's required k candidate results to satisfy the final attribute filtering requirement, reducing ANNS efficiency. Simultaneously, it requires maintaining both vector and attribute indexes, increasing storage and computational overhead.
[0033] To address the limitations of the two methods mentioned above, a third solution can be devised: combining attribute filtering and vector similarity search to construct a hybrid query index. However, designing a suitable hybrid query index is extremely challenging. Firstly, this method cannot maintain both vector and attribute indexes simultaneously; instead, it uses only one combined vector and attribute index. This combined index needs to effectively balance attribute filtering and vector similarity search to support joint pruning during the hybrid query response process, minimizing intermediate candidate results and thus improving query efficiency. Secondly, this method requires consideration of various factors, such as parameters during the index construction phase and parameters during the query response phase, which significantly impact the performance of the hybrid query index. Parameter tuning for the hybrid query index needs to balance multiple objectives, such as queries per second (QPS) and recall. These objectives often conflict; for example, increasing QPS may decrease recall, and vice versa. While hybrid query index parameter tuning can utilize many existing techniques in the field, these techniques have several limitations in VDMS hybrid query index parameter tuning. For example, while heuristic strategies such as rule-based and search-based methods are effective in specific situations, they struggle to adapt to the rapid changes and complex parameters of VDMS, easily getting trapped in local optima. Reinforcement learning is effective in high-dimensional parameter tuning, but it is inefficient when facing conflicting objectives and requires extensive offline training. Overall, existing parameter tuning methods are inefficient in multi-dimensional parameter spaces and struggle to balance conflicting objectives. Therefore, designing a hybrid query index structure that balances attribute filtering and vector similarity search, and automatically tuning the hybrid query index parameters to fully leverage its efficiency advantages, has become a key issue for the further industrialization of VDMS.
[0034] This embodiment proposes a hybrid query method for a vector data management system to fully leverage the efficiency advantages of hybrid query indexes. Please refer to [link to relevant documentation]. Figure 1 The method includes an index building phase and a query response phase;
[0035] Step 101: In the index building stage, the parameters of the hybrid query index are automatically optimized based on the historical hybrid query set and the data object set stored in the vector data management system, and the hybrid query index is built based on the optimized parameters and the data objects stored in the vector data management system as nodes.
[0036] Step 102: In the query response phase, for each mixed query request submitted online by the user, the mixed query index output by the index building phase is used to provide a response.
[0037] Please see Figure 2 The index building phase includes:
[0038] Step 201: Obtain all historical mixed query requests and all data objects in the vector data management system. Each historical mixed query request is a mixed query request that has been submitted and saved by the user. Each data object consists of a vector and multiple attribute values.
[0039] Specifically, a historical set of mixed query requests is retrieved from VDMS. This set contains mixed query requests submitted online by users, each consisting of the expected number of objects to be returned, a query vector, and attribute constraints. A set of data objects is also retrieved from VDMS, containing all data objects stored in VDMS. Each data object consists of a vector and multiple attribute value pairs.
[0040] Step 202: Based on the preset balance coefficient, preset attribute distance metric weight, vector distance metric between data objects and attribute distance metric between data objects, set the fusion distance metric between vectors and attributes of different data objects. The fusion distance metric is used to calculate the distance between any two data objects.
[0041] Specifically, the method in this embodiment constructs a hybrid query index based on a proximity graph. The core of this index is the proximity graph, which consists of nodes and directed edges. Each node is a data object stored in VDMS, and each data object consists of a vector and multiple attribute value pairs. Each node in the proximity graph emits at most M directed edges (or simply edges), and the endpoints to which the directed edges point are called neighbors, where M is an adjustable preset parameter. Each edge in the proximity graph is associated with a real value representing the distance between the two endpoints. This distance is calculated by fusing a preset single vector distance metric and multiple attribute distance metrics. The vector distance metric reflects the distance between two data objects in the vector space, while the attribute distance metric reflects the distance between two data objects based on a certain subset of attributes. Each attribute distance metric consists of a preset subset of attributes and a distance metric applicable to that subset, returning a real value between 0 and 1. For example, a simple attribute distance metric can be defined on a single attribute A, returning a comparison result of the values of two data objects on attribute A; that is, if their attribute A values are the same, it returns 0; otherwise, it returns 1.
[0042] Step 203: Obtain all tunable parameters and the value range of each tunable parameter; combine a specific value of all tunable parameters into a hybrid query index parameter configuration; obtain all evaluation metrics used in the automatic parameter tuning process; and call the automatic parameter tuning method based on multi-objective Bayesian optimization to determine the optimal hybrid query index parameter configuration.
[0043] Specifically, obtain the tunable parameters and their value ranges. These parameters include the parameters of the basic ANNS algorithm and the balance coefficient in the fusion distance formula. Attribute distance metric weight ,…, These adjustable parameters, and their specific combinations, are called the hybrid query index parameter configuration, or simply parameter configuration. Simultaneously, preset evaluation metrics applicable to all parameter configurations are obtained, such as Queries Per Second (QPS) and recall (representing the percentage of k-nearest neighbor data objects that satisfy the attribute constraints of the returned set of k data objects). An automatic parameter tuning method based on Multi-Objective Bayesian Optimization (MOBO) is then used to determine the optimal hybrid query index parameter configuration.
[0044] Step 204: Construct a neighborhood graph of the data object according to the optimal hybrid query index parameter configuration. The neighborhood graph is the hybrid query index output in the index construction stage.
[0045] Based on the optimal parameter configuration, the basic ANNS algorithm is adapted to construct a proximity graph of all data object sets in VDMS, which serves as the final output hybrid query index.
[0046] Please see Figure 3 The query-response phase includes:
[0047] Step 301: Obtain the expected number of returned objects k, query vector, and attribute constraints from the mixed query request submitted online by the user.
[0048] Specifically, after the hybrid query index is built, VDMS can answer hybrid query requests submitted online by users based on the hybrid query index. A hybrid query request consists of the expected number of objects to be returned (k), a query vector, and attribute constraints. Specifically, VDMS obtains the query vector and attribute constraints from the hybrid query request submitted by the user and answers the hybrid query request based on the hybrid query index.
[0049] Step 302: Use a preset vector distance metric as the distance metric between the vector in the data object and the query vector in the mixed query request, and refer to the distance between the vector in the data object and the query vector in the mixed query request as the distance between the data object and the query vector.
[0050] Step 303: Iteratively update the candidate data object set in the hybrid query index output during the index construction phase; during the iterative update process, the candidate data object set is always maintained to consist of k data objects; the candidate data object set output at the end of the iterative update process is called the target data object set.
[0051] Specifically, an iterative local search process is initiated, where the input for each iteration is the output of the previous iteration or the initial set of objects, and the output is a set of objects that better matches the mixed query request.
[0052] Step 304: Delete data objects that do not meet the attribute constraints from the target data object set, sort the remaining data objects in the target data object set in ascending order according to their distance from the query vector, and return the sorted list of data objects as the query result to the user.
[0053] Specifically, data objects that satisfy the attribute constraints are selected from the output object set of the last iteration, sorted in ascending order according to their distance from the query vector, and the sorted list of data objects is returned to the user as the query result.
[0054] In a specific embodiment, the fusion distance metric is obtained using the following formula:
[0055]
[0056] in, It is the fusion distance metric between two data objects. It is a preset vector distance metric between two data objects. It is in the i A preset attribute distance metric between two data objects on a preset attribute subset. It is a preset balance coefficient. It is a minimal constant that guarantees the denominator is not zero. This is the preset number of attribute distance metrics. It is the first i Weights of a preset attribute distance metric. Represents data objects With data objects The fusion distance between them Represents data objects With data objects Vector distance between them Indicates the first i Data objects on a preset subset of attributes With data objects The attribute distance between them, where, , , ..., All of these are included in the parameters for subsequent automatic optimization.
[0057] In a specific embodiment, the step of invoking an automatic parameter tuning method based on multi-objective Bayesian optimization to determine the optimal hybrid query index parameter configuration includes:
[0058] Step 401: Generate a preset number of initial mixed query index parameter configurations based on the adjustable parameters and the value range; the adjustable parameters include the preset balance coefficient, the preset attribute distance metric weight, and the maximum number of neighbors per node in the proximity graph.
[0059] Step 402: Construct a proximity graph of the data object according to the configuration of each initial mixed query index parameter, and answer all historical mixed query requests based on the proximity graph using the query answering phase method to obtain the score vector of all evaluation indicators for each initial mixed query index parameter configuration, where each component in the score vector of all evaluation indicators is the score of an evaluation indicator.
[0060] Specifically, a preset number of initial hybrid query index parameter configurations are generated. For each parameter configuration, the vector distance metric in the basic ANNS algorithm is replaced with a vector-attribute fusion distance metric. The improved basic ANNS algorithm is called to construct a hybrid query index based on the proximity graph. Based on this index, each hybrid query request in the historical hybrid query request set is answered, and the score vector of all evaluation indicators for each initial hybrid query index parameter configuration is obtained.
[0061] Step 403: Configure each initial mixed query index parameter as an input to a training sample, and use the score vector of all evaluation indicators corresponding to each initial mixed query index parameter configuration as the output of the corresponding training sample to form a training set for the preset probability proxy model, and train the preset probability proxy model.
[0062] Specifically, the initial mixed query index parameter configuration is used as the independent variable X of the initial sampled dataset, and the corresponding evaluation index score vector is used as the dependent variable Y. A pre-defined probabilistic surrogate model (hereinafter referred to as the surrogate model) is trained using the initial sampled dataset. The surrogate model can employ Gaussian Process (GP) or Random Forest (RF) to predict the score vector of the evaluation index given the parameter configuration.
[0063] Step 404: Obtain the hybrid query index parameter configuration recommended by the preset probability proxy model after training and the corresponding score vector of all evaluation indicators.
[0064] Specifically, a hybrid query index based on a proximity graph is constructed using the new parameter configuration recommended by the pre-trained probabilistic proxy model, and each hybrid query request in the historical hybrid query request set is answered based on this index, and the score vector of the evaluation index of the new parameter configuration is calculated.
[0065] Step 405: Determine whether the score vector of all evaluation indicators corresponding to the recommended hybrid query index parameter configuration meets the preset performance target.
[0066] Specifically, the preset performance metrics include, but are not limited to, the number of query requests per second or the recall rate.
[0067] Step 406: If the preset performance target is not met and the number of recommendations by the preset probabilistic proxy model does not exceed the preset recommendation number threshold, then the recommended hybrid query index parameter configuration and the corresponding score vector of all evaluation indicators are added as a training sample to the training set of the preset probabilistic proxy model, and the preset probabilistic proxy model is trained again until the score vector of all evaluation indicators corresponding to the hybrid query index parameter configuration recommended by the probabilistic proxy model after training meets the preset performance target, or the number of recommendations by the preset probabilistic proxy model is equal to the preset recommendation number threshold, then the training of the preset probabilistic proxy model ends.
[0068] Specifically, the new parameter configuration and its corresponding preset evaluation index values are added to the sampled dataset, and the proxy model is retrained using the sampled dataset until the score vector of all evaluation indexes corresponding to the hybrid query index parameter configuration recommended by the probabilistic proxy model after training meets the preset performance target, or the number of recommendations of the preset probabilistic proxy model is equal to the preset number of recommendations threshold, and then the training of the preset probabilistic proxy model ends.
[0069] Step 407: Select the parameter configuration that performs best on the preset primary evaluation index under the premise of satisfying the preset constraints from the final training set of the preset probabilistic proxy model, and set it as the optimal hybrid query index parameter configuration.
[0070] Specifically, the optimal hybrid query index parameter configuration is selected based on the parameter configuration that performs best in the preset primary evaluation metric, such as recall, while meeting preset constraints, such as QPS not being lower than a preset threshold.
[0071] In a specific embodiment, obtaining the hybrid query index parameter configuration recommended by the trained preset probabilistic proxy model and the corresponding score vector of all evaluation metrics includes:
[0072] Step 501: Use the standard expected hypervolume improvement as the acquisition function for multi-objective Bayesian optimization to evaluate the improvement of a new hybrid query index parameter configuration on the current Pareto front. The current Pareto front is composed of the score vectors of all non-dominated evaluation metrics in the training set of the preset probabilistic surrogate model. The score vector Y in the training set is called non-dominated if and only if there is no other score vector Z in the training set, all components of Z are not inferior to the corresponding components of Y, and Z has at least one component that is superior to the corresponding component of Y.
[0073] Step 502: Calculate the new hybrid query index parameter configuration that maximizes the desired super-volume improvement using a preset optimization algorithm, and set the new hybrid query index parameter configuration as the recommended hybrid query index parameter configuration.
[0074] Specifically, Expected Hypervolume Improvement (EHVI) is used as the acquisition function of MOBO to evaluate the extent to which a new parameter configuration improves the current Pareto Frontier.
[0075] EHVI assesses its value by calculating the potential increase in hypervolume resulting from the new parameter configuration. The specific calculation formula is as follows:
[0076]
[0077] in, It is a hypervolume function. As a reference point, it is usually set to the minimum value of the current Pareto front. It is the set of performance values for all currently non-dominated solutions. It is a new parameter configuration for surrogate model prediction. The performance distribution, In the target space, the reference point is used as an example. Based on the non-dominated solution set The volume of the enclosed region. In multi-objective optimization, a solution... A solution is called a non-dominated solution if and only if there is no other solution. , making Not inferior to in all objectives And superior to at least one objective When applying the above calculation formula, first calculate the hypervolume of all current non-dominated solutions. Then use a surrogate model to predict the new parameter configuration. Performance distribution Finally, in terms of performance distribution The EHVI value of the new parameter configuration is estimated by Monte Carlo Integration based on random sampling.
[0078] The problem of maximizing EHVI can be defined as an optimization problem:
[0079]
[0080] in, This is the parameter space defined by the adjustable parameters and their value ranges. By using optimization algorithms such as stochastic gradient descent to solve the above optimization problem, the recommended parameter configuration can be obtained. .
[0081] Step 503: Based on the recommended mixed query index parameter configuration, construct a proximity graph of the data object, and based on the proximity graph, use the query response phase method to answer all historical mixed query requests to obtain the score vector of all evaluation indicators corresponding to the recommended mixed query index parameter configuration.
[0082] Specifically, a hybrid query index based on a proximity graph is constructed using the recommended hybrid query index parameter configuration, and each hybrid query request in the historical hybrid query request set is answered based on this index. The score vector of all evaluation metrics of the recommended hybrid query index parameter configuration is calculated.
[0083] During MOBO, the performance of parameter configurations needs to be evaluated multiple times. Each performance evaluation requires building a hybrid query index corresponding to the parameter configuration and answering historical hybrid query requests based on the constructed index. The construction of the nearest neighbor graph is the most time-consuming part of each performance evaluation. Since the key to constructing the nearest neighbor graph lies in determining the neighbor set of each data object node, and determining the neighbor set requires calculating the fusion distance between each data object node and all other data object nodes and selecting the M neighbors with the smallest fusion distance, the time complexity of constructing the nearest neighbor graph is O(N). 2 M), where N is the number of data objects and M is the maximum number of neighbors per node in the tunable neighborhood graph.
[0084] To accelerate the construction of multiple proximity graphs, the proximity graph of the data object is constructed according to a certain hybrid query index parameter configuration, including:
[0085] Step 601: Divide all N data objects into multiple clusters, each cluster containing no more than M data objects that are close to each other, where M is the maximum number of neighbors per node in the proximity graph in the hybrid query index parameter configuration.
[0086] Specifically, all N data objects stored in VDMS are divided into approximately N / M clusters, with each cluster containing approximately, but no more than, M, data objects. The partitioning result needs to minimize the fusion distance between data objects in the same cluster and maximize the fusion distance between data objects in different clusters. This step can be implemented using a cluster partitioning algorithm with partition balancing constraints and partition size limitations, such as a constrained k-centroid algorithm (e.g., k-means algorithm and k-centroid algorithm) or the Metis algorithm based on multilevel graph partitioning. This embodiment does not impose restrictions on the cluster partitioning algorithm. Based on the time complexity of the k-means algorithm, the time complexity of this step is estimated to be O(N). 2 / M) level.
[0087] Step 602: Set each of the data objects as a node in the neighborhood graph.
[0088] Step 603: For each data object o, select L preset cluster centers with the smallest fusion distance to o from the cluster centers of all clusters. The L cluster centers are called target cluster centers, and the clusters they belong to are called target clusters. Select M other data objects with the smallest fusion distance to o from the target clusters as neighbors of o in the neighborhood graph. That is, add directed edges from the node corresponding to o to the nodes corresponding to the M other data objects in the neighborhood graph.
[0089] Specifically, for each data object *o* stored in VDMS, L cluster centers closest to *o* are selected from the cluster centers obtained in the first step. Then, M data objects closest to *o* are selected from the clusters containing these cluster centers as neighbors of *o* in the neighborhood graph. Here, *L* is an adjustable integer parameter introduced in the two-step construction method. For each data object *o*, this step requires calculating the fusion distance between *o* and approximately N / M cluster centers, and selecting the L cluster centers with the smallest fusion distance. The time complexity of this operation is O(NL / M). Furthermore, this step also requires selecting the M data objects closest to *o* from the clusters containing these L cluster centers. The time complexity of this operation is O(LM). 2 The overall time complexity is O(N). 2 L / M+NLM 2 )level.
[0090] Step 604: After processing all N data objects as described above, a neighborhood graph of the data objects is obtained.
[0091] The time complexity of all the above steps is still O(N). 2 L / M+NLM 2 The time complexity of constructing the neighbor graph before optimization is O(N). 2Compared to the M) level, the construction method proposed in this embodiment reduces the time complexity of nearest neighbor graph construction to O(N). 2 L / M+NLM 2 The level is such that N is much larger than M and L, thus significantly reducing the construction time of the nearest neighbor graph and improving the efficiency of MOBO.
[0092] In a specific embodiment, the step of iteratively updating the candidate data object set in the hybrid query index output during the index construction phase includes:
[0093] Step 701: Randomly select m preset data objects from the hybrid query index output in the index construction stage, where mk is a preset tunable non-negative parameter.
[0094] Specifically, m data objects are randomly selected from the core proximity graph of the hybrid query index, where mk is a preset non-negative parameter used to encourage the initial object set to include more data objects that satisfy the attribute constraints. Since the query response phase also occurs during the MOBO process, mk is also included in the automatic tuning parameters.
[0095] Step 702: Based on the attribute constraints in the mixed query request, divide the set of m data objects into a first subset and a second subset. The first subset consists of data objects that satisfy the attribute constraints in the mixed query request, and the second subset consists of data objects that do not satisfy the attribute constraints in the mixed query request.
[0096] Specifically, m randomly selected data objects are divided into two subsets: the first subset satisfies the attribute constraints, and the second subset does not.
[0097] Step 703: Select k data objects from the first subset that have the smallest distance to the query vector in the mixed query request to form a candidate data object set; if the candidate data object set has less than k data objects, select multiple data objects from the second subset that have the smallest distance to the query vector in the mixed query request to supplement the candidate data object set to k data objects.
[0098] Specifically, the k data objects closest to the query vector are selected from the first subset. Only when the number of selected data objects p is less than k, the kp data objects closest to the query vector are selected from the second subset, thus forming a candidate data object set with k elements.
[0099] Step 704: Iteratively update the candidate data object set. In each iteration, input the candidate data object set output by the previous iteration, and update the input candidate data object set with the k data objects that are smaller in distance to the query vector in the mixed query request, which will be used as the candidate data object set output by this iteration.
[0100] Specifically, each iteration makes fine adjustments based on the previous results, causing the candidate dataset to gradually converge toward the global optimal solution.
[0101] Step 705: When the candidate data object set input in this iteration is equal to the candidate data object set output in this iteration, end the iterative update process and output the candidate data object set input in this iteration as the final candidate data object set output in the iterative update process; otherwise, continue iteratively updating the candidate data object set.
[0102] In a specific embodiment, the step of inputting the candidate data object set from the previous iteration in each iteration, and updating the input candidate data object set with the k data objects that are smaller in distance to the query vector in the mixed query request, as the candidate data object set output in the current iteration, includes:
[0103] Step 801: Based on the candidate data object set input in this iteration, calculate the union of the neighbor sets of all data objects in the input candidate data object set in the hybrid query index output in the index construction stage, and divide the union of the neighbor sets into a first subset and a second subset. The first subset consists of data objects that satisfy the attribute constraints in the hybrid query request, and the second subset consists of data objects that do not satisfy the attribute constraints in the hybrid query request.
[0104] Specifically, consider the union of the neighbor sets of all data objects in the input object set, and divide the data objects in this union into two subsets. The first subset satisfies the attribute constraints, while the second subset does not.
[0105] Step 802: Select k data objects from the first subset that have the smallest distance to the query vector in the mixed query request to form the candidate data object set output in this iteration; if the candidate data object set has less than k data objects, select multiple data objects from the second subset that have the smallest distance to the query vector in the mixed query request to supplement the candidate data object set output in this iteration to the k data objects.
[0106] Specifically, the k data objects closest to the query vector are selected from the first subset. Only when the number of selected data objects p is less than k, are the kp data objects closest to the query vector selected from the second subset, ultimately forming an output object set with k elements. If the output object set of this iteration equals the input object set, the iteration stops; otherwise, the next iteration continues.
[0107] In summary, this invention proposes a hybrid query method by extending the existing ANNS algorithm based on Proximity Graph (PG). The key to this method is the introduction of a vector and attribute joint index structure based on the proximity graph. The distance metric between any two nodes in the proximity graph is defined by fusing a pre-defined single vector distance metric and multiple attribute distance metrics, constructing a hybrid query index based on the proximity graph. Each pre-defined attribute distance metric reflects a certain distance between two data objects on a subset of attributes. In this index, each node in the proximity graph represents a data object, and the edges between nodes reflect the distances between data objects. Each data object contains a vector and multiple attribute value pairs. This method uses the proximity graph constructed with a vector and attribute fusion distance metric as the sole hybrid query index structure. By automatically tuning the hybrid query index parameters using MOBO technology, it significantly improves the performance of hybrid query responses and achieves an optimal balance between several conflicting performance objectives, such as query requests per second and recall rate.
[0108] In specific embodiments, the alternative technical details involved in this invention include: the selection of the basic ANNS algorithm, the selection of the vector distance metric, the selection of the attribute distance metric, the selection of the evaluation metric in MOBO, the selection of the probabilistic surrogate model in MOBO, the selection of the EHVI maximization problem solving algorithm, the definition of the MOBO termination condition, and the selection of the cluster partitioning algorithm in the two-step nearest neighbor graph construction method. Any specific selection of these technical details does not depart from the technical framework and process defined by this invention, and therefore should not be considered as exceeding the technical protection scope of this invention.
[0109] In a specific embodiment, please refer to Figure 4 This is a schematic diagram of the structure of a hybrid query device for a vector data management system in this embodiment, including:
[0110] The index building module 901 is used to automatically optimize the parameters of the hybrid query index based on the historical hybrid query set and the data object set stored in the vector data management system, and to build the hybrid query index with the data objects stored in the vector data management system as nodes based on the optimized parameters.
[0111] The query response module 902 is used to respond to each mixed query request submitted online by the user using the mixed query index output by the index building phase.
[0112] In a specific embodiment, the third embodiment of this application provides a computer device including a processor and a memory; the processor is used to execute a computer program stored in the memory to implement the method as described in any of the first embodiments of this application.
[0113] Figure 5An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 5 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a string retrieval method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the string retrieval method. Those skilled in the art will understand that… Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0114] In a specific embodiment, the fourth embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any one of the first embodiments of this application.
[0115] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
[0116] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments for application in other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A hybrid query method for a vector data management system, characterized in that, The method includes an index building phase and a query response phase; the index building phase automatically optimizes the parameters of the hybrid query index based on the historical hybrid query set and the data object set stored in the vector data management system, and builds the hybrid query index with the data objects stored in the vector data management system as nodes based on the optimized parameters; The query response phase responds to each mixed query request submitted online by the user using the mixed query index output by the index building phase. The index building phase includes: Obtain all historical mixed query requests and all data objects in the vector data management system. Each historical mixed query request is a mixed query request that has been submitted and saved by the user, and each data object consists of a vector and multiple attribute values. Based on a preset balance coefficient, a preset attribute distance metric weight, a vector distance metric between data objects, and an attribute distance metric between data objects, a fusion distance metric between vectors and attributes is set for different data objects. The fusion distance metric is used to calculate the distance between any two data objects. Obtain all tunable parameters and the value range of each tunable parameter; combine a specific value of all tunable parameters into a hybrid query index parameter configuration; obtain all evaluation metrics used in the automatic parameter tuning process; and call the automatic parameter tuning method based on multi-objective Bayesian optimization to determine the optimal hybrid query index parameter configuration. Based on the optimal hybrid query index parameter configuration, a proximity graph of the data object is constructed, and the proximity graph is the hybrid query index output during the index construction phase; The query-response phase includes: Obtain the expected number of objects k, query vector, and attribute constraints from the mixed query request submitted online by the user; A preset vector distance metric is used as the distance metric between the vectors in the data object and the query vectors in the mixed query request, and the distance between the vectors in the data object and the query vectors in the mixed query request is simply referred to as the distance between the data object and the query vector. The candidate data object set is iteratively updated in the hybrid query index output during the index building phase; during the iterative update process, the candidate data object set is always maintained to consist of k data objects; the candidate data object set output at the end of the iterative update process is called the target data object set. Delete data objects that do not satisfy the attribute constraints from the target data object set, sort the remaining data objects in the target data object set in ascending order according to their distance from the query vector, and return the sorted list of data objects as the query result to the user.
2. The hybrid query method for the vector data management system as described in claim 1, characterized in that, The fusion distance metric is obtained using the following formula: in, It is the fusion distance metric between two data objects. It is a preset vector distance metric between two data objects. It is in the i A preset attribute distance metric between two data objects on a preset attribute subset. It is a preset balance coefficient. It is a minimal constant that guarantees the denominator is not zero. This is the preset number of attribute distance metrics. It is the first i Weights of a preset attribute distance metric. Represents data objects With data objects The fusion distance between them Represents data objects With data objects Vector distance between them Indicates the first i Data objects on a preset subset of attributes With data objects The distance between attributes.
3. The hybrid query method for the vector data management system as described in claim 1, characterized in that, The invocation of an automatic parameter tuning method based on multi-objective Bayesian optimization to determine the optimal hybrid query index parameter configuration includes: The preset number of initial hybrid query index parameter configurations are generated based on the adjustable parameters and the value range; the adjustable parameters include the preset balance coefficient, the preset attribute distance metric weight, and the maximum number of neighbors per node in the proximity graph; Based on each of the initial mixed query index parameter configurations, a proximity graph of the data object is constructed. Based on the proximity graph, the query response phase method is used to answer all historical mixed query requests to obtain the score vector of all evaluation indicators for each of the initial mixed query index parameter configurations. Each component in the score vector of all evaluation indicators is the score of an evaluation indicator. Each initial mixed query index parameter configuration is used as the input of a training sample, and the score vector of all evaluation indicators corresponding to each initial mixed query index parameter configuration is used as the output of the corresponding training sample to form a training set for the preset probability proxy model, and the preset probability proxy model is trained. Obtain the hybrid query index parameter configuration recommended by the preset probability proxy model after training, and the corresponding score vector of all evaluation indicators; Determine whether the score vector of all evaluation metrics corresponding to the recommended hybrid query index parameter configuration meets the preset performance target; If the preset performance target is not met and the number of recommendations by the preset probabilistic proxy model does not exceed the preset recommendation number threshold, then the recommended hybrid query index parameter configuration and the corresponding score vector of all evaluation indicators are added as a training sample to the training set of the preset probabilistic proxy model, and the preset probabilistic proxy model is trained again until the score vector of all evaluation indicators corresponding to the recommended hybrid query index parameter configuration of the probabilistic proxy model after training meets the preset performance target, or the number of recommendations by the preset probabilistic proxy model is equal to the preset recommendation number threshold, then the training of the preset probabilistic proxy model ends. The parameter configuration that performs best on the preset primary evaluation index under the premise of satisfying preset constraints is selected from the final training set of the preset probabilistic proxy model and set as the optimal hybrid query index parameter configuration.
4. The hybrid query method for the vector data management system as described in claim 3, characterized in that, The step of obtaining the hybrid query index parameter configuration recommended by the preset probabilistic proxy model after training and its corresponding score vector of all evaluation metrics includes: The standard expected hypervolume improvement is used as the acquisition function for multi-objective Bayesian optimization to evaluate the improvement of a new hybrid query index parameter configuration on the current Pareto front. The current Pareto front is composed of the score vectors of all non-dominated evaluation metrics in the training set of the preset probabilistic surrogate model. The score vector Y in the training set is called non-dominated if and only if there is no other score vector Z in the training set, all components of Z are not inferior to the corresponding components of Y, and Z has at least one component that is superior to the corresponding component of Y. The new hybrid query index parameter configuration that maximizes the desired supervolume improvement is calculated using a preset optimization algorithm, and the new hybrid query index parameter configuration is set as the recommended hybrid query index parameter configuration. Based on the recommended hybrid query index parameter configuration, a proximity graph of the data object is constructed, and based on the proximity graph, the query response phase method is used to answer all historical hybrid query requests to obtain the score vector of all evaluation indicators corresponding to the recommended hybrid query index parameter configuration.
5. The hybrid query method for the vector data management system as described in any one of claims 1, 3, and 4, characterized in that, The step of constructing the proximity graph of the data object based on the optimal hybrid query index parameter configuration includes: All N data objects are divided into multiple clusters, each cluster containing no more than M data objects that are close to each other, where M is the maximum number of neighbors per node in the proximity graph in the hybrid query index parameter configuration. Each of the data objects is set as a node in the neighborhood graph; For each data object o, select L preset cluster centers with the smallest fusion distance to o from the cluster centers of all clusters. The L cluster centers are called target cluster centers, and the clusters they belong to are called target clusters. Select M other data objects with the smallest fusion distance to o from the target clusters as neighbors of o in the neighborhood graph. That is, add directed edges from the node corresponding to o to the nodes corresponding to the M other data objects in the neighborhood graph. After processing all N data objects as described above, a neighborhood graph of the data objects is obtained.
6. The hybrid query method for the vector data management system as described in claim 1, characterized in that, The iterative update of the candidate data object set in the hybrid query index output during the index construction phase includes: In the hybrid query index output during the index building phase, a preset number of m data objects are randomly selected, where mk is a preset tunable non-negative parameter; Based on the attribute constraints in the mixed query request, the set of m data objects is divided into a first subset and a second subset. The first subset consists of data objects that satisfy the attribute constraints in the mixed query request, and the second subset consists of data objects that do not satisfy the attribute constraints in the mixed query request. Select k data objects from the first subset that have the smallest distance to the query vector in the mixed query request to form a candidate data object set; if the candidate data object set has less than k data objects, select multiple data objects from the second subset that have the smallest distance to the query vector in the mixed query request to supplement the candidate data object set to k data objects. The candidate data object set is updated iteratively. In each iteration, the candidate data object set output by the previous iteration is input, and the input candidate data object set is updated with the k data objects that are smaller in distance to the query vector in the mixed query request, which are used as the candidate data object set output by the current iteration. When the candidate data object set input in this iteration is equal to the candidate data object set output in this iteration, the iteration update process ends, and the candidate data object set input in this iteration is output as the final candidate data object set output by the iteration update process; otherwise, the iteration update of the candidate data object set continues.
7. The hybrid query method for the vector data management system as described in claim 6, characterized in that, Each iteration takes the candidate data object set from the previous iteration as input, updates the input candidate data object set with the k data objects that are smaller in distance to the query vector in the mixed query request, and uses these as the candidate data object set for the current iteration, including: Based on the candidate data object set input in this iteration, calculate the union of the neighbor sets of all data objects in the input candidate data object set in the hybrid query index output in the index building stage, and divide the union of the neighbor sets into a first subset and a second subset. The first subset consists of data objects that satisfy the attribute constraints in the hybrid query request, and the second subset consists of data objects that do not satisfy the attribute constraints in the hybrid query request. Select k data objects from the first subset that have the smallest distance to the query vector in the mixed query request to form the candidate data object set output in this iteration; if the candidate data object set has less than k data objects, select multiple data objects from the second subset that have the smallest distance to the query vector in the mixed query request to supplement the candidate data object set output in this iteration to the k data objects.
8. A hybrid query device for a vector data management system, employing the hybrid query method for the vector data management system as described in claim 1, characterized in that, include: The index building module is used to automatically optimize the parameters of the hybrid query index based on the historical hybrid query set and the data object set stored in the vector data management system, and to build the hybrid query index with the data objects stored in the vector data management system as nodes based on the optimized parameters. The query response module is used to respond to each mixed query request submitted online by a user using the mixed query index output by the index building phase.
9. A computer device, characterized in that, Including processor and memory; The processor is used to execute a computer program stored in the memory to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and System for Multi-Tier Image Matching in a Mixed Media Environment
US20060262976A1
Custom named entities and tags for natural language search query processing
US20210149901A1