A query method, an index processing method, and corresponding devices

By constructing a graph index based on or approximately based on the Pareto front in the vector database, the problem of query weight changes affecting query results is solved, enabling efficient and accurate querying of the vector database under different weight conditions.

CN123157952APending Publication Date: 2026-11-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510681759.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In vector databases, changes in query weights can cause indexes to become unsuitable during the query process, affecting the accuracy and performance of query results.

Method used

A graph index based on or approximately Pareto front is used. Through multi-objective optimization, it is ensured that changes in the weight of the query vector do not affect the query results. Adaptive query results are achieved by utilizing the vector points and edge relationships in the graph index.

Benefits of technology

It improves the accuracy and performance of query results in vector databases, and can maintain high efficiency and accuracy of queries under different weight conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157952A_ABST
    Figure CN123157952A_ABST
Patent Text Reader

Abstract

A query method is applied to a vector database. When the graph index of the vector database is generated or updated, it determines the Pareto front or approximate Pareto front for each vector point in the graph index. Since the Pareto front or approximate Pareto front is the set of vector points corresponding to different weight combinations under the same optimization objective, the graph index can be applied to queries with various weight combinations. It can determine more accurate query results for queries with various weight combinations, thereby improving the performance of the vector database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technology, specifically to a query method, an index processing method, and a corresponding device. Background Technology

[0002] Vector databases are databases that store data in vector form. With the increasing diversity of data types, vector databases not only support text vectors but also multimodal vectors such as images, audio, and video. Therefore, vectorizing different types of data and using vectors for querying vector data has become a hot research topic.

[0003] Vector queries typically refer to the process of finding vectors similar to the query vector in a high-dimensional vector space. Because data is stored in vectorized form, each data item is usually represented by multiple vectors, and different vectors may be assigned different weights (e.g., a data item is represented by vectors A and B, where vector A has a weight of 0.4 and vector B has a weight of 0.6). Therefore, when generating an index for this data item, the index is generated according to the weights corresponding to the different vectors. Vector queries often also involve mixed vector queries, where the query includes multiple vectors, and each vector in the query also has a corresponding weight.

[0004] If the weight of the query matches the weight of the vector of the data item to be queried, the index can provide a more accurate query result. However, if the weight of the query changes and does not match the weight of the vector of the data item to be queried, the index cannot adapt to the changed weight. Querying through the index will affect the accuracy of the query result and thus the performance of the vector database. Summary of the Invention

[0005] This application provides a query method to improve the accuracy of query results and enhance the performance of vector databases. This application also provides an indexing method, corresponding apparatus, a computer-readable storage medium, and a computer program product.

[0006] This application provides a query method applicable to a vector database. The method includes: receiving a first query, the first query indicating a query vector of a first modality; obtaining a first weight based on the first query, the first weight corresponding to the query vector of the first modality; determining a first vector point from a graph index of the vector database based on the first weight; wherein the graph index includes the first vector point and a plurality of second vector points, the plurality of second vector points being located at the Pareto front or approximately Pareto front of the first vector point, the Pareto front or approximately Pareto front being a set of vector points corresponding to different weight combinations satisfying the same optimization objective; the first vector point being a vector point among the vector points satisfying the first weight whose distance to the target vector satisfies a first requirement, the target vector being the vector corresponding to the first query; and the data vector corresponding to the first vector point being the query result of the first query.

[0007] In this application, a vector database refers to a database that stores data in vector form and uses vectors for retrieval. Vector data can also include relational databases, non-relational databases, or other types of databases. As long as the database includes data stored or retrieved in vector form, it can be called a vector database.

[0008] In this application, "modality" refers to the form in which data or information is presented. For example, the same information can be transmitted in different ways, such as text, voice, images, or video. These different transmission methods can be understood as multimodal. For instance, information transmitted through text can be understood as one modality, and information transmitted through images can be understood as another modality. Additionally, the title content can be understood as one modality, and the body content as another. This application does not specifically limit the form of modality; anything that can be distinguished between two different forms can be understood as a different modality. A data item in a vector database is usually represented by a multimodal vector, and vectors of different modalities can have different weights. Of course, the data item in this application can also be a unimodal vector, and the query scheme of this application can also be applied to unimodal queries.

[0009] In this application, the first modality refers to one of the modalities in a multimodal dataset, and the first weight is the weight corresponding to the query vector of the first modality. Typically, the weight value ranges from 0 to 1. The sum of the weights of the vectors from multiple modalities for a data item is usually 1; however, this application does not impose this limitation.

[0010] In this application, the first query can be a Structured Query Language (SQL) statement. The first query may include one or more query vectors, and the weights corresponding to each query vector can be configured by the user in the first query, or they can be obtained by a vector database based on the semantic information in the first query.

[0011] In this application, a "graph index" is an index used to indicate the data storage location in a vector database in the form of a graph. The graph index includes multiple vector points and multiple edges. Each vector point indicates the storage location of a data vector in the vector database, and edges indicate the proximity relationship between two vector points. Typically, only two vector points satisfying the relative neighborhood graph (RNG) relationship are connected by an edge; two vector points not satisfying the RNG relationship are not connected by an edge. An RNG is an undirected graph constructed based on the distance relationship between points, commonly used in computational geometry, pattern recognition, and data analysis. Its core idea is to connect every two points in a point set, provided that no other point is simultaneously closer to either of these two points. This graph construction method helps in analyzing the structure of data, especially when finding natural "influence regions" or "neighborhoods" between data points, avoiding excessive redundant connections and highlighting key structural features.

[0012] A Pareto frontier is a solution in a multi-objective optimization problem that is Pareto optimal or undominated if no other solution is at least equal to it in all objectives and better in at least one objective. The set of all Pareto optimal solutions is called the Pareto frontier. These solutions represent different objective trade-offs; that is, to achieve improvement in one objective, one must sacrifice another.

[0013] An approximate Pareto front refers to a Pareto front determined by a greedy approximate search, which saves time in finding an exact Pareto front.

[0014] The points on the Pareto front or near-Pareto front are the set of vector points corresponding to different weight combinations that satisfy the same optimization objective. In a unimodal query, all weights except the first weight can be considered as zero, so the Pareto front or near-Pareto front includes vector points with various weight combinations.

[0015] In this application, the optimization objective can be set according to requirements, such as the weighted distance of multimodal vectors being within a certain threshold range.

[0016] In the first aspect mentioned above, because the graph index is constructed based on the Pareto front or an approximate Pareto front, and contains vector points with various weight combinations, no matter what the first weight of the query vector in the first query is, or how the first weight changes, the first vector point that matches the first weight of the first query and is closest to the target vector can be found on the graph index to obtain the query result, thereby improving the accuracy of the query result.

[0017] In one possible implementation, the first query is also used to indicate the query vector of the second modality;

[0018] Obtaining the first weight based on the first query includes: obtaining the first weight and the second weight based on the first query;

[0019] Determining a first vector point from the graph index of the vector database based on a first weight includes: determining a first vector point from the graph index of the vector database based on a first weight and a second weight. The first vector point is the vector point that is closest to the target vector among the vector points that satisfy the first weight and the second weight. The target vector includes the query vector of the first modality and the query vector of the second modality.

[0020] In this possible implementation, for multimodal queries, the graph index can still find the first vector point that satisfies the first and second weights and is closest to the target vector, thus obtaining the accuracy query result.

[0021] In one possible implementation, the sum of the multimodal vector weighted distances between the vector points on the Pareto front or near-Pareto front and the first vector point is minimized.

[0022] In this possible implementation, a multi-objective optimization problem is given. If the optimization objective is to minimize the sum of weighted distances of multiple vectors, then for any weight α, α∈[0,1], the weighted nearest neighbors of vector x are always included in the Pareto front of vector x. Thus, regardless of how α changes for the query vector, as long as the Pareto front of each vector is constructed in advance for its multi-objective objective, it can be guaranteed that the weighted nearest neighbors of that vector are always included in the Pareto front of vector x. This lays the foundation for the design of graph index structures, enabling the graph index to adaptively handle queries with different weights without setting α when generating or updating the graph index.

[0023] In one possible implementation, determining a first vector point from a graph index of a vector database based on a first weight includes: filtering a first relative neighborhood graph that satisfies the first weight from the graph index; wherein the two closest vector points on the graph index are connected by an edge, each edge on the graph index has a weight range applicable to the weight, and the weight range of each edge on the first relative neighborhood graph includes the first weight; and determining the first vector point closest to the target vector on the first relative neighborhood graph.

[0024] In this possible implementation, a first relative neighborhood graph that satisfies the first weight is selected from the graph index. The weight range of the edges in the first relative neighborhood graph includes the first weight. This can reduce invalid queries, increase the speed of querying the first vector point, and improve the query performance of the vector database.

[0025] In one possible implementation, if the first query is also used to indicate the query vector of the second modality, then the weight range of each edge on the first relative neighborhood graph also includes the second weight.

[0026] In this possible implementation, for multimodal queries, filtering the first relative neighborhood graph from the graph index using multiple weights can improve the accuracy of the first relative neighborhood graph and improve the query performance of the vector database.

[0027] In one possible implementation, the first relative neighborhood graph that satisfies the first weight is selected from the graph index, including: starting from the starting vector point, routing is performed on the graph index according to the first weight and the weight range of the edges on the graph index to determine the edges on the graph index that include the first weight and the corresponding vector points; wherein, the starting vector point is the edge vector point among multiple edge vector points that is closest to the target vector corresponding to the first query.

[0028] In this possible implementation, starting from the initial vector point, filtering the first relative neighborhood graph from the graph index according to one or more weights can improve the speed of filtering the first relative neighborhood graph, thereby improving the query performance of the vector database.

[0029] In one possible implementation, the edge vector points are vector points that are outside the first threshold range from the center of the graph index.

[0030] In this application, the edge vector points change with the size of the graph index, and the value of the first threshold can also change with the size of the graph index.

[0031] In this possible implementation, selecting an edge vector point that is far from the center of the graph index to start the graph search process is beneficial for queries with any weight to quickly select a suitable starting vector point to begin the graph search, which can improve the speed of the first relative neighborhood graph filtering, thereby improving the query performance of the vector database.

[0032] A second aspect of this application provides an indexing method, comprising: receiving a first request, the first request indicating the addition of a first data vector; inserting a first vector point into a graph index of a vector database, the first vector point indicating the first data vector; determining a plurality of second vector points associated with the first vector point, the plurality of second vector points being located at the Pareto front or approximate Pareto front of the first vector point, the Pareto front or approximate Pareto front being a set of vector points corresponding to different weight combinations satisfying the same optimization objective.

[0033] Secondly, during the data insertion operation, the corresponding first vector point is also inserted into the graph index, thereby determining the Pareto front or approximate Pareto front of the first vector point in the graph index. This allows the graph index to be applicable to queries with various weights, thereby improving the accuracy of queries and enhancing the performance of the vector database.

[0034] In one possible implementation, the method further includes: determining the weight range of the applicable weights for the edges connected to the first vector point based on the pruning strategy of the relative neighborhood graph.

[0035] In this application, two points can satisfy the relative neighborhood graph requirement under certain weights, and cannot satisfy the relative neighborhood graph requirement under certain weights. According to this principle, the weights that satisfy the relative neighborhood graph requirement are the weight range of the edge between the two points. For example, if the weight range of an edge is 0.5 to 0.9, it means that when the weight is between 0.5 and 0.9, the two points satisfy the relative neighborhood graph requirement, and when the weight is not between 0.5 and 0.9, the two points do not satisfy the relative neighborhood graph requirement.

[0036] In this possible implementation, determining the applicable weight range for the edges on the graph index can improve query speed and accuracy.

[0037] In one possible implementation, the method further includes: determining edge vector points of the graph index, where the edge vector points are vector points located outside the center of the graph index within a first threshold range.

[0038] In this possible implementation, updating the edge vector points of the graph index in a timely manner as the graph index is updated can help queries of any weight to quickly select a suitable starting vector point to begin graph search, thereby improving the speed of the first relative neighborhood graph filtering and thus improving the query performance of the vector database.

[0039] In one possible implementation, the method further includes: receiving a second request indicating the deletion of a first data vector; deleting the first vector point in the graph index of the vector database to update the graph index; or, regenerating the graph index.

[0040] In this possible implementation, the graph index is also updated promptly for deletion operations, which can improve the accuracy of subsequent queries.

[0041] In one possible implementation, the method further includes: receiving a third request, the third request being used to indicate modification of a first data vector; deleting a first vector point in the graph index of a vector database and inserting a third vector point, the third vector point being used to indicate a second data vector, the second data vector being obtained by modifying the first data vector; determining multiple fourth vector points associated with the third vector point, the multiple fourth vector points being located at the Pareto front or approximate Pareto front of the third vector point, the Pareto front or approximate Pareto front being a set of vector points corresponding to different weight combinations satisfying the same optimization objective.

[0042] In this possible implementation, for modification operations, the first vector point can be deleted from the graph index first, and then the third vector point can be inserted. By updating the graph index in a timely manner, the accuracy of subsequent queries can be improved.

[0043] A third aspect of this application provides a data processing apparatus, comprising:

[0044] The transceiver unit is used to receive a first query, which is used to indicate a query vector of a first mode;

[0045] The first processing unit is used to obtain a first weight based on a first query, wherein the first weight corresponds to the query vector of the first modality;

[0046] The second processing unit is used to determine a first vector point from the graph index of the vector database based on a first weight; wherein the graph index includes the first vector point and multiple second vector points, the multiple second vector points are located at the Pareto front or approximately Pareto front of the first vector point, the Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations under the same optimization objective; the first vector point is the vector point among the vector points that satisfy the first weight and whose distance to the target vector meets the first requirement, the target vector is the vector corresponding to the first query; the data vector corresponding to the first vector point is the query result of the first query.

[0047] In one possible implementation, the first processing unit is configured to obtain a first weight and a second weight based on the first query, provided that the first query is also used to indicate a query vector of the second modality.

[0048] The second processing unit is used to determine a first vector point from the graph index of the vector database based on a first weight and a second weight. The first vector point is the vector point that is closest to the target vector among the vector points that satisfy the first weight and the second weight. The target vector includes the query vector of the first modality and the query vector of the second modality.

[0049] In one possible implementation, the sum of the multimodal vector weighted distances between the vector points on the Pareto front or near-Pareto front and the first vector point is minimized.

[0050] In one possible implementation, the second processing unit is used to filter out a first relative neighborhood graph that satisfies the first weight from the graph index; wherein the two closest vector points on the graph index are connected by an edge, each edge on the graph index has a weight range of the applicable weight, and the weight range of each edge on the first relative neighborhood graph includes the first weight; and on the first relative neighborhood graph, the first vector point that is closest to the target vector is determined.

[0051] In one possible implementation, if the first query is also used to indicate the query vector of the second modality, then the weight range of each edge on the first relative neighborhood graph also includes the second weight.

[0052] In one possible implementation, the second processing unit is configured to start from the starting vector point and, based on the first weight and the weight range of the edges on the graph index, perform routing on the graph index to determine the edges on the graph index that include the first weight and the corresponding vector points; wherein the starting vector point is the edge vector point among multiple edge vector points that is closest to the target vector corresponding to the first query.

[0053] In one possible implementation, the edge vector points are vector points that are outside the first threshold range from the center of the graph index.

[0054] A fourth aspect of this application provides a data processing apparatus, comprising:

[0055] A transceiver unit is used to receive a first request, which is used to instruct the addition of a first data vector.

[0056] The first processing unit is used to insert a first vector point into the graph index of the vector database, the first vector point being used to indicate a first data vector;

[0057] The second processing unit is used to determine multiple second vector points associated with the first vector point. The multiple second vector points are located at the Pareto front or approximately Pareto front of the first vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

[0058] In one possible implementation, the second processing unit is further configured to determine the applicable weight range for the edges connected to the first vector point based on the pruning strategy of the relative neighborhood graph.

[0059] In one possible implementation, the second processing unit is further configured to determine the edge vector points of the graph index, wherein the edge vector points are vector points that are outside the first threshold range from the center of the graph index.

[0060] In one possible implementation, the transceiver unit is further configured to receive a second request, which is used to instruct the deletion of the first data vector;

[0061] The first processing unit is also configured to delete the first vector point in the graph index of the vector database to update the graph index; or, regenerate the graph index.

[0062] In one possible implementation, the transceiver unit is also used to receive a third request, which is used to indicate modification of the first data vector;

[0063] The first processing unit is also used to delete the first vector point in the graph index of the vector database and insert a third vector point, the third vector point being used to indicate the second data vector, the second data vector being obtained by modifying the first data vector;

[0064] The second processing unit is also used to determine multiple fourth vector points associated with the third vector point. These multiple fourth vector points are located at the Pareto front or approximately Pareto front of the third vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

[0065] A fifth aspect of this application provides a data processing apparatus. The apparatus may include at least one processor, a memory, and a communication interface. The processor is coupled to the memory and the communication interface. The memory is used to store instructions, the processor is used to execute the instructions, and the communication interface is used to communicate with other devices under the control of the processor. When executed by the processor, the instructions cause the processor to perform the method of the first aspect or any possible implementation thereof.

[0066] A sixth aspect of this application provides a data processing apparatus. The apparatus may include at least one processor, a memory, and a communication interface. The processor is coupled to the memory and the communication interface. The memory is used to store instructions, the processor is used to execute the instructions, and the communication interface is used to communicate with other devices under the control of the processor. When executed by the processor, the instructions cause the processor to perform the methods of the second aspect or any possible implementation thereof.

[0067] The seventh aspect of this application provides a computer-readable storage medium storing one or more computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the processor performs a method as described in the first aspect or any possible implementation thereof.

[0068] The eighth aspect of this application provides a computer-readable storage medium storing one or more computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the processor performs a method as described in the second aspect above or any possible implementation thereof.

[0069] The ninth aspect of this application provides a computer program product storing one or more computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the processor executes the method described in the first aspect or any possible implementation thereof.

[0070] The tenth aspect of this application provides a computer program product storing one or more computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the processor executes the method described in the second aspect or any possible implementation thereof.

[0071] The eleventh aspect of this application provides a chip system including a processor for supporting a computer device in implementing the functions involved in the first aspect or any possible implementation thereof. In one possible design, the chip system may further include a memory for storing necessary program instructions and data. This chip system may be composed of chips or may include chips and other discrete devices.

[0072] The twelfth aspect of this application provides a chip system including a processor for supporting a computer device in implementing the functions involved in the second aspect or any possible implementation thereof. In one possible design, the chip system may further include a memory for storing necessary program instructions and data. This chip system may be composed of chips or may include chips and other discrete devices.

[0073] The thirteenth aspect of this application provides a database system including a scheduling node, wherein the scheduling node is used to execute the method of the first aspect or any possible implementation thereof, or the scheduling node is used to execute the method of the second aspect or any possible implementation thereof, and the database system may be a vector database.

[0074] The technical effects of the second to thirteenth aspects or any of their possible implementations can be found in the first aspect or the technical effects of different possible implementations of the first aspect, and will not be repeated here. Attached Figure Description

[0075] Figure 1A This is a schematic diagram of the architecture of a database system;

[0076] Figure 1B This is a schematic diagram of the architecture of a distributed database system provided in an embodiment of this application;

[0077] Figure 1C This is another schematic diagram of the architecture of the distributed database system provided in the embodiments of this application;

[0078] Figure 2This is a schematic diagram of the structure of the computer device or network device provided in the embodiments of this application;

[0079] Figure 3 This is an example schematic diagram of the relative neighborhood graph provided in the embodiments of this application;

[0080] Figure 4 This is an example schematic diagram of a multimodal data vector provided in an embodiment of this application;

[0081] Figure 5 This is a schematic diagram of the insertion operation process of the vector database provided in the embodiments of this application;

[0082] Figure 6A This is an example schematic diagram of graph index updating provided in an embodiment of this application;

[0083] Figure 6B This is an example schematic diagram of a Pareto front or an approximate Pareto front provided in the embodiments of this application;

[0084] Figure 6C This is an example schematic diagram of the graph index provided in the embodiments of this application;

[0085] Figure 6D and Figure 6E This is an example schematic diagram of edge vector points provided in the embodiments of this application;

[0086] Figure 6F This is a comparative diagram of the edge vector point strategy and the center vector point strategy provided in the embodiments of this application;

[0087] Figure 7 This is a schematic diagram of the deletion operation process of the vector database provided in the embodiments of this application;

[0088] Figure 8 This is another example of graph index updating provided in the embodiments of this application;

[0089] Figure 9 This is a schematic diagram of an embodiment of the query method provided in this application;

[0090] Figure 10 This is a schematic diagram of another embodiment of the query method provided in this application;

[0091] Figures 11A to 11C This is a schematic diagram illustrating an example of hybrid vector query provided in an embodiment of this application;

[0092] Figure 12 This is another structural schematic diagram of the data processing apparatus provided in the embodiments of this application;

[0093] Figure 13 This is another schematic diagram of the cluster database system provided in the embodiments of this application. Detailed Implementation

[0094] The embodiments of this application are described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. As those skilled in the art will understand, with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0095] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0096] This application provides a query method to improve the accuracy of query results and enhance the performance of a vector database. This application also provides an indexing method, corresponding apparatus, a computer-readable storage medium, and a computer program product. These will be described in detail below.

[0097] The method provided in this application embodiment can be applied to a database system. Figure 1A This illustrates a typical logical architecture of a database system, based on Figure 1A Database system 100 includes database 110 and database management system (DBMS) 130.

[0098] Database 110 is an organized collection of data stored in database storage 120, that is, a related collection of data organized, stored, and used according to a specific data model. Depending on the data model used to organize the data, the data can be divided into various types, such as relational data, graph data, and time series data. Relational data is data modeled using a relational model, usually represented as a table, where rows represent a set of related values ​​for an object or entity. Graph data, simply called a "graph," is used to represent relationships between objects or entities, such as social relationships. Time series data is a series of data columns recorded and indexed in chronological order, used to describe the state changes of an object over time. The database in this application is a vector database, meaning a database that stores data in vector form and uses vectors for retrieval. Vector data can also include relational databases, non-relational databases, or other types of databases; any database that includes data stored or retrieved in vector form can be called a vector database.

[0099] The database management system 130 is the core of the database system, serving as system software for organizing, storing, and maintaining data. Clients 200 can access the database 110 through the database management system 130, and database administrators also use the database management system for database maintenance. The database management system 130 provides various functions for clients 200 to create, modify, and query the database; clients 200 can be applications or user devices. The functions provided by the database management system 130 may include, but are not limited to, the following: (1) Data definition function: The database management system 130 provides a data definition language (DDL) to define the structure of the database 110. The DDL is used to describe the database framework and can be stored in the data dictionary; (2) Data access function: The database management system 130 provides a data manipulation language (DML) to implement basic access operations on the database 110, such as retrieval (query), insertion, modification and deletion; (3) Database operation management function: The database management system 130 provides data control function to effectively control and manage the operation of the database 110 to ensure that the data is correct and valid; (4) Database creation and maintenance function: including loading the initial data of the database, database dumping, recovery, reorganization, system performance monitoring and analysis, etc.; (5) Database transmission: The database management system provides data transmission to realize communication between the client and the database management system, which is usually coordinated with the operating system.

[0100] Database storage 120 includes, but is not limited to, solid-state drives (SSDs), disk arrays, cloud storage, or other types of non-transitory computer-readable storage media. Those skilled in the art will understand that a database system may include more than […]. Figure 1A The components shown are fewer or more components, or include those with Figure 1A The components shown are different components. Figure 1A Only components more relevant to the implementation disclosed in the embodiments of the present invention are shown.

[0101] The database system provided in this application embodiment can be a distributed database system (DDBS). DDBS is a logically unified database composed of multiple physically dispersed database units connected by a computer network. Each connected database unit is called a site or node. The following describes the process in conjunction with... Figure 1B and Figure 1C Introducing DDBS.

[0102] Figure 1B This diagram illustrates a distributed database system employing a shared-nothing architecture. The system includes one or more coordinator nodes (CNs) and multiple data nodes (DNs). The CNs manage and maintain the graph index of the vector database and can also assign tasks to the DNs, such as instructing one or more DNs to perform data insertion, deletion, modification, or query operations.

[0103] It should be noted that a distributed database system may also include one or more GTMs (such as...). Figure 1BThe system comprises a first GTM and a second GTM. The first GTM acts as the master GTM, while the second GTM backs up the data of the first GTM and takes over its operation when the first GTM fails, ensuring the high reliability of DDBS. CNs and DNs communicate via a network channel. Each DN has its own dedicated hardware resources (such as data storage), operating system, and database. CNs, DNs, the first GTM, or the second GTM communicate via a network channel. In one embodiment, this network channel can consist of network devices such as switches, routers, and gateways. CNs, DNs, and GTMs jointly implement the functions of the database management system, providing clients with services such as database querying (retrieval), insertion, modification, and deletion. In one embodiment, a database management system is deployed on each CN, DN, and GTM. In this distributed database system, data is allocated to various DNs according to the database model and application characteristics. Query tasks are divided into several parts by the CN and executed in parallel on multiple DNs, coordinating computation to provide database services as a whole. All communication functions can be implemented on a high-bandwidth network interconnection system.

[0104] In a distributed database system, the CN, DN, first GTM, or second GTM can be a physical machine, such as a database server, or a virtual machine (VM) or container running on abstract hardware resources. In one embodiment, the CN, DN, first GTM, or second GTM is a VM or container, and the network channel is a virtual switching network, which includes virtual switches. The database management system deployed in the CN, DN, first GTM, or second GTM is a DBMS instance, which can be a process or a thread. These DBMSs work together to complete the functions of the database relational system. In another embodiment, the CN, DN, first GTM, or second GTM is a physical machine, and the network channel includes one or more switches, which can be a storage area network (SAN) switch, an Ethernet switch, a fiber optic switch, or other physical switching equipment.

[0105] Figure 1C This is a schematic diagram of a distributed database system using a shared-storage architecture. Figure 1C In the distributed database system shown, a shared data storage device stores data that can be shared by multiple Data Nodes (DNs). DNs can perform read and write operations on the data in the data storage device via a network channel. The shared data storage device can be a shared disk array. The CNs, DNs, and the first or second GTM communicate via a network channel, which can be found in the above description. Figure 1BPlease refer to the relevant introductions for understanding. In this system, data can be stored in a shared data storage device. Query tasks are divided into several parts by the CN (Network Controller), executed in parallel on multiple DNs (Data Networks), and compute collaboratively, providing database services as a whole. All communication functions can be implemented on a high-bandwidth interconnected network. (Similar to...) Figure 1B Similar to the shared-nothing architecture of the distributed database system described, CN, DN, first GTM, or second GTM can be either physical machines or virtual machines.

[0106] In all embodiments of this application, the data storage of the database system includes, but is not limited to, SSDs, disk arrays, or other types of non-transient computer-readable media. Figure 1A-1C Although a database is not shown, it should be understood that a database is stored in a data storage device. Those skilled in the art will understand that a database system may include more than [a certain number of data storage devices]. Figure 1A-1C The components shown are fewer or more components, or include those with Figure 1A-1C The components shown are different components. Figure 1A-1C Only components more relevant to the implementation disclosed in the embodiments of this application are shown. However, those skilled in the art will understand that a distributed database system can contain any number of CNs and DNs. The database management system functions of each CN and DN can be implemented by appropriate combinations of software, hardware, and / or firmware running on each CN and DN.

[0107] The above Figure 1B and Figure 1C The described distributed database system includes multiple Data Domains (DNs) and multiple Data Centers (CNs). DNs are responsible for executing specific execution plans. Aside from the different data they store, DNs are architecturally identical and support various data distribution methods. CNs can be elected from DNs using an election algorithm or can adopt a different architecture. Depending on the specific deployment of the distributed database, there can be one or more CNs. Database modules can be deployed equally across CNs and DNs, and their roles within the distributed database can be configured through configuration files.

[0108] The query method or indexing method provided in this application embodiment can be applied to the above. Figure 1A The computer equipment where the database management system is located, Figure 1B or Figure 1CThe CN or DN in the text refers to either a computer device. Both CN and DN can represent a computer device. Furthermore, the query or indexing method provided in this application can also be applied to computer devices or network devices in non-distributed database systems; for example, a single computer device or network device constitutes a database system. Of course, the computer device or network device used to execute the query or indexing method provided in this application can be a physical machine or a virtual machine.

[0109] The computer equipment in this application embodiment can be a server or a terminal device. The terminal device, also known as user equipment (UE), mobile station (MS), or mobile terminal (MT), can be a handheld device or an in-vehicle device. Examples of current terminal devices include: mobile phones, tablets, laptops, PDAs, drones, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in vehicle-to-everything (V2X) communication, wireless terminals in self-driving cars, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, and wireless terminals in smart homes. For example, a wireless terminal in a V2X communication device can be an in-vehicle device, a complete vehicle device, an in-vehicle module, or a vehicle itself. In industrial control, wireless terminals can be cameras, robots, etc. In smart homes, wireless terminals can be televisions, air conditioners, robot vacuums, speakers, set-top boxes, etc.

[0110] The network device in this application embodiment can be a switch, router, gateway, or network card, etc.

[0111] For information on the structure of the computer device or network device used to execute the query method or index processing method provided in the embodiments of this application, please refer to [reference needed]. Figure 2 To understand.

[0112] like Figure 2 As shown, the computer device or network device may include an application layer 201, a system layer 202, and a hardware layer 203.

[0113] The application layer 201 can include multiple applications, each of which can access the database system of the system layer 201, thereby enabling the use of the database management system of the system layer 202. If it is a CN or DN in a distributed database system, the application can be a request sent by a client, and the database management system on the CN or DN can be a database management subsystem within the distributed database system.

[0114] System layer 202 includes the operating system (OS) and database management system. The operating system is a set of interconnected system software programs that manage and control computer operation, the use and execution of hardware and software resources, and the provision of public services to organize user interaction. Depending on the operating environment, operating systems can be categorized as desktop operating systems, mobile operating systems, server operating systems, embedded operating systems, etc. The operating system manages the computer system's hardware, software, and data resources, controls program execution, improves the human-computer interface, provides support for other application software, and maximizes the utilization of all computer system resources. The main functions of an operating system include process management, memory management, device management, file management, and job management.

[0115] The database management system is responsible for performing data insertion, deletion, modification, or query operations.

[0116] Hardware layer 203 includes a communication interface 2031, a processor 2032, and a storage device 2033. The communication interface 2031, processor 2032, and storage device 2033 can be interconnected via a bus. The storage device 2033 may include memory 20331 and external storage 20332, which is relative to memory 20331 and may be a persistent storage resource such as a hard disk.

[0117] In embodiments of this application, processor 2032 is used to control and manage the operations of network devices or computer devices. For example, processor 2022 is used to generate or update graph indexes. Communication interface 2031 is used to support communication between network devices or computer devices. Memory 20331 can be used to store information on graph indexes or portions of graph indexes, and external storage 20332 can be used to store data managed by a database management system.

[0118] The processor 2032 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, etc. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 2 The symbol is represented by only one line, but this does not mean that there is only one bus or one type of bus.

[0119] This application relates to graph indexes for vector databases. A graph index is an index that indicates the location of data storage in a vector database in the form of a graph. A graph index consists of multiple vector points and multiple edges. Each vector point indicates the storage location of a data vector in the vector database, and the edges indicate the proximity relationship between two vector points. Generally, only two vector points that satisfy the relative neighborhood graph (RNG) relationship are connected by an edge. Two vector points that do not satisfy the RNG relationship are not connected by an edge, or in other words, edges that do not satisfy the RNG relationship are pruned using a pruning strategy.

[0120] A Logical Generation Tool (RNG) is an undirected graph constructed based on distance relationships between points, commonly used in computational geometry, pattern recognition, and data analysis. Its core idea is to connect every two points in a set, provided that no other point is simultaneously closer to either of those two points. This graph construction method helps in analyzing the structure of data, especially when searching for natural "influence regions" or "neighborhoods" between data points, avoiding excessive redundant connections and highlighting key structural features. Figure 3 The diagram illustrates seven vector points, numbered 1 to 7. Multiple edges can connect these seven vector points, such as... Figure 3 In this algorithm, multiple triangles can be formed by connecting edges. For example, vector points 1, 2, and 3 form Δ123, vector point 3, vector point 4 and 5 form Δ345, and vector points 4, 6, and 7 form Δ467. In each triangle, the longest side does not meet the requirements of RNG. Removing the longest side from each triangle yields the RNG. Of course, Figure 3Points in the graph index can also be called nodes, and the names of points in the graph index are not limited in this application.

[0121] The graph index of the vector database in this application satisfies the RNG requirements; the graph index of the vector database can be found in [reference needed]. Figure 3 Let's understand RNG in this context.

[0122] Because vector databases support not only text vectors but also multimodal vectors such as images, audio, and video, the data items stored in a vector database are typically multimodal vectors. This means that a single data item's vector can be represented using vectors from multiple modalities, and each modal vector is usually assigned a weight when inserted into the vector database. For example... Figure 4 As shown, data vector A includes vectors for mode 1 and mode 2, where the weight of the mode 1 vector is 0.4 and the weight of the mode 2 vector is 0.6; data vector B includes vectors for mode 1, mode 2, and mode 3, where the weight of the mode 1 vector is 0.3 and the weight of the mode 2 vector is 0.3; the weight of the mode 3 vector is 0.4; data vector C includes a vector for mode 1, with a weight of 1. Data vector C can be understood as having weights of 0 for the other modes. Of course, this example uses the sum of the weights of all modes being 1. This application does not limit the sum of the weights; it can be greater than or less than 1.

[0123] In this application, "modality" refers to the form in which data or information is presented. For example, the same information can be conveyed through different means such as text, voice, images, or video. These different ways of conveying information can be understood as multimodal. For instance, information conveyed through text can be understood as one modality, and information conveyed through images can be understood as another modality. Additionally, the title content can be understood as one modality, and the body content as another. This application does not specifically limit the form of modality; anything that can be distinguished between two different forms can be understood as a different modality.

[0124] Because the graph index is generated or updated based on the corresponding weights during the storage process of data vectors, the weights on the graph index are also fixed. Therefore, if the weights of multiple vectors in the query do not match the weights on the graph index, accurate query results cannot be obtained, which affects the performance of the vector database.

[0125] Based on this, this application provides an indexing method that can obtain graph indexes applicable to various weights, enabling queries of various weights to obtain more accurate query results, thereby improving the performance of vector databases.

[0126] The following section describes the insertion, deletion, and modification operations in a vector database, as well as the changes to the graph index during these operations.

[0127] I. Insertion operation;

[0128] For instructions on inserting data vectors into a vector database, please refer to [link / reference]. Figure 5 To understand.

[0129] like Figure 5 As shown, the insertion process may include:

[0130] S501. The client sends the first request to the DBMS. Correspondingly, the DBMS receives the first request.

[0131] The first request is used to instruct the addition of a first data vector.

[0132] The form of the first data vector can be found in the above. Figure 4 The data vectors A, B, and C in the data vectors are interpreted as such, but this application does not limit this interpretation.

[0133] S502.DBMS inserts the first data vector into the vector database.

[0134] S503.DBMS inserts the first vector point into the graph index of the vector database. The first vector point is used to indicate the first data vector.

[0135] The first vector point can be inserted sequentially into the graph index and associated with the storage location of the first data vector in the vector database.

[0136] The SQL syntax for creating an index in this application can be:

[0137] CREATE VECTOR INDEX product_index

[0138] ON products

[0139] USING IVF_HNSW(

[0140] (title_vec),(description_vec) )

[0142] WITH(distance_type='COSINE');

[0143] As can be seen from the above syntax, the first data vector includes vectors of two modalities, namely the title vector (title_vec) and the description vector (description_vec), and no weights are assigned to these two modal vectors.

[0144] The process of inserting the first vector point into the graph index of a vector database by the DBMS can be found in [reference needed]. Figure 6A To understand this, the graph index before the update includes vector points 1 to 16. The first vector point can be labeled as vector point 17. Inserting vector point 17 into the graph index containing vector points 1 to 16 yields the updated graph index.

[0145] certainly, Figure 6A This is just an example of a graph index; in reality, a graph index would include a much larger number of vector points.

[0146] S504.DBMS determines multiple second vector points associated with the first vector point. These multiple second vector points are located at the Pareto front or approximately Pareto front of the first vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

[0147] A Pareto frontier is a solution in a multi-objective optimization problem that is Pareto optimal or undominated if no other solution is at least equal to it in all objectives and better in at least one objective. The set of all Pareto optimal solutions is called the Pareto frontier. These solutions represent different objective trade-offs; that is, to achieve improvement in one objective, one must sacrifice another.

[0148] An approximate Pareto front refers to a Pareto front determined by a greedy approximate search, which saves time in finding an exact Pareto front.

[0149] The points on the Pareto front or near-Pareto front are the set of vector points corresponding to different weight combinations that satisfy the same optimization objective. In a unimodal query, all weights except the first weight can be considered as zero, so the Pareto front or near-Pareto front includes vector points with various weight combinations.

[0150] In this application, the optimization objective can be set according to requirements, such as the weighted distance of multimodal vectors being within a certain threshold range.

[0151] For information on the Pareto front or near-Pareto front, please refer to [link / reference needed]. Figure 6B To understand, such as Figure 6B As shown, for example: if the optimization objective is to minimize the sum of multi-vector weighted distances, then the vector point with the smallest sum of multi-modal vector weighted distances to the first vector point can be searched from the graph index, for example: Figure 6BIf five points in the first layer satisfy this requirement, then these four points are points on the Pareto front or approximately on the Pareto front of the first vector point. The five points in the first layer can be combinations of different weights. For example, taking a weight sum of 1 as an example, they could be weight combinations of (0.1, 0.9), (0.2, 0.8), (0.3, 0.7), (0.4, 0.6), and (0.5, 0.5). The multimodal vector weighted distance sums calculated from these different weight combinations are all equal, and the first vector point has the smallest weighted distance sum on the graph index. Wherein, δ... e and δ s These represent the distances between different modal vectors.

[0152] If the number of 5 points in the first layer satisfies the nearest neighbor requirement for the first vector point, the process of determining the Pareto front can be terminated. If the number of 5 points does not satisfy the nearest neighbor requirement for the first vector point, a suboptimal objective can be set to determine more vector points from the graph index. For example, vector points whose weighted distance sum of multimodal vectors is slightly greater than the minimum weighted distance sum of multimodal vectors can be used as approximate Pareto fronts. Figure 6B The vector points in the second or third layer can be used as approximate Pareto front vector points of the first vector point.

[0153] pass Figure 6B Multiple vector points in the first, second, and third layers can be combined with various weights. Vector points in various weight combinations are all weighted nearest neighbors of the first vector point, and are all vector points on the Pareto front or approximately the Pareto front of the first vector point.

[0154] S505.DBMS determines the applicable weight range for the edges connected to the first vector point based on the pruning strategy of the relative neighborhood graph.

[0155] After determining the Pareto front or approximate Pareto front for the first vector point, various weight combinations can be determined. Each vector point in the graph index will have its corresponding Pareto front or approximate Pareto front. Therefore, vector points in the graph index can be applied to various weight combinations, meaning that the graph index can basically be applied to queries with various weights or weight combinations. However, two points may satisfy the relative neighborhood graph requirement under certain weights, but not under others. According to this principle, the weights that satisfy the relative neighborhood graph requirement are the weight range of the edge between the two points. For example, if the weight range of an edge is 0.5 to 0.9, it means that when the weight is between 0.5 and 0.9, the two points satisfy the relative neighborhood graph requirement; when the weight is not between 0.5 and 0.9, the two points do not satisfy the relative neighborhood graph requirement.

[0156] For a diagram illustrating the range of edge weights, please refer to [link / reference needed]. Figure 6CTo understand. For example Figure 6C As shown, each edge defines the weight range for which weights are used. This allows for selection within the corresponding weight range when performing a query based on the weights.

[0157] S506.DBMS determines the edge vector points of the graph index. Edge vector points are vector points that are outside the first threshold range from the center of the graph index.

[0158] In this application, the edge vector points change with the size of the graph index, and the value of the first threshold can also change with the size of the graph index.

[0159] For information on edge vector points, please refer to [link / reference]. Figure 6D and Figure 6E To understand. From Figure 6D and Figure 6E The comparison shows that the edge vector points change with the size of the graph index, and the value of the first threshold can also change with the size of the graph index.

[0160] The purpose of edge vector points is to determine the starting vector point for the query, such as... Figure 6F It can be seen that either the edge vector point strategy of S1 or the center vector point strategy of S2 can be used to determine the starting vector point for the query.

[0161] from Figure 6F As can be seen, the distances between the three edge vector points 1, 4, and 6 are relatively large, and the distances between query q and each edge vector point are also quite significant. For example, the distance between edge vector point 1 and query q is 0.64, the distance between edge vector point 4 and query q is 0.26, and the distance between edge vector point 6 and query q is 0.53. Therefore, we can choose edge vector point 4, which has the closest distance to query q, as the starting point for the query.

[0162] If the S2 center vector point strategy is adopted, the distances of the three vector points 2, 3, and 5 to the query are all very close. For example, the distance between vector point 2 and query q is 0.32, the distance between vector point 3 and query q is 0.23, and the distance between vector point 5 and query q is 0.25. In this case, it is difficult to directly select a vector point as the starting vector point to start the query, which will lead to the need to calculate the distance between query q and multiple vector points, resulting in redundant calculations.

[0163] Compared to S2, the S1 approach allows us to directly select the vector point 4 closest to the query q from among the three edge vector points 1, 4, and 6, without needing to calculate the distance between the query q and multiple vector points, thus saving computational resources.

[0164] The above describes the graph index processing procedure during the insertion operation. As can be seen from the above process, because the vector points on the graph index have Pareto fronts or approximate Pareto fronts with various weight combinations, the graph index can be applied to queries with various weights, thereby improving the accuracy of queries and improving the performance of the vector database.

[0165] II. Deletion operation;

[0166] For the deletion process in the vector database, please refer to [link / reference]. Figure 7 To understand. For example Figure 7 As shown, the process includes:

[0167] S701. The client sends a second request to the DBMS. Correspondingly, the DBMS receives the second request.

[0168] The second request is used to instruct the deletion of the first data vector; the deletion of the first vector point in the graph index of the vector database to update the graph index; or, the regeneration of the graph index.

[0169] S702.DBMS deletes the first data vector in the vector database.

[0170] S703.DBMS deletes the first vector point in the graph index of the vector database.

[0171] The process of deleting the first vector point in the graph index of a vector database by the DBMS can be found in [reference needed]. Figure 8 To understand this, the graph index before the update includes vector points 1 to 17. Removing vector point 17 from the graph index yields the updated graph index, which includes vector points 1 to 16.

[0172] III. Modification Operations;

[0173] The modification process for the vector database can be a process of deletion followed by insertion. This process may include: receiving a third request, which indicates the modification of a first data vector; deleting the first vector point in the graph index of the vector database and inserting a third vector point, which indicates a second data vector obtained by modifying the first data vector; and determining multiple fourth vector points associated with the third vector point, where the multiple fourth vector points are located at the Pareto front or approximate Pareto front of the third vector point. The Pareto front or approximate Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

[0174] For an explanation of the deletion and insertion processes, please refer to the previous sections on deletion and insertion operations; they will not be repeated here.

[0175] Having described the graph indexing process above, the following section, with reference to the accompanying diagram, introduces the query method. Vector querying typically refers to finding vectors similar to the query vector in a high-dimensional vector space. It is mainly used for high-dimensional data retrieval and similarity searching, and usually employs approximate nearest neighbor search. Approximate nearest neighbor search is a technique for quickly finding vector points that are "sufficiently close" to the query vector on large-scale, high-dimensional datasets.

[0176] like Figure 9 As shown, the query method provided in this application embodiment includes:

[0177] S901. The client sends the first query. Correspondingly, the DBMS receives the first query.

[0178] The first query is used to indicate the query vector for the first modality.

[0179] In this application, the first query can be a Structured Query Language (SQL) statement. The first query may include one or more query vectors, and the weights corresponding to each query vector can be configured by the user in the first query, or they can be obtained by the DBMS based on the semantic information in the first query.

[0180] S902.DBMS obtains the first weight based on the first query, and the first weight corresponds to the query vector of the first modality;

[0181] If the first weight is configured in the first query, the DBMS can parse the first weight from the first query. If the first weight is not configured in the first query, the DBMS can carefully determine the first weight based on the semantic information of the first query.

[0182] S903.DBMS determines a first vector point from the graph index of the vector database based on a first weight. The graph index includes the first vector point and multiple second vector points. The multiple second vector points are located at the Pareto front or approximately Pareto front of the first vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective. The first vector point is the vector point among the vector points that satisfy the first weight and whose distance to the target vector meets the first requirement. The target vector is the vector corresponding to the first query. The data vector corresponding to the first vector point is the query result of the first query.

[0183] In the solution provided in this application embodiment, since the graph index is constructed based on the Pareto front or approximately the Pareto front, and the graph index contains vector points with various weight combinations, no matter what the first weight of the query vector in the first query is, or how the first weight changes, the first vector point that matches the first weight of the first query and is closest to the target vector can be found on the graph index to obtain the query result, thereby improving the accuracy of the query result.

[0184] If the above query is a hybrid vector query, then S902 may include obtaining a first weight and a second weight based on the first query; S903 may include: determining a first vector point from the graph index of the vector database based on the first weight, including: determining a first vector point from the graph index of the vector database based on the first weight and the second weight, wherein the first vector point is the vector point that is closest to the target vector among the vector points that satisfy the first weight and the second weight, and the target vector includes the query vector of the first modality and the query vector of the second modality.

[0185] If the first query involves multiple query vectors, then the query process is a hybrid vector query. A hybrid vector query is a multimodal query in which each query consists of multiple vectors, and each data vector is also represented by multiple vectors. The hybrid vector query process finds the most matching data vector by assigning different weights to each vector.

[0186] The following example, which involves query vectors of two modalities in the first query, illustrates the process of mixed vector query.

[0187] like Figure 10 As shown, the query process includes:

[0188] S1001. The client sends the first query. Correspondingly, the DBMS receives the first query.

[0189] S1002.DBMS determines the first weight and the second weight based on the first query.

[0190] The first weight is used to indicate the query vector of the first modality, and the second weight is used to indicate the query vector of the second modality.

[0191] S1003.DBMS determines the starting vector point from the edge vector points.

[0192] The process of determining the starting vector point can be found in [reference needed]. Figure 11A To understand, such as Figure 11A As shown, there are three edge vector points on the graph index: edge vector point 1, edge vector point 11, and edge vector point 12. (Refer to the above...) Figure 6FThe principle of the edge vector point strategy in S1 is to determine that edge vector 1 is the closest to the target vector corresponding to the first query, and then edge vector point 1 is used as the starting vector point.

[0193] S1004.DBMS starts from the initial vector point and selects the first relative neighborhood graph that satisfies the first weight and the second weight from the graph index.

[0194] The process of selecting the first relative neighborhood graph can be found in [reference needed]. Figure 11B Let's understand this. Taking an example with a first weight α1 = 0.4 and a second weight α2 = 0.6, Figure 11B Each edge on the graph index shown has an applicable weight range. Starting from the starting vector point (i.e., edge vector point 1), routing is performed based on α1 = 0.4 and α2 = 0.6. The edges containing α1 = 0.4 and α2 = 0.6 are selected from the graph index for routing.

[0195] The routing process can include starting from vector point 1. The weight range of the edge between vector point 1 and vector point 2 is [0, 0.8], including α1 = 0.4 and α2 = 0.6, so the route is from vector point 1 to vector point 2. Vector point 2 is connected by three edges: the edge connected to vector point 0, the edge connected to vector point 3, and the edge connected to vector point 6. The weight range of the edge connected to vector point 0 is [0, 0.3], excluding α1 = 0.4 and α2 = 0.6, so it is not selected; the weight range of the edge connected to vector point 3 is [0.3, 0.5], including α1 = 0.4 but excluding α2 = 0.6, so it is not selected; the weight range of the edge connected to vector point 6 is [0.2, 0.8], including α1 = 0.4 and α2 = 0.6, so the route is from vector point 2 to vector point 6. Vector point 6 is connected by two edges: one connecting to vector point 7 and the other to vector point 8. The weight of the edge connecting to vector point 7 is in the range [0.5, 0.9], excluding α1 = 0.4 but including α2 = 0.6, so it is not selected. The weight of the edge connecting to vector point 8 is in the range [0.2, 0.6], including α1 = 0.4 and α2 = 0.6. Therefore, the route from vector point 6 to vector point 8 is possible. Vector point 8 is connected by two edges: one connecting to vector point 9 and the other to vector point 12. The weight of the edge connecting to vector point 8 is in the range [0.2, 0.9], including α1 = 0.4 and α2 = 0.6. The weight of the edge connecting to vector point 12 is in the range [0.4, 0.9], including α1 = 0.4 and α2 = 0.6. Therefore, the route from vector point 8 to vector point 12 is possible, and the route can also be routed to vector point 9. Since vector point 12 is no longer connected to any other edges, the branch route for vector point 12 ends. Vector point 9 connects to vector point 10. The weight of the edge between vector points 9 and 10 ranges from [0.5, 0.9], excluding α1 = 0.4 and including α2 = 0.6. Therefore, the route cannot continue downwards, ending at vector point 9. Because the routes for both vector points 9 and 12 have ended, the entire routing process concludes, yielding the desired result. Figure 11C The first relative neighborhood graph is shown.

[0196] S1005.DBMS determines the first vector point that is closest to the weighted distance of the first query from the first relative neighborhood graph.

[0197] If, after calculation, it is determined that vector point 8 has the closest weighted distance to the first query among the six vector points in the first relative neighborhood graph, then vector point 8 is determined as the vector point on the index graph corresponding to the data vector to be queried.

[0198] S1006.DBMS reads the first data vector from the vector database based on the first vector point.

[0199] S1007.DBMS returns the first data vector to the client.

[0200] The query scheme provided in this application can reduce invalid queries and improve the speed of querying the first vector point by using edge vector points and filtering the relative neighborhood graph based on weight range. Moreover, regardless of the first and second weights of the query vector in the first query, or how the first and second weights change, the first vector point that matches the first weight and second weight of the first query and is closest to the target vector can be found on the graph index to obtain the query result, thereby improving the accuracy of the query result.

[0201] The above embodiments describe index processing methods and query methods. The data processing apparatus 1200 provided in the embodiments of this application is described below with reference to the accompanying drawings.

[0202] like Figure 12 As shown, during the indexing process, the data processing apparatus 1200 provided in this application embodiment can be the DBMS described above. The data processing apparatus 1200 includes:

[0203] Transceiver unit 1201 is used to receive a first request, the first request being used to instruct the addition of a first data vector;

[0204] The first processing unit 1202 is used to insert a first vector point into the graph index of the vector database, the first vector point being used to indicate a first data vector;

[0205] The second processing unit 1203 is used to determine multiple second vector points associated with the first vector point. The multiple second vector points are located at the Pareto front or approximately Pareto front of the first vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

[0206] Optionally, the second processing unit 1203 is further configured to determine the weight range of the applicable weights for the edges connected to the first vector point according to the pruning strategy of the relative neighborhood graph.

[0207] Optionally, the second processing unit 1203 is further configured to determine the edge vector points of the graph index, wherein the edge vector points are vector points that are outside the first threshold range from the center of the graph index.

[0208] Optionally, the transceiver unit 1201 is also configured to receive a second request, the second request being used to instruct the deletion of the first data vector;

[0209] The first processing unit is also configured to delete the first vector point in the graph index of the vector database to update the graph index; or, regenerate the graph index.

[0210] Optionally, the transceiver unit 1201 is also configured to receive a third request, which is used to indicate modification of the first data vector;

[0211] The first processing unit 1202 is further configured to delete a first vector point in the graph index of the vector database and insert a third vector point, wherein the third vector point is used to indicate a second data vector, and the second data vector is obtained by modifying the first data vector.

[0212] The second processing unit 1203 is also used to determine multiple fourth vector points associated with the third vector point. The multiple fourth vector points are located at the Pareto front or approximately Pareto front of the third vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

[0213] like Figure 12 As shown, during the query process, the data processing device 1200 provided in this application embodiment can be the DBMS described above. The data processing device 1200 includes:

[0214] The transceiver unit 1201 is used to receive a first query, which is used to indicate a query vector of a first mode;

[0215] The first processing unit 1202 is used to obtain a first weight based on a first query, wherein the first weight corresponds to the query vector of the first modality;

[0216] The second processing unit 1203 is used to determine a first vector point from the graph index of the vector database based on a first weight; wherein the graph index includes the first vector point and multiple second vector points, the multiple second vector points are located at the Pareto front or approximately Pareto front of the first vector point, the Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations under the same optimization objective; the first vector point is the vector point among the vector points that satisfy the first weight and whose distance to the target vector meets the first requirement, the target vector is the vector corresponding to the first query; the data vector corresponding to the first vector point is the query result of the first query.

[0217] Optionally, the first processing unit 1202 is configured to obtain a first weight and a second weight based on the first query, provided that the first query is also used to indicate a query vector of the second modality.

[0218] The second processing unit 1203 is used to determine a first vector point from the graph index of the vector database based on a first weight and a second weight. The first vector point is the vector point that is closest to the target vector among the vector points that satisfy the first weight and the second weight. The target vector includes the query vector of the first modality and the query vector of the second modality.

[0219] Optionally, the sum of the multimodal vector weighted distances between the vector points on the Pareto front or the approximate Pareto front and the first vector point is minimized.

[0220] Optionally, the second processing unit 1203 is used to filter out a first relative neighborhood graph that satisfies the first weight from the graph index; wherein the two closest vector points on the graph index are connected by an edge, each edge on the graph index has a weight range of applicable weights, and the weight range of each edge on the first relative neighborhood graph includes the first weight; on the first relative neighborhood graph, the first vector point that is closest to the target vector is determined.

[0221] Optionally, if the first query is also used to indicate the query vector of the second modality, then the weight range of each edge on the first relative neighborhood graph also includes the second weight.

[0222] Optionally, the second processing unit 1203 is configured to start from the starting vector point and, based on the first weight and the weight range of the edges on the graph index, perform routing on the graph index to determine the edges on the graph index that include the first weight and the corresponding vector points; wherein, the starting vector point is the edge vector point among multiple edge vector points that is closest to the target vector corresponding to the first query.

[0223] Optionally, the edge vector point is the vector point outside the first threshold range of the distance to the center of the graph index.

[0224] See Figure 13 This application also provides a clustered database system, including: a hardware layer 1307 and a virtual machine monitor (VMM) 1301 running on the hardware layer 1307, and multiple virtual machines 1302. A virtual machine can serve as a read node or a write node in the clustered database system. Optionally, a virtual machine can also be designated as a coordinating node.

[0225] Specifically, Virtual Machine 1302 is a virtual computer simulated on public hardware resources using virtual machine software. Operating systems and applications can be installed on the virtual machine, and it can also access network resources. For applications running in the virtual machine, it's as if they are working on a real computer.

[0226] Hardware Layer 1307: The hardware platform running in the virtualized environment, which can be abstracted from the hardware resources of one or more physical hosts. The hardware layer may include various hardware components, such as a processor 1304 (e.g., CPU) and memory 1305, as well as a network interface card 1303 (e.g., RDMA network card), high-speed / low-speed input / output (I / O) devices, and other devices with specific processing functions.

[0227] Virtual machine 1302, based on the VMM and the hardware resources provided by hardware layer 1307, runs executable programs to implement some or all of the functions of the DBMS in the above method embodiments. For the sake of brevity, it will not be described in detail here.

[0228] Furthermore, the clustered database system may also include a host: acting as a management layer to manage and allocate hardware resources; presenting a virtual hardware platform for virtual machines; and implementing virtual machine scheduling and isolation. The host may be a Virtual Machine Monitor (VMM); or it may be a combination of a VMM and a privileged virtual machine. The virtual hardware platform provides various hardware resources to the virtual machines running on it, such as virtual processors (e.g., VCPUs), virtual memory, virtual disks, virtual network cards, etc. The virtual disk may correspond to a file or a logical block device on the host. Virtual machines run on the virtual hardware platform prepared for them by the host, and one or more virtual machines run on the host. The VCPU of virtual machine 1302 executes an executable program stored in its corresponding virtual memory to implement or perform the method steps described in the above-described method embodiments of the present invention. For example, it implements some or all of the functions of the DBMS in the above-described method embodiments.

[0229] In another embodiment of this application, a computer-readable storage medium is also provided, which stores computer-executable instructions. When at least one processor of the device executes the computer-executable instructions, the device performs some or all of the functions of the DBMS in the above method embodiment.

[0230] In another embodiment of this application, a computer program product is also provided, which includes computer-executable instructions stored in a computer-readable storage medium; at least one processor of the device can read the computer-executable instructions from the computer-readable storage medium, and the at least one processor executes the computer-executable instructions to cause the device to perform some or all of the functions of the DBMS in the above method embodiment.

[0231] In another embodiment of this application, a chip system is also provided, which includes a processor for supporting the DBMS in implementing the aforementioned index processing method or query method. In one possible design, the chip system may further include a memory for coordinating the necessary program instructions and data for the nodes. This chip system may be composed of chips or may include chips and other discrete devices.

[0232] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0233] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0234] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0235] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0236] In addition, the functional units in the various embodiments of this application 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.

[0237] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this application, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A query method, characterized in that, include: Receive a first query, which is used to indicate a query vector of a first modality; A first weight is obtained based on the first query, and the first weight corresponds to the query vector of the first modality; Based on the first weight, a first vector point is determined from the graph index of the vector database; wherein, the graph index includes the first vector point and a plurality of second vector points, the plurality of second vector points being located at the Pareto front or approximately Pareto front of the first vector point, the Pareto front or approximately Pareto front being a set of vector points corresponding to different weight combinations satisfying the same optimization objective; the first vector point is a vector point among the vector points satisfying the first weight whose distance to the target vector satisfies a first requirement, the target vector being the vector corresponding to the first query; the data vector corresponding to the first vector point is the query result of the first query.

2. The method according to claim 1, characterized in that, The first query is also used to indicate the query vector of the second modality; The step of obtaining the first weight based on the first query includes: The first weight and the second weight are obtained based on the first query; The step of determining the first vector point from the graph index of the vector database based on the first weight includes: Based on the first weight and the second weight, a first vector point is determined from the graph index of the vector database. The first vector point is the vector point that is closest to the target vector among the vector points that satisfy the first weight and the second weight. The target vector includes the query vector of the first modality and the query vector of the second modality.

3. The method according to claim 1 or 2, characterized in that, The sum of the multimodal vector weighted distances between the vector points on the Pareto front or the approximate Pareto front and the first vector point is minimized.

4. The method according to any one of claims 1-3, characterized in that, The step of determining the first vector point from the graph index of the vector database based on the first weight includes: A first relative neighborhood graph that satisfies the first weight is selected from the graph index; wherein, the two closest vector points on the graph index are connected by an edge, each edge on the graph index has a weight range of applicable weight, and the weight range of each edge on the first relative neighborhood graph includes the first weight. On the first relative neighborhood graph, determine the first vector point that is closest to the target vector.

5. The method according to claim 4, characterized in that, If the first query is also used to indicate the query vector of the second modality, then the weight range of each edge on the first relative neighborhood graph also includes the second weight.

6. The method according to claim 4 or 5, characterized in that, The step of filtering the first relative neighborhood graph that satisfies the first weight from the graph index includes: Starting from the initial vector point, routing is performed on the graph index according to the first weight and the weight range of the edges on the graph index to determine the edges on the graph index that include the first weight and the corresponding vector points; wherein, the initial vector point is the edge vector point among multiple edge vector points that is closest to the target vector corresponding to the first query.

7. The method according to claim 6, characterized in that, The edge vector point is a vector point that is outside the first threshold range from the center of the graph index.

8. An index processing method, characterized in that, include: Receive a first request, the first request being used to instruct the addition of a first data vector; Insert a first vector point into the graph index of the vector database, the first vector point being used to indicate the first data vector; Determine multiple second vector points associated with the first vector point. The multiple second vector points are located at the Pareto front or approximately Pareto front of the first vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

9. The method according to claim 8, characterized in that, The method further includes: determining the applicable weight range for the edges connected to the first vector point according to the pruning strategy of the relative neighborhood graph.

10. The method according to claim 8 or 9, characterized in that, The method further includes: Determine the edge vector points of the graph index, wherein the edge vector points are vector points that are outside the first threshold range from the center of the graph index.

11. The method according to any one of claims 8-10, characterized in that, The method further includes: Receive a second request, which instructs the deletion of the first data vector; Delete the first vector point in the graph index of the vector database to update the graph index; or, regenerate the graph index.

12. The method according to any one of claims 8-10, characterized in that, The method further includes: Receive a third request, the third request being used to instruct modification of the first data vector; The first vector point is deleted from the graph index of the vector database, and a third vector point is inserted. The third vector point is used to indicate a second data vector, which is obtained by modifying the first data vector. Determine multiple fourth vector points associated with the third vector point. These multiple fourth vector points are located at the Pareto front or approximately Pareto front of the third vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

13. A data processing apparatus, characterized in that, include: A transceiver unit is used to receive a first query, wherein the first query is used to indicate a query vector of a first modality; The first processing unit is configured to obtain a first weight based on the first query, wherein the first weight corresponds to a query vector of a first modality; The second processing unit is configured to determine a first vector point from the graph index of the vector database based on the first weight; wherein the graph index includes the first vector point and a plurality of second vector points, the plurality of second vector points being located at the Pareto front or approximately Pareto front of the first vector point, the Pareto front or approximately Pareto front being a set of vector points corresponding to different weight combinations satisfying the same optimization objective; the first vector point is a vector point among the vector points satisfying the first weight whose distance to the target vector satisfies a first requirement, the target vector being the vector corresponding to the first query; the data vector corresponding to the first vector point is the query result of the first query.

14. The apparatus according to claim 13, characterized in that, The first processing unit is configured to obtain the first weight and the second weight based on the first query, provided that the first query is also used to indicate a query vector of the second modality. The second processing unit is configured to determine a first vector point from the graph index of the vector database based on the first weight and the second weight. The first vector point is the vector point that is closest to the target vector among the vector points that satisfy the first weight and the second weight. The target vector includes the query vector of the first modality and the query vector of the second modality.

15. A data processing apparatus, characterized in that, include: A transceiver unit is configured to receive a first request, wherein the first request is configured to instruct the addition of a first data vector; The first processing unit is configured to insert a first vector point into the graph index of the vector database, the first vector point being used to indicate the first data vector; The second processing unit is used to determine a plurality of second vector points associated with the first vector point. The plurality of second vector points are located at the Pareto front or approximately Pareto front of the first vector point. The Pareto front or approximately Pareto front is a set of vector points corresponding to different weight combinations that satisfy the same optimization objective.

16. The apparatus according to claim 15, characterized in that, The second processing unit is further configured to determine the applicable weight range for the edges connected to the first vector point based on the pruning strategy of the relative neighborhood graph.

17. The apparatus according to claim 15 or 16, characterized in that, The second processing unit is further configured to determine the edge vector points of the graph index, wherein the edge vector points are vector points that are outside the first threshold range from the center of the graph index.

18. A data processing apparatus, characterized in that, Includes a processor and a computer-readable storage medium storing a computer program; The processor is coupled to the computer-readable storage medium, and the computer program, when executed by the processor, implements the method as described in any one of claims 1-7, or the method as described in any one of claims 8-12.

19. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7, or the method as described in any one of claims 8-12.

20. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer device, causes the computer device to perform the method as described in any one of claims 1-7, or the method as described in any one of claims 8-12.