Method and device for carrying out pre-filtering retrieval on vector database

By splitting the front filtering search conditions of vector database and matching multiple data indexes, the problem of slow front filtering search speed in the prior art is solved, and a faster similarity calculation speed is achieved.

CN119848316APending Publication Date: 2025-04-18BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411977841.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the prior art, when searching vector databases before filtering, the speed is slow, which affects the speed of target object similarity calculation.

Method used

By obtaining the pre-filtering search conditions of the target object, splitting them into multiple target search sub-conditions, determining the data index in the vector database according to the sub-condition type, multi-data index matching and merging, and obtaining the pre-filtering search results.

Benefits of technology

It effectively improves the speed of pre-filtering and retrieval, thereby speeding up similarity calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848316A_ABST
    Figure CN119848316A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for carrying out pre-filtering retrieval on a vector database, electronic equipment and a readable storage medium, and relates to the technical field of artificial intelligence such as big data, cloud services and deep learning. The method for performing pre-filtering retrieval on the vector database comprises the following steps: acquiring a pre-filtering retrieval condition of a target object, and obtaining a plurality of target retrieval sub-conditions according to the pre-filtering retrieval condition; according to the condition types of the plurality of target retrieval sub-conditions, determining data indexes respectively corresponding to the plurality of target retrieval sub-conditions in a vector database; and obtaining a pre-filtering retrieval result corresponding to the target object according to each target retrieval sub-condition and the data index corresponding to the target retrieval sub-condition. According to the method and the device, the speed of performing pre-filtering retrieval on the vector database can be increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the field of artificial intelligence technology such as big data, cloud services, and deep learning. A method, device, electronic device, and readable storage medium for pre-filtering retrieval of a vector database are provided. Background Art

[0002] Pre-filtering retrieval of a vector database is used to narrow down the range of candidate objects in the vector database before similarity calculation of the target object. The speed of pre-filtering retrieval greatly affects the speed of similarity calculation of the target object. Therefore, how to improve the speed of pre-filtering retrieval of a vector database has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] According to a first aspect of the present disclosure, a method for performing a pre-filtering search on a vector database is provided, comprising: obtaining a pre-filtering search condition for a target object, and obtaining a plurality of target search sub-conditions according to the pre-filtering search condition; determining, according to the condition types of the plurality of target search sub-conditions, data indexes in the vector database corresponding to the plurality of target search sub-conditions respectively; and obtaining a pre-filtering search result corresponding to the target object according to each target search sub-condition and its corresponding data index.

[0004] According to a second aspect of the present disclosure, a device for performing a pre-filtering search on a vector database is provided, comprising: an acquisition unit, used to acquire a pre-filtering search condition of a target object, and obtain a plurality of target search sub-conditions according to the pre-filtering search condition; a determination unit, used to determine, according to the condition types of the plurality of target search sub-conditions, data indexes in the vector database corresponding to the plurality of target search sub-conditions respectively; and a retrieval unit, used to obtain a pre-filtering search result corresponding to the target object according to each target search sub-condition and its corresponding data index.

[0005] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0006] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.

[0007] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method as described above when executed by a processor.

[0008] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0010] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0011] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0012] Figure 3 It is a block diagram of an electronic device used to implement the method of pre-filtering and retrieving a vector database according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0013] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is omitted in the following description.

[0014] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the method for performing pre-filtering retrieval on a vector database in this embodiment specifically includes the following steps:

[0015] S101, obtaining a pre-filtering search condition for a target object, and obtaining a plurality of target search sub-conditions according to the pre-filtering search condition;

[0016] S102, determining, according to the condition types of the multiple target search sub-conditions, data indexes corresponding to the multiple target search sub-conditions in a vector database;

[0017] S103: Obtain a pre-filtered search result corresponding to the target object according to each target search sub-condition and its corresponding data index.

[0018] The method of performing pre-filtering retrieval on a vector database in this embodiment, by splitting the pre-filtering retrieval condition corresponding to the target object into multiple target retrieval sub-conditions, obtains the pre-filtering retrieval of the corresponding target object according to each target retrieval sub-condition and its corresponding data index, which can effectively improve the speed of pre-filtering retrieval, and then correspondingly improve the speed of similarity calculation based on the obtained pre-filtering retrieval results.

[0019] In this embodiment, the vector database is a database specifically used for storing, managing and querying feature vectors; the feature vectors stored in the vector database may be feature vectors corresponding to different texts, different voices, different images, and the like.

[0020] In this embodiment, the pre-filtering retrieval of the vector database refers to filtering the feature vectors (or candidate objects) to be calculated according to specific conditions before performing similarity calculations based on the feature vectors of the target object and the feature vectors in the vector database, so as to narrow the range of the feature vectors, thereby improving the speed and accuracy of the similarity calculation.

[0021] In this embodiment, the target object may be different objects such as images, texts, and voices; this embodiment may determine the target object according to input or selection of the input terminal.

[0022] When executing S101, the input end can input or select the pre-filter retrieval condition of the target object when inputting or selecting the target object; that is, when executing S101, the pre-filter retrieval condition of the corresponding target object can be obtained according to the selection or input of the input end.

[0023] When executing S101 to obtain the pre-filtering retrieval condition of the target object, the present embodiment may also adopt the following implementation method: in response to determining that the target object is an image, performing image recognition on the obtained target object; and obtaining the pre-filtering retrieval condition of the target object based on the obtained image recognition result.

[0024] For example, if the target object is an image, and if the object contained in the image is clothing, the image recognition result obtained by executing S101 in this embodiment may be clothing color, clothing type, etc., and the obtained clothing color, clothing type, etc. are then used as pre-filtering retrieval conditions corresponding to the target object.

[0025] If the target object is a text, when executing S101, this embodiment can directly obtain the pre-filtering search condition of the target object according to the specific content in the text.

[0026] For example, if the target object is a text, and the content of the text is "brand A's black outerwear long sleeves", then when this embodiment executes S101, "brand A's black long sleeves" can be used as the pre-filtering retrieval condition corresponding to the target object.

[0027] If the target object is speech, when executing S101, this embodiment may first convert the acquired speech into text, and then obtain the pre-filtering retrieval condition of the target object according to the converted text.

[0028] In this embodiment, after executing S101 to obtain the pre-filtering search condition, the obtained pre-filtering search condition can be split, and then a plurality of target search sub-conditions can be obtained according to the splitting results.

[0029] It is understandable that if this embodiment executes S101 and only obtains one target search sub-condition, then this embodiment can use a preset method, such as a multi-threaded concurrent scanning method or a filter condition vectorization acceleration method, to perform a pre-filter search on the vector database according to the target search sub-condition (or the pre-filter search condition).

[0030] For example, if the pre-filtering search condition is "red top", the multiple target search sub-conditions obtained by executing S101 in this embodiment may include the (red) sub-condition and the (top) sub-condition; if the pre-filtering search condition is "male with age less than 30 and height greater than 170", the multiple target search sub-conditions obtained by executing S101 in this embodiment may include the (age less than 30) sub-condition, the (height greater than 170) sub-condition, and the (male) sub-condition.

[0031] After executing S101 to obtain multiple target search sub-conditions according to the pre-filtering search condition, this embodiment executes S102 to determine data indexes corresponding to the multiple target search sub-conditions in the vector database according to the condition types of the multiple target search sub-conditions.

[0032] When executing S102, this embodiment first determines the condition type of each target search sub-condition, and then uses the data index corresponding to the determined condition type in the vector database as the data index corresponding to each target search sub-condition.

[0033] When executing S102 in this embodiment, the corresponding condition type can be determined directly according to the target search sub-condition. For example, when the target search sub-condition is the (red) sub-condition, the condition type corresponding to the sub-condition can be "clothing color"; for example, when the target search sub-condition is the (age less than 30) sub-condition, the condition type corresponding to the sub-condition is "age".

[0034] In this embodiment, the data indexes corresponding to different condition types include vector data corresponding to different condition types, and each vector data corresponds to a different candidate object.

[0035] For example, in the data index corresponding to the "clothing color" condition type, feature vectors corresponding to candidate objects of different colors may be included; in the data index corresponding to the "age" condition type, feature vectors of all candidate objects arranged in descending order of age may be included.

[0036] In this embodiment, when executing S102 to determine the condition type of the target search sub-condition, the target search sub-condition can be input into a pre-trained condition type determination model, and then the condition type corresponding to the target search sub-condition is obtained according to the output result of the condition type determination model.

[0037] In this embodiment, the vector database constructs different data indexes in advance according to different condition types. Therefore, after executing S102 to complete the determination of the condition type, this embodiment can determine the corresponding data index according to the condition type.

[0038] After executing S102 to determine the data indexes respectively corresponding to the multiple target search sub-conditions in the vector database, this embodiment executes S103 to obtain the pre-filtering search result corresponding to the target object according to each target search sub-condition and its corresponding data index.

[0039] Specifically, when executing S103 in this embodiment to obtain the front-filtering retrieval result of the corresponding target object according to each target retrieval sub-condition and its corresponding data index, the implementation method that can be adopted is: according to each target retrieval sub-condition and its corresponding data index, obtain the front-filtering retrieval sub-result corresponding to each target retrieval sub-condition; merge multiple front-filtering retrieval sub-results, and use the obtained merged result as the front-filtering retrieval result of the corresponding target object.

[0040] That is to say, this embodiment obtains the front-filter search sub-results corresponding to different target search sub-conditions through multi-data index matching, and then obtains the front-filter search results based on multiple front-filter search sub-results through merging, which can improve the speed of obtaining the front-filter search results.

[0041] Among them, when this embodiment executes S103 to merge multiple front-filtering search sub-results and uses the obtained merged result as the front-filtering search result of the corresponding target object, the implementation method that can be adopted is: extracting candidate objects that exist in multiple front-filtering search sub-results at the same time; and obtaining the front-filtering search result of the corresponding target object based on the extracted candidate objects.

[0042] In this embodiment, when executing S103 to obtain the front-filtered search sub-result corresponding to each target search sub-condition according to each target search sub-condition and its corresponding data index, the implementation method that can be adopted is: for each target search sub-condition, the current target search sub-condition is matched with the data index corresponding to it; based on the matching result, the front-filtered search sub-result corresponding to the current target search sub-condition is obtained.

[0043] Among them, when executing S103, this embodiment may also include the following contents: obtaining the selectivity of the matching results, the selectivity in this embodiment is the ratio between the number of matching results obtained and the number of candidate objects (or feature vectors) included in the data index; in response to determining that the obtained selectivity is less than or equal to a preset selectivity threshold, obtaining the pre-filtered retrieval sub-results corresponding to the current target retrieval sub-conditions according to the matching results.

[0044] That is to say, this embodiment can obtain the pre-filtering search sub-result corresponding to the current target search sub-condition based on the obtained matching results only when the selection rate of the matching results is not particularly high. If the selection rate of the matching results is very high, it indicates that most of the candidate objects in the vector database meet the corresponding conditions and there is no need for pre-filtering search sub-results.

[0045] In this embodiment, the data format of the pre-filter retrieval sub-results may be a bitmap. When executing S103, this embodiment may merge the bitmaps corresponding to different pre-filter retrieval sub-results, thereby using the bitmap merging result as the pre-filter retrieval result corresponding to the target object.

[0046] It can be understood that, in the bitmap merging result obtained by merging different bitmaps in this embodiment, only the position information of the candidate objects existing in all the bitmaps is retained.

[0047] For example, if two bitmaps are obtained, one of which is Figure 1 is [0, 1, 0, 1, 1], bit Figure 2 The bitmap is [0, 0, 0, 1, 1], where 0 in the bitmap indicates that the candidate object at the position is not a candidate object that matches the target search sub-condition, and 1 in the bitmap indicates that the candidate object at the position is a candidate object that matches the target search sub-condition. Figure 1 With position Figure 2 The merged bitmap is [0, 0, 0, 1, 1].

[0048] After executing S103 to obtain the pre-filtering retrieval result corresponding to the target object, this embodiment can obtain the feature vector of the candidate object corresponding to the pre-filtering retrieval result from the vector database, and then complete the similarity calculation between the target object and the candidate object based on the feature vector.

[0049] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2 As shown, the device 200 for performing pre-filtering retrieval on a vector database in this embodiment includes:

[0050] An acquisition unit 201 is used to acquire a pre-filtering retrieval condition of a target object, and obtain a plurality of target retrieval sub-conditions according to the pre-filtering retrieval condition;

[0051] A determination unit 202 is used to determine data indexes corresponding to the multiple target search sub-conditions in a vector database according to the condition types of the multiple target search sub-conditions;

[0052] The retrieval unit 203 is used to obtain the pre-filtered retrieval result corresponding to the target object according to each target retrieval sub-condition and its corresponding data index.

[0053] In this embodiment, the vector database is a database specifically used for storing, managing and querying feature vectors; the feature vectors stored in the vector database may be feature vectors corresponding to different texts, different voices, different images, and the like.

[0054] In this embodiment, the pre-filtering search of the vector database refers to filtering the feature vectors to be calculated according to specific conditions before performing similarity calculations based on the feature vectors of the target object and the feature vectors in the vector database, so as to narrow the range of the feature vectors, thereby improving the speed and efficiency of the similarity calculation.

[0055] In this embodiment, the target object may be different objects such as images, texts, and voices; this embodiment may determine the target object according to input or selection of the input terminal.

[0056] The acquisition unit 201 may acquire the pre-filtering retrieval condition corresponding to the target object according to the selection or input of the input terminal.

[0057] When acquiring the pre-filtering retrieval condition of the target object, the acquisition unit 201 may also adopt the following implementation method: in response to determining that the target object is an image, performing image recognition on the acquired target object; and acquiring the pre-filtering retrieval condition of the target object based on the obtained image recognition result.

[0058] If the target object is a text, the acquisition unit 201 may directly acquire the pre-filtering retrieval condition of the target object according to the specific content in the text.

[0059] If the target object is speech, the acquisition unit 201 may first convert the acquired speech into text, and then acquire the pre-filtering retrieval condition of the target object according to the converted text.

[0060] After obtaining the pre-filtering search condition, the obtaining unit 201 may split the obtained pre-filtering search condition, and then obtain a plurality of target search sub-conditions according to the splitting results.

[0061] It can be understood that if the acquisition unit 201 only obtains one target search sub-condition, this embodiment can use a preset method, such as a multi-threaded concurrent scanning method or a filter condition vectorization acceleration method, to perform a pre-filter search on the vector database according to the target search sub-condition (or the pre-filter search condition).

[0062] In this embodiment, after the acquisition unit 201 obtains multiple target search sub-conditions according to the pre-filtering search condition, the determination unit 202 determines the data indexes corresponding to the multiple target search sub-conditions in the vector database according to the condition types of the multiple target search sub-conditions.

[0063] The determining unit 202 first determines the condition type of each target search sub-condition, and then uses the data index corresponding to the determined condition type in the vector database as the data index corresponding to each target search sub-condition.

[0064] The determination unit 202 can directly determine the corresponding condition type based on the target retrieval sub-condition. For example, when the target retrieval sub-condition is the (red) sub-condition, the condition type corresponding to the sub-condition can be "clothing color"; for example, when the target retrieval sub-condition is the (age less than 30) sub-condition, the condition type corresponding to the sub-condition is "age".

[0065] In this embodiment, the data indexes corresponding to different condition types include vector data corresponding to different condition types, and each vector data corresponds to a different candidate object.

[0066] When determining the condition type of the target retrieval sub-condition, the determination unit 202 may input the target retrieval sub-condition into a pre-trained condition type determination model, and then obtain the condition type corresponding to the target retrieval sub-condition according to the output result of the condition type determination model.

[0067] In this embodiment, the vector database constructs different data indexes according to different condition types in advance, so after the determination unit 202 completes the determination of the condition type, it can determine the corresponding data index according to the condition type.

[0068] In this embodiment, after the determining unit 202 determines the data indexes corresponding to the multiple target search sub-conditions in the vector database, the searching unit 203 obtains the pre-filtering search result corresponding to the target object according to each target search sub-condition and its corresponding data index.

[0069] Specifically, when the retrieval unit 203 obtains the pre-filtering retrieval result of the corresponding target object according to each target retrieval sub-condition and its corresponding data index, the implementation method that can be adopted is: according to each target retrieval sub-condition and its corresponding data index, obtain the pre-filtering retrieval sub-result corresponding to each target retrieval sub-condition; merge multiple pre-filtering retrieval sub-results, and use the obtained merged result as the pre-filtering retrieval result of the corresponding target object.

[0070] That is to say, the search unit 203 obtains the front-filter search sub-results corresponding to different target search sub-conditions by means of multi-data index matching, and then obtains the front-filter search result based on multiple front-filter search sub-results by means of merging, which can improve the speed of obtaining the front-filter search result.

[0071] Among them, when the retrieval unit 203 merges multiple front-filtering retrieval sub-results and uses the obtained merged result as the front-filtering retrieval result of the corresponding target object, the implementation method that can be adopted is: extracting candidate objects that exist in multiple front-filtering retrieval sub-results at the same time; and obtaining the front-filtering retrieval result of the corresponding target object based on the extracted candidate objects.

[0072] When the retrieval unit 203 obtains the pre-filtered retrieval sub-result corresponding to each target retrieval sub-condition based on each target retrieval sub-condition and its corresponding data index, the implementation method that can be adopted is: for each target retrieval sub-condition, the current target retrieval sub-condition is matched in and its corresponding data index; based on the matching result, the pre-filtered retrieval sub-result corresponding to the current target retrieval sub-condition is obtained.

[0073] The search unit 203 may further perform the following: obtaining a selectivity of matching results; in response to determining that the obtained selectivity is less than or equal to a preset selectivity threshold, obtaining a pre-filtered search sub-result corresponding to the current target search sub-condition according to the matching results.

[0074] That is to say, the retrieval unit 203 can obtain the pre-filtering retrieval sub-result corresponding to the current target retrieval sub-condition based on the obtained matching results only when the selection rate of the matching results is not particularly high. If the selection rate of the matching results is very high, it indicates that most of the candidate objects in the vector database meet the corresponding conditions and there is no need for pre-filtering retrieval sub-results.

[0075] In this embodiment, the data format of the pre-filtering search sub-results may be a bitmap, and the search unit 203 may merge the bitmaps corresponding to different pre-filtering search sub-results, thereby using the bitmap merging result as the pre-filtering search result corresponding to the target object.

[0076] It can be understood that, in the bitmap merging result obtained by merging different bitmaps by the retrieval unit 203 , only the position information of the candidate objects existing in all the bitmaps is retained.

[0077] After the retrieval unit 203 obtains the pre-filtering retrieval result corresponding to the target object, the feature vector of the candidate object corresponding to the pre-filtering retrieval result can be obtained from the vector database, and then the similarity calculation between the target object and the candidate object is completed according to the feature vector.

[0078] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0079] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0080] like Figure 3 , is a block diagram of an electronic device for performing a method for pre-filtering retrieval of a vector database according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0081] like Figure 3As shown, the device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 can also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0082] A number of components in the device 300 are connected to the I / O interface 305, including: an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0083] The computing unit 301 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 301 performs the various methods and processes described above, such as a method for pre-filtering a vector database. For example, in some embodiments, the method for pre-filtering a vector database may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 308.

[0084] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 300 via the ROM 302 and / or the communication unit 309. When the computer program is loaded into the RAM 303 and executed by the computing unit 301, one or more steps of the method for pre-filtering and retrieving the vector database described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to perform the method for pre-filtering and retrieving the vector database in any other appropriate manner (e.g., by means of firmware).

[0085] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0086] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable device for pre-filtering and retrieving a vector database, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0087] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0088] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0089] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0090] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.

[0091] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0092] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for pre-filtering and searching a vector database, comprising: Acquire a pre-filtering retrieval condition of a target object, and obtain a plurality of target retrieval sub-conditions according to the pre-filtering retrieval condition; Determining, according to the condition types of the multiple target search sub-conditions, data indexes corresponding to the multiple target search sub-conditions in the vector database; According to each target search sub-condition and its corresponding data index, a pre-filtered search result corresponding to the target object is obtained.

2. The method according to claim 1, wherein: The obtaining of the pre-filtering search result corresponding to the target object according to each target search sub-condition and its corresponding data index comprises: According to each target search sub-condition and its corresponding data index, a pre-filtered search sub-result corresponding to each target search sub-condition is obtained; The plurality of pre-filtering search sub-results are merged, and the obtained merged result is used as the pre-filtering search result corresponding to the target object.

3. The method according to claim 2, wherein: The obtaining of the pre-filtered search sub-result corresponding to each target search sub-condition according to each target search sub-condition and its corresponding data index comprises: For each target search sub-condition, match the current target search sub-condition in its corresponding data index; According to the matching results, the pre-filtered search sub-results corresponding to the current target search sub-conditions are obtained.

4. The method according to claim 3, wherein: The obtaining of the pre-filtered search sub-results corresponding to the current target search sub-condition according to the matching results includes: Obtaining a selection rate of the matching result; In response to determining that the selection rate is less than or equal to a preset selection rate threshold, a pre-filtered search sub-result corresponding to the current target search sub-condition is obtained according to the matching result.

5. The method according to claim 2, wherein: The step of merging the plurality of pre-filtering search sub-results and using the obtained merged result as the pre-filtering search result corresponding to the target object includes: Extracting candidate objects that exist simultaneously in the plurality of pre-filtering search sub-results; According to the extracted candidate objects, a pre-filtered retrieval result corresponding to the target object is obtained.

6. The method according to claim 1, wherein: The pre-filtering retrieval conditions for obtaining the target object include: In response to determining that the target object is an image, performing image recognition on the target object; According to the obtained image recognition result, a pre-filtering retrieval condition of the target object is obtained.

7. The method according to claim 1, wherein: The pre-filtering retrieval conditions for obtaining the target object include: In response to determining that the target object is speech, converting the target object into text; According to the obtained text conversion result, the pre-filtering retrieval condition of the target object is obtained.

8. A device for pre-filtering and searching a vector database, comprising: An acquisition unit, used to acquire a pre-filtering retrieval condition of a target object, and obtain a plurality of target retrieval sub-conditions according to the pre-filtering retrieval condition; A determination unit, configured to determine, according to the condition types of the multiple target search sub-conditions, data indexes respectively corresponding to the multiple target search sub-conditions in the vector database; The retrieval unit is used to obtain the pre-filtered retrieval result corresponding to the target object according to each target retrieval sub-condition and its corresponding data index.

9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Vector retrieval method, system and equipment based on vector ID and storage medium

    CN120277248A

  • Database retrieval method and device, equipment, storage medium and product

    CN121456193A

  • Method and device for generating Token by intelligent computing cloud platform through computing power acceleration

    CN122364446A