Distributed retrieval service cluster management method and system based on Nacos

By developing atomic operation functions in the vector search service node and utilizing Nacos cluster management, the problem of low configuration management efficiency is solved, and efficient vector search service cluster management and load balancing are achieved.

CN118964028APending Publication Date: 2024-11-15CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411095384.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the management of vector search service, the configuration method leads to low management efficiency, cannot guarantee load balancing, and frequently manually modify the configuration to cope with the problems of changes in the number of service instances, changes in health status and insufficient resources.

Method used

Develop atomic operation functions in vector search service nodes, collect registration information and register nodes into Nacos cluster, obtain registration information through the search management system to select service nodes, provide atomic operation functions to the upper-level business caller, and realize the vector search service cluster management.

Benefits of technology

It improves the management efficiency of vector retrieval service cluster, reduces the difficulty of connecting upper-level business calls, and realizes effective management and load balancing of the cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964028A_ABST
    Figure CN118964028A_ABST
Patent Text Reader

Abstract

The invention discloses a Nacos-based distributed retrieval service cluster management method and system. The method comprises the following steps: developing an atomic operation function in each vector retrieval service node; collecting registration information corresponding to each vector retrieval service node, and registering each vector retrieval service node into a Nacos cluster according to the registration information; developing a retrieval management system, and obtaining registration information corresponding to each vector retrieval service node from the Nacos cluster through the retrieval management system; selecting a vector retrieval service node according to the registration information, and providing service for an upper-layer business calling party according to an atomic operation function corresponding to the vector retrieval service node to obtain current vector retrieval service data; and managing the vector retrieval service cluster according to the current vector retrieval service data. The method can effectively improve the cluster management efficiency under a plurality of vector retrieval service nodes, reduces the docking difficulty of upper-layer business calling parties, and can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a distributed search service cluster management method and system based on Nacos. Background Art

[0002] When managing vector retrieval services, developers often use a configuration-based approach, that is, directly configuring the service addresses of all retrieval services into business codes, relational databases (such as MySQL), or caches (such as Redis). However, when managing vector retrieval services through configuration, if there are problems such as changes in the number of service instances, changes in service health status, and insufficient service resources, it is necessary to manually modify the configured vector retrieval service information frequently to ensure the normal operation of the service. This configuration-based approach has low management efficiency and cannot ensure load balancing of the retrieval service data. Summary of the invention

[0003] To solve the above technical problems, the purpose of the present invention is to provide a distributed search service cluster management method and system based on Nacos with high management efficiency.

[0004] To achieve the above purpose, one aspect of an embodiment of the present application proposes a distributed search service cluster management method based on Nacos, comprising the following steps:

[0005] Develop atomic operation functions in each vector retrieval service node;

[0006] Collecting registration information corresponding to each of the vector retrieval service nodes, and then registering each of the vector retrieval service nodes in the Nacos cluster according to the registration information;

[0007] Developing a retrieval management system, and obtaining the registration information corresponding to each of the vector retrieval service nodes from the Nacos cluster through the retrieval management system;

[0008] Selecting the vector retrieval service node according to the registration information, and then providing services to the upper-layer service caller according to the atomic operation function corresponding to the vector retrieval service node, and obtaining current vector retrieval service data;

[0009] A vector retrieval service cluster is managed according to the current vector retrieval service data, wherein the vector retrieval service cluster includes a plurality of the vector retrieval service nodes.

[0010] In some embodiments, the atomic operation function includes a vector library atomic operation function, a vector data atomic operation function, and a vector retrieval function. The atomic operation function is developed in each vector retrieval service node, specifically including:

[0011] Developing the vector library atomic operation function in each of the vector retrieval service nodes;

[0012] Developing the vector data atomic operation function in each of the vector retrieval service nodes;

[0013] Developing the vector retrieval function in each of the vector retrieval service nodes;

[0014] The vector library atomic operation function, the vector data atomic operation function and the vector retrieval function are encapsulated as an http interface.

[0015] In some embodiments, the registration information includes first registration information, second registration information, and third registration information, and collecting the registration information corresponding to each of the vector retrieval service nodes specifically includes:

[0016] Collecting the first registration information corresponding to the vector library, the first registration information including at least one of the current number of sets, the current number of partitions, and the current vector data capacity;

[0017] Collecting the second registration information corresponding to the host machine, where the second registration information includes at least one of a current graphics processor usage rate, a current central processor usage rate, and a current disk usage rate;

[0018] The third registration information corresponding to each of the vector retrieval service nodes is collected, where the third registration information includes at least one of a service identification number and a maximum vector data capacity.

[0019] In some embodiments, registering each of the vector retrieval service nodes into the Nacos cluster according to the registration information specifically includes:

[0020] Pushing the first registration information, the second registration information, and the third registration information corresponding to each of the vector retrieval service nodes as metadata to Nacos in the Nacos cluster;

[0021] The first registration information, the second registration information and the third registration information are updated according to a preset time interval, and then the Nacos is refreshed according to the updated first registration information, the second registration information and the third registration information.

[0022] In some embodiments, selecting the vector retrieval service node according to the registration information, and then providing services to the upper-layer service caller according to the atomic operation function corresponding to the vector retrieval service node to obtain current vector retrieval service data specifically includes:

[0023] Analyzing the registration information corresponding to each of the vector retrieval service nodes, and determining at least one of the vector retrieval service nodes as a candidate service node according to the analysis result;

[0024] Forwarding the vector request sent by the upper-layer service caller to the candidate service node through the retrieval management system to obtain response data of the candidate service node;

[0025] The service is provided to the upper-layer service caller according to the node quantity of the candidate service node, the response data, and the atomic operation function, and the current vector retrieval service data is obtained.

[0026] In some embodiments, the current vector retrieval service data includes first current vector retrieval service data and second current vector retrieval service data, and providing services to the upper-layer service caller according to the node number of the candidate service node, the response data, and the atomic operation function to obtain the current vector retrieval service data specifically includes:

[0027] When the number of nodes is a first preset number, the corresponding response data is sent to the upper-layer service caller, and then the service is provided to the upper-layer service caller according to the atomic operation function corresponding to the candidate service node, to obtain the first current vector retrieval service data;

[0028] When the number of nodes is a second preset number, the corresponding response data is filtered and aggregated, and then the filtered and aggregated response data is sent to the upper-layer business caller, and services are provided to the upper-layer business caller according to the atomic operation function corresponding to the candidate service node, so as to obtain the second current vector retrieval service data.

[0029] In some embodiments, managing the vector search service cluster according to the current vector search service data specifically includes:

[0030] performing and analyzing the first current vector retrieval service data and the second current vector retrieval service data, and determining one of the candidate service nodes as an optimal service node according to the analysis result;

[0031] The vector request sent by the upper-layer service caller is forwarded to the optimal service node through the retrieval management system to perform an atomic operation function call.

[0032] To achieve the above purpose, another aspect of the embodiment of the present application proposes a distributed search service cluster management system based on Nacos, including:

[0033] Function development module, used to develop atomic operation functions in each vector retrieval service node;

[0034] An information collection and registration module, used to collect registration information corresponding to each of the vector retrieval service nodes, and then register each of the vector retrieval service nodes in the Nacos cluster according to the registration information;

[0035] A cluster registration information acquisition module, used to develop a retrieval management system, and obtain the registration information corresponding to each vector retrieval service node from the Nacos cluster through the retrieval management system;

[0036] A vector retrieval service providing module, configured to select the vector retrieval service node according to the registration information, and then provide services to an upper-layer service caller according to the atomic operation function corresponding to the vector retrieval service node, so as to obtain current vector retrieval service data;

[0037] The retrieval service cluster management module is used to manage the vector retrieval service cluster according to the current vector retrieval service data, and the vector retrieval service cluster includes a plurality of the vector retrieval service nodes.

[0038] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the distributed retrieval service cluster management method based on Nacos as described above is implemented.

[0039] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium for computer-readable storage, and stores one or more programs, and the one or more programs can be executed by one or more processors to implement the distributed retrieval service cluster management method based on Nacos as described above.

[0040] The beneficial effects of the present invention are as follows: the distributed retrieval service cluster management method and system based on Nacos of the present invention develops an atomic operation function in each vector retrieval service node, collects registration information corresponding to each vector retrieval service node, and then registers each vector retrieval service node in the Nacos cluster according to the registration information, then develops a retrieval management system, obtains registration information corresponding to each vector retrieval service node from the Nacos cluster through the retrieval management system, and selects a vector retrieval service node according to the registration information, and then provides services to the upper-level business caller according to the atomic operation function corresponding to the vector retrieval service node, obtains the current vector retrieval service data, and finally manages the vector retrieval service cluster according to the current vector retrieval service data. The present invention manages the vector retrieval service cluster through the developed retrieval management system, encapsulates the atomic operation function of each vector retrieval service node, and can effectively improve the management efficiency of the cluster under multiple vector retrieval service nodes, while reducing the docking difficulty of the upper-level business caller. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 A flowchart of a distributed search service cluster management method based on Nacos provided in an embodiment of the present invention;

[0043] Figure 2 A step flow chart of step S101 provided in an embodiment of the present invention;

[0044] Figure 3 A flowchart of the steps of collecting registration information provided by an embodiment of the present invention;

[0045] Figure 4 A flowchart of the steps of Nacos registration provided by an embodiment of the present invention;

[0046] Figure 5 A step flow chart of step S104 provided in an embodiment of the present invention;

[0047] Figure 6 Another step flow chart of step S104 provided in an embodiment of the present invention;

[0048] Figure 7 A step flow chart of step S105 provided in an embodiment of the present invention;

[0049] Figure 8 A flow chart of a distributed search service cluster management method based on Nacos provided in an embodiment of the present invention;

[0050] Fig. 9 A schematic diagram of the structure of a distributed search service cluster management system based on Nacos provided in an embodiment of the present invention;

[0051] Fig.10 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0053] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0054] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0055] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0056] Nacos (Dynamic Naming and Configuration Service) is a dynamic service discovery, configuration management, and service management platform for building cloud-native applications.

[0057] Vector databases are widely used in the current field of artificial intelligence, including face recognition, motor vehicle recognition, non-motor vehicle recognition, and text and voice similarity retrieval. In daily production, for the operation and retrieval of vector databases, people often do not directly operate the vector databases, but develop a vector retrieval service for it, encapsulate the vector database capabilities, and provide relevant vector operation capabilities to the outside through the service.

[0058] However, as the business scale grows, the vector data used in the vector database will also increase exponentially, and the performance of a single vector database will also be stretched. Previous technologies often expand the capacity of existing services, that is, after evaluating the amount of business data, correspondingly adding multiple sets of vector databases and vector retrieval services to jointly provide services to the outside world, which in turn raises the question of how to manage these vector retrieval services. When managing vector retrieval services, developers often adopt a configuration-based approach, that is, directly configuring the service addresses of all retrieval services into business codes, relational databases (such as MySQL) or caches (such as Redis). However, when managing vector retrieval services in a configured manner, if there are problems such as changes in the number of service instances, changes in service health status, and insufficient service resources, it is necessary to manually and frequently modify the configured vector retrieval service information to ensure the normal operation of the service. This configuration method has low management efficiency and cannot guarantee load balancing of each retrieval service data.

[0059] To this end, the embodiment of the present invention proposes a distributed retrieval service cluster management method based on Nacos, develops atomic operation functions in each vector retrieval service node, collects registration information corresponding to each vector retrieval service node, and then registers each vector retrieval service node in the Nacos cluster according to the registration information, then develops a retrieval management system, obtains registration information corresponding to each vector retrieval service node from the Nacos cluster through the retrieval management system, and selects a vector retrieval service node according to the registration information, and then provides services to the upper-level business caller according to the atomic operation function corresponding to the vector retrieval service node, obtains the current vector retrieval service data, and finally manages the vector retrieval service cluster according to the current vector retrieval service data. The present invention manages the vector retrieval service cluster through the developed retrieval management system, encapsulates the atomic operation functions of each vector retrieval service node, and can effectively improve the management efficiency of the cluster under multiple vector retrieval service nodes, while reducing the docking difficulty of the upper-level business caller. The retrieval service cluster management method can be applied to scenes such as face recognition, motor vehicle recognition, non-motor vehicle recognition, and text and voice similarity retrieval, but is not limited to this.

[0060] Reference Figure 1 , Figure 1A flowchart of a distributed search service cluster management method based on Nacos is provided in an embodiment of the present invention. The embodiment of the present invention proposes a distributed search service cluster management method based on Nacos, and the method includes steps S101 to S105:

[0061] S101. Developing atomic operation functions in each vector retrieval service node;

[0062] Reference Figure 2 , Figure 2 A step flow chart of step S101 provided in an embodiment of the present invention, further as an optional implementation mode, the atomic operation function includes a vector library atomic operation function, a vector data atomic operation function and a vector retrieval function, and the step of developing the atomic operation function in each vector retrieval service node can be further divided into the following steps S1011 to S1014:

[0063] S1011. Developing vector library atomic operation functions in each vector retrieval service node;

[0064] Exemplarily, the vector library atomic operation functions may include functions such as adding a collection, deleting a collection, adding a partition, and deleting a partition, but are not limited thereto. Adding a collection means adding a new collection in the vector library to store and manage a specific type of vector data; deleting a collection means deleting a collection that is no longer needed in the vector database to release the resources it occupies; adding a partition means adding a new partition inside a collection to store and manage a specific part of the data in the collection, and the partition can divide the data based on different standards (such as time, geographic location, and user group, etc.); deleting a partition means deleting a partition that is no longer needed to release the resources it occupies.

[0065] S1012. Developing vector data atomic operation functions in each vector retrieval service node;

[0066] Exemplarily, the vector data atomic operation functions may include functions such as adding vector data, deleting vector data, modifying vector data, and querying vector data, but are not limited thereto.

[0067] S1013. Developing a vector search function in each vector search service node;

[0068] Exemplarily, the vector search function may include similarity search, range search, batch search and other functions, but is not limited thereto.

[0069] S1014. Encapsulate the vector library atomic operation function, the vector data atomic operation function and the vector retrieval function into an http interface.

[0070] Specifically, the vector library atomic operation function, the vector data atomic operation function and the vector retrieval function are encapsulated in the form of an http interface, that is, exposed through the http protocol, so that the upper-layer business caller can call these functions by sending an http request.

[0071] S102, collecting registration information corresponding to each vector retrieval service node, and then registering each vector retrieval service node to the Nacos cluster according to the registration information;

[0072] Reference Figure 3 , Figure 3 A flowchart of the steps of collecting registration information provided in an embodiment of the present invention. Further as an optional implementation mode, the registration information includes first registration information, second registration information and third registration information. The step of collecting registration information corresponding to each vector retrieval service node can be further divided into the following steps S1021 to S1023:

[0073] S1021. Collect first registration information corresponding to the vector library, where the first registration information includes at least one of the current number of sets, the current number of partitions, and the current vector data capacity;

[0074] Specifically, in the vector retrieval service, it is necessary to monitor the status of the internal vector database (i.e., vector library) in order to understand the current load and resource usage of the vector database. The first registration information collected includes at least one of the current number of sets, the current number of partitions, and the current vector data capacity, but is not limited to this.

[0075] S1022, collecting second registration information corresponding to the host machine, where the second registration information includes at least one of a current graphics processor usage rate, a current central processor usage rate, and a current disk usage rate;

[0076] Specifically, in addition to the information of the vector database itself, the vector retrieval service also needs to monitor the hardware resource usage of the system deployment host. The collected second registration information includes at least one of the current graphics processor (GPU) usage rate, the current central processing unit (CPU) usage rate, and the current disk usage rate, but is not limited to this.

[0077] S1023. Collect third registration information corresponding to each vector retrieval service node, where the third registration information includes at least one of a service identification number and a maximum vector data capacity.

[0078] Specifically, when each vector retrieval service node registers in Nacos, it needs a unique service identification number to identify itself. Therefore, it is also necessary to collect the service identification number of the configured vector retrieval service and the maximum supported vector data capacity to help the system make decisions when processing load balancing. The collected third registration information includes the service identification number and the maximum vector data capacity, but is not limited to this.

[0079] Reference Figure 4 , Figure 4 A flowchart of a step of Nacos registration provided in an embodiment of the present invention, further as an optional implementation, the step of registering each vector retrieval service node in the Nacos cluster according to the registration information can be further divided into the following steps S1024 and S1025:

[0080] S1024, pushing the first registration information, the second registration information, and the third registration information corresponding to each vector retrieval service node as metadata to Nacos in the Nacos cluster;

[0081] S1025. Update the first registration information, the second registration information, and the third registration information according to a preset time interval, and then refresh Nacos according to the updated first registration information, the second registration information, and the third registration information.

[0082] Specifically, when the vector retrieval service is started, the vector retrieval service node needs to register itself in Nacos so that other services or management systems can discover it. During registration, the vector retrieval service node pushes the first registration information, the second registration information, and the third registration information collected as metadata to Nacos, and in order to maintain the real-time nature of the information, collects the latest registration information according to the preset time interval, and refreshes the latest registration information to Nacos.

[0083] Those skilled in the art will appreciate that the preset time interval may be selected according to actual needs, for example, 3 seconds, 5 seconds, 8 seconds, etc.

[0084] S103, develop a retrieval management system, and obtain the registration information corresponding to each vector retrieval service node from the Nacos cluster through the retrieval management system;

[0085] Specifically, the retrieval management system is used to manage the vector retrieval service cluster, encapsulate the vector retrieval capabilities and provide services to the outside. By connecting to the same Nacos cluster as the vector retrieval service node, the registration information of all vector retrieval service nodes is obtained from the Nacos cluster and cached locally. In addition, the retrieval management system sets a data change monitoring callback for the vector retrieval service node to obtain the latest number of vector retrieval service nodes and the service status of each vector retrieval service node in real time.

[0086] S104, selecting a vector retrieval service node according to the registration information, and then providing services to the upper-layer service caller according to the atomic operation function corresponding to the vector retrieval service node to obtain current vector retrieval service data;

[0087] Reference Figure 5 , Figure 5 A step flow chart of step S104 provided in an embodiment of the present invention is further provided as an optional implementation mode. A vector retrieval service node is selected according to registration information, and then a service is provided to an upper-layer service caller according to an atomic operation function corresponding to the vector retrieval service node. The step of obtaining current vector retrieval service data can be further divided into the following steps S1041 to S1043:

[0088] S1041, analyzing the registration information corresponding to each vector retrieval service node, and determining at least one vector retrieval service node as a candidate service node according to the analysis result;

[0089] S1042, forwarding the vector request sent by the upper-layer service caller to the candidate service node through the retrieval management system, and obtaining response data of the candidate service node;

[0090] S1043: Provide services to the upper-layer service caller according to the node quantity, response data, and atomic operation function of the candidate service node, and obtain current vector retrieval service data.

[0091] In some optional embodiments, the same vector library operation interface is defined in the retrieval management system with reference to the atomic operation capability provided in the vector retrieval service, including vector library collection addition / deletion operation capability, partition addition / deletion operation capability, vector data addition / deletion / modification / query operation capability, and vector retrieval capability, and provided to the upper-layer business caller for use. Internally, the current survival status and resource occupancy of each vector retrieval service node are obtained by analyzing the registration information of the vector retrieval service node and the last update time of the registration information, and the optimal one or more vector retrieval service nodes are selected as candidate service nodes according to the analysis results, and the vector request sent by the upper-layer business caller is forwarded to these candidate service nodes. After the candidate service node returns the response data, the response data is directly transparently transmitted to the upper-layer business caller, so as to provide services to the upper-layer business caller and obtain the current vector retrieval service data.

[0092] Reference Figure 6 , Figure 6 Another step flow chart of step S104 provided in an embodiment of the present invention, further as an optional implementation manner, the current vector retrieval service data includes first current vector retrieval service data and second current vector retrieval service data, and step S1043 can be further divided into the following steps S10431 and S10432:

[0093] S10431. When the number of nodes is a first preset number, the corresponding response data is sent to the upper-layer service caller, and then the service is provided to the upper-layer service caller according to the atomic operation function corresponding to the candidate service node, and the first current vector retrieval service data is obtained;

[0094] S10432. When the number of nodes is the second preset number, the corresponding response data is filtered and aggregated, and then the filtered and aggregated response data is sent to the upper-layer business caller, and the service is provided to the upper-layer business caller according to the atomic operation function corresponding to the candidate service node, and the second current vector retrieval service data is obtained.

[0095] Exemplarily, if the number of vector retrieval service nodes corresponding to the request is 1 (i.e., the first preset number), the response data is directly transmitted transparently; if the number of vector retrieval service nodes requested is greater than 1 (i.e., the second preset number), it is necessary to filter and aggregate the response data after each vector retrieval service node returns the response data, and then transmit it transparently to the upper-level business caller.

[0096] Furthermore, if the response data returned by some vector retrieval service nodes exceeds the maximum response time set by the system, the call is considered to have failed as a whole, and the call will not wait for the vector retrieval service node to return the response data, and the call failure information will be directly returned to the upper-layer service caller. It can be understood by those skilled in the art that the maximum response time can be selected according to actual needs.

[0097] S105: Manage a vector retrieval service cluster according to current vector retrieval service data, where the vector retrieval service cluster includes multiple vector retrieval service nodes.

[0098] Specifically, the retrieval management system manages the vector retrieval service cluster by analyzing the current vector retrieval service data of each vector retrieval service node. That is, when the upper-level business caller operates the vector database through the retrieval management system, real-time calculation and analysis are performed to obtain the optimal vector retrieval service node, and the vector request is forwarded to the optimal vector retrieval service node.

[0099] Reference Figure 7 , Figure 7 A step flow chart of step S105 provided in an embodiment of the present invention is further provided as an optional implementation mode. The step of managing the vector search service cluster according to the current vector search service data can be further divided into the following steps S1051 and S1052:

[0100] S1051, monitoring and analyzing the first current vector retrieval service data and the second current vector retrieval service data, and determining a vector retrieval service node among the candidate service nodes as the optimal service node according to the analysis result;

[0101] S1052: forward the vector request sent by the upper-layer service caller to the optimal service node through the retrieval management system to perform atomic operation function call.

[0102] Specifically, the retrieval management system manages the current vector retrieval service cluster by analyzing the real-time data of each vector retrieval service node (i.e., the first current vector retrieval service data and the second current vector retrieval service data). That is, when the upper-level business caller operates the vector database through the retrieval management system, the final vector retrieval service node (i.e., the optimal service node) is obtained through real-time calculation and analysis, and the vector request is forwarded to this node.

[0103] For example, for different atomic capability interfaces, the following atomic operation function calls can be performed after obtaining the optimal service node:

[0104] Vector library addition / deletion operation: parse the vector library id in the parameter, pull the registration information corresponding to the vector library id from the Nacos service information, if the service cannot be found, or the last update time of the registration information is greater than the preset update threshold, the vector library is considered to be offline and the operation failure information is returned. Otherwise, call the atomic capability interface of the vector library to perform the operation.

[0105] Vector data add / modify / delete operations: parse the vector library id and vector id in the parameters, and pull the registration information corresponding to the vector library id from the Nacos service information. If the service cannot be found, or the last update time of the registration information is greater than the preset update threshold, the vector library is considered to be offline and the operation failure information is returned. Otherwise, the atomic capability interface of the vector library is called to perform the operation.

[0106] Vector data retrieval function: parse the vector library id and vector id in the parameters, pull the registration information corresponding to the vector library id from the Nacos service information, call the atomic capability interface of all vector retrieval service nodes respectively, aggregate the response data, and return the result to the upper-level business caller.

[0107] Those skilled in the art will appreciate that the preset update threshold can be selected according to actual needs. For example, the preset update threshold can be three minutes, five minutes, seven minutes, etc.

[0108] Furthermore, the vector retrieval management system also provides a vector retrieval service cluster data viewing interface to monitor the data of the vector retrieval service cluster in real time.

[0109] In summary, the processing flow of the distributed search service cluster management method according to the embodiment of the present invention is as follows: Figure 8As shown. First, develop vector library atomic operation related functions in the vector retrieval service node and expose these services through the http protocol, such as vector library collection addition / deletion, partition addition / deletion, vector data addition / deletion / modification, vector retrieval, etc., so that each vector retrieval service node has the most basic atomic operation function. Then, develop Nacos registration related capabilities in the vector retrieval service node, collect the registration information corresponding to the current vector retrieval service node, including the current service status, current number of collections, current number of partitions, current vector data capacity, current GPU usage, current CPU usage, current disk usage, last update time and other information, and update these registration information to Nacos regularly. Next, develop a retrieval management system and connect to the same Nacos cluster, and then obtain the registration information of each node in the current vector retrieval service cluster from the Nacos cluster. Through the registration information of each vector retrieval service node and the last update time of the registration information, the current survival status and resource occupancy of each vector retrieval service node can be judged. Next, the retrieval management system implements the same vector library operation interface as the vector retrieval service, and internally directly forwards the vector request to the downstream vector retrieval service node and exposes it to the upper-level business caller. Finally, the retrieval management system manages the current vector retrieval service cluster by analyzing the current vector retrieval service data of each vector retrieval service node. That is, when the upper-level business caller operates the vector database through the retrieval management system, the final vector retrieval service node is obtained through real-time calculation and analysis, and the vector request is forwarded to the corresponding node. It also implements instance management, health check, capacity monitoring, load balancing, data balancing, and selection strategy service discovery for the vector retrieval service cluster.

[0110] Taking a vector search service cluster with three nodes as an example, the processing flow of the distributed search service cluster management method according to an embodiment of the present invention is as follows:

[0111] The first step is to transform the atomic capability interfaces of the three vector search service nodes and expose them.

[0112] The second step is to transform the Nacos service registration information of the three vector retrieval service nodes, and regularly collect the latest updated registration information of the system and report it to Nacos;

[0113] The third step is to deploy the retrieval management system, collect the registration information of the current vector retrieval service cluster from Nacos, and after receiving the vector request from the upper-level business caller, analyze the current vector library request in real time, obtain the service identification number of the vector retrieval service node, assemble the node's response data, and call the vector retrieval service.

[0114] The above describes the distributed retrieval service cluster management method based on Nacos according to the embodiment of the present invention. It can be recognized that, compared with the vector retrieval service management method in the prior art, the embodiment of the present invention, on the one hand, manages the vector retrieval service cluster through the developed retrieval management system, encapsulates the atomic operation functions of each vector retrieval service node, and can effectively improve the management efficiency of the cluster under multiple vector retrieval service nodes, simplify the management difficulty of the distributed retrieval service cluster, and reduce the docking difficulty of the upper-level business caller; on the other hand, the vector retrieval service cluster data viewing interface is improved, and the service status of the vector retrieval service cluster can be monitored in real time, reducing the probability of online accidents.

[0115] Reference Fig. 9 The embodiment of the present invention further provides a distributed search service cluster management system based on Nacos, including:

[0116] Function development module, used to develop atomic operation functions in each vector retrieval service node;

[0117] The information collection and registration module is used to collect the registration information corresponding to each vector retrieval service node, and then register each vector retrieval service node to the Nacos cluster according to the registration information;

[0118] Cluster registration information collection module is used to develop a retrieval management system, which obtains the registration information corresponding to each vector retrieval service node from the Nacos cluster through the retrieval management system;

[0119] A vector retrieval service providing module is used to select a vector retrieval service node according to the registration information, and then provide services to the upper-layer business caller according to the atomic operation function corresponding to the vector retrieval service node to obtain the current vector retrieval service data;

[0120] The retrieval service cluster management module is used to manage the vector retrieval service cluster according to the current vector retrieval service data. The vector retrieval service cluster includes multiple vector retrieval service nodes.

[0121] The contents of the above-mentioned distributed retrieval service cluster management method embodiment based on Nacos are all applicable to the distributed retrieval service cluster management system embodiment based on Nacos. The functions specifically implemented by the distributed retrieval service cluster management system embodiment based on Nacos are the same as those of the above-mentioned distributed retrieval service cluster management method embodiment based on Nacos, and the beneficial effects achieved are also the same as those achieved by the above-mentioned distributed retrieval service cluster management method embodiment based on Nacos.

[0122] The embodiment of the present invention also provides an electronic device, which includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and when the program is executed by the processor, the above-mentioned distributed retrieval service cluster management method based on Nacos is realized. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0123] like Fig.10 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Fig.10 , an embodiment of the present invention provides an electronic device, including:

[0124] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.

[0125] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the distributed retrieval service cluster management method based on Nacos in the embodiment of the present invention;

[0126] Input / output interface 1003, used to implement information input and output;

[0127] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0128] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0129] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0130] An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned distributed retrieval service cluster management method based on Nacos.

[0131] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0132] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.

[0133] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0134] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0135] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0136] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0137] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.

[0138] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0139] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0140] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0141] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A distributed search service cluster management method based on Nacos, characterized in that: The following steps are involved: Develop atomic operation functions in each vector retrieval service node; Collecting registration information corresponding to each of the vector retrieval service nodes, and then registering each of the vector retrieval service nodes in the Nacos cluster according to the registration information; Developing a retrieval management system, and obtaining the registration information corresponding to each of the vector retrieval service nodes from the Nacos cluster through the retrieval management system; Selecting the vector retrieval service node according to the registration information, and then providing services to the upper-layer service caller according to the atomic operation function corresponding to the vector retrieval service node, and obtaining current vector retrieval service data; A vector retrieval service cluster is managed according to the current vector retrieval service data, wherein the vector retrieval service cluster includes a plurality of the vector retrieval service nodes.

2. According to a Nacos-based distributed search service cluster management method according to claim 1, it is characterized in that: The atomic operation function includes a vector library atomic operation function, a vector data atomic operation function and a vector search function. The atomic operation function is developed in each vector search service node, specifically including: Developing the vector library atomic operation function in each of the vector retrieval service nodes; Developing the vector data atomic operation function in each of the vector retrieval service nodes; Developing the vector retrieval function in each of the vector retrieval service nodes; The vector library atomic operation function, the vector data atomic operation function and the vector retrieval function are encapsulated as an http interface.

3. According to a Nacos-based distributed search service cluster management method according to claim 1, it is characterized in that: The registration information includes first registration information, second registration information and third registration information, and the collecting of registration information corresponding to each of the vector search service nodes specifically includes: Collecting the first registration information corresponding to the vector library, the first registration information including at least one of the current number of sets, the current number of partitions, and the current vector data capacity; Collecting the second registration information corresponding to the host machine, where the second registration information includes at least one of a current graphics processor usage rate, a current central processor usage rate, and a current disk usage rate; The third registration information corresponding to each of the vector retrieval service nodes is collected, where the third registration information includes at least one of a service identification number and a maximum vector data capacity.

4. According to claim 3, a distributed search service cluster management method based on Nacos is characterized in that: The step of registering each of the vector retrieval service nodes with the Nacos cluster according to the registration information specifically includes: Pushing the first registration information, the second registration information, and the third registration information corresponding to each of the vector retrieval service nodes as metadata to Nacos in the Nacos cluster; The first registration information, the second registration information and the third registration information are updated according to a preset time interval, and then the Nacos is refreshed according to the updated first registration information, the second registration information and the third registration information.

5. According to a Nacos-based distributed search service cluster management method according to claim 1, it is characterized in that: The step of selecting the vector retrieval service node according to the registration information, and then providing services to the upper-layer service caller according to the atomic operation function corresponding to the vector retrieval service node, to obtain current vector retrieval service data specifically includes: Analyzing the registration information corresponding to each of the vector retrieval service nodes, and determining at least one of the vector retrieval service nodes as a candidate service node according to the analysis result; Forwarding the vector request sent by the upper-layer service caller to the candidate service node through the retrieval management system to obtain response data of the candidate service node; The service is provided to the upper-layer service caller according to the node quantity of the candidate service node, the response data, and the atomic operation function, and the current vector retrieval service data is obtained.

6. According to claim 5, a distributed search service cluster management method based on Nacos is characterized in that: The current vector retrieval service data includes first current vector retrieval service data and second current vector retrieval service data, and providing services to the upper-layer service caller according to the node number of the candidate service node, the response data, and the atomic operation function to obtain the current vector retrieval service data specifically includes: When the number of nodes is a first preset number, the corresponding response data is sent to the upper-layer service caller, and then the service is provided to the upper-layer service caller according to the atomic operation function corresponding to the candidate service node, to obtain the first current vector retrieval service data; When the number of nodes is a second preset number, the corresponding response data is filtered and aggregated, and then the filtered and aggregated response data is sent to the upper-layer business caller, and services are provided to the upper-layer business caller according to the atomic operation function corresponding to the candidate service node, so as to obtain the second current vector retrieval service data.

7. According to claim 6, a distributed search service cluster management method based on Nacos is characterized in that: The managing the vector search service cluster according to the current vector search service data specifically includes: analyzing the first current vector retrieval service data and the second current vector retrieval service data, and determining one of the candidate service nodes as an optimal service node according to the analysis result; The vector request sent by the upper-layer service caller is forwarded to the optimal service node through the retrieval management system to perform an atomic operation function call.

8. A distributed search service cluster management system based on Nacos, characterized in that: include: Function development module, used to develop atomic operation functions in each vector retrieval service node; An information collection and registration module, used to collect registration information corresponding to each of the vector retrieval service nodes, and then register each of the vector retrieval service nodes in the Nacos cluster according to the registration information; A cluster registration information acquisition module, used to develop a retrieval management system, and obtain the registration information corresponding to each vector retrieval service node from the Nacos cluster through the retrieval management system; A vector retrieval service providing module, configured to select the vector retrieval service node according to the registration information, and then provide services to an upper-layer service caller according to the atomic operation function corresponding to the vector retrieval service node, so as to obtain current vector retrieval service data; The retrieval service cluster management module is used to manage the vector retrieval service cluster according to the current vector retrieval service data, and the vector retrieval service cluster includes a plurality of the vector retrieval service nodes.

9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the distributed retrieval service cluster management method based on Nacos are implemented as described in any one of claims 1 to 7.

10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the distributed retrieval service cluster management method based on Nacos as described in any one of claims 1 to 7.