Data retrieval method and device and storage medium

By dividing multiple second data into multiple sets and assigning them to multiple processing components for parallel selection, the problem of long data retrieval delay in the prior art is solved and more efficient data retrieval is achieved.

CN118551084APending Publication Date: 2024-08-27HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310133700.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-17
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The existing retrieval equipment is inefficient when selecting K pieces of data with the optimal distance from the first data from multiple second data, resulting in an increase in data retrieval delay.

Method used

By dividing the plurality of second data into a plurality of sets, each set including a portion of the similarity between the second data and the first data, and allocating these sets to a plurality of processing components, allowing the processing components to select data in parallel, thereby Improve the efficiency of selecting data.

Benefits of technology

It improves the efficiency of retrieving data, reduces the delay in retrieving data, and improves the accuracy of retrieving data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551084A
    Figure CN118551084A
Patent Text Reader

Abstract

The invention discloses a data retrieval method and device and a storage medium, and belongs to the field of communication. The method comprises the steps that a cloud retrieval platform obtains the similarity between to-be-retrieved first data and each piece of second data in a plurality of pieces of second data; the cloud retrieval platform obtains a plurality of sets, wherein any set in the plurality of sets comprises partial second data in the plurality of pieces of second data and the similarity between the first data and the partial second data; the cloud retrieval platform allocates the plurality of sets to a plurality of processing components, the plurality of processing components including a first processing component for selecting at least one piece of second data from the first set based on the similarity included in the first set, the first set is a set assigned to the first processing component. According to the invention, the time delay of data retrieval can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a method, device and storage medium for retrieving data. Background Art

[0002] Distance retrieval is a method of retrieving data, and a retrieval device can use distance retrieval to retrieve data.

[0003] In the related art, the process of a retrieval device retrieving data may be as follows: the retrieval device receives a retrieval request, the retrieval request includes first data to be retrieved, and the retrieval device may store multiple second data. The retrieval device obtains the distance between the first data and each second data, and selects K second data with the best distance from the multiple second data, where K is an integer greater than or equal to 1. The retrieval device sends a retrieval response, which includes the K second data.

[0004] The retrieval device often includes a large amount of second data, which results in a long time required for the retrieval device to select K second data from the plurality of second data, thereby increasing the delay in retrieving data. Summary of the invention

[0005] The present application provides a method, device and storage medium for retrieving data to reduce the delay of retrieving data. The technical solution is as follows:

[0006] In a first aspect, the present application provides a method for retrieving data, in which a cloud retrieval platform obtains the similarity between a first data to be retrieved and each second data in a plurality of second data. The cloud retrieval platform obtains a plurality of sets, any one of which includes a portion of the second data in the plurality of second data and the similarity between the first data and the portion of the second data. The cloud retrieval platform assigns the plurality of sets to a plurality of processing components, the plurality of processing components including a first processing component, the first processing component being used to select at least one second data from the first set based on the similarity included in the first set, the first set being a set assigned to the first processing component.

[0007] Since the cloud retrieval platform divides the plurality of second data into a plurality of sets, any set includes a portion of the second data in the plurality of second data and the similarity between the first data and the portion of the second data, the cloud retrieval platform allocates the plurality of sets to a plurality of processing components. For any processing component and the set allocated to the processing component, the processing part is used to select at least one second data from the set based on the similarity included in the set, so that the plurality of processing components select data in parallel, thereby improving the efficiency of selecting data, thereby improving the latency of retrieving data.

[0008] In one possible implementation, the multiple processing components are multiple central processing units CPU in the cloud retrieval platform, or the multiple processing components are multiple streaming multiprocessors SM included in the graphics processing unit GPU in the cloud retrieval platform, or the multiple processing components are virtual processors included in the cloud retrieval platform.

[0009] In another possible implementation, the cloud retrieval platform includes the CPU and the GPU, the multiple processing components are multiple SMs included in the GPU, and the architecture adopted by the cloud retrieval platform is a client / server heterogeneous architecture. The CPU in the cloud retrieval platform sends a sorting request to the multiple SMs in the GPU, wherein the sorting request sent by the CPU to any one of the multiple SMs includes a partial set of multiple sets. In this way, data can be selected in parallel in the heterogeneous architecture, thereby improving the efficiency of data selection.

[0010] In another possible implementation, the cloud retrieval platform assigns the second set to the second processing component, and the second set includes the second data selected by each of the multiple processing components and the similarity between the first data and the second data selected by each processing component. The second processing component is used to select at least one second data from the second set based on the similarity included in the second set. Since the sum of the second data included in the second set may be relatively large, the accuracy of the retrieved data can be improved by selecting at least one second data from the second set by the second processing component.

[0011] In another possible implementation, the total number of the multiple sets is N, the total number of processing components included in the cloud retrieval platform is M, M is an integer greater than 1, and when N is greater than M, the number of the multiple processing components is M, or, when N is less than or equal to M, the number of the multiple processing components is N.

[0012] In another possible implementation, when N is greater than M, the cloud search platform allocates M sets to M processing components, and the M sets are partial sets in the N sets. When the first processing component selects at least one second data from the first set, the cloud search platform allocates a third set to the first processing component, and the third set is a set in the N sets other than the M sets. In this way, the N sets are allocated to multiple processing components of the cloud search platform.

[0013] In another possible implementation, the first data and the plurality of second data are all unstructured data, so that the unstructured data can be retrieved.

[0014] In another possible implementation, the cloud search platform receives a search request including first data input by a user through an input interface in the search interface, so that the cloud search platform can obtain the first data to be searched, and can retrieve data from the plurality of second data based on the first data.

[0015] In another possible implementation, the cloud search platform sends a search response, which includes a search display interface, and the search display interface includes the at least one second data sorted according to the similarity between the first data. In this way, the selected second data can be sent to the user to meet the user's search needs.

[0016] In another possible implementation manner, the first processing component is configured to select at least one second data having the highest similarity to the first data from the first set.

[0017] In a second aspect, the present application provides a device for retrieving data, which is used to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the device includes a unit for executing the method in the first aspect or any possible implementation of the first aspect.

[0018] In a third aspect, the present application provides a cluster for retrieving data, the cluster comprising at least one computing device, each of the at least one computing device comprising at least one processor and at least one memory, the at least one memory storing computer-readable instructions; the at least one processor executes the computer-readable instructions so that the cluster executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0019] In a fourth aspect, the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the method of the above-mentioned first aspect or any possible implementation method of the first aspect.

[0020] In a fifth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program is loaded by a processor to execute the method of the above-mentioned first aspect or any possible implementation manner of the first aspect.

[0021] In a sixth aspect, the present application provides a chip comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to execute the method of the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1It is a structural diagram of a network architecture provided by an embodiment of the present application;

[0023] Figure 2 It is a structural schematic diagram of a retrieval device provided in an embodiment of the present application;

[0024] Figure 3 It is a structural diagram of another network architecture provided by an embodiment of the present application;

[0025] Figure 4 is a flow chart of a method for retrieving data provided by an embodiment of the present application;

[0026] Figure 5 is a schematic diagram of multiple processing components selecting second data provided by an embodiment of the present application;

[0027] Figure 6 is a flow chart of a method for establishing a second corresponding relationship provided by an embodiment of the present application;

[0028] Figure 7 is a schematic diagram of calculating distances of multiple resource blocks provided in an embodiment of the present application;

[0029] Figure 8 is a schematic diagram of the structure of a device for retrieving data provided in an embodiment of the present application;

[0030] Fig. 9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0031] Fig.10 It is a schematic diagram of the structure of a cluster for retrieving data provided in an embodiment of the present application;

[0032] Fig.11 It is a schematic diagram of the structure of another cluster for retrieving data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0034] The data may be structured data or unstructured data. Structured data may be text data, etc., and unstructured data may be pictures, videos, audios, or user behavior logs, etc. Currently, there is a need to retrieve data, and distance retrieval technology may be used to improve the accuracy and / or efficiency of data retrieval. Distance retrieval technology has been widely used in different fields. For example, an image search engine may use distance retrieval technology to retrieve images based on the images to be retrieved. For another example, a music website may use distance retrieval technology to retrieve songs based on a piece of audio. For another example, a text search engine may use distance retrieval technology to retrieve at least one text data based on the text data to be retrieved.

[0035] See also Figure 1 The embodiment of the present application provides a cloud cluster architecture 100, which is used to retrieve data using a distance search technology. The cloud cluster architecture 100 includes a plurality of first devices 101 and a plurality of cloud search platforms 102, and each first device 101 communicates with each cloud search platform 102.

[0036] For any first device 101 among the multiple first devices 101, the first device 101 receives a first search request from a user, the first search request includes first data to be retrieved, and sends a second search request to each cloud search platform 102, the second search request includes the first data.

[0037] For any cloud retrieval platform 102, the cloud retrieval platform 102 stores multiple second data. The cloud retrieval platform 102 receives a second retrieval request, obtains the distance between the first data included in the second retrieval request and each of the multiple second data, selects K second data with the best distance to the first data, K is an integer greater than or equal to 1, and sends a second retrieval response to the first device 101, the second retrieval response includes the K second data, and the distance between the first data and each of the K second data.

[0038] Each cloud search platform 102 stores multiple second data, and there is no intersection between the multiple second data stored in each cloud search platform 102. The first device 101 receives the second search response sent by each cloud search platform 102, and the second search response sent by each cloud search platform 102 includes K second data and the distance between the first data and each of the K second data. The first device 101 receives a total of Q*K second data and the distance between the first data and each of the Q*K second data, where Q is the number of cloud search platforms 102 included in the cloud cluster architecture 100, and * is a multiplication operation.

[0039] The first device 101 selects L second data with the best distance to the first data from the Q*K second data, and sends a first retrieval response to the user, where the first retrieval response includes the L second data, where L is an integer greater than or equal to 1 and less than or equal to K.

[0040] In some embodiments, see Figure 1The cloud search platform 102 is also a cluster, including multiple search devices 1021. The cloud search platform 102 receives the second search request sent by the first device 101, and sends the second search request to a certain search device 1021. The search device 1021 obtains the distance between the first data included in the second search request and each of the multiple second data, selects K second data with the best distance to the first data, K is an integer greater than or equal to 1, and sends a second search response to the first device 101, the second search response includes the K second data, and the distance between the first data and each of the K second data.

[0041] The better the distance between the first data and the second data, the higher the similarity between the first data and the second data. Optionally, the smaller the distance between the first data and the second data, the better the distance between the first data and the second data; or, the larger the distance between the first data and the second data, the better the distance between the first data and the second data.

[0042] Therefore, the cloud search platform 102 selects the K second data with the best distance from the first data, which means selecting the K second data with the highest similarity to the first data. The first device 101 selects the L second data with the best distance from the first data, which means selecting the L second data with the highest similarity to the first data.

[0043] In some embodiments, the second retrieval request includes the first data, which means that the second retrieval request includes n first feature vectors of the first data, where n is an integer greater than or equal to 1, each first feature vector includes D features of the first data, where D is an integer greater than 1, and each first feature vector is different.

[0044] In some embodiments, the cloud search platform 102 storing a plurality of second data means that: the cloud search platform 102 stores a first corresponding relationship, and the first corresponding relationship is used to store the corresponding relationship between the second data and the second feature vector of the second data.

[0045] For any record in the first correspondence, the record includes a second data and a second feature vector of the second data, and the second feature vector of the second data includes the feature of the second data. Each retrieval device 1021 in the cloud retrieval platform 102 can access the first correspondence. The first correspondence in each cloud retrieval platform 102 is different, and there is no intersection between the first correspondences in each cloud retrieval platform 102.

[0046] In some embodiments, for any cloud search platform 102, the cloud search platform 102 stores multiple second data, which means that each search device 1021 in the cloud search platform 102 stores multiple second data, and the multiple second data stored by each search device 1021 are the same. Alternatively, the cloud search platform 102 further includes a storage device, which stores multiple second data.

[0047] In some embodiments, each retrieval device 1021 stores the first corresponding relationship, or the storage device stores the first corresponding relationship.

[0048] For any cloud retrieval platform 102, the operation of the cloud retrieval platform 102 obtaining the distance between the first data and each second data among multiple second data can be: the cloud retrieval platform 102 obtains the distance between the first data and each second data based on the n first feature vectors of the first data and the second feature vector of each second data.

[0049] Optionally, for any second data, the cloud search platform 102 may calculate the distance between the second feature vector of the second data and the n first feature vectors of the first data, and use the distance as the distance between the first data and the second data.

[0050] For any cloud search platform 102 , the cloud search platform 102 includes multiple search algorithms. For any search algorithm, the search algorithm is used to use at least one first feature vector to search for K second data from multiple second data included in the cloud search platform 102 .

[0051] The process of retrieving K second data by the retrieval algorithm can be divided into two steps. The first step is: obtaining the distance between the first data and each of the multiple second data; the second step is: selecting K second data with the best distance to the first data from the multiple second data.

[0052] In some embodiments, the cloud search platform 102 includes M processing components, where M is an integer greater than 1. After obtaining the distance between the first data and each of the plurality of second data, the cloud search platform 102 assigns a set to a processing component in the cloud search platform 102, the set including the plurality of second data and the distance between the first data and each of the plurality of second data. The processing component selects K second data with the best distance to the first data from the plurality of second data included in the set.

[0053] In some embodiments, the cloud retrieval platform 102 includes M processing components, which means that any retrieval device 1021 in the cloud retrieval platform 102 includes M processing components, and after obtaining the distance between the first data and each of the multiple second data, the retrieval device 1021 assigns a set to a processing component in the retrieval device 1021, and the set includes the multiple second data and the distance between the first data and each of the multiple second data.

[0054] The number of the plurality of second data is relatively large, which may cause the processing component to need a long time to select the K second data with the best distance from the plurality of second data. For example, the number of the plurality of second data may reach tens of thousands, hundreds of thousands or millions, etc., which may cause the processing component to need a long time to select the K second data with the best distance from the plurality of second data, resulting in low efficiency in retrieving data.

[0055] In order to improve the efficiency of retrieving data, the cloud retrieval platform 102 can use multiple processing components to select the second data from the multiple second data in parallel. The detailed implementation process is shown in the following Figure 4 The method 400 shown is not described in detail herein.

[0056] In some embodiments, the M processing components are M CPUs in the cloud retrieval platform 102 .

[0057] In some embodiments, the cloud search platform 102 is a client / server (C / S) heterogeneous architecture. Figure 2 The cloud retrieval platform 102 includes a CPU and a GPU, wherein the GPU includes a global memory and M streaming multiprocessors (SMs). The M processing components are M SMs in the GPU, and the global memory of the GPU is used to store the plurality of second data. Optionally, the global memory of the GPU is used to store the first corresponding relationship.

[0058] In a heterogeneous architecture, the CPU acts as a client and the GPU acts as a server. The CPU sends a sorting request to the GPU, where the sorting request includes a set. An SM in the GPU receives the sorting request and selects K second data with the best distance to the first data from the multiple second data included in the set.

[0059] In some embodiments, the cloud retrieval platform 102 is a client / server (C / S) heterogeneous architecture, which means that the retrieval device 1021 in the cloud retrieval platform 102 is a C / S heterogeneous architecture, and the retrieval device 1021 includes a CPU that acts as a client and a GPU that acts as a server.

[0060] In some embodiments, the M processing components are M virtual processors in the cloud retrieval platform 102 , and the virtual processors may be vCPUs and / or vGPUs, etc.

[0061] In some embodiments, for any two retrieval algorithms, the two retrieval algorithms may use different numbers of first feature vectors when the performance of retrieving data meets the first condition. For example, some retrieval algorithms may use x first feature vectors to retrieve data to meet the first condition, where x is an integer greater than or equal to 1. Some retrieval algorithms may use y first feature vectors to retrieve data to meet the first condition, where y is an integer greater than or equal to 1, and x is not equal to y.

[0062] In some embodiments, the first condition may be optimal performance, that is, the number of first feature vectors used by any two retrieval algorithms when the performance of retrieving data is optimal may be different. Alternatively, the first condition may be that the performance of retrieving data exceeds a performance threshold, that is, the number of first feature vectors used by any two retrieval algorithms when the performance of retrieving data exceeds a performance threshold may be different. Optionally, the performance of a retrieval algorithm in retrieving data may include the time required for the retrieval algorithm to retrieve data.

[0063] Therefore, in order to improve the efficiency of retrieving data, the cloud search platform 102 receives a second search request. Since the second search request includes n first feature vectors of the first data, a first search algorithm is obtained based on n. The multiple search algorithms include the first search algorithm, and the first search algorithm is a search algorithm whose performance meets the first condition when using the n first feature vectors to retrieve data. Based on the n first feature vectors, K second data are retrieved from the multiple second data by the first search algorithm, which can improve the efficiency of retrieving the K second data.

[0064] In some embodiments, the cloud search platform 102 may include a second correspondence relationship, which is used to store the correspondence between the number of first feature vectors and the search algorithm. Any record in the second correspondence relationship includes a number and a search algorithm, and the record is used to indicate that the performance of the search algorithm when using the number of first feature vectors to search for data meets the first condition. In this way, when the cloud search platform 102 receives a second search request, the second search request includes n first feature vectors of the first data, and based on n, the corresponding search algorithm is obtained from the first correspondence relationship as the first search algorithm.

[0065] For any retrieval algorithm, the retrieval algorithm retrieves the second data from a plurality of second data based on an operating parameter, and the performance of the retrieval algorithm in retrieving data using different operating parameters is different.

[0066] In some embodiments, the second correspondence is used to store the correspondence between the number of first feature vectors, the operating parameters, and the retrieval algorithm. Any record in the second correspondence includes a number, an operating parameter, and a retrieval algorithm, and the record is used to indicate that the performance of the retrieval algorithm when using the number of first feature vectors and the one operating parameter to retrieve data meets the first condition.

[0067] In this way, when the cloud search platform 102 receives the second search request, based on n, it obtains the corresponding search algorithm and operating parameters from the second corresponding relationship, and uses the obtained search algorithm as the first search algorithm and the obtained operating parameters as the first operating parameters. The first search algorithm is a search algorithm whose performance meets the first condition when using n first feature vectors to retrieve data. The first operating parameters are operating parameters used by the first search algorithm when the performance of retrieving data meets the first condition. The cloud search platform 102 retrieves K second data from multiple second data through the first search algorithm based on the n first feature vectors and the first operating parameters, which can improve the efficiency of retrieving the K second data.

[0068] In some embodiments, see Figure 3 The network architecture 100 also includes a balancing device 103 , which can communicate with each first device 101 of the multiple first devices 101 .

[0069] The balancing device 101 is used to receive a first search request from a user, select a first device 101 from the multiple first devices 101 based on a load balancing strategy, and send the first search request to the selected first device 101 .

[0070] See also Figure 4 The present application embodiment provides a method 400 for retrieving data, wherein the method 400 is applied to Figure 1 or Figure 3 The cloud cluster architecture 100 is shown. The method 400 includes the following process from step 401 to step 409.

[0071] Step 401: The balancing device receives a first search request, where the first search request includes first data to be searched.

[0072] When the user needs to use the first data to retrieve data, the user can use the terminal device to send a first retrieval request to the equalizing device, where the first retrieval request includes the first data.

[0073] In some embodiments, the first search request including the first data may mean that the first search request includes n first feature vectors of the first data, that is, the first search request sent by the terminal device to the equalizing device includes n first feature vectors of the first data, where n is an integer greater than or equal to 1.

[0074] The first data may be unstructured data, for example, the first data may be data such as pictures, videos, audios, or user logs, etc. Alternatively, the first data may be structured data, for example, the first data may be text data, etc.

[0075] In some embodiments, the terminal device displays a search interface, which includes an input interface, through which the user inputs the first data. Assuming that the first data is a picture, the user opens the local album of the terminal device through the input interface, selects a picture in the local album as the first data, and the terminal device obtains the first data selected by the user through the input interface. Alternatively, the user opens the camera of the terminal device through the input interface, takes a picture through the camera, and the terminal device obtains the picture taken by the camera as the first data.

[0076] Step 402: The balancing device sends a first search request to the first device.

[0077] In step 402, the balancing device selects a first device from a plurality of first devices based on a load balancing strategy, and sends a first search request to the selected first device.

[0078] Step 403: The first device receives the first search request, and sends a second search request to each of the Q cloud search platforms, where the second search request includes the first data, and Q is an integer greater than 1.

[0079] In some embodiments, the second search request includes the first data means that the second search request includes n first feature vectors of the first data. In step 403, the n first feature vectors are obtained based on the first data included in the first search request, and a second search request is sent to each of the Q cloud search platforms, the second search request including the n first feature vectors.

[0080] Each of the n first feature vectors includes D features of the first data.

[0081] In some embodiments, the first device receives a first retrieval request, inputs the first data included in the first retrieval request into a feature vector acquisition model, enables the feature vector acquisition model to acquire n first feature vectors of the first data based on the first data, and acquires n first feature vectors of the first data output by the feature vector acquisition model.

[0082] In some embodiments, the first search request sent by the terminal device to the balancing device includes n first feature vectors of the first data. After receiving the first search request, the first device sends a second search request to each of the Q cloud search platforms, and the second search request includes n first feature vectors of the first data.

[0083] For any one of the Q cloud search platforms, the cloud search platform performs the following steps.

[0084] Step 404: The cloud search platform receives the second search request, and obtains the distance between the first data in the second search request and each second data in the plurality of second data.

[0085] In some embodiments, the cloud retrieval platform includes at least one retrieval device, and the cloud retrieval platform selects a retrieval device from the at least one retrieval device based on a load balancing strategy. After receiving the second retrieval request, the cloud retrieval platform may send the second retrieval request to the selected retrieval device. The selected retrieval device obtains the distance between the first data in the second retrieval request and each of the second data in the plurality of second data.

[0086] The multiple second data are multiple second data stored in the cloud retrieval platform.

[0087] The plurality of second data may be structured data or unstructured data.

[0088] In step 404, the cloud retrieval platform (or the selected retrieval device) receives a second retrieval request, obtains n first feature vectors of the first data, obtains multiple second data and the second feature vector of each second data in the multiple second data, and obtains the distance between the first data and each second data based on the n first feature vectors of the first data and the second feature vector of each second data.

[0089] In some embodiments, the second search request includes the first data, and the cloud search platform (or the selected search device) inputs the first data included in the second search request into the feature vector acquisition model, so that the feature vector acquisition model acquires n first feature vectors of the first data based on the first data, and acquires n first feature vectors of the first data output by the feature vector acquisition model. Alternatively, the second search request includes n first feature vectors of the first data, and the cloud search platform (or the selected search device) acquires n first feature vectors of the first data from the second search request.

[0090] In some embodiments, for the selected retrieval device, the retrieval device includes a plurality of second data, the retrieval device locally obtains the plurality of second data, and obtains the second feature vector of each of the plurality of second data. For example, the retrieval device includes a first corresponding relationship, and the retrieval device obtains the plurality of second data and the second feature vector of each of the second data from the first corresponding relationship.

[0091] In some embodiments, for the cloud retrieval platform where the selected retrieval device is located, the cloud retrieval platform includes a storage device that stores a first correspondence relationship, and the retrieval device obtains multiple second data and a second feature vector of each second data from the first correspondence relationship of the storage device.

[0092] In some embodiments, the operation of obtaining the distance between the first data and each second data is:

[0093] Based on n, a first search algorithm is obtained, and the first search algorithm is a search algorithm that uses the n first feature vectors to search for data that meets the first condition. Based on the n first feature vectors and the second feature vector of each second data, the distance between the first data and each second data is obtained by the first search algorithm.

[0094] In some embodiments, a first operating parameter may also be obtained based on n, where the first operating parameter is an operating parameter used when the first retrieval algorithm performs best in retrieving data. Then, based on the first operating parameter, the n first feature vectors and the second feature vector of each second data, the distance between the first data and each second data is obtained through the first retrieval algorithm.

[0095] In some embodiments, based on n, a first retrieval algorithm and a first operating parameter corresponding to n are obtained from a second corresponding relationship, and the second corresponding relationship is used to store the corresponding relationship between the number of first feature vectors, the operating parameters and the retrieval algorithm.

[0096] Since the first search algorithm is a search algorithm whose performance of retrieving data using the n first feature vectors satisfies the first condition, it means that the first search algorithm is a search algorithm with the best performance of retrieving data using the n first feature vectors, or it means that the first search algorithm is a search algorithm whose performance of retrieving data using the n first feature vectors exceeds a performance threshold. In this way, retrieving data using the first search algorithm can greatly improve the efficiency of retrieving data.

[0097] In some embodiments, the first operating parameter includes one or more of the following: the number of resource blocks "block1" used by the first search algorithm, the number of threads "thread1" included in the resource block, or the shared memory size "memory1" used by the resource block.

[0098] Thus, in step 404, "block1" resource blocks are allocated based on the first operating parameter and a shared memory is allocated to each resource block. Each resource block in the "block1" resource blocks includes "thread1" threads, and the size of the shared memory allocated to each resource block is equal to "memory1". For each resource block in the "block1" resource blocks, each resource block corresponds to a part of the records in the first corresponding relationship, and each resource block corresponds to different records. For any resource block, the thread in the resource block is used to run the first retrieval algorithm, so that the thread in the resource block can calculate the distance between the first data and the second data in each record corresponding to the resource block based on the n first feature vectors and the second feature vector of the second data in each record corresponding to the resource block, and the shared memory corresponding to the resource block is used to save the distance calculated by the thread in the resource block. Thus, the distance calculated by the thread in each resource block is the distance between the first data and each second data in the first corresponding relationship.

[0099] Step 405: The cloud search platform obtains N sets, where the N sets include a first set, where the first set includes a portion of the second data among the plurality of second data, and a distance between the first data and the portion of the second data, where N is an integer greater than 1.

[0100] In step 405, the plurality of second data are divided into N sets, each set including a portion of the second data in the plurality of second data and a distance between the first data and the portion of the second data.

[0101] In some embodiments, Z second data are selected from the plurality of second data, and the Z second data and the distance between the first data and the Z second data are combined into a set, where Z is an integer greater than 1. If the number of remaining unselected second data exceeds Z, Z second data are selected from the remaining second data, and the Z second data and the distance between the first data and the Z second data are combined into a set. If the number of remaining unselected second data does not exceed Z, the remaining second data and the distance between the first data and the remaining second data are combined into a set.

[0102] Z may be an integer value such as 32767, 65535, or 131070.

[0103] Step 406: The cloud retrieval platform allocates the N sets to multiple processing components, the cloud retrieval platform includes the multiple processing components, and the first processing component allocated to the first set is used to select K second data from the first set based on the distance included in the first set, where K is an integer greater than or equal to 1.

[0104] The cloud search platform (or the selected search device) includes M processing components, and the multiple processing components are part or all of the M processing components. When N is greater than M, the number of the multiple processing components is M, that is, the multiple processing components are the M processing components. Alternatively, when N is less than or equal to M, the number of the multiple processing components is N.

[0105] In some embodiments, when N is greater than M, the plurality of processing components include M processing components, and the retrieval device allocates the N sets to the M processing components. Optionally, during implementation, the retrieval device selects M sets from the N sets and allocates the M sets to the M processing components. For any one of the M processing components, for ease of description, the one processing component is referred to as a first processing component, and the set allocated to the first processing component is referred to as a first set. When the first processing component selects K second data from the first set, a set is selected from the unselected sets as a third set, and the third set is allocated to the first processing component.

[0106] In some embodiments, when N is less than or equal to M, the plurality of processing elements includes N processing elements, and the N sets are allocated to the N processing elements.

[0107] For any processing component assigned to a set, the processing component selects K second data from the second data included in the set based on the distance included in the set. In implementation, the processing component selects K second data with the best distance from the first data from the second data included in the set.

[0108] In some embodiments, the processing part may use multiple processes or threads to select K second data with the best distance to the first data from the second data included in the set in parallel through the multiple processes or threads.

[0109] In some embodiments, the second data selected by each processing component is also obtained, and a total of N*K second data are obtained.

[0110] In some embodiments, the number of the N*K second data may be larger, see Figure 5 , it is also possible to assign the second set to the second processing component, the second set includes the N*K second data, and the distance between the first data and each of the N*K second data, the cloud retrieval platform (or the selected retrieval device) includes a first processing component, the first processing component is used to select K second data from the second set based on the distance included in the second set. In implementation, the first processing component selects K second data with the best distance from the first data from the second data included in the second set.

[0111] In the C / S heterogeneous architecture, the cloud retrieval platform (selected retrieval device) includes a CPU and a GPU, the multiple processing components are multiple SMs in the GPU, the CPU sends a sorting request to each of the multiple SMs, the sorting request sent to each SM includes a partial set of the N sets, and the sorting request sent to each SM includes a different set. In this way, after any SM receives the sorting request, it selects K second data from the set based on the distance included in the set in the sorting request. Optionally, each sorting request includes a set.

[0112] Step 407: The cloud search platform sends a second search response to the first device, where the second search response includes the selected second data.

[0113] In some embodiments, the second search response may further include a distance between the first data and each of the selected second data.

[0114] The second search response includes the N*K second data and the distance between the first data and each of the N*K second data. Alternatively, the second search response includes the K second data selected by the first processing component and the distance between the first data and each of the K second data.

[0115] When each of the Q cloud retrieval platforms retrieves the second data, it sends a second retrieval response to the first device.

[0116] Step 408: The first device receives a second search response sent by each of the Q cloud search platforms, and selects L second data from the second data included in the Q second search responses, where L is an integer greater than or equal to 1 and less than or equal to K.

[0117] In step 408, the first device receives a total of Q second search responses, each of which includes N*K second data and the distance between the first data and each of the N*K second data. Therefore, the first device receives a total of Q*N*K second data and the distance between the first data and each of the Q*N*K second data. The first device selects L second data with the best distance from the first data from the Q*N*K second data. Or,

[0118] The first device receives a total of Q second search responses, each of which includes K second data and the distance between the first data and each of the K second data. Therefore, the first device receives a total of Q*K second data and the distance between the first data and each of the Q*K second data. The first device selects L second data with the best distance from the first data from the Q*K second data.

[0119] Step 409: The first device sends a first retrieval response, where the first retrieval response includes the L second data.

[0120] In step 409, the first device sends a first search response to the terminal device corresponding to the user, where the first search response includes the L second data.

[0121] In some embodiments, the search response includes a search display interface, and the search display interface includes L second data sorted according to the similarity between the first data. In this way, after receiving the search response, the terminal device directly displays the search display interface.

[0122] For the above-mentioned feature vector acquisition model, the feature vector acquisition model is obtained through training based on at least one training sample, each of the at least one training sample includes a data and at least one feature vector, and each of the at least one feature vector includes D features of the data.

[0123] In some embodiments, the process of training the feature vector acquisition model includes the following operations (1)-(3).

[0124] (1): Based on the feature vector to be trained, a model is obtained and the data in each training sample, and at least one feature vector corresponding to each training sample is obtained.

[0125] For each training sample, at least one feature vector corresponding to the training sample is a feature vector output by the feature vector acquisition model to be trained after processing the data in the training sample.

[0126] The traffic type recognition model to be trained includes a convolutional neural network, a random forest algorithm, a logistic regression algorithm or a support vector machine (SVM), etc.

[0127] In operation (1), the data in each training sample is input into the feature vector acquisition model to be trained, so that the feature vector acquisition model to be trained obtains at least one feature vector corresponding to each training sample based on the data in each training sample, and obtains at least one feature vector corresponding to each training sample output by the feature vector acquisition module to be trained.

[0128] (2): Based on at least one feature vector in each training sample and at least one feature vector corresponding to each training sample, a loss value is calculated through a loss function, and the parameters of the model obtained by adjusting the feature vector to be trained based on the loss value.

[0129] (3): When it is determined that the feature vector acquisition model to be trained should continue to be trained, the operation returns to operation (1); when it is determined that the feature vector acquisition model to be trained should not continue to be trained, the feature vector acquisition model to be trained is used as the feature vector acquisition model.

[0130] In some embodiments, when the number of times the feature vector acquisition model to be trained is trained reaches a specified number of times, it is determined not to continue training the feature vector acquisition model to be trained.

[0131] In some embodiments, a plurality of verification samples are used to obtain the accuracy of the feature vector obtained by the feature vector acquisition model to be trained. When the accuracy exceeds a specified accuracy threshold, it is determined not to continue training the feature vector acquisition model to be trained. In implementation:

[0132] A plurality of verification samples are obtained, each verification sample including data and at least one feature vector. Based on the data in each verification sample and the feature vector to be trained, a model is obtained, and at least one feature vector corresponding to each verification sample is obtained. Based on at least one feature vector in each verification sample and at least one feature vector corresponding to each verification sample, the accuracy of the feature vector is calculated. If the accuracy does not exceed a specified accuracy threshold, it is determined to continue training the feature vector acquisition model to be trained, and if the accuracy exceeds the specified accuracy threshold, it is determined not to continue training the feature vector acquisition model to be trained.

[0133] In an embodiment of the present application, the cloud retrieval platform receives a second retrieval request, the second retrieval request includes n first feature vectors of the first data to be retrieved, and based on the n first feature vectors and the second feature vector of each second data in the plurality of second data, obtains the distance between the first data and each second data. The plurality of second data are divided into N sets, each set includes part of the second data in the plurality of second data, and the distance between the first data and the part of the second data, and the N sets are assigned to a plurality of processing components. For any processing component and the set assigned to the processing component, the processing component selects K second data from the set based on the distance included in the set. In this way, the plurality of processing components can select second data from the plurality of second data in parallel, thereby improving the efficiency of selecting second data and thus improving the efficiency of retrieving data.

[0134] See also Figure 6 The present application embodiment provides a method 600 for establishing a second corresponding relationship, wherein the method 600 is applied to Figure 1 or Figure 3In the network architecture 100 shown, the execution subject of the method 600 can be a cloud search platform in the network architecture 100 or a search device in the cloud search platform. Next, the implementation of the method 600 is described by taking the cloud search platform as an example. The cloud search platform can be replaced with a search device to obtain a search device to implement the method 600. The method 600 includes the following process from step 601 to step 604.

[0135] Step 601: The cloud retrieval platform obtains m third feature vectors of the third data to be detected, each third feature vector including D features of the third data.

[0136] D is also called the dimension of the third eigenvector.

[0137] m may be an integer selected from a numerical range greater than or equal to 1 and less than or equal to H, where H is an integer greater than 1. Optionally, H is a numerical value such as 16, 32 or 64.

[0138] In step 601, the cloud search platform can obtain m third feature vectors of the third data in a variety of ways. Two ways are listed below, which are respectively way 1 and way 2.

[0139] Method 1: The cloud retrieval platform obtains the third data to be detected, inputs the third data into the feature vector acquisition model, enables the feature vector acquisition model to obtain m third feature vectors of the third data based on the third data, and obtains m third feature vectors of the third data output by the feature vector acquisition model.

[0140] In some embodiments, the third data is data generated by the cloud retrieval platform, or the third data is data downloaded from the network by the cloud retrieval platform, etc.

[0141] Method 2: The cloud search platform receives a search request, which includes m third feature vectors of the third data.

[0142] In some embodiments, the retrieval request is a retrieval request sent by any first device and received by the cloud retrieval platform.

[0143] Step 602: Based on the m third feature vectors, the cloud search platform obtains the performance of a target search algorithm using each of the multiple operating parameters to search for data, where the target search algorithm is any one of the multiple search algorithms.

[0144] The dimension of the feature vector used by each of the multiple retrieval algorithms to retrieve data is equal to D. Optionally, the multiple retrieval algorithms are pre-set retrieval algorithms.

[0145] In some embodiments, the cloud search platform includes a third correspondence relationship, and the third correspondence relationship is used to store the correspondence between the dimension of the feature vector and the search algorithm. Any record in the third correspondence relationship includes a dimension and multiple search algorithms, and the dimension of the feature vector used by each search algorithm in the multiple search algorithms when searching data is equal to the dimension included in the record.

[0146] In some embodiments, before executing step 602, multiple corresponding retrieval algorithms can be obtained from the third corresponding relationship based on the dimension D of the third feature vector, and a retrieval algorithm can be selected from the multiple retrieval algorithms as a target retrieval algorithm.

[0147] In step 602, the cloud search platform obtains multiple operating parameters, selects one operating parameter from the multiple operating parameters as the target operating parameter, and retrieves data in the first corresponding relationship through the target search algorithm based on the m third characteristic vectors and the target operating parameter, and obtains the performance of the target search algorithm using the target operating parameter to retrieve data. Then, for other operating parameters in the multiple operating parameters, the other operating parameters are processed according to the above-mentioned processing method for the target operating parameter, and the performance of the target search algorithm using the target operating parameter to retrieve data is obtained. In this way, the performance of the target search algorithm using each operating parameter to retrieve data is obtained.

[0148] In some embodiments, the performance of the target retrieval algorithm in retrieving data may include the latency required for the target retrieval algorithm to retrieve data.

[0149] In some embodiments, the cloud retrieval platform may enumerate multiple operating parameters, each operating parameter including the number of resource blocks "block", the number of threads "thread" included in the resource block and / or the shared memory size "memory" used by the resource block, etc.

[0150] For example, referring to Table 1 below, assuming that the cloud search platform enumerates multiple operating parameters as shown in Table 1, each row in Table 1 is recorded as an operating parameter. Optionally, when the cloud search platform enumerates the number of resource blocks "block", each enumerated "block" may be a multiple of 16. For example, referring to Table 1 below, the number of resource blocks enumerated "block" may be 16, 32, or 64.

[0151] When the cloud retrieval platform enumerates the number of threads "thread" included in each resource block, each enumerated "thread" may be a multiple of 16. For example, as shown in Table 1 below, the number of threads "thread" included in each enumerated resource block may be 16, 32, 64 or 128.

[0152] When the cloud retrieval platform enumerates the shared memory size "memory" that can be used by each thread included in the resource block, each enumerated "memory" may be a multiple of 16. For example, as shown in Table 1 below, each enumerated "memory" can be 16k, 32k or 64k.

[0153] Table 1

[0154] Serial number The number of resource blocks "block" Number of threads "thread" Shared memory size "memory" 1 16 16 16k 2 16 32 16k 3 16 64 16k 4 16 128 16k 5 32 16 32k 6 32 32 32k 7 32 64 32k 8 32 128 32k 9 64 16 64k 10 64 32 64k 11 64 64 64k 12 64 128 64k …… …… …… ……

[0155] In some embodiments, the performance of the target retrieval algorithm using the target operating parameters to retrieve data includes the time delay required for the target retrieval algorithm to use the target operating parameters to retrieve data.

[0156] The cloud search platform calculates the distance between the third data and each second data in the first corresponding relationship through the target search algorithm based on the m third feature vectors, the second feature vector of each second data in the first corresponding relationship, and the target operation parameter, and selects K second data with the smallest distance from the third data from the first corresponding relationship. The K second data are the data retrieved by the cloud search platform. The cloud search platform times the process of retrieving the K second data using the m third feature vectors, the second feature vector of each second data in the first corresponding relationship, and the target operation parameter, and obtains the time required for the target search algorithm to retrieve the data using the target operation parameter.

[0157] In some embodiments, the target operating parameters include the number of resource blocks "block1", the number of threads "thread1" included in the resource block and / or the size of shared memory "memory1" used by the resource block, etc. The process of the cloud retrieval platform retrieving the K second data is:

[0158] The cloud retrieval platform allocates "block1" resource blocks based on the target operation parameters and allocates shared memory to each resource block. Each resource block in the "block1" resource blocks includes "thread1" threads, and the size of the shared memory allocated to each resource block is equal to "memory1". For each resource block in the "block1" resource blocks, each resource block corresponds to a part of the records in the first corresponding relationship, and each resource block corresponds to different records. For any resource block, the threads in the resource block are used for the target retrieval algorithm, so that the threads in the resource block can calculate the distance between the third data and the second data in each record corresponding to the resource block based on the m third feature vectors and the second feature vector of the second data in each record corresponding to the resource block, and the shared memory corresponding to the resource block is used to save the distance calculated by the threads in the resource block. In this way, the distance calculated by the threads in each resource block includes the distance between the third data and each second data in the first corresponding relationship. The cloud retrieval platform selects K second data with the best distance to the third data from the first corresponding relationship.

[0159] For example, see Figure 7 , assuming that the number of resource blocks "block" in the target operation parameter is equal to 4, the cloud retrieval platform allocates 4 resource blocks, namely resource block A, resource block B, resource block C and resource block D. Resource block A corresponds to the records of rows 0-31, rows 128-159, rows 256-278, and so on in the first correspondence. Resource block B corresponds to the records of rows 32-63, rows 160-191, rows 288-319, and so on in the first correspondence. Resource block C corresponds to the records of rows 64-95, rows 192-223, rows 320-351, and so on in the first correspondence. Resource block D corresponds to the records of rows 96-127, rows 224-255, rows 352-383, and so on in the first correspondence. In this way, resource block A, resource block B, resource block C and resource block D can calculate distances in parallel, thereby improving the efficiency of retrieving data.

[0160] In some embodiments, for any resource block, the threads in the resource block run on the SM of the GPU of the cloud retrieval platform. Optionally, for any SM in the GPU, the SM can run threads in one or more resource blocks, thereby effectively utilizing the parallel architecture of multiple SMs of the GPU and improving the efficiency of retrieving data.

[0161] Step 603: The cloud search platform obtains a first operating parameter of the target search algorithm and the best performance of the search data. The first operating parameter is an operating parameter used by the target search algorithm among the multiple operating parameters when the performance of the search data is best.

[0162] Since the cloud search platform has obtained the performance of the target search algorithm using each operating parameter to retrieve data, the cloud search platform selects the best performance from the performance of the search data corresponding to each operating parameter, and uses the operating parameter corresponding to the best performance as the first operating parameter of the target search algorithm.

[0163] The target retrieval algorithm is one of the multiple retrieval algorithms. For each of the other retrieval algorithms in the multiple retrieval algorithms, each of the other retrieval algorithms is used as the target retrieval algorithm and the operations of the above steps 602 and 603 are performed respectively, so as to obtain the first operating parameters of each of the multiple retrieval algorithms and the best performance of the retrieval data. Then, step 604 is performed.

[0164] Step 604: The cloud search platform selects a search algorithm with the best performance in retrieving data and satisfying the first condition from the multiple search algorithms as the first search algorithm, and stores m, the first search algorithm and the first operating parameter of the first search algorithm in a second corresponding relationship.

[0165] In step 604, the cloud search platform selects a search algorithm with the best performance for retrieving data from the multiple search algorithms as the first search algorithm, or selects a search algorithm with the best performance for retrieving data exceeding a performance threshold from the multiple search algorithms as the first search algorithm.

[0166] For a numerical range greater than or equal to 1 and less than or equal to H, an integer is selected from the unselected integers in the numerical range as m, and then the process of steps 601 to 604 is performed again. After each integer in the data range is selected, the first search algorithm and the first operating parameter corresponding to each integer in the numerical range are stored in the second corresponding relationship.

[0167] In some embodiments, in step 604, the cloud search platform may also store the correspondence between m and the first search algorithm in a second correspondence.

[0168] In the embodiment of the present application, the cloud search platform selects an integer m, obtains m third feature vectors, obtains the best performance of each search algorithm in retrieving data from multiple search algorithms based on the m third feature vectors, selects the search algorithm with the best performance in retrieving data that meets the first condition from the multiple search algorithms as the first search algorithm, and stores m and the first search algorithm in correspondence in the second correspondence. In this way, when the cloud search platform receives a search request including n feature vectors of the first data, it obtains the first search algorithm whose performance in retrieving data using the n feature vectors meets the first condition from the second correspondence based on n, and uses the first search algorithm to retrieve data, which can improve the efficiency of retrieving data.

[0169] See also Figure 8 The embodiment of the present application provides a device 800 for retrieving data, wherein the device 800 is deployed at Figure 1 or Figure 3 In the cloud search platform 102 of the network architecture 100 shown in the figure, or in the search device 1021 in the cloud search platform 102, or deployed in Figure 4 In the cloud search platform of the method 400 shown in FIG. 4 or in the search device in the cloud search platform, or deployed in Figure 6 In the cloud search platform or the search device in the cloud search platform of the method 600 shown. The device 800 includes:

[0170] The processing unit 801 is used to obtain the similarity between the first data to be retrieved and each second data in the plurality of second data;

[0171] The processing unit 801 is further configured to obtain a plurality of sets, any one of the plurality of sets including a portion of the second data in the plurality of second data and a similarity between the first data and the portion of the second data;

[0172] The processing unit 801 is further used to assign the multiple sets to multiple processing components, which include a first processing component, which is used to select at least one second data from the first set based on the similarity included in the first set, and the first set is assigned to the set of the first processing component.

[0173] Optionally, the detailed implementation process of the processing unit 801 obtaining multiple sets can be found in Figure 4 The relevant contents of step 405 of the method 400 are not described in detail here.

[0174] Optionally, the detailed implementation process of the processing unit 801 allocating the multiple sets to multiple processing components can be found in Figure 4 The relevant contents of step 406 of the method 400 are not described in detail here.

[0175] Optionally, the multiple processing components are multiple central processing units CPU in the device 800, or the multiple processing components are multiple streaming multiprocessors SM included in the graphics processing unit GPU in the device 800, or the multiple processing components are virtual processors included in the device 800.

[0176] Optionally, the multiple processing components are multiple SMs included in a GPU, the architecture adopted by the device 800 is a client / server heterogeneous architecture, and the processing unit 801 is used to send sorting requests to the multiple SMs in the GPU, wherein the sorting request sent by the processing unit 801 to any one of the multiple SMs includes a partial set of the multiple sets.

[0177] Optionally, the detailed implementation process of the processing unit 801 sending the sorting request to the multiple SMs in the GPU can be found in Figure 4 The relevant contents of step 406 of the method 400 are not described in detail here.

[0178] Optionally, the processing unit 801 is further configured to:

[0179] A second set is assigned to the second processing component, the second set includes the second data selected by each of the multiple processing components and the similarity between the first data and the second data selected by each processing component, and the second processing component is used to select at least one second data from the second set based on the similarity included in the second set.

[0180] Optionally, the detailed implementation process of the processing unit 801 allocating the second set to the first processing unit can be found in Figure 4 The relevant contents of step 406 of the method 400 are not described in detail here.

[0181] Optionally, the total number of the multiple sets is N, and the total number of processing components included in the device 800 is M, where M is an integer greater than 1. When N is greater than M, the number of the multiple processing components is M, or when N is less than or equal to M, the number of the multiple processing components is N.

[0182] Optionally, when N is greater than M, the processing unit 801 is configured to:

[0183] Allocate M sets to M processing elements, where the M sets are partial sets of the N sets;

[0184] When the first processing component selects at least one second data from the first set, a third set is allocated to the first processing component, and the third set is a set other than the M sets in the N sets.

[0185] Optionally, the detailed implementation process of the processing unit 801 allocating the M sets to the M processing components can be found in Figure 4 The relevant contents of step 406 of the method 400 are not described in detail here.

[0186] Optionally, the detailed implementation process of the processing unit 801 allocating the fourth set to the second processing component can be found in Figure 4 The relevant contents of step 406 of the method 400 are not described in detail here.

[0187] Optionally, the first data and the plurality of second data are both unstructured data.

[0188] Optionally, the device 800 further includes:

[0189] The receiving unit 802 is configured to receive a search request, where the search request includes first data input by a user through an input interface in the search interface.

[0190] Optionally, the detailed implementation process of receiving the search request by the receiving unit 802 can be found in Figure 4 The relevant contents of step 406 of the method 400 are not described in detail here.

[0191] Optionally, the device 800 further includes:

[0192] The sending unit 803 is used to send a search response, where the search response includes a search display interface, and the search display interface includes at least one second data sorted according to the similarity between the second data and the first data.

[0193] Optionally, the detailed implementation process of the sending unit 803 sending the search response can be found in Figure 4 The relevant contents of step 407 of the method 400 are not described in detail here.

[0194] Optionally, the first processing component is used to select at least one second data having the highest similarity to the first data from the first set.

[0195] Among them, the processing unit 801, the receiving unit 802 and the sending unit 803 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the processing unit 801 is introduced below by taking the processing unit 801 as an example. Similarly, the implementation of the receiving unit 802 and the sending unit 803 can refer to the implementation of the processing unit 801.

[0196] As an example of a software functional unit, the processing unit 801 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the processing unit 801 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region can include multiple AZs.

[0197] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0198] As an example of a hardware functional unit, the processing unit 801 may include at least one computing device, such as a server, etc. Alternatively, the processing unit 801 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0199] The multiple computing devices included in the processing unit 801 can be distributed in the same region or in different regions. The multiple computing devices included in the processing unit 801 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the processing unit 801 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0200] It should be noted that, in other embodiments, the processing unit 801 can be used to execute any step of the method provided in any of the above embodiments, the receiving unit 802 can be used to execute any receiving step of the method provided in any of the above embodiments, and the sending unit 803 can be used to execute any sending step of the method provided in any of the above embodiments. The steps that the processing unit 801, the receiving unit 802, and the sending unit 803 are responsible for implementing can be specified as needed, and the processing unit 801, the receiving unit 802, and the sending unit 803 respectively implement different steps of the method provided in any of the above embodiments to realize all functions of the device 800 for retrieving data.

[0201] In an embodiment of the present application, the processing unit divides the plurality of second data into a plurality of sets, any set includes a portion of the second data in the plurality of second data and the similarity between the first data and the portion of the second data, and the processing unit assigns the plurality of sets to a plurality of processing components. For any processing component and the set assigned to the processing component, the processing part is used to select at least one second data from the set based on the similarity included in the set, so that the plurality of processing components select data in parallel, thereby improving the efficiency of selecting data, thereby improving the latency of retrieving data.

[0202] See also Fig. 9 , the present application embodiment provides a computing device 900. The computing device 900 may be Figure 1 or Figure 3 The retrieval device in the network architecture 100 shown, or Figure 4 The retrieval device in the method 400 shown, or Figure 6 The retrieval device in the method 600 is shown.

[0203] like Fig. 9 As shown, the computing device 900 includes: a bus 902, a processor 904, a memory 906, and a communication interface 908. The processor 904, the memory 906, and the communication interface 908 communicate through the bus 902. The computing device 900 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 900.

[0204] The bus 902 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The bus 904 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 904 may include a path for transmitting information between various components of the computing device 900 (eg, the memory 906, the processor 904, and the communication interface 908).

[0205] The processor 904 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0206] The memory 906 may include a volatile memory, such as a random access memory (RAM). The processor 904 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0207] See also Fig. 9 , the memory 906 stores executable program codes, and the processor 904 executes the executable program codes to respectively implement the functions of the processing unit 801, the receiving unit 802, and the sending unit 803 in the device 800 shown in the figure, thereby implementing the method provided by any of the above embodiments. That is, the memory 906 stores instructions for executing the method provided by any of the above embodiments. Or,

[0208] The communication interface 903 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or a communication network.

[0209] The embodiment of the present application also provides a cluster for retrieving data. The cluster for retrieving data includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0210] like Fig.10 As shown, the cluster for retrieving data includes at least one computing device 900. The memory 906 in one or more computing devices 900 in the cluster for retrieving data may store the same instructions for executing the method provided in any of the above embodiments.

[0211] In some possible implementations, the memory 906 of one or more computing devices 900 in the data retrieval cluster may also store partial instructions for executing the above data management method. In other words, a combination of one or more computing devices 900 may jointly execute instructions for executing the method provided in any of the above embodiments.

[0212] In some possible implementations, one or more computing devices in the cluster that retrieves data may be connected via a network, which may be a wide area network or a local area network. Fig.11 A possible implementation is shown. Fig.11As shown, two computing devices 900A and 900B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.

[0213] In this type of possible implementation, the memory 906 in the computing device 900A stores the execution Figure 8 Instructions for the functions of the processing unit 801 in the illustrated embodiment. Meanwhile, the memory 906 in the computing device 900B stores instructions for executing the functions of the processing unit 801 in the illustrated embodiment. Figure 8 Instructions for the functions of the receiving unit 802 and / or the sending unit 803 in the illustrated embodiment.

[0214] It should be understood that Fig.11 The functions of the computing device 900A shown in FIG. 9A may also be completed by multiple computing devices 900. Similarly, the functions of the computing device 900B may also be completed by multiple computing devices 900.

[0215] The present application embodiment also provides another cluster for retrieving data. The connection relationship between the computing devices in the cluster for retrieving data can be similarly referred to as Fig.11 The connection mode of the cluster for retrieving data is different in that the memory 906 in one or more computing devices 900 in the cluster for retrieving data may store the same instructions for executing the method provided by any of the above embodiments.

[0216] In some possible implementations, the memory 906 of one or more computing devices 900 in the data retrieval cluster may also store partial instructions for executing the method provided in any of the above embodiments. In other words, the combination of one or more computing devices 900 may jointly execute instructions for executing the method provided in any of the above embodiments.

[0217] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the method provided in any of the above embodiments.

[0218] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the method provided in any of the above embodiments.

[0219] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0220] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for retrieving data, characterized in that: The method comprises: The cloud search platform obtains the similarity between the first data to be searched and each second data in the plurality of second data; The cloud search platform acquires a plurality of sets, any one of the plurality of sets including a portion of the second data in the plurality of second data and a similarity between the first data and the portion of the second data; The cloud retrieval platform assigns the multiple sets to multiple processing components, the multiple processing components include a first processing component, the first processing component is used to select at least one second data from the first set based on the similarity included in the first set, and the first set is the set assigned to the first processing component.

2. The method according to claim 1, characterized in that The multiple processing components are multiple central processing units CPU in the cloud retrieval platform, or the multiple processing components are multiple streaming multiprocessors SM included in the graphics processing unit GPU in the cloud retrieval platform, or the multiple processing components are virtual processors included in the cloud retrieval platform.

3. The method according to claim 2, characterized in that The cloud search platform includes the CPU and the GPU, the multiple processing components are multiple SMs included in the GPU, the architecture adopted by the cloud search platform is a client / server heterogeneous architecture, and the cloud search platform allocates the multiple sets to multiple processing components, including: The CPU in the cloud retrieval platform sends a sorting request to the multiple SMs in the GPU, wherein the sorting request sent by the CPU to any one of the multiple SMs includes a partial set of the multiple sets.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The cloud retrieval platform assigns a second set to a second processing component, the second set including second data selected by each of the multiple processing components and the similarity between the first data and the second data selected by each processing component, and the second processing component is used to select at least one second data from the second set based on the similarity included in the second set.

5. The method according to any one of claims 1 to 4, characterized in that: The total number of the multiple sets is N, and the total number of processing components included in the cloud retrieval platform is M, where M is an integer greater than 1. When N is greater than M, the number of the multiple processing components is M, or when N is less than or equal to M, the number of the multiple processing components is N.

6. The method according to claim 5, characterized in that When N is greater than M, the cloud search platform allocates the multiple sets to multiple processing components, including: The cloud search platform allocates M sets to the M processing components, where the M sets are partial sets among the N sets; When the first processing component selects at least one second data from the first set, the cloud retrieval platform allocates a third set to the first processing component, where the third set is a set among the N sets except the M sets.

7. The method according to any one of claims 1 to 6, characterized in that: The first data and the plurality of second data are both unstructured data.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: The cloud search platform receives a search request, where the search request includes the first data input by a user through an input interface in a search interface.

9. The method according to claim 8, characterized in that The method further comprises: The cloud search platform sends a search response, wherein the search response includes a search display interface, and the search display interface includes the at least one second data sorted according to a similarity with the first data.

10. The method according to any one of claims 1 to 9, characterized in that: The first processing component is used to select at least one second data having the highest similarity to the first data from the first set.

11. A device for retrieving data, characterized in that: The device comprises: A processing unit, configured to obtain a similarity between the first data to be retrieved and each second data in the plurality of second data; The processing unit is further configured to obtain a plurality of sets, any one of the plurality of sets including a portion of the second data in the plurality of second data and a similarity between the first data and the portion of the second data; The processing unit is further used to assign the multiple sets to multiple processing components, the multiple processing components include a first processing part, the first processing component is used to select at least one second data from the first set based on the similarity included in the first set, and the first set is assigned to the set of the first processing components.

12. The device according to claim 11, characterized in that The multiple processing components are multiple central processing units CPU in the device, or the multiple processing components are multiple streaming multiprocessors SM included in a graphics processor GPU in the device, or the multiple processing components are virtual processors included in the device.

13. The device according to claim 12, characterized in that The multiple processing components are multiple SMs included in the GPU, the architecture adopted by the device is a client / server heterogeneous architecture, and the processing unit is used to send sorting requests to the multiple SMs in the GPU, wherein the sorting request sent by the processing unit to any one of the multiple SMs includes a partial set of the multiple sets.

14. The device according to any one of claims 11 to 13, characterized in that: The processing unit is further used for: A second set is allocated to a second processing component, the second set including second data selected by each of the plurality of processing components and a similarity between the first data and the second data selected by each of the processing components, the second processing component being configured to select at least one second data from the second set based on the similarity included in the second set.

15. The device according to any one of claims 11 to 14, characterized in that: The total number of the multiple sets is N, and the total number of processing components included in the device is M, where M is an integer greater than 1. When N is greater than M, the number of the multiple processing components is M, or when N is less than or equal to M, the number of the multiple processing components is N.

16. The device according to claim 15, characterized in that When N is greater than M, the processing unit is used to: Allocate M sets to the M processing components, wherein the M sets are partial sets of the N sets; When the first processing component selects at least one second data from the first set, a third set is allocated to the first processing component, where the third set is a set among the N sets except the M sets.

17. The device according to any one of claims 11 to 16, characterized in that: The first data and the plurality of second data are both unstructured data.

18. The device according to any one of claims 11 to 17, characterized in that The device also includes: The receiving unit is used to receive a search request, where the search request includes the first data input by a user through an input interface in a search interface.

19. The device according to claim 18, characterized in that The device also includes: The sending unit is used to send a search response, wherein the search response includes a search display interface, and the search display interface includes the at least one second data sorted according to a similarity with the first data.

20. The device according to any one of claims 11 to 19, characterized in that The first processing component is used to select at least one second data having the highest similarity to the first data from the first set.

21. A cluster for retrieving data, characterized in that: The cluster includes at least one computing device, each of the at least one computing device includes at least one processor and at least one memory, and the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the cluster executes the method according to any one of claims 1 to 10.

22. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

23. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Feature retrieval method and device and storage medium

    CN109165307A

  • KR20220076965A