Vector database multi-copy cluster management system and method
Through the vector database multi-replica cluster management system, the load balancing module and proxy service module are used to solve the problems of insufficient performance of vector database and insufficient support for multi-replica modes, efficient data processing and storage are achieved, and the performance of the business system is improved.
Patent Information
- Application Number
- CN202411237868.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-27
AI Technical Summary
The existing vector databases have insufficient performance when processing high-dimensional vector data, which cannot meet the retrieval needs of business systems, and some databases cannot implement the multi-copy mode, resulting in low data processing efficiency.
Design a vector database multi-replica cluster management system, including a load balancing module and multiple vector database proxy service modules, receive and forward user requests through the load balancing module, ensure that the request is distributed to a normal-state vector database copy for processing, and Data synchronization and retrieval operations are performed between replicas to achieve efficient data processing.
It realizes unified management of multi-replica clusters of different types of vector databases, improves data processing efficiency, and even when a single node is down, vector databases in multi-replica mode can still provide storage and retrieval services efficiently.
Smart Images

Figure CN119201442A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a vector database multi-copy cluster management system and method. Background Art
[0002] At present, with the advent of the big data era, the amount of data and data dimensions are constantly growing. Traditional relational databases face a large performance bottleneck when processing high-dimensional vector data. Vector databases, with their specific data structure, can more efficiently store and retrieve high-dimensional vector data to meet big data processing requests. However, in some scenarios, the original performance of the vector database cannot meet the retrieval requirements of the business system. At this time, it is necessary to set up multiple copies of the vector database to meet the retrieval requirements. However, although some vector databases support clustering capabilities, they cannot achieve multi-copy mode, resulting in low data processing efficiency of the system. For this reason, it is urgent to design a general vector database multi-copy cluster management solution to improve the processing efficiency of vector data by the business system.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a vector database multi-copy cluster management system and method, so as to at least solve the technical problem that the related technology cannot uniformly manage different types of vector database multi-copy clusters, resulting in low data processing efficiency.
[0005] According to one aspect of an embodiment of the present application, a vector database multi-copy cluster management system is provided, the system comprising: a load balancing module, a plurality of vector database proxy service modules, and each vector database proxy service module corresponds to a vector database copy, wherein the load balancing module is used to receive a vector data processing request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier of a target instance for performing a processing operation on vector data; forwarding the vector data processing request message to a first vector database proxy service module corresponding to a first vector database copy in the target instance according to the instance identifier, wherein the target instance comprises a plurality of vector database copies storing the same vector data, and the first vector database copy is any one of the plurality of vector database copies in the target instance that is in a normal state; feeding back the processing result returned by the first vector database proxy service module corresponding to the first vector database copy to the user terminal; the first vector database proxy service module is used to perform corresponding processing operations on the vector data according to the vector data processing request message, obtain corresponding processing results, and feed back the processing results to the load balancing module.
[0006] Optionally, the load balancing module is also used to determine the instance status of the target instance corresponding to the instance identifier; when the instance status is normal, determine the first vector database copy whose copy status within the target instance is normal, and forward the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy; when the instance status is abnormal, feedback the corresponding vector data processing failure response message to the user terminal.
[0007] Optionally, the load balancing module is also used to send a heartbeat detection signal to the vector database proxy service module corresponding to each vector database copy in the target instance; determine the copy status of each vector database copy according to whether each vector database proxy service module feeds back a corresponding response signal within a preset time period, including: when the vector database proxy service module feeds back a corresponding response signal within a preset time period, determine that the copy status of the vector database copy corresponding to the vector database proxy service module is a normal state; when the vector database proxy service module does not feed back a corresponding response signal within the preset time period, determine that the copy status of the vector database copy corresponding to the vector database proxy service module is an abnormal state; determine the instance status of the target instance according to the copy status of each vector database copy in the target instance, including: when the copy status of any vector database copy in the target instance is a normal state, determine that the instance status of the target instance is a normal state; when the copy status of all vector database copies in the target instance are abnormal states, determine that the instance status of the target instance is an abnormal state.
[0008] Optionally, the processing operation at least includes: a synchronization operation, wherein the load balancing module is also used to receive a vector data synchronization request message initiated by a user terminal, wherein the vector data processing request carries at least the instance identifier of the target instance on which the vector data synchronization operation is performed; forwarding the vector data synchronization request message to the first vector database copy proxy service module corresponding to the first vector database copy in the target instance according to the instance identifier; the first vector database proxy service module is used to write the vector data into the corresponding first vector database copy, and when the writing is successful, push the first copy identifier of the first vector database copy and the vector data to the Kafka message queue corresponding to the target instance; the second vector database proxy service module is used to determine whether the second copy identifier of the second vector database copy is the same as the first copy identifier when the corresponding second vector database copy consumes the vector data in the Kafka message queue; when the second copy identifier is different from the first copy identifier, write the vector data into the second vector database copy, and feed back the writing result to the load balancing module, wherein the second vector database copy is other vector database copies except the first vector database copy among the multiple vector database copies in the target instance.
[0009] Optionally, the load balancing module is further configured to feed back the writing result returned by the second vector database proxy service module corresponding to the second vector database copy to the user terminal.
[0010] Optionally, the processing operation also includes: a retrieval operation, wherein the load balancing module is also used to receive a vector data retrieval request message initiated by a user terminal, wherein the vector data retrieval request message carries at least an instance identifier of a target instance for performing a retrieval operation on vector data; forwarding the vector data processing request message to a first vector database proxy service module corresponding to a first vector database copy in the target instance based on the instance identifier; the first vector database proxy service module is also used to perform a search in the corresponding first vector database copy based on the vector data processing request message, and feed back the retrieval result to the load balancing module.
[0011] Optionally, the vector database type of the vector database copy includes at least one of the following: an open source vector database, a video memory vector database.
[0012] According to another aspect of an embodiment of the present application, a vector database multi-copy cluster management method is also provided, which is applied to a load balancing module, including: receiving a vector data processing request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier of a target instance for performing processing operations on vector data; forwarding the vector data processing request message to a first vector database proxy service module corresponding to a first vector database copy in the target instance based on the instance identifier, wherein the target instance includes multiple vector database copies storing the same vector data, the first vector database copy is any one of the multiple vector database copies in the target instance that is in a normal state, and the first vector database proxy service module is used to perform corresponding processing operations on the vector data based on the vector data processing request message, obtain corresponding processing results, and feed back the processing results to the load balancing module; and feed back the processing results returned by the first vector database proxy service module corresponding to the first vector database copy to the user terminal.
[0013] Optionally, before forwarding the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy in the target instance based on the instance identifier, the method also includes: determining the instance status of the target instance corresponding to the instance identifier; when the instance status is normal, determining the first vector database copy in the target instance whose copy status is normal, and forwarding the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy; when the instance status is abnormal, feeding back a corresponding vector data processing failure response message to the user terminal.
[0014] Optionally, determining the instance state of the target instance corresponding to the instance identifier includes: sending a heartbeat detection signal to the vector database proxy service module corresponding to each vector database copy in the target instance; determining the replica state of each vector database copy according to whether each vector database proxy service module feeds back a corresponding response signal within a preset time period, including: when the vector database proxy service module feeds back a corresponding response signal within a preset time period, determining that the replica state of the vector database copy corresponding to the vector database proxy service module is a normal state; when the vector database proxy service module does not feed back a corresponding response signal within the preset time period, determining that the replica state of the vector database copy corresponding to the vector database proxy service module is an abnormal state; determining the instance state of the target instance according to the replica state of each vector database copy in the target instance, including: when the replica state of any vector database copy in the target instance is a normal state, determining that the instance state of the target instance is a normal state; when the replica states of all vector database copies in the target instance are abnormal states, determining that the instance state of the target instance is an abnormal state.
[0015] Optionally, the processing operation includes at least one of the following: a synchronization operation, a retrieval operation.
[0016] According to another aspect of an embodiment of the present application, an electronic device is further provided, comprising: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned vector database multi-copy cluster management method through the computer program.
[0017] In an embodiment of the present application, a load balancing module in a vector database multi-copy cluster management system first receives a vector data processing request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier of a target instance for performing processing operations on the vector data; then, the load balancing module forwards the vector data processing request message to a first vector database proxy service module corresponding to a first vector database copy in the target instance based on the instance identifier, wherein the target instance includes multiple vector database copies storing the same vector data, and the first vector database copy is any one of the multiple vector database copies in the target instance that is in a normal state; then, the first vector database proxy service module performs corresponding processing operations on the vector data based on the vector data processing request message, obtains corresponding processing results, and feeds back the processing results to the load balancing module; finally, the load balancing module feeds back the processing results returned by the first vector database proxy service module corresponding to the first vector database copy to the user terminal. Therefore, the vector database multi-copy cluster management system adapts to all types of vector databases and processes vector data processing requests initiated by users through a multi-copy mode, so that even when a single node crashes, the vector database in the multi-copy mode can still efficiently provide storage and retrieval services, thereby solving the technical problem that related technologies cannot uniformly manage multi-copy clusters of different types of vector databases, resulting in low data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 It is a structural diagram of an optional vector database multi-copy cluster management system according to an embodiment of the present application;
[0020] Figure 2 It is a schematic diagram of a vector data synchronization process of an optional vector database multi-copy cluster according to an embodiment of the present application;
[0021] Figure 3 It is a schematic diagram of a vector data retrieval process of an optional vector database multi-copy cluster according to an embodiment of the present application;
[0022] Figure 4 It is a flowchart of an optional vector database multi-copy cluster management method according to an embodiment of the present application;
[0023] Figure 5 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] In addition, the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0027] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0028] Vector database: A database specifically used to store and query vectors. The vectors stored in it come from the vectorization of text, speech, images, videos, etc., and different indexes are provided to provide vector similarity search.
[0029] Instance: In a database, an instance represents a collection of programs. For example, in Oracle, an instance is a set of database programs that support the operation of the database.
[0030] Multiple copies: refers to storing the same data on multiple server nodes to ensure data reliability and availability, so that if a node fails, copies on other nodes can continue to provide services. It is also a technical means to improve data query performance.
[0031] Kafka is a distributed messaging system that supports partitions, multiple copies, and Zookeeper coordination. Its biggest feature is that it can process large amounts of data in real time to meet various demand scenarios.
[0032] Decentralization, also known as decentralization, means that when a vector database implements multi-copy data synchronization, there is no single central node to control it. All copies can accept requests and process data, and achieve data synchronization and consistency between copies.
[0033] Example 1
[0034] The present application embodiment provides an embodiment of a vector database multi-copy cluster management system, Figure 1 is a schematic diagram of the structure of an optional vector database multi-copy cluster management system according to an embodiment of the present application, such as Figure 1 As shown. The vector database multi-copy cluster management system 10 includes: a load balancing module 11, multiple vector database proxy service modules 12 (including 121, 122, ..., 12n), and each vector database proxy service module is used to provide vector data management operations for a corresponding vector database copy, which can adapt to different types of vector databases. In addition, one or more vector database copies can form an instance (such as instance 1 is composed of multiple copies such as the first vector database copy and the second vector database copy). Therefore, the vector database multi-copy cluster includes multiple instances, such as instance 1, instance 2, ..., instance N, and the vector data of each vector database copy in the same instance remains consistent, and a vector database copy corresponds to a set of independent vector databases, whose types include but are not limited to: open source vector databases (such as Milvus), self-developed graphics memory version vector databases, etc.
[0035] Specifically, when the vector database multi-copy cluster management system 10 receives a vector data processing request message from a user terminal, the interaction process between the load balancing module 11 and the multiple vector database proxy service modules 12 is as follows:
[0036] First, the load balancing module 11 receives a vector data processing request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier (such as an instance ID) of a target instance for processing vector data; then, the load balancing module 11 forwards the vector data processing request message to the first vector database proxy service module 121 corresponding to the first vector database copy in the target instance according to the instance identifier. The target instance includes multiple vector database copies storing the same vector data, and the first vector database copy is any one of the multiple vector database copies in the target instance that is in a normal state; then, the first vector database proxy service module 121 can perform corresponding processing operations on the vector data according to the vector data processing request message, obtain corresponding processing results, and feed back the processing results to the load balancing module 11; finally, the load balancing module 11 can feed back the processing results returned by the first vector database proxy service module 121 corresponding to the first vector database copy to the user terminal.
[0037] It should be noted that the above Figure 1 The system shown is for illustration only and does not limit the structure of the system. The cluster deployment system may include but is not limited to Figure 1 The components shown in .
[0038] The functions and interaction processes of various modules in the vector database multi-copy cluster management system 10 are described below in conjunction with specific processing implementation processes.
[0039] As an optional implementation, before the load balancing module 11 forwards the vector data processing request message to the first vector database proxy service module 121 corresponding to the first vector database copy in the target instance according to the instance identifier, in order to ensure that the vector data can be processed normally, it can also perform the following steps:
[0040] The above-mentioned load balancing module 11 determines the instance status of the target instance corresponding to the instance identifier; when the instance status is normal, determines that the copy status within the target instance is the first vector database copy in the normal state, and forwards the vector data processing request message to the first vector database proxy service module 121 corresponding to the first vector database copy; when the instance status is abnormal, feeds back the corresponding vector data processing failure response message to the user terminal.
[0041] Optionally, the load balancing module 11 may determine the instance state of the target instance corresponding to the instance identifier in the following manner:
[0042] Step 1: The load balancing module 11 sends a heartbeat detection signal to the vector database proxy service module corresponding to each vector database copy in the target instance;
[0043] Step 2: The load balancing module 11 determines the replica status of each vector database replica according to whether each vector database proxy service module feeds back a corresponding response signal within a preset time period, including: when the vector database proxy service module feeds back a corresponding response signal within a preset time period, determining that the replica status of the vector database replica corresponding to the vector database proxy service module is a normal status (i.e., the vector database replica can process vector data normally); when the vector database proxy service module does not feed back a corresponding response signal within the preset time period, determining that the replica status of the vector database replica corresponding to the vector database proxy service module is an abnormal status (i.e., the vector database replica cannot process vector data);
[0044] Step 3: The load balancing module 11 determines the instance state of the target instance according to the replica state of each vector database replica in the target instance, including: when the replica state of any vector database replica in the target instance is in a normal state, determining that the instance state of the target instance is in a normal state; when the replica state of all vector database replicas in the target instance is in an abnormal state, determining that the instance state of the target instance is in an abnormal state.
[0045] In the above-mentioned heartbeat detection mechanism, by periodically sending signals to detect the instance status of the target instance corresponding to the instance identifier and the copy status of each vector database copy in the target instance, the vector data to be processed can be loaded to the normal vector database copy in the target instance for corresponding processing operations, thereby improving the processing performance of the vector database multi-copy cluster.
[0046] Optionally, the processing operation involved in the vector data processing request message initiated by the above-mentioned user terminal includes at least one of the following: a synchronization operation and a retrieval operation.
[0047] Specifically, when the processing operation is a synchronous operation, that is, adding, deleting, or modifying, the vector database multi-copy cluster management system 10 also includes: a second vector database proxy service module 122 corresponding to the second vector database copy, and the second vector database copy is a vector database copy other than the first vector database copy among the multiple vector database copies in the target instance. Therefore, the load balancing module 11, the first vector database proxy service module 121, and the second vector database proxy service module 122 can be Figure 2 The processes shown in the figure interact to achieve synchronous operation of vector data, including:
[0048] Step S11, the load balancing module 11 receives a vector data synchronization request message initiated by a user terminal, wherein the vector data synchronization request carries at least an instance identifier of a target instance for performing synchronization operation on vector data;
[0049] Step S12, the load balancing module 11 determines the instance state of the target instance corresponding to the instance identifier, wherein, if the instance state is abnormal, step S13 is executed; if the instance state is normal, steps S14 to S22 are executed;
[0050] Step S13, the load balancing module 11 feeds back a corresponding vector data synchronization failure response message to the user terminal;
[0051] Step S14, the load balancing module 11 determines the first vector database replica whose replica status in the target instance is normal;
[0052] Step S15, the load balancing module 11 forwards the vector data synchronization request message to the first vector database proxy service module 121 corresponding to the first vector database copy;
[0053] Step S16, the first vector database proxy service module 121 writes the vector data into the corresponding first vector database replica, and pushes the first replica identifier (i.e., the sender replica ID) and the vector data of the first vector database replica to the Kafka message queue corresponding to the target instance, wherein the body of the Kafka message queue is the instance identifier, and the message body is the first replica identifier and the vector data;
[0054] Step S17, when the second vector database replica consumes the vector data in the Kafka message queue, the second vector database proxy service module 122 determines whether the second replica identifier (i.e., the current replica ID) of the second vector database replica is the same as the first replica identifier, wherein if the second replica identifier is not the same as the first replica identifier, steps S18 to S20 are executed; if the second replica identifier is the same as the first replica identifier, steps S21 to S22 are executed;
[0055] Step S18, the second vector database proxy service module 122 writes the vector data into the second vector database copy;
[0056] Step S19, the second vector database proxy service module 122 feeds back the corresponding writing result to the load balancing module 11;
[0057] Step S20, the load balancing module 11 forwards the writing result to the user terminal;
[0058] Step S21, the second vector database proxy service module 122 feeds back a response message indicating that the vector data has been written to the load balancing module 11;
[0059] Step S22: The load balancing module 11 forwards the response message to the user terminal.
[0060] In the vector data synchronization process of the above steps S11-S22, the vector data to be synchronized can be first loaded to any vector database copy in the target instance where it is located when entering the database, that is, any vector database copy in a normal state in the target instance can independently receive the entry request from the application layer, and synchronize the vector data to other vector database copies in the target instance, thereby realizing decentralized multi-copy vector data synchronization (similar to the multi-master mode), so that the synchronization performance of the vector data is maximized.
[0061] In addition, when the processing operation is a retrieval operation, the load balancing module 11 and the first vector database proxy service module 121 in the vector database multi-copy cluster management system 10 can be connected according to Figure 3 The process shown in the figure interacts to implement the retrieval operation of vector data, including:
[0062] Step S31, the load balancing module 11 receives a vector data retrieval request message initiated by a user terminal, wherein the vector data synchronization request carries at least an instance identifier of a target instance for performing a retrieval operation on vector data;
[0063] Step S32, the load balancing module 11 determines the instance state of the target instance corresponding to the instance identifier, wherein, if the instance state is abnormal, step S33 is executed; if the instance state is normal, steps S34 to S38 are executed;
[0064] Step S33, the load balancing module 11 feeds back a corresponding vector data retrieval failure response message to the user terminal;
[0065] Step S34, the load balancing module 11 determines the replica status of each vector database replica in the target instance;
[0066] Step S35, the load balancing module 11 forwards the vector data retrieval request message to the first vector database proxy service module 121 corresponding to the first vector database replica whose replica status is normal;
[0067] Step S36, the first vector database proxy service module 121 searches in the corresponding first vector database copy according to the vector data processing request message to obtain a search result, wherein the search result is the vector data to be searched;
[0068] Step S37, the first vector database proxy service module 121 feeds back the search result to the load balancing module 11;
[0069] Step S38: The load balancing module 11 feeds back the search result to the user terminal.
[0070] Therefore, in an embodiment of the present application, the vector database multi-copy cluster management system 10 can be adapted to all types of vector databases, and the system 10 can achieve high availability of the vector database, solve the technical problem that the vector database does not support the multi-copy mode, resulting in the unavailability of the vector database when a node in a cluster is abnormal, and achieve that even when a single node fails, the vector database cluster in the multi-copy mode can still efficiently provide storage and retrieval services.
[0071] Example 2
[0072] Based on the above-mentioned Example 1, the embodiment of the present application also provides a method embodiment of a vector database multi-copy cluster management method applied to the above-mentioned load balancing module. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0073] Figure 4 is a flow chart of an optional vector database multi-copy cluster management method according to an embodiment of the present application, such as Figure 4 As shown, the method at least includes steps S402-S406, wherein:
[0074] Step S402: receiving a vector data processing request message initiated by a user terminal.
[0075] The above-mentioned vector data processing request carries at least the instance identifier of the target instance for performing a processing operation on the vector data, and the processing operation includes at least one of the following: a synchronization (including adding, modifying, and deleting) operation, and a retrieval operation.
[0076] Step S404: forward the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy in the target instance according to the instance identifier.
[0077] The target instance includes a plurality of vector database copies storing the same vector data, and the first vector database copy is any one of the plurality of vector database copies in the target instance that is in a normal state.
[0078] The first vector database proxy service module can perform corresponding processing operations on the vector data according to the vector data processing request message, obtain corresponding processing results, and feed back the processing results to the load balancing module.
[0079] Step S406: Feedback the processing result returned by the first vector database proxy service module corresponding to the first vector database copy to the user terminal.
[0080] The above method of this embodiment is further introduced below.
[0081] As an optional implementation, before the load balancing module executes step S404, it can also determine the instance status of the target instance corresponding to the instance identifier; when the instance status is normal, determine the first vector database copy whose copy status within the target instance is normal, and forward the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy; when the instance status is abnormal, feedback the corresponding vector data processing failure response message to the user terminal.
[0082] Optionally, the load balancing module may determine the instance state of the target instance corresponding to the instance identifier in the following manner:
[0083] Step 1: The load balancing module sends a heartbeat detection signal to the vector database proxy service module corresponding to each vector database replica in the target instance;
[0084] Step 2: The load balancing module determines the replica status of each vector database replica according to whether each vector database proxy service module feeds back a corresponding response signal within a preset time period, including: when the vector database proxy service module feeds back a corresponding response signal within a preset time period, determining that the replica status of the vector database replica corresponding to the vector database proxy service module is a normal status (i.e., the vector database replica can process vector data normally); when the vector database proxy service module does not feed back a corresponding response signal within the preset time period, determining that the replica status of the vector database replica corresponding to the vector database proxy service module is an abnormal status (i.e., the vector database replica cannot process vector data);
[0085] Step 3: The load balancing module determines the instance state of the target instance according to the replica state of each vector database replica in the target instance, including: when the replica state of any vector database replica in the target instance is normal, determining that the instance state of the target instance is normal; when the replica state of all vector database replicas in the target instance is abnormal, determining that the instance state of the target instance is abnormal.
[0086] In the above-mentioned heartbeat detection mechanism, by periodically sending signals to detect the instance status of the target instance corresponding to the instance identifier and the copy status of each vector database copy in the target instance, the vector data to be processed can be loaded to the normal vector database copy in the target instance for corresponding processing operations, thereby improving the processing performance of the vector database multi-copy cluster.
[0087] Based on the technical solution provided by the above steps S402-S406, it can be learned that the load balancing module determines the instance status of the corresponding target instance and the copy status of each vector database copy in the target instance according to the instance identifier of the target instance where the vector data is located carried in the vector data processing request message. Since the vector database copies in the target instance are independent of each other and the stored vector data are consistent, the load balancing module can forward the vector data processing request message to the first vector database proxy service module corresponding to any first vector database copy in the target instance that is in a normal state according to the instance status and the copy status, so that the vector data can be processed normally by the first vector database proxy service module; finally, the processing result fed back by the first vector database proxy service module is forwarded to the user terminal, thereby realizing decentralized multi-copy data processing and improving data processing efficiency.
[0088] Example 3
[0089] According to an embodiment of the present application, an electronic device is also provided, wherein: Figure 5 is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application, such as Figure 5 As shown, the electronic device includes one or more processors; a memory for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the vector database multi-copy cluster management method in the above-mentioned embodiment 2 when running.
[0090] Optionally, the processor is configured to implement the following steps by executing a computer program:
[0091] Step S1, receiving a vector data processing request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier of a target instance for performing a processing operation on vector data;
[0092] Step S2, forwarding the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy in the target instance according to the instance identifier, wherein the target instance includes multiple vector database copies storing the same vector data, the first vector database copy is any one of the multiple vector database copies in the target instance that is in a normal state, and the first vector database proxy service module is used to perform corresponding processing operations on the vector data according to the vector data processing request message, obtain corresponding processing results, and feed back the processing results to the load balancing module;
[0093] Step S3: Feedback the processing result returned by the first vector database proxy service module corresponding to the first vector database copy to the user terminal.
[0094] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0095] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0096] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0097] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0098] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0099] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0100] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A vector database multi-copy cluster management system, characterized in that: The system includes: a load balancing module, a plurality of vector database proxy service modules, and each of the vector database proxy service modules corresponds to a vector database copy, wherein: The load balancing module is used to receive a vector data processing request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier of a target instance for performing a processing operation on the vector data; forwarding the vector data processing request message to a first vector database proxy service module corresponding to a first vector database copy in the target instance based on the instance identifier, wherein the target instance includes multiple vector database copies storing the same vector data, and the first vector database copy is any one of the multiple vector database copies in the target instance that is in a normal state; feeding back the processing result returned by the first vector database proxy service module corresponding to the first vector database copy to the user terminal; The first vector database proxy service module is used to perform corresponding processing operations on the vector data according to the vector data processing request message, obtain corresponding processing results, and feed back the processing results to the load balancing module.
2. The system according to claim 1, characterized in that The load balancing module is also used to determine the instance status of the target instance corresponding to the instance identifier; when the instance status is normal, determine the first vector database copy whose copy status within the target instance is normal, and forward the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy; when the instance status is abnormal, feed back the corresponding vector data processing failure response message to the user terminal.
3. The system according to claim 1, characterized in that The load balancing module is also used to send a heartbeat detection signal to the vector database proxy service module corresponding to each vector database copy in the target instance; determine the copy status of each vector database copy according to whether each vector database proxy service module feeds back a corresponding response signal within a preset time period, including: when the vector database proxy service module feeds back a corresponding response signal within a preset time period, determine that the copy status of the vector database copy corresponding to the vector database proxy service module is a normal state; when the vector database proxy service module does not feed back a corresponding response signal within the preset time period, determine that the copy status of the vector database copy corresponding to the vector database proxy service module is an abnormal state; determine the instance status of the target instance according to the copy status of each vector database copy in the target instance, including: when the copy status of any vector database copy in the target instance is a normal state, determine that the instance status of the target instance is a normal state; when the copy status of all vector database copies in the target instance are abnormal states, determine that the instance status of the target instance is an abnormal state.
4. The system according to claim 1, characterized in that The processing operation at least includes: synchronization operation, wherein: The load balancing module is further used to receive a vector data synchronization request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier of a target instance for performing synchronization operations on vector data; forwarding the vector data synchronization request message to a first vector database replica proxy service module corresponding to a first vector database replica in the target instance according to the instance identifier; The first vector database proxy service module is used to write the vector data into the corresponding first vector database copy, and when the writing is successful, push the first copy identifier of the first vector database copy and the vector data to the Kafka message queue corresponding to the target instance; The second vector database proxy service module is used to determine whether the second replica identifier of the second vector database replica is the same as the first replica identifier when the corresponding second vector database replica consumes the vector data in the Kafka message queue; if the second replica identifier is not the same as the first replica identifier, write the vector data into the second vector database replica and feed back the writing result to the load balancing module, wherein the second vector database replica is other vector database replicas among the multiple vector database replicas in the target instance except the first vector database replica.
5. The system according to claim 4, characterized in that The load balancing module is further configured to feed back the writing result returned by the second vector database proxy service module corresponding to the second vector database copy to the user terminal.
6. The system according to claim 1, characterized in that The processing operation also includes: a retrieval operation, wherein: The load balancing module is further used to receive a vector data retrieval request message initiated by a user terminal, wherein the vector data retrieval request message carries at least an instance identifier of a target instance for performing a retrieval operation on vector data; forwarding the vector data processing request message to a first vector database proxy service module corresponding to a first vector database copy in the target instance according to the instance identifier; The first vector database proxy service module is further used to search in the corresponding first vector database copy according to the vector data processing request message, and feed back the search result to the load balancing module.
7. The system according to claim 1, characterized in that The vector database type of the vector database copy includes at least one of the following: an open source vector database and a video memory vector database.
8. A vector database multi-copy cluster management method, characterized in that: Applicable to load balancing modules, including: Receiving a vector data processing request message initiated by a user terminal, wherein the vector data processing request carries at least an instance identifier of a target instance for performing a processing operation on the vector data; Forwarding the vector data processing request message to a first vector database proxy service module corresponding to a first vector database copy in the target instance according to the instance identifier, wherein the target instance includes multiple vector database copies storing the same vector data, the first vector database copy is any one of the multiple vector database copies in the target instance that is in a normal state, and the first vector database proxy service module is used to perform corresponding processing operations on the vector data according to the vector data processing request message, obtain corresponding processing results, and feed back the processing results to the load balancing module; The processing result returned by the first vector database proxy service module corresponding to the first vector database copy is fed back to the user terminal.
9. The method according to claim 8, characterized in that Before forwarding the vector data processing request message to the first vector database proxy service module corresponding to the first vector database copy in the target instance according to the instance identifier, the method further includes: Determining an instance state of the target instance corresponding to the instance identifier; When the instance state is normal, determine a first vector database replica whose replica state in the target instance is normal, and forward the vector data processing request message to a first vector database proxy service module corresponding to the first vector database replica; When the instance state is an abnormal state, a corresponding vector data processing failure response message is fed back to the user terminal.
10. The method according to claim 9, characterized in that Determining the instance state of the target instance corresponding to the instance identifier includes: Sending a heartbeat detection signal to a vector database proxy service module corresponding to each vector database copy in the target instance; Determining the replica status of each vector database replica according to whether each vector database proxy service module feeds back a corresponding response signal within a preset time period, including: when the vector database proxy service module feeds back a corresponding response signal within a preset time period, determining that the replica status of the vector database replica corresponding to the vector database proxy service module is a normal state; when the vector database proxy service module does not feed back a corresponding response signal within the preset time period, determining that the replica status of the vector database replica corresponding to the vector database proxy service module is an abnormal state; Determining the instance state of the target instance according to the replica states of each vector database replica in the target instance includes: when the replica state of any vector database replica in the target instance is in a normal state, determining that the instance state of the target instance is a normal state; when the replica states of all vector database replicas in the target instance are in an abnormal state, determining that the instance state of the target instance is an abnormal state.
11. The method according to claim 8, characterized in that The processing operation includes at least one of the following: a synchronization operation and a retrieval operation.
12. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the vector database multi-copy cluster management method according to any one of claims 8 to 11 is executed when the program is run.
Citation Information
Cited By
Vector database smart auto-scaling
US12699712B1