Object searching method and device, equipment and storage medium

By combining the quantitative representation index and the inverted index table, candidate quantized representations related to the reference quantized representation are selected and local filtered, which solves the search delay problem under large-scale data and complex filtering conditions, and realizes high-performance and low-latency vector retrieval.

CN119513225APending Publication Date: 2025-02-25HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311033821.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the process of vector search with attribute filtering conditions, it is difficult for the prior art to efficiently process large-scale data and complex filtering conditions, resulting in excessive search delay.

Method used

By obtaining the reference quantized representation and attribute values, selecting relevant candidate quantized representations using the quantized representation index, and local area filtering is performed based on the inverted index table to return the target object similar to the reference object.

Benefits of technology

It realizes high-performance and low-latency retrieval under large data volume and complex filtering conditions, and reduces the scanned data volume and partition number through localized operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513225A_ABST
    Figure CN119513225A_ABST
Patent Text Reader

Abstract

The invention provides an object searching method and device, equipment and a storage medium, and relates to the technical field of data searching. The method includes obtaining a reference quantized representation for a reference object in a search input and a set of attribute values for the reference object. The method further includes selecting, from the plurality of quantized representations, a set of candidate quantized representations related to the reference quantized representation based on the reference quantized representation and a quantized representation index generated from the plurality of quantized representations of the plurality of objects. The method further includes filtering the set of candidate quantized representations based on the set of attribute values and a set of inverted index tables associated with a set of partitions of the set of candidate quantized representations of the plurality of partitions formed by the plurality of quantized representations. The method further includes returning a plurality of target objects similar to the reference object based on the filtered set of candidate quantized representations. According to the embodiment of the invention, high-performance and low-delay retrieval under the conditions of large data volume and complex filtering is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application mainly relate to the field of data search. More specifically, the embodiments of the present application relate to a method, apparatus, device and storage medium for searching an object. Background Art

[0002] With the widespread application of artificial intelligence (AI) technology, the emergence of natural language processing, image processing and other technologies has promoted the transformation and development of the traditional search field. In the traditional search field, deterministic search algorithms such as keywords are mostly used. AI technology has enhanced the processing capabilities of unstructured data and supports the conversion of unstructured data into multi-dimensional vectors, thereby transforming the search from the original keyword search to vectorized search, and from deterministic search to similarity search.

[0003] In the field of vector retrieval, the distance between vectors is generally used to characterize the degree of similarity of corresponding data. Moreover, in most business scenarios, on the premise of satisfying similarity retrieval, the search results also need to meet the attribute feature filtering conditions. This type of problem can be described as vector retrieval with attribute filtering conditions. However, there are still many problems that need to be solved in the process of vector retrieval with attribute filtering conditions. Summary of the invention

[0004] An embodiment of the present application provides a solution for searching an object.

[0005] According to the first aspect of the present application, a method for searching for objects is provided. The method for searching for objects includes obtaining a reference quantization representation for a reference object in a search input and a set of attribute values ​​for the reference object; selecting a set of candidate quantization representations related to the reference quantization representation from multiple quantization representations based on the reference quantization representation and a quantization representation index generated from multiple quantization representations of multiple objects; filtering a set of candidate quantization representations based on a set of attribute values ​​and a set of inverted index tables of a set of partitions associated with a set of candidate quantization representations in multiple partitions formed by the multiple quantization representations, wherein the inverted index tables in the set of inverted index tables are generated by the attribute values ​​of the objects corresponding to the quantization representations in the corresponding partitions; and returning multiple target objects similar to the reference object based on the filtered set of candidate quantization representations.

[0006] In this way, the quantitative representation index is used so that only local areas related to multiple quantitative representations are scanned during the retrieval process to obtain a set of candidate quantitative representations. At the same time, when filtering the quantitative representation, only the inverted index table of the partition related to the local area needs to be used to calculate the reference result for filtering the quantitative representation. As the amount of data grows massively, the above operation will only slightly increase the amount of data scanned for retrieval, and the number of corresponding partitions scanned will also only slightly increase, ensuring high-performance, low-latency retrieval under large data volumes and complex filtering conditions.

[0007] In some embodiments, selecting a group of candidate quantization representations related to a reference quantization representation from a plurality of quantization representations includes: selecting a group of similar partitions adjacent to the reference quantization representation from a similar region formed by performing a similar aggregation operation on the plurality of quantization representations based on the similarity between the reference quantization representation and the quantization representation in the quantization representation index; and determining the quantization representations in a group of similar partitions as a group of candidate quantization representations. In this way, it is possible to quickly and accurately determine a portion of the quantization representations that need to be processed from the plurality of quantization representations without having to process all of the quantization representations.

[0008] In some embodiments, filtering a set of candidate quantization representations includes: determining a logical operation for filtering a set of candidate quantization representations based on a set of attribute values; determining whether a reference result for filtering the candidate quantization representations has been calculated for a target partition in a set of partitions that corresponds to a candidate quantization representation in a set of candidate quantization representations; if it is determined that the reference result has not been calculated for the target partition, determining the reference result based on the logical operation and the inverted index table for the target partition; and filtering the candidate quantization representations based on the reference result. In this way, the local area data scanned by the search can be filtered quickly and accurately, ensuring high-performance filtering retrieval under large data volumes; as the complexity of the filtering conditions increases, the calculation delay of the inverted filtering increases less, and low-latency retrieval under complex filtering conditions can be provided.

[0009] In some embodiments, filtering a set of candidate quantized representations further comprises: if it is determined that a reference result has been calculated for the target partition, filtering the candidate quantized representations based on the reference result. In this way, the reference result for filtering can be quickly obtained.

[0010] In some embodiments, the method further includes: if it is determined that the candidate quantization representation does not pass the filtering, removing the candidate quantization representation from a set of candidate quantization representations. In this way, irrelevant quantization representations can be quickly removed to ensure accuracy.

[0011] In some embodiments, returning multiple target objects similar to the reference object includes: determining a set of similarities between the reference quantized representation and a filtered set of candidate quantized representations; and selecting multiple target quantized representations from the filtered set of candidate quantized representations based on the set of similarities. In this way, multiple target quantized representations to be retrieved can be selected quickly and accurately.

[0012] In some embodiments, selecting multiple target quantization representations from the filtered set of candidate quantization representations includes: sorting the filtered set of candidate quantization representations based on a set of similarities; and selecting multiple target quantization representations from the sorted set of candidate quantization representations. In this way, multiple target quantization representations to be retrieved can be selected quickly and accurately.

[0013] In some embodiments, the method further includes: performing similarity aggregation operations on the multiple quantized representations based on the similarities between the multiple quantized representations; and generating a quantized representation index based on the multiple quantized representations that have been similarly aggregated. In this way, the quantized representation index can be generated quickly, and the efficiency of quantized representation retrieval can be improved.

[0014] In some embodiments, the method further includes: performing a clustering operation on the multiple quantized representations based on the similarity between the multiple quantized representations to determine multiple partitions; and determining an inverted index table of attribute values ​​of a group of objects corresponding to the group of quantized representations based on a group of quantized representations in each of the multiple partitions. In this way, an inverted index table for a partition can be generated quickly and accurately, and the amount of calculation in the retrieval filtering process can be reduced.

[0015] In some embodiments, each of the plurality of partitions includes: an identifier of the object, a quantized representation of the object, and an offset position of the quantized representation of the object in the partition. In this way, information in the partition can be quickly determined.

[0016] In some embodiments, the method further comprises: for each of the plurality of objects, generating a mapping relationship between the object's identifier and the partition where the quantized representation of the object is located and the offset position in the partition. In this way, the partition where the quantized representation of the object is located and the position in the partition can be quickly determined by the object's identifier.

[0017] In some embodiments, determining an inverted index table of attribute values ​​of a set of objects corresponding to a set of quantitative representations includes: obtaining a set of quantitative representations in a partition; obtaining attribute values ​​of a set of objects based on identifiers of a set of objects corresponding to the set of quantitative representations; and establishing an inverted index table based on the attribute values ​​of the set of objects. In this way, an inverted index table for a partition can be quickly generated, and the amount of calculation in the retrieval filtering process can be reduced.

[0018] According to the second aspect of the present application, a device for searching objects is provided. The device for searching objects includes a reference quantization representation and an attribute value acquisition unit, configured to acquire a reference quantization representation for a reference object in a search input and a set of attribute values ​​for the reference object; a candidate quantization representation selection unit, configured to select a set of candidate quantization representations related to the reference quantization representation from multiple quantization representations based on the reference quantization representation and a quantization representation index generated from multiple quantization representations of multiple objects; a quantization representation filtering unit, configured to filter a set of candidate quantization representations based on a set of attribute values ​​and a set of inverted index tables of a set of partitions associated with a set of candidate quantization representations in multiple partitions formed by multiple quantization representations, wherein the inverted index tables in the set of inverted index tables are generated by the attribute values ​​of the objects corresponding to the quantization representations in the corresponding partitions; and a target object returning unit, configured to return multiple target objects similar to the reference object based on the filtered set of candidate quantization representations.

[0019] In some embodiments, the candidate quantization representation selection unit includes: an aggregation selection unit, configured to select a group of similar partitions adjacent to the reference quantization representation from a similar area formed by performing similar aggregation operations on multiple quantization representations based on the similarity between the reference quantization representation and the quantization representation in the quantization representation index; and a candidate quantization representation determination unit, configured to determine the quantization representations in a group of similar partitions as a group of candidate quantization representations.

[0020] In some embodiments, the quantization representation filtering unit includes: a logical operation determination unit, configured to determine a logical operation for filtering a set of candidate quantization representations based on a set of attribute values; a partition filtering determination unit, configured to determine whether a reference result for filtering the candidate quantization representation has been calculated for a target partition in a set of partitions corresponding to a candidate quantization representation in a set of candidate quantization representations; a reference result determination unit, configured to determine a reference result based on the logical operation and an inverted index table for the target partition if it is determined that the reference result has not been calculated for the target partition; and a first filtering unit, configured to filter the candidate quantization representations based on the reference result.

[0021] In some embodiments, the quantization representation filtering unit further includes: a second filtering unit configured to filter the candidate quantization representations based on the reference result if it is determined that the reference result has been calculated for the target partition.

[0022] In some embodiments, the apparatus further comprises: a removing unit configured to remove the candidate quantized representation from a set of candidate quantized representations if it is determined that the candidate quantized representation does not pass the filtering.

[0023] In some embodiments, the target object return unit includes: a similarity determination unit configured to determine a set of similarities between a reference quantization representation and a filtered set of candidate quantization representations; and a plurality of target quantization representation selection units configured to select a plurality of target quantization representations from the filtered set of candidate quantization representations based on a set of similarities.

[0024] In some embodiments, the multiple target quantization representation selection units include: a sorting unit configured to sort a filtered set of candidate quantization representations based on the set of similarities; and a quantization representation selection unit configured to select multiple target quantization representations from the sorted set of candidate quantization representations.

[0025] In some embodiments, the apparatus further includes: a similarity aggregation operation unit configured to perform a similarity aggregation operation on multiple quantized representations based on the similarity between the multiple quantized representations; and a quantized representation index generation unit configured to generate a quantized representation index based on the multiple quantized representations that have been similarly aggregated.

[0026] In some embodiments, the device also includes: multiple partition determination units, configured to perform clustering operations on multiple quantized representations based on similarities between the multiple quantized representations to determine multiple partitions; and an inverted index table determination unit, configured to determine an inverted index table of attribute values ​​of a set of objects corresponding to a set of quantized representations based on a set of quantized representations in each partition of the multiple partitions.

[0027] In some embodiments, each partition of the plurality of partitions includes: an identification of the object, a quantized representation of the object, and an offset position of the quantized representation of the object in the partition.

[0028] In some embodiments, the apparatus further includes: a mapping relationship generating unit configured to generate, for each object among the plurality of objects, a mapping relationship between the identifier of the object and the partition where the quantized representation of the object is located and an offset position in the partition.

[0029] In some embodiments, the inverted index table determination unit includes: a quantization representation acquisition unit, configured to acquire a set of quantization representations in a partition; an object attribute value acquisition unit, configured to acquire attribute values ​​of a set of objects based on identifiers of a set of objects corresponding to the set of quantization representations; and an inverted index table establishment unit, configured to establish an inverted index table based on the attribute values ​​of the set of objects.

[0030] According to the third aspect of the present application, an electronic device is also provided, comprising: at least one computing unit; and at least one memory, wherein the at least one memory is coupled to the at least one computing unit and stores instructions for execution by the at least one computing unit, wherein when the instructions are executed by the at least one computing unit, the device executes the method described in the first aspect of the present application.

[0031] According to a fourth aspect of the present application, a computer-readable storage medium is further provided, on which a computer program is stored, and when the program is executed by a processor, the method described in the first aspect of the present application is implemented.

[0032] According to a fifth aspect of the present application, a computer program product is also provided, comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to the first aspect of the present application.

[0033] It can be understood that the device of the second aspect, the electronic device of the third aspect, the computer storage medium of the fourth aspect, or the computer program product of the fifth aspect provided above is used to execute the method provided in the first aspect. Therefore, the explanation or description of the first aspect is also applicable to the second aspect, the third aspect, the fourth aspect, and the fifth aspect. In addition, the beneficial effects that can be achieved in the second aspect, the third aspect, the fourth aspect, and the fifth aspect can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0035] Figure 1 A schematic diagram showing an example environment in which various embodiments of the present application can be implemented;

[0036] Figure 2 A schematic diagram showing an example process in which various embodiments of the present application can be implemented;

[0037] Figure 3 A schematic diagram showing an example implementation architecture according to some embodiments of the present application;

[0038] Figure 4 A schematic diagram showing a schematic process of constructing a joint index according to some embodiments of the present application;

[0039] Figure 5 A schematic diagram showing an example of online joint search according to some embodiments of the present application;

[0040] Figure 6 A schematic flow chart for retrieving an object according to some embodiments of the present application is shown;

[0041] Figure 7 A schematic flow chart of constructing a vector index according to some embodiments of the present application is shown;

[0042] Figure 8 A schematic flowchart of constructing an inverted index according to some embodiments of the present application is shown;

[0043] Fig. 9 A schematic flow chart of parsing filtering conditions according to some embodiments of the present application is shown;

[0044] Fig.10 A schematic flow chart of retrieving similar vectors according to some embodiments of the present application is shown;

[0045] Fig.11 A block diagram showing an apparatus according to some embodiments of the present application; and

[0046] Fig.12 A block diagram of a computing device capable of implementing various embodiments of the present application is shown. DETAILED DESCRIPTION

[0047] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.

[0048] In the description of the embodiments of the present application, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0049] As mentioned above, in most business scenarios, on the premise of satisfying similarity search, the search results also need to meet the attribute feature filtering conditions. However, in order to realize the vector search with attribute feature filtering conditions for a certain object, a traditional solution is to perform inverted filtering first and then search. Specifically, in this method, it is first determined whether the request has a filtering condition. If so, the inverted index of all vectors is used to complete the filtering operation and obtain the vectors that meet the filtering conditions. Then, when scanning the vector, if there is a filtering condition, the previously calculated filtering result is used to first determine whether the vector meets the filtering condition, and then the similarity is calculated for the vector that meets the filtering condition. If there is no filtering condition, the similarity is calculated directly. This method can effectively realize the attribute value filtering function, but as the total amount of vectors increases, the inverted table of attribute values ​​will grow together. Since it is necessary to complete the conditional filtering operation based on the inverted table for all vectors, the filtering calculation time continues to increase with the increase in the number of vectors, which in turn causes the entire retrieval delay to continue to increase. Therefore, in the case of large-scale data, the filtering operation for the entire amount of data will cause excessive delay and fail to meet the business performance requirements.

[0050] Another traditional solution is to encode the labels and filter them during retrieval. Specifically, this solution determines whether the request contains a filter condition, and if so, encodes the scalar value in the filter condition. When scanning a vector, if a filter condition exists, the filter calculation is completed using the previously calculated encoded value and the encoded value in the scalar index, and then the similarity is calculated for the vectors that meet the filter condition; if the filter condition does not exist, the similarity is calculated directly. Since the scalar attribute value needs to be encoded, the number of attribute values ​​must be limited and enumerable, which limits the scope of use of the filtering function. In addition, as the complexity of the filter condition increases, the amount of calculation for each vector to determine whether the filter condition is met continues to increase, resulting in a significant increase in retrieval latency. This solution can ensure that the retrieval latency will not increase as the amount of data increases; however, as the complexity of the filter condition increases, the retrieval latency will increase significantly.

[0051] In order to solve at least some of the above problems and other potential problems, in an embodiment of the present application, a computing device first obtains a reference quantization representation for a reference object in a search input and a set of attribute values ​​for the reference object. Then the computing device uses the reference quantization representation and the quantization representation index generated from multiple quantization representations of multiple objects to determine a set of candidate quantization representations related to the reference quantization representation. Then the computing device filters a set of candidate quantization representations according to the set of attribute values ​​and in combination with a set of inverted index tables of a set of partitions associated with a set of candidate quantization representations in multiple partitions formed by multiple quantization representations. Finally, the computing device can return multiple target objects similar to the reference object based on multiple target quantization representations selected from a filtered set of candidate quantization representations. In this way, the quantization representation index is used so that only local areas related to multiple quantization representations are scanned during the retrieval process to obtain a set of candidate quantization representations. At the same time, when filtering the quantization representation, only the inverted index table of the partition related to the local area needs to be used to calculate the reference result for filtering the quantization representation. As the amount of data grows massively, the above operations will only slightly increase the amount of data scanned for retrieval, and the corresponding number of partitions scanned will also only slightly increase, ensuring high-performance, low-latency retrieval under large data volumes and complex filtering conditions.

[0052] The embodiments of the present application are further described below in conjunction with the accompanying drawings. Figure 1 1 is a schematic diagram of an example environment 100 in which various embodiments of the present application can be implemented. Figure 1 As shown, the example environment 100 includes a computing device 104. The computing device 104 includes, but is not limited to, a vehicle-mounted computing device, a personal computer, a server, a handheld or laptop device, a mobile device, a multiprocessor system, a consumer electronics product, a minicomputer, a mainframe computer, a distributed computing environment including any of the above systems or devices, and the like.

[0053] The computing device 104 can be used to provide search services for users. After the user inputs the reference object 102, multiple target objects 118 similar to the reference object 102 can be provided to the user for viewing or use by the user. The reference object 102 input by the user can be any suitable data information. In some embodiments, the reference object 102 can be a picture. For example, the user inputs a picture to find a picture similar to the content in the picture, such as using a picture including a dog to find a picture with a dog similar to the dog in the picture. In some embodiments, the reference object 102 can be text information. The user enters text to find information similar to or related to the input text. For example, the user enters to find an application, and the reference object can be the name of the application; if the user wants to find some information, the reference object can be some keywords entered by the user. In some embodiments, the reference object can be an audio clip that the user wants to retrieve, etc. The above examples are only used to describe the present disclosure, and are not specifically limited to the present disclosure. The reference object can be any suitable input information that the user wants to retrieve.

[0054] like Figure 1 As shown, the computing device 104 processes the reference object input by the user to generate a reference quantized representation 106 corresponding to the reference object, such as a vector corresponding to the reference object. Figure 1 It is shown that the computing device 104 receives the reference object 102, and then the computing device generates a reference quantized representation 106 corresponding to the reference object 102, which is only an example and not a specific limitation of the present disclosure. In another example, the reference quantized representation 106 of the reference object 102 is obtained by other computing devices, and then the computing device 104 receives the reference quantized representation 106 of the reference object 102 from the other device.

[0055] exist Figure 1 In the embodiment, in addition to obtaining the reference quantitative representation 106 of the reference object 102, the computing device 104 will also receive a set of attribute values ​​108 of the reference object 102 if some attribute information needs to be used to filter the reference object during the retrieval process. The set of attribute values ​​can be used as a label of the reference object. In some embodiments, the set of attribute values ​​108 is obtained by the reference object input by the user. For example, when the reference object input by the user is a picture of a dog, in addition to generating a quantitative representation of the picture, an image content label can be added and set to a dog. In another example, the set of attribute values ​​is some directional information collected by the computing device when the user inputs the reference object as the attribute information of the reference object, such as the region of the object to be found, the age of the object, and other information. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure.

[0056] The computing device 104 can also obtain a pre-generated quantitative representation index 110 for multiple quantitative representations of multiple objects in the target library to be retrieved. The quantitative representation index 110 is constructed by using a vector aggregation algorithm for multiple quantitative representations of multiple objects in the target library. For example, an inverted file (IVF) clustering algorithm or a graph aggregation algorithm is used to perform similar aggregation operations on multiple quantitative representations to generate a quantitative representation index for searching multiple quantitative representations. In one example, the quantitative representation index is a vector index. Then, the computing device uses the obtained reference quantitative representation 106 to search for a group of similar partitions similar to the reference quantitative representation 106 in the quantitative representation index 110 in the similar area for multiple quantitative representations generated by the above-mentioned similar aggregation algorithm. Then, the quantitative representations in the group of similar partitions are used as a group of candidate quantitative representations 112. In one example, the vector aggregation algorithm is an IVF clustering algorithm, and a group of similar partitions are selected from multiple partitions generated by processing multiple quantitative representations by the IVF clustering algorithm. In another example, the vector aggregation algorithm is a graph aggregation algorithm, and the group of similar partitions are some areas in the graph formed by processing multiple quantitative representations by the graph aggregation algorithm. The above examples are only used to describe the present disclosure, but are not specifically limited to the present disclosure.

[0057] In addition, the computing device 104 can also obtain information about multiple partitions related to multiple quantitative representations of multiple objects in the target library and an inverted index table of attribute values ​​corresponding to each partition in the multiple partitions. The multiple partitions are obtained by using a vector partition aggregation algorithm for multiple quantitative representations of multiple objects, such as an IVF clustering algorithm. This operation can be performed in the computing device 104 or on other computing devices, and then the computing device 104 obtains multiple partitions obtained by the partition aggregation algorithm. For each partition, it can include the identifier of each object located in the partition, the quantitative representation of the object, and the offset position of the quantitative representation in the partition. The identifier of the object in the partition can be used to obtain the attribute value of the corresponding object, and then these attribute values ​​are used to generate an inverted index table for each partition. For example, the inverted index table includes the attribute value and the offset position of the quantitative representation of the object having the attribute value in the partition. The above example is only used to describe the present disclosure, and is not a specific limitation of the present disclosure. Any suitable information can also be included in the inverted index table.

[0058] Next, the computing device 104 needs to filter a set of candidate quantization representations 112 to determine whether each candidate quantization representation in the set of candidate quantization representations meets the requirements of a set of attribute values ​​of the input reference object. If the candidate quantization representation meets the requirements of a set of attribute values ​​of the input reference object, it indicates that the candidate quantization representation has passed the filtering. If the candidate quantization representation does not meet the requirements of a set of attribute values ​​of the input reference object, it indicates that the candidate quantization representation has not passed the filtering, and the quantization representation is removed from the set of candidate quantization representations. Specifically, when filtering the set of candidate quantization representations, it is necessary to use a set of attribute values ​​108 and a set of inverted index tables 114 of a set of partitions corresponding to the set of candidate quantization representations to filter the set of candidate quantization representations 112. After filtering the set of candidate quantization representations 112, a filtered set of candidate quantization representations 116 is generated. Then, multiple target quantization representations are selected from the filtered set of candidate quantization representations 116, for example, multiple target quantization representations with high similarity are selected based on the similarity between the quantization representation of the reference object and the quantization representation in the filtered set of candidate quantization representations. Then, a corresponding plurality of target objects 118 may be obtained based on the plurality of target quantized representations to be returned to the user or other computing devices.

[0059] In this way, the quantitative representation index is used so that only local areas related to multiple quantitative representations are scanned during the retrieval process to obtain a set of candidate quantitative representations. At the same time, when filtering the quantitative representation, only the inverted index table of the partition related to the local area needs to be used to calculate the reference result for filtering the quantitative representation. As the amount of data grows massively, the above operation will only slightly increase the amount of data scanned for retrieval, and the number of corresponding partitions scanned will also only slightly increase, ensuring high-performance, low-latency retrieval under large data volumes and complex filtering conditions.

[0060] Combined with the above Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present application can be implemented is described below. Figure 2 Schematic diagram of an example process 200 in which various embodiments of the present application can be implemented. In this example process, the quantization of an object is represented as a vector of the object. Figure 2As shown, before performing vector retrieval, the vector objects in the database or storage repository need to be processed to construct a joint index. Then, when performing vector retrieval, the constructed joint index is used to find the appropriate vector. Specifically, first determine the vector object 202 to be used to construct the joint index. In some embodiments, the vector object 102 includes an object identifier, a vector of the object, and a simple value of the object. Further, the vector of the object is obtained by processing the information of the vector object itself. For example, feature extraction, feature encoding, and related processing are performed on some objects to obtain the vector of the object. Next, at box 204, a joint index is constructed for retrieval. The process of constructing a joint index can be seen in Figure 4 Description. After the joint index is constructed, before the actual search is performed, at box 206, the joint index is loaded in the vector engine. At this time, the computing device can store the joint index locally for fast retrieval. The above operation process is mainly performed before the search is performed. The operation described below is an online retrieval process. At box 210, the computing device performs a search with a filter condition. For example, the search can obtain the vector of the object input by the user, and at the same time, the attribute value of the object input by the user can be obtained. The attribute value can be used as a label of the object. For example, when an image with a dog is input, the dog identified from the image can be used as the attribute value or label of the image after processing. Then, the vector engine 208 is used for retrieval. The vector engine has loaded the joint index. The vector engine 208 uses the joint index, the vector of the input object, and the attribute value as the filter condition to perform the search. Then, the recall result that meets the filter condition is determined at box 212. In this way, using the joint index, the recall result that meets the filter condition can be quickly obtained, and when the amount of data increases, high-performance filter retrieval can be performed, and low-latency retrieval under complex filter conditions can be provided.

[0061] Combined with the above Figure 2 A schematic diagram of a specific example environment in which multiple embodiments of the present application can be implemented is described below. Figure 3 A schematic diagram of an example implementation architecture 300 is described according to some embodiments of the present application. Figure 3As shown, the technical solution of the present application can be implemented in a server 302. The server 302 includes a software layer 304, which includes software and applications that the server can respond to. The engine module 306 is located in the software layer 304, which is a vector engine online retrieval service component. The engine module 306 mainly processes online retrieval requests, and includes an interface 308. The interface 308 is used to accept online retrieval requests. The engine module 306 also includes a vector retrieval module 310, which is used to complete joint index loading. The engine module 306 also includes a data layer 314, which is used to store a joint index 318. The vector retrieval module 310 completes filtered retrieval through a joint filter search module 312. The index builder 316 mainly handles the construction of the joint index 318, and the joint index includes an attribute value inverted index and a vector index. Alternatively, the index builder 316 provides an offline index construction service for the vector engine.

[0062] Combined with the above Figure 3 A schematic diagram describing an example implementation architecture according to some embodiments of the present application. Figure 4 A schematic diagram of an exemplary process 400 for constructing a joint index according to some embodiments of the present application is described. Figure 4 As shown, each piece of object information in object information 402 includes an object identifier (ID), a vector value of the object, and an attribute value of the object (color: red, country: us). The attribute value of the object can also be called a scalar value of the object. Then, the object information 402 can be used to construct a joint index, which consists of a vector index and an attribute value inverted index table based on vector clustering information. The vector value of the object in object information 402 can be used to construct a vector index 404. Figure 4 As shown, a general vector algorithm (IVF clustering algorithm or graph aggregation algorithm) is used to construct a vector index 404. By using this vector algorithm, similar vectors are aggregated together, which facilitates the rapid search for similar partitions similar to the target vector during retrieval and traversal within the similar partitions. Figure 4 As shown, the vector index 404 is obtained by the IVF clustering algorithm, so it includes multiple partitions, and the vectors in each partition are similar. When searching for similar vectors through the vector index, the vector of the input reference object can be compared with the vector of the center point in each partition, and then several partitions with similar distances can be found, and then each vector in these partitions can be traversed. Figure 4The partition formed by the IVF algorithm is only an example and is not a specific limitation of the present disclosure. In other embodiments, the vectors of the object can be aggregated by other vector algorithms to generate a vector index. In this case, the vectors are not partitioned, and the similarity between the vectors is represented by the association relationship. In this case, when searching for a target vector related to the reference vector of the reference object, a similar region similar to the reference vector can be searched from the vector association relationship region for all objects as a similar partition. Then the vectors in the similar partition are traversed.

[0063] like Figure 4 As shown, multiple attribute value inverted index tables 416 can be further generated. For the vectors in the object information, the vectors are similarly aggregated by using a vector aggregation partitioning algorithm (IVF class) to generate multiple partitions 406, and the multiple partitions 406 include partitions 0 408, ... partition n 410. Based on the multiple partitions 406, an object identifier (ID) mapping relationship 414 can be further generated, which includes the object identifier and the partition where the vector of the object is located and the offset position in the partition. For example, the mapping relationship includes object identifier ID-[partition number, offset position in the partition]. Then, the attribute values ​​of the objects in each partition can be used to construct multiple attribute value inverted index tables 416 for multiple partitions.

[0064] exist Figure 4 For partition 0, it has an attribute value inverted index table 418. In the attribute value inverted index table 418, for the attribute value RED[], it indicates that there is no vector with the attribute value RED in the partition, and for the attribute value BLUE[1,3,9...], it indicates that the object corresponding to the vector at the offset position 1, 3, 9, etc. in the partition has the attribute value BLUE. For partition N, it has an inverted table 420. The inverted table can also be locally densified. For each attribute value, it includes the same number of bits as the number of vectors in the partition. If the object of the vector at an offset position in the partition has the attribute value, the corresponding bit position is set to 1, otherwise it is set to 0. After the densification process, the corresponding inverted tables 422 and 424 can be obtained. The generated vector index 404 and the multiple attribute value inverted index tables 416 together form a joint index 412 for retrieval.

[0065] Combined with the above Figure 4 A schematic diagram is provided to describe the schematic process of constructing a joint index according to some embodiments of the present application. Figure 5 A schematic diagram describing an example of online joint search according to some embodiments of the present application. Figure 5In the query 502 with filtering, the query vector and attribute value filtering conditions for the reference object are included. For example, the query vector is 101101, and its attribute value filtering conditions are "COLOR:RED" and "COUNTRY:US", and the relationship between the two attribute values ​​is an AND relationship. This indicates that the object found needs to have both "COLOR:RED" and "COUNTRY:US". Then, in box 504, the attribute value filtering conditions in the query are parsed to obtain the corresponding logical operation F (scalar1, scalar2...), scalar1 and scalar2 represent the corresponding attribute values, and the logical operation F performs an AND operation on "COLOR:RED" and "COUNTRY:US". Next, in the vector retrieval process, a vector similar to the reference vector is first searched from the vector index 506. Then, for each vector found from the vector index, it is determined whether the partition corresponding to the vector has completed the logical operation. If the partition has not completed the logical operation, use F(scalar1, scalar2…) and the inverted table of the partition to calculate the reference result that meets the filtering condition in the partition. For example, the inverted information with the attribute values ​​scalar1 and scalar2 will be found from the attribute value inverted index table of the partition, and then the obtained inverted information will be subjected to logical operations, such as AND operations, OR operations, or various combination operations, to obtain the reference result for filtering. The reference result includes which offset position vectors in the partition meet the attribute value filtering condition. Then, the reference result can be used to determine whether the vector meets the filtering condition. Figure 4 As shown, three partitions 1, 2 and M are determined from the plurality of partitions 508 by vector index, and filtering logic operations are applied to the three partitions. Then, as shown in block 510, light-colored points in the three partitions are filtered out, and dark-colored points are retained as filtered points. Then, for the vectors that meet the filtering conditions, the distance to the reference vector is calculated, and the most similar k vector values ​​512 are returned.

[0066] Combined with the above Figure 5 A schematic diagram of an example of online joint search according to some embodiments of the present application is described. Figure 6 A schematic flowchart 600 for retrieving an object according to some embodiments of the present application is described, wherein Figure 6 The method shown can be Figure 1 Executed by computing device 104 or any suitable computing device.

[0067] like Figure 6 As shown, at block 602, a reference quantized representation of a reference object in a search input and a set of attribute values ​​for the reference object are obtained. Figure 1As shown, the information of the reference object 102 is included in the user's search input, and then the reference quantitative representation 106 of the reference object 102 can be obtained at the computing device 104 or the reference quantitative representation 106 of the reference object can be obtained from other computing devices. In one example, the object can be feature extracted and then the extracted features are encoded and converted into vector features. In another example, the object is directly mapped to a vector. For example, the object is text, and a vector of the text is generated based on the vector corresponding to each word in the text. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. Those skilled in the art can obtain the reference quantitative representation of the reference object in any suitable manner.

[0068] For searches that require filtering using attribute values, it is also necessary to obtain a set of attribute values ​​of the reference object used for filtering. This set of attribute values ​​is information associated with the reference object to be searched, which can be used as a label for the reference object. For example, this set of attribute information can be obtained from the reference object; it can also be determined by information collected by the computing device, such as the geographical scope of the search, the age of the user who inputs the search object, and other information. If the search object does not need to be filtered, it is not necessary to obtain a set of attribute values ​​of the reference object.

[0069] At block 604, a set of candidate quantized representations related to the reference quantized representation is selected from the plurality of quantized representations based on the reference quantized representation and the quantized representation index generated from the plurality of quantized representations of the plurality of objects. For example, the computing device 104 obtains a set of candidate quantized representations 110 according to the quantized representation 106 by using the quantized representation index generated from the plurality of quantized representations of the plurality of objects.

[0070] In some embodiments, the quantization representation index is generated by the computing device 104. Additionally, the generation process can be generated offline by the computing device 104. During the generation process, the computing device 104 first calculates the similarity between the quantization representations. In one example, the similarity is represented by the distance between the quantization representations. In another example, the similarity is represented by the cosine similarity between the quantization representations. The above examples are only used to describe the present disclosure, but not to specifically limit the present disclosure. Those skilled in the art can use any suitable method to calculate the similarity between vectors. Then, based on the similarity between multiple quantization representations, a similar aggregation operation is performed on multiple quantization representations. Then, the computing device generates a quantization representation index based on multiple quantization representations that are similarly aggregated. In some embodiments, the computing device can use an inverted file clustering algorithm or a graph aggregation algorithm to perform a similar aggregation operation on multiple quantization representations to generate a quantization representation index for searching multiple quantization representations. In some embodiments, the quantization representation index is generated by other computing devices according to the above method and obtained by the computing device 104. The above examples are only used to describe the present disclosure, but not to specifically limit the present disclosure.

[0071] In some embodiments, after obtaining the quantization representation index, when selecting a group of candidate quantization representations related to the reference quantization representation from multiple quantization representations, the similarity between the reference quantization representation and the quantization representation in the quantization representation index can be used to select a group of similar partitions adjacent to the reference quantization representation from the similar area formed by the similar aggregation operation corresponding to the multiple quantization representations. Then the quantization representations in a group of similar partitions are determined as a group of candidate quantization representations. In some embodiments, when the quantization representation index is obtained by an inverted file clustering algorithm, the similarity between the reference quantization index and the central quantization representation of each partition in the inverted file clustering can be calculated first. Then a predetermined number of partitions with high similarity are selected from the multiple partitions generated by the inverted file clustering. Then the quantization representations in the predetermined number of partitions with high similarity are used as a group of candidate quantization representations. In some embodiments, when the quantization representation index is implemented by a graph aggregation algorithm, the corresponding similar partitions can be found by calculating the similarity between the reference quantization representation and the quantization representation in the similar area implemented by the graph aggregation algorithm. Then the quantization representations in the similar partitions found are determined as a group of candidate quantization representations. The above examples are only used to describe the present disclosure, and are not specifically limited to the present disclosure. Those skilled in the art may determine a group of candidate quantization representations related to the reference quantization representation according to the quantization representation index in any appropriate manner.

[0072] At block 606, the set of candidate quantized representations is filtered based on the set of property values ​​and a set of inverted index tables associated with a set of partitions of the set of candidate quantized representations in the plurality of partitions formed by the plurality of quantized representations. The inverted index tables in the set of inverted index tables are generated by the property values ​​of the objects corresponding to the quantized representations in the corresponding partitions. For example, the computing device 104 uses the set of inverted index tables 114 obtained by the set of candidate quantized representations and then filters the set of candidate quantized representations 112 in combination with the set of property values ​​108 of the reference object 102 to generate a filtered set of candidate quantized representations 116.

[0073] In some embodiments, the computing device 104 may generate multiple partitions according to multiple quantitative representations of multiple objects in the object library. Specifically, the computing device determines multiple partitions by clustering the multiple quantitative representations according to the similarity between the multiple quantitative representations of the multiple objects. For example, multiple partitions may be generated by processing multiple quantitative representations of multiple objects through an inverted file clustering algorithm. For example, each of the multiple partitions may include: an identification of an object, a quantitative representation of the object, and an offset position of the quantitative representation of the object in the partition. The above example is only used to describe the present disclosure, but not to specifically limit the present disclosure, and each partition may include any appropriate information. Then, the computing device 104 may further determine an inverted index table of attribute values ​​of a group of objects corresponding to a group of quantitative representations according to a group of quantitative representations in each of the multiple partitions. Specifically, when determining an inverted index table of attribute values ​​of a group of objects corresponding to a group of vectors, the computing device 104 may first obtain a group of quantitative representations in the partition. For example, after the partitions for multiple quantitative representations are determined by the above clustering algorithm, the identification of the quantitative representations and their corresponding objects in each partition may be known. At this time, the attribute values ​​of a group of objects may be obtained according to the identification of a group of objects corresponding to a group of quantitative representations. Then, the acquired attribute values ​​of the group of objects are used to establish an inverted index table. The inverted index table is established based on the attribute values ​​of multiple objects, and the offset position of the vector including the attribute in the distinction can be found through it. In some embodiments, the process of clustering and partitioning multiple quantized representations of multiple objects and generating an inverted index table corresponding to each partition can be implemented on other computing devices, and the computing device 104 can receive it from other computing devices as needed. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure.

[0074] In some embodiments, the computing device also generates a mapping relationship for each of the multiple objects. For each of the multiple objects, the computing device can generate a mapping relationship between the identification of the object and the partition where the quantization representation of the object is located and the offset position in the partition. In some embodiments, when filtering a set of candidate quantization representations, the computing device 104 determines the logical operation for filtering a set of candidate quantization representations based on a set of attribute values ​​for the reference object. In one example, if the searched object is required to have each essential value in the set of attribute values, it is necessary to construct a logical operation with a logical and relationship of these attribute values. In another example, if the searched object is required to have only one essential value in the set of attribute values, it is necessary to construct a logical or operation with these attribute values. In another example, the set of attribute values ​​can be subjected to a combination of logical and and logical or operations as needed. The above examples are only used to describe the present disclosure, not to specifically limit the disclosure. Those skilled in the art can set the logical operation generated by a set of attribute values ​​as needed.

[0075] In some embodiments, when filtering a set of candidate quantization representations, it is also necessary to use the reference results of the target partition corresponding to the candidate quantization representation in the set of candidate quantization representations. Therefore, when filtering a set of candidate quantization representations, it is necessary to first determine the target partition corresponding to the candidate quantization representation in the set of candidate quantization representations. This process is implemented using the mapping relationship between the identifier of the object described above and the partition where the quantization representation of the object is located and the offset position in the partition. For example, for a candidate quantization representation in a set of candidate quantization representations, it is necessary to first determine the identifier of the object corresponding to the candidate quantization representation. Then use the identifier to find the target partition where the candidate quantization representation is located and its offset position in the target partition in the above mapping relationship. After determining the target partition where the candidate quantization representation is located, it is then determined whether the reference result for filtering the candidate quantization representation has been calculated for the target partition. If it is determined that the reference result has not been calculated for the target partition, the computing device 104 uses the logical operation and the inverted index table for the target partition to determine the reference result. The process of determining the reference result is to combine the logical operation with the inverted index table for the target partition, and find the object that satisfies the logical operation consisting of a set of attribute values ​​in the inverted index table of the partition. For example, if a set of attribute values ​​includes red and a place name, and the logical operation constituted is an AND operation of red and the place name, the offset position of the quantization representation of the object having both red and the place name in the partition can be found through the inverted index table, and then the offset position can be used to determine which quantization representations in the partition correspond to objects that meet the logical operation. Further, the offset position that meets the result of the logical operation is determined as the reference result. If it is determined that the reference result has been calculated for the target partition, the candidate quantization representations are filtered based on the reference result. For example, the candidate quantization representations are filtered by confirming whether the offset position of the candidate quantization representation in the partition is in the reference result. If it is determined that the candidate quantization representation does not pass the filtering, the candidate quantization representation is removed from a set of candidate quantization representations. At this time, it indicates that the object corresponding to the quantization representation does not meet the requirements of a set of attribute values. If it is determined that the candidate quantization representation passes the filtering, the candidate quantization representation is retained, and other candidate quantization representations in a set of candidate quantization representations are filtered in this way.

[0076] In some embodiments, the aggregation method for generating the quantization representation index of multiple quantization representations of multiple objects is the same as the clustering method for partitioning multiple vectors when establishing an inverted index table, for example, both use the IVF clustering method. At this time, the multiple partitions where a group of candidate quantization representations are located by the quantization representation index search and the partitions filtered by the group of candidate quantization representation search are the same partitions. Therefore, after finding multiple partitions corresponding to a group of candidate quantization representations corresponding to the quantization representation of the reference object, each quantization representation in these partitions can be directly traversed. For each quantization representation, determine whether the partition where the quantization representation is located has calculated the reference result. If the reference result is not calculated, the reference result is calculated using a logical operation formed by a set of attribute values ​​combined with the inverted index table of the partition. If the reference result is calculated, determine whether the offset position of the quantization representation is in the reference result. If it is, it means that it has passed the filtering, and if it is not, it means that it has not passed the filtering.

[0077] In some embodiments, the aggregation method for generating the quantization representation index of multiple quantization representations of multiple objects is different from the clustering method for partitioning multiple vectors when establishing the inverted index table. For example, the aggregation method for generating the quantization representation index is a graph aggregation algorithm, and the clustering method for partitioning multiple vectors when establishing the inverted index table is an IVF clustering method. The two methods result in inconsistent aggregation results. At this time, after finding a set of candidate quantization representations corresponding to the quantization representation of the reference object through the quantization representation index, for each candidate quantization representation obtained, the partition where the candidate quantization representation is located is found by the object identifier of the candidate quantization representation. After determining the partition, determine whether the partition where the quantization representation is located has calculated the reference result for filtering. If the reference result is not calculated, the reference result is calculated by combining the inverted index table of the partition using a set of attribute values. If the reference result is calculated, determine whether the offset position of the quantization representation is in the reference result. If it is, it means that it passes the filter, and if it is not, it means that it fails the filter. All partitions that have calculated the reference result will cover a set of candidate quantization representations determined by the quantization representation index. The above examples are only used to describe the present disclosure, but are not specifically limited to the present disclosure.

[0078] At block 608, a plurality of target objects similar to the reference object are returned based on the filtered set of candidate quantized representations. Figure 1 As shown, the computing device 104 obtains a plurality of target quantization representations from the filtered set of candidate quantization representations 116 , and then returns a plurality of objects corresponding to the plurality of target quantization representations to the user.

[0079] In some embodiments, when returning multiple target objects similar to the reference object, the computing device 104 first determines a set of similarities between the reference quantitative representation and the filtered set of candidate quantitative representations. Then, the computing device 104 selects multiple target quantitative representations from the filtered set of candidate quantitative representations based on the set of similarities. Specifically, the computing device 104 sorts the filtered set of candidate quantitative representations based on a set of similarities. Then, multiple target quantitative representations are selected from the sorted set of candidate quantitative representations. For example, multiple target quantitative representations with higher similarities that are ranked in front are selected. Then, multiple objects are obtained based on the multiple target quantitative representations.

[0080] Through this method, vector index is used so that only local areas related to multiple quantization representations are scanned during vector retrieval to obtain a set of candidate quantization representations. At the same time, when filtering the vector, only the inverted index table of the partition related to the local area needs to be used to calculate the reference result of filtering the vector. As the amount of data grows massively, the above operation will only slightly increase the amount of data scanned for retrieval, and the number of corresponding partitions scanned will also only slightly increase, ensuring high-performance and low-latency retrieval under large data volumes and complex filtering conditions.

[0081] Combined with the above Figure 6 A schematic flow chart for retrieving an object according to some embodiments of the present application is described. Figure 7-10 The process for implementing high-performance vector retrieval with filtering conditions according to some embodiments of the present application is described. First, Figure 7 FIG. 4 shows a schematic flow chart of constructing a vector index according to some embodiments of the present application. Figure 7 As shown, the process 700 is used to construct an IVF type vector index. At box 702, the operation is started. At box 704, the computing device parses and obtains the vector value in the object. In one example, the vector features of the object are extracted by processing the object. For example, the image features of the image are extracted, and then the extracted image features are encoded and converted into vector features. The above example is only used to describe the present disclosure, but not specifically limited to the present disclosure. At box 706, the model of the IVF type index is trained. The model of the IVF type index is implemented by a neural network model, which can be obtained by training sample vector representations and sample indexes. Then at box 708, the trained model is used to build a vector index. For multiple vectors of multiple objects in the retrieval library, the trained model is used to build a vector index. In some embodiments, the generated vector index may include partitions, each partition having a center point vector representation. Each partition includes multiple vector representations. After the vector index is generated, it ends at box 710. Alternatively, a graph algorithm can also be used to generate a vector index. Additionally, the generated vector index is a region composed of points connected to each other based on similarity.

[0082] Figure 8 shows a schematic flowchart of constructing an inverted index according to some embodiments of the present application. In Figure 8 , according to the vector index of the IVF type, a scalar inverted index table is built for each partition. The example process 800 starts at block 802. Then at block 804, the previously Figure 7 constructed vector index is loaded. Then at block 806, the computing device can obtain the partition information of the IVF type index, including the total number of partitions N. Then, an inverted index table is generated for each partition. At block 808, i = 0 is set to indicate starting from the 0th partition. Then, at block 810, the vectors within the ith partition are obtained. Next, at block 812, the corresponding attribute values are obtained from the object information based on the vector IDs. At block 814, an inverted index table is built using the attribute values. At block 816, it is determined whether i < N holds. If it holds, then at block 820, i is incremented and the calculation continues for the next partition. If it does not hold, the operation ends at block 818, indicating that the inverted index table has been built for all partitions.

[0083] Fig. 9 shows a schematic flowchart of parsing a filtering condition according to some embodiments of the present application. As Fig. 9 shown, it illustrates the attribute value filtering condition in the request. Specifically, the example process 900 starts at block 902. Then at block 904, it is confirmed whether the request needs to be filtered. If no filtering is required, the example process ends. If a filtering operation is required, then at block 906, the filtering condition is verified. For example, it is checked whether each filtering condition meets the corresponding syntax rules or whether all the filtering conditions meet the matching rules, etc. At block 908, the computing device parses the filtering condition into a recursive calculation function. For example, the recursive calculation function is a logical operation of the constructed attribute values. Then the operation ends at block 910.

[0084] Fig.10A schematic flow chart of retrieving similar vectors according to some embodiments of the present application is shown. In this process, a joint index is used to retrieve similar vectors that meet the filtering conditions. The example process 1000 starts at box 1002, and then at box 1004, an IVF type index is used to retrieve and obtain a list of partitions to be scanned. At box 1006, for each partition that needs to be scanned, each vector in the partition is traversed. Since the vector index generation method is the same as the vector partitioning method, the partition determined in the vector index is the same as the partition for calculating the filtering result. At box 1008, it is determined whether there is a filtering condition. If there is no filtering condition, the vector similarity is calculated directly at box 1018. If there is a filtering condition, at box 1010, it is determined whether the partition where the vector is located has calculated a reference result for filtering. If the partition where the vector is located has calculated a reference result for filtering, go to box 1014. If the partition where the vector is located has not yet calculated the reference result for filtering, at box 1012, the attribute value inverted index table corresponding to the partition and the recursive calculation function are used to calculate the reference result for filtering in the partition. At box 1014, the calculated reference result is used to determine whether the vector meets the filtering condition. If not, the vector is discarded at box 1016. If it is satisfied, the similarity between the vector and the reference vector of the object in the search input is calculated at box 1018. Then at box 1020, the K vectors with the highest similarity are returned. Finally, the process ends at box 1022.

[0085] Fig.11 A block diagram of a device 1100 for retrieving an object according to an embodiment of the present application is further shown. The device 1100 is applied to a computing device and may include multiple modules for performing the following steps: Figure 6 The corresponding steps in the process 600 discussed in Fig.11 As shown, the device 1100 includes: a reference quantization representation and attribute value acquisition unit 1102, configured to acquire a reference quantization representation for a reference object in a search input and a set of attribute values ​​for the reference object; a candidate quantization representation selection unit 1104, configured to select a set of candidate quantization representations related to the reference quantization representation from multiple quantization representations based on the reference quantization representation and a quantization representation index generated from multiple quantization representations of multiple objects; a quantization representation filtering unit 1106, configured to filter a set of candidate quantization representations based on a set of attribute values ​​and a set of inverted index tables of a set of partitions in multiple partitions formed by the multiple quantization representations and associated with a set of candidate quantization representations, wherein the inverted index tables in the set of inverted index tables are generated by attribute values ​​of objects corresponding to the quantization representations in the corresponding partitions; and a target object returning unit 1108, configured to return multiple target objects similar to the reference object based on the filtered set of candidate quantization representations.

[0086] In some embodiments, the candidate quantization representation selection unit 1104 includes: a similarity aggregation selection unit, configured to select a group of similar partitions adjacent to the reference quantization representation from a similar area formed by performing a similarity aggregation operation on multiple quantization representations based on the similarity between the reference quantization representation and the quantization representation in the quantization representation index; and a candidate quantization representation determination unit, configured to determine the quantization representations in a group of similar partitions as a group of candidate quantization representations.

[0087] In some embodiments, the quantization representation filtering unit 1106 includes: a logical operation determination unit, configured to determine a logical operation for filtering a set of candidate quantization representations based on a set of attribute values; a partition filtering determination unit, configured to determine whether a reference result for filtering the candidate quantization representation has been calculated for a target partition in a set of partitions corresponding to a candidate quantization representation in a set of candidate quantization representations; a reference result determination unit, configured to determine a reference result based on the logical operation and an inverted index table for the target partition if it is determined that the reference result has not been calculated for the target partition; and a first filtering unit, configured to filter the candidate quantization representations based on the reference result.

[0088] In some embodiments, the quantized representation filtering unit 1106 further includes: a second filtering unit configured to filter the candidate quantized representations based on the reference result if it is determined that the reference result has been calculated for the target partition.

[0089] In some embodiments, the apparatus 1100 further includes: a removing unit configured to remove the candidate quantized representation from a set of candidate quantized representations if it is determined that the candidate quantized representation fails filtering.

[0090] In some embodiments, the target object return unit 1108 includes: a similarity determination unit, configured to determine a set of similarities between a reference quantization representation and a filtered set of candidate quantization representations; and a plurality of target quantization representation selection units, configured to select a plurality of target quantization representations from the filtered set of candidate quantization representations based on a set of similarities.

[0091] In some embodiments, the multiple target quantization representation selection unit includes: a sorting unit configured to sort a filtered set of candidate quantization representations based on a set of similarities; and a quantization representation selection unit configured to select multiple target quantization representations from the sorted set of candidate quantization representations.

[0092] In some embodiments, the apparatus 1100 further includes: a similarity aggregation operation unit configured to perform a similarity aggregation operation on the multiple quantized representations based on the similarity between the multiple quantized representations; a quantized representation index generation unit configured to generate a quantized representation index based on the multiple quantized representations that have been similarly aggregated.

[0093] In some embodiments, the device 1100 also includes: multiple partition determination units, configured to perform clustering operations on multiple quantized representations based on similarities between the multiple quantized representations to determine multiple partitions; and an inverted index table determination unit, configured to determine an inverted index table of attribute values ​​of a set of objects corresponding to a set of quantized representations based on a set of quantized representations in each partition of the multiple partitions.

[0094] In some embodiments, each partition of the plurality of partitions includes: an identification of the object, a quantized representation of the object, and an offset position of the quantized representation of the object in the partition.

[0095] In some embodiments, the apparatus 1100 further includes: a mapping relationship generating unit configured to generate, for each object among the multiple objects, a mapping relationship between the identifier of the object and the partition where the quantized representation of the object is located and an offset position in the partition.

[0096] In some embodiments, the inverted index table determination unit includes: a quantization representation acquisition unit, configured to acquire a set of quantization representations in a partition; an object attribute value acquisition unit, configured to acquire attribute values ​​of a set of objects based on identifiers of a set of objects corresponding to the set of quantization representations; and an inverted index table establishment unit, configured to establish an inverted index table based on the attribute values ​​of the set of objects.

[0097] Fig.12 1 shows a schematic block diagram of an example device 1200 that can be used to implement an embodiment of the present application. Figure 1 The computing device 104 and Figure 3 The devices 302 in the example device 1200 can all be implemented by the example device 1200. As shown in the figure, the device 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 1202 or computer program instructions loaded from a storage unit 1208 to a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

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

[0099] The various processes and processing described above, such as methods 600, 700, 800, 900, and 1000, may be performed by the processing unit 1201. For example, in some embodiments, the methods 600, 700, 800, 900, and 1000 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded into the RAM 1203 and executed by the CPU 1201, one or more actions of the methods 600, 700, 800, 900, and 1000 described above may be performed.

[0100] The present application may be a method, an apparatus, a system, a chip and / or a computer program product. The chip may include a processing unit and a communication interface, and the processing unit may process program instructions received from the communication interface. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for executing various aspects of the present application are loaded.

[0101] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0102] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0103] The computer program instructions for performing the operation of the present application can be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of a computer-readable program instruction to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute a computer-readable program instruction, thereby realizing various aspects of the present application.

[0104] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0105] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0106] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0107] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the function involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs the function or action of the specification, or can be realized by a combination of special-purpose hardware and computer instructions.

[0108] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for searching an object, characterized in that: include: Obtaining a reference quantized representation for a reference object in the search input and a set of attribute values ​​for the reference object; selecting, from the plurality of quantized representations, a set of candidate quantized representations associated with the reference quantized representation based on the reference quantized representation and quantized representation indices generated from a plurality of quantized representations of a plurality of objects; filtering the set of candidate quantized representations based on the set of property values ​​and a set of inverted index tables associated with a set of partitions of the set of candidate quantized representations in a plurality of partitions formed by the plurality of quantized representations, wherein an inverted index table in the set of inverted index tables is generated by property values ​​of objects corresponding to the quantized representations in the corresponding partitions; as well as Based on the filtered set of candidate quantized representations, a plurality of target objects similar to the reference object are returned.

2. The method according to claim 1, characterized in that The selecting a set of candidate quantized representations related to the reference quantized representation from the multiple quantized representations comprises: Based on the similarity between the reference quantized representation and the quantized representation in the quantized representation index, selecting a group of similar partitions adjacent to the reference quantized representation from the similarity region formed by performing similarity aggregation operations on the plurality of quantized representations; and The quantized representations in the group of similar partitions are determined as the group of candidate quantized representations.

3. The method of claim 1 , wherein filtering the set of candidate quantized representations comprises: determining, based on the set of property values, a logical operation for filtering the set of candidate quantized representations; determining whether a reference result for filtering the candidate quantized representations has been calculated for a target partition in the set of partitions corresponding to a candidate quantized representation in the set of candidate quantized representations; If it is determined that the reference result has not been calculated for the target partition, determine the reference result based on the logical operation and the inverted index table for the target partition; as well as The candidate quantized representations are filtered based on the reference result.

4. The method according to claim 3, characterized in that: The filtering of the set of candidate quantized representations further comprises: If it is determined that the reference result has been calculated for the target partition, the candidate quantization representations are filtered based on the reference result.

5. The method according to claim 3 or 4, characterized in that: Also includes: If it is determined that the candidate quantized representation does not pass the filtering, the candidate quantized representation is removed from the set of candidate quantized representations.

6. The method according to claim 3 or 4, wherein returning a plurality of target objects similar to the reference object comprises: determining a set of similarities between the reference quantized representation and the filtered set of candidate quantized representations; as well as Based on the set of similarities, a plurality of target quantized representations are selected from the filtered set of candidate quantized representations.

7. The method according to claim 6, characterized in that The step of selecting a plurality of target quantization representations from the filtered set of candidate quantization representations comprises: sorting the filtered set of candidate quantized representations based on the set of similarities; and The plurality of target quantized representations are selected from the sorted set of candidate quantized representations.

8. The method according to claim 1, characterized in that Also includes: Based on the similarities between the multiple quantized representations, performing a similarity aggregation operation on the multiple quantized representations; as well as The quantized representation index is generated based on the plurality of similarity-aggregated quantized representations.

9. The method according to claim 8, characterized in that Also includes: Based on the similarities between the multiple quantized representations, clustering the multiple quantized representations to determine multiple partitions; as well as Based on a set of quantized representations in each of the plurality of partitions, an inverted index table of attribute values ​​of a set of objects corresponding to the set of quantized representations is determined.

10. The method according to claim 9, characterized in that Each partition of the plurality of partitions includes: an identification of an object, a quantized representation of the object, and an offset position of the quantized representation of the object in the partition.

11. The method according to claim 10, characterized in that Also includes: For each object among the multiple objects, a mapping relationship between the identifier of the object, the partition where the quantized representation of the object is located, and the offset position in the partition is generated.

12. The method according to claim 9, characterized in that Determining an inverted index table of attribute values ​​of a set of objects corresponding to the set of quantized representations comprises: obtaining a set of quantized representations in the partition; obtaining attribute values ​​of the set of objects based on identifications of the set of objects corresponding to the set of quantized representations; and The inverted index table is established based on the attribute values ​​of the group of objects.

13. A device for searching an object, characterized in that: The device comprises: a reference quantized representation and attribute value acquisition unit configured to acquire a reference quantized representation for a reference object in the search input and a set of attribute values ​​for the reference object; a candidate quantization representation selection unit configured to select, based on the reference quantization representation and quantization representation indexes generated from a plurality of quantization representations of a plurality of objects, a group of candidate quantization representations related to the reference quantization representation from the plurality of quantization representations; a quantization representation filtering unit configured to filter the set of candidate quantization representations based on the set of property values ​​and a set of inverted index tables of a set of partitions in a plurality of partitions formed by the plurality of quantization representations and associated with the set of candidate quantization representations, wherein the inverted index tables in the set of inverted index tables are generated by property values ​​of objects corresponding to the quantization representations in the corresponding partitions; and The target object returning unit is configured to return a plurality of target objects similar to the reference object based on the filtered set of candidate quantization representations.

14. An electronic device comprising: at least one computing unit; At least one memory, the at least one memory being coupled to the at least one computing unit and storing instructions for execution by the at least one computing unit, the instructions, when executed by the at least one computing unit, causing the device to perform the method according to any one of claims 1-12.

15. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 12.

16. A computer program product comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 12.

Citation Information

Cited By

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

    CN121456193A

  • Method and apparatus for searching for object, device, and storage medium

    EP4745796A1