Resource data search method, device, server and storage medium

By calculating the similarity between the first vector of resource data and the quantized second vector, and replacing the preset value with pre-stored floating-point values, the problem of low search accuracy in the prior art is solved, and efficient and accurate resource data search is achieved.

CN115309807BActive Publication Date: 2025-08-08北京凌川科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211027623.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-25
Publication Date
2025-08-08
Estimated Expiration
2042-08-25

AI Technical Summary

Technical Problem

In the prior art, when the user data volume is large, the resource data search method has a high memory footprint and a slow search speed, and the search accuracy of ANNS combined with the quantization method is not high.

Method used

By obtaining the first vector corresponding to the resource data and the quantized multiple second vectors, the similarity is calculated, the solution quantization process is performed, and the preset value is replaced by the pre-stored floating-point value, the second vector with the highest similarity is determined as the search result.

Benefits of technology

It improves the accuracy and speed of resource data search, reduces memory usage, and meets the search needs under large data volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309807B_ABST
    Figure CN115309807B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a resource data search method, device, server, and storage medium. The method comprises: obtaining a first vector corresponding to resource data and a plurality of quantized second vectors; calculating the similarity between the first vector and the plurality of second vectors, respectively, and determining a first number of second vectors with the highest similarity; performing dequantization processing on the first number of second vectors to obtain dequantized second vectors; wherein, if there is a target second vector whose element quantization value is a preset value in the first number of second vectors, the preset value is replaced with a pre-stored floating-point value of the element; determining a second number of second vectors with the highest similarity to the first vector from the dequantized second vectors, and using the resource data corresponding to the second number of second vectors as the search result. The embodiments of the present disclosure can improve the accuracy of resource data search.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and in particular to a resource data search method, device, server, and storage medium. Background Art

[0002] With the development of internet technology, resource data search technologies have emerged, with applications such as searching or recommending short videos and articles. Approximately Nearest Neighbor Search (ANNS) is a widely used recommendation or search method. Specifically, given a feature vector to be recommended or searched, it searches an existing database for several feature vectors that are most similar to it, using these as search results. However, when the amount of user data is large, this method can lead to high memory usage and slow search speeds.

[0003] Related art techniques employ ANNS combined with quantization. Specifically, they utilize a scaling factor to convert floating-point feature vectors into integers, thereby reducing memory usage and improving search speed. However, during the quantization process, if the scaling factor is too large, a significant number of feature vectors will be lost; if the scaling factor is too small, smaller elements in the feature vector will experience significant information loss. Consequently, the ANNS combined with quantization methods used in related art suffer from low search accuracy. Summary of the Invention

[0004] The present disclosure provides a resource data search method, device, server, and storage medium to at least address the problem of low search accuracy in related technologies. The technical solutions of the present disclosure are as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a method for searching resource data is provided, comprising:

[0006] Obtaining a first vector corresponding to the resource data and a plurality of quantized second vectors;

[0007] calculating similarities between the first vector and a plurality of the second vectors respectively, and determining a first number of the second vectors having the highest similarities;

[0008] performing a dequantization process on the first number of second vectors to obtain a dequantized second vector; wherein, if a target second vector having an element quantized by a preset value exists in the first number of second vectors, replacing the preset value with a pre-stored floating-point value of the element to obtain a dequantization result corresponding to the target second vector; wherein the preset value is used to indicate that a product of the floating-point value of the element and a scaling factor exceeds a representation range of a pre-quantized integer format;

[0009] A second number of dequantized second vectors having the highest similarity to the first vector is determined from the dequantized second vectors, and resource data corresponding to the second number of second vectors is used as a search result.

[0010] In a possible implementation, a method of obtaining the second vector includes:

[0011] Get the initial second vector in floating point format from the dataset;

[0012] Multiplying the initial second vector by a scaling factor to obtain an intermediate second vector;

[0013] When the floating-point value of an element in the intermediate second vector exceeds a representation range of a pre-quantized integer format, determining the quantization value of the element to be a preset value;

[0014] When the floating-point values of the elements in the intermediate second vector do not exceed the representation range, the intermediate second vector is rounded to obtain a second vector.

[0015] In one possible implementation, if there is a target second vector in the first number of second vectors whose element quantization value is a preset value, replacing the preset value with a pre-stored floating-point value of the element to obtain a dequantization result corresponding to the target second vector includes:

[0016] If there is an element of the target second vector in the first number of second vectors whose quantized value is a preset value, replacing the preset value with a pre-stored floating-point value of the element;

[0017] If an element of the target second vector is a quantized value other than the preset value, a dequantized value of the element is determined according to the scaling factor to obtain a dequantized result corresponding to the target second vector.

[0018] In a possible implementation, the scaling factor is obtained by:

[0019] After multiplying the initial second vector by a preset scaling factor, the resulting product is rounded to obtain a quantized second vector;

[0020] Dividing the quantized second vector by the scaling factor to obtain a dequantized second vector;

[0021] By using a preset optimization algorithm, a preset scaling factor that satisfies the minimum distance between the initial second vector and the plurality of dequantized second vectors is used as the scaling factor.

[0022] In a possible implementation, the method further includes:

[0023] Amplifying the scaling factor by a preset multiple to obtain an amplified scaling factor, wherein the preset multiple is determined according to a storage space where the pre-stored floating-point value of the element is located;

[0024] Multiplying the initial second vector by a scaling factor to obtain an intermediate second vector includes:

[0025] The initial second vector is multiplied by the amplified scaling factor to obtain an intermediate second vector.

[0026] In a possible implementation, the method further includes:

[0027] The data set is updated using the quantized multiple second vectors, and the floating-point values corresponding to the preset values are stored.

[0028] According to a second aspect of an embodiment of the present disclosure, a device for searching resource data is provided, comprising:

[0029] A first acquisition module, configured to acquire a first vector corresponding to resource data and a plurality of quantized second vectors;

[0030] a first determining module, configured to respectively calculate similarities between the first vector and a plurality of second vectors, and determine a first number of second vectors having the highest similarities;

[0031] a dequantization module, configured to dequantize the first number of second vectors to obtain a dequantized second vector; wherein, if a target second vector has an element whose quantization value is a preset value among the first number of second vectors, the dequantization module is configured to replace the preset value with a pre-stored floating-point value of the element to obtain a dequantization result corresponding to the target second vector; wherein the preset value is used to indicate that the product of the floating-point value of the element and the scaling factor exceeds a representation range of a pre-quantized integer format;

[0032] A search module is configured to determine a second number of dequantized second vectors having the highest similarity to the first vector from the dequantized second vectors, and use resource data corresponding to the second number of second vectors as a search result.

[0033] In a possible implementation, the method further includes:

[0034] A second acquisition module is used to obtain an initial second vector in a floating point format from the data set;

[0035] A first processing module, configured to obtain an intermediate second vector by multiplying the initial second vector by a scaling factor;

[0036] A second determining module is configured to determine, when a floating-point value of an element in the intermediate second vector exceeds a representation range of a pre-quantized integer format, that the quantized value of the element is a preset value;

[0037] The second processing module is configured to round the intermediate second vector to obtain a second vector if the floating-point values of the elements in the intermediate second vector do not exceed the representation range.

[0038] In a possible implementation, the dequantization module includes:

[0039] a replacing submodule, configured to, if a quantized value of an element of a target second vector exists in the first number of second vectors and is a preset value, replace the preset value with a pre-stored floating-point value of the element;

[0040] The dequantization submodule is configured to determine, if an element of the target second vector is a quantized value other than the preset value, a dequantized value of the element according to the scaling factor, and obtain a dequantized result corresponding to the target second vector.

[0041] In a possible implementation, the method further includes:

[0042] A third processing module is configured to multiply the initial second vector by a preset scaling factor and then round the resulting product to obtain a quantized second vector;

[0043] a fourth processing module, configured to divide the quantized second vector by the scaling factor to obtain a dequantized second vector;

[0044] The third determining module is configured to use a preset optimization algorithm to select a preset scaling factor that satisfies the minimum distance between the initial second vector and the plurality of de-quantized second vectors as the scaling factor.

[0045] In a possible implementation, the method further includes:

[0046] The fifth processing module is configured to amplify the scaling factor by a preset multiple to obtain an amplified scaling factor, wherein the preset multiple is determined according to a storage space where the pre-stored floating-point value of the element is located.

[0047] The fourth processing module includes:

[0048] The processing submodule is configured to multiply the initial second vector by the amplified scaling factor to obtain an intermediate second vector.

[0049] In a possible implementation, the method further includes:

[0050] An updating module is configured to update the data set using the quantized plurality of second vectors and store floating-point values corresponding to the preset values.

[0051] According to a third aspect of an embodiment of the present disclosure, a server is provided, including:

[0052] processor;

[0053] a memory for storing instructions executable by the processor;

[0054] The processor is configured to execute the instructions to implement the resource data search method as described in any one of the embodiments of the present disclosure.

[0055] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute a resource data search method as described in any one of the embodiments of the present disclosure.

[0056] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, comprising instructions that, when executed by a processor of a server, enable the server to perform the resource data search method described in any one of the embodiments of the present disclosure. The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:

[0057] In the embodiment of the present disclosure, by performing similarity calculation between the quantized second vector of the resource data and the first vector of the resource data to be searched, the efficiency of the calculation can be improved compared to the similarity calculation between the unquantized second vector and the first vector in the prior art. The requirement for resource data search speed is met when the amount of user data is large. After obtaining the first number of second vectors, when dequantizing the first number of second vectors, the embodiment of the present disclosure uses pre-stored floating-point values to replace the preset values, thereby ensuring that there is no information loss in the dequantization of the elements corresponding to the preset values. Among them, the preset value is used to characterize the quantization value of the element that exceeds the preset range. Since there are fewer elements with quantization values exceeding the preset range, and the larger quantization value has a stronger effect on the calculation of similarity, the additional storage of floating-point values of elements with larger quantization values can achieve the beneficial effect of using a small amount of memory in exchange for greater calculation accuracy. Thus, the accuracy of resource data search is improved.

[0058] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0060] Figure 1 The figure is a flowchart of a method for searching resource data according to an exemplary embodiment.

[0061] Figure 2 The figure is a flowchart of a method for searching resource data according to an exemplary embodiment.

[0062] Figure 3 The figure is a flowchart of a method for searching resource data according to an exemplary embodiment.

[0063] Figure 4 The figure is a block diagram of a device for searching resource data according to an exemplary embodiment.

[0064] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment.

[0065] Figure 6 The figure is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION

[0066] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0067] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.

[0068] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0069] In order to facilitate those skilled in the art to understand the technical solution provided by the embodiments of the present disclosure, the technical environment in which the technical solution is implemented is described below.

[0070] In related resource data search technologies, the ANNS combined with quantization method is used. Taking the conversion of 32-bit floating-point numbers to 8-bit integers as an example, the vector corresponding to the original 32-bit floating-point resource data is multiplied by the scaling factor and mapped to the 8-bit integer representation range [-128, 127]. In this process, elements less than -128 will be truncated to -128, and elements greater than 127 will be truncated to 127. 128 / the element with the largest absolute value is often used as the above scaling factor, which will result in greater information loss for elements with smaller values. If a larger scaling factor is used, the information loss of the above truncation operation will be greater.

[0071] Another related resource data search technology uses ANNS combined with quantization and additional floating-point storage for all resource data vectors to improve search speed. During the search process, more than a preset number of similar vectors are returned. These similar vectors are restored to floating-point format using the additionally stored floating-point numbers, and their distances to the original vector to be searched are compared again. These vectors are rearranged and a preset number of feature vectors are selected as the final result. However, this method requires additional storage of the floating-point values of all vectors, which takes up a considerable amount of storage space. Furthermore, even if more than a preset number of similar feature vectors are returned, there is no guarantee that these similar feature vectors are the most approximate feature vectors.

[0072] Another related resource data search technology uses ANNS combined with dimensional quantization. For each element of the searched vector, a scaling factor is assigned to each element, mitigating the accuracy loss caused by uneven data distribution. However, during storage, the quantized vector data is stored. During retrieval, the scaling factors are not uniform, so the elements must be converted back to floating-point format for calculation based on their corresponding scaling factors. Therefore, ANNS combined with dimensional quantization only saves storage space without improving search speed.

[0073] Based on actual technical requirements similar to those described above, embodiments of the present disclosure provide a data processing method, apparatus, electronic device, and storage medium.

[0074] Figure 1 FIG. 1 is a flow chart showing a method for searching resource data according to an exemplary embodiment. Figure 1 As shown, the method is used in a server and includes the following steps.

[0075] In step S101 , a first vector corresponding to resource data and a plurality of quantized second vectors are obtained.

[0076] In an embodiment of the present disclosure, the resource data may include video resources, voice resources, picture resources, text resources, etc. The resource data may include resource data to be searched. The first vector may include a vector that can characterize the characteristics of the resource data. The first vector of the resource data may be extracted by using an artificial neural network, or the first vector of the resource data may be obtained by using a dictionary mapping method. The embodiment of the present disclosure does not limit the method of obtaining the first vector. In an embodiment of the present disclosure, the second vector may include a second vector in a data set to be searched, and the data set to be searched may include multiple resource data. In one example, the data set may exist in a database, storing a second vector for indexing the corresponding resource data. In one example, the data set may also exist in multiple databases, where the database may include a master database and a slave database, etc.

[0077] In an embodiment of the present disclosure, the quantized second vector may include one obtained by quantizing the original second vector. For example, the original second vector exists in a floating-point format, and the quantized second vector exists in an integer format. In one example, if the representation range of the floating-point format is larger than the representation range of the integer format, for example, the floating-point format is 32 bits and the integer format is 8 bits. It is necessary to multiply the vector data in the floating-point format by the scaling factor so that the product value is mapped to the representation range of the 8-bit integer format. In one example, during the quantization process, the quantization value of the vector element whose floating-point value is larger than the preset range can be set to a preset value. In one example, the boundary value of the integer format representation range can be set to a preset value.

[0078] In step S103 , similarities between the first vector and a plurality of second vectors are calculated respectively, and a first number of second vectors having the highest similarities are determined.

[0079] In the embodiment of the present disclosure, the calculation of the similarity between the first vector and the second vector may include multiple methods, and the similarity is obtained by calculating the Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, Mahalanobis distance, vector inner product or Pearson correlation coefficient of the two vectors. The embodiment of the present disclosure is not limited. The similarity between the first vector and the multiple second vectors is calculated separately. For example, the first vector is A, and the multiple second vectors are a, b, c, d, e..., and the similarity between A and a is calculated and recorded as x1; the similarity between A and b is calculated and recorded as x2; the similarity between A and c is calculated and recorded as x3; the similarity between A and d is calculated and recorded as x4; the similarity between A and d is calculated and recorded as x4; the similarity between A and e is calculated and recorded as x5, and so on. In the determination of the first number of second vectors with the highest similarity, in one example, the first number of second vectors with the highest similarity can be determined by comparison method. In another example, the first number of second vectors with the highest similarity can be determined by sorting method. In the embodiment of the present disclosure, the setting of the first number can be determined according to the number of pre-searched resource data. For example, if 50 video data are pre-searched, the first number may be set to a number greater than 50, such as 80 or 120.

[0080] In step S105, the first number of second vectors is dequantized to obtain a dequantized second vector; wherein, if there is a target second vector in the first number of second vectors whose element quantization value is a preset value, the preset value is replaced by a pre-stored floating-point value of the element to obtain a dequantization result corresponding to the target second vector; wherein, the preset value is used to represent that the product of the floating-point value of the element and the scaling factor exceeds the representation range of the prequantized integer format.

[0081] In an embodiment of the present disclosure, floating-point values corresponding to elements set to preset values can be pre-stored. For example, the vector identifier of the vector in which the element is located and the floating-point value of the element can be stored. If the quantization values of multiple elements in the vector are set to preset values, the corresponding element positions, such as the vector identifier, the element position and the floating-point value of the element, can also be stored during storage. Dequantization processing is performed on each element in the first number of second vectors, specifically including: if the quantization value of the target second vector element is a preset value, then the preset value is replaced by the above-mentioned pre-stored floating-point value of the element; if the quantization value of the target second vector element is other quantization values other than the preset value, then according to the scaling factor, for example, the other quantization value is divided by the scaling factor to obtain the dequantization result corresponding to the target second vector. In another embodiment, if there is no target second vector in the first number of second vectors whose element quantization value is a preset value, the dequantization method can be achieved by dividing the second vector by the scaling factor.

[0082] In step S107 , a second number of second vectors having the highest similarity to the first vector are determined from the dequantized second vectors, and resource data corresponding to the second number of second vectors are used as search results.

[0083] In the embodiment of the present disclosure, since the dequantized second vector is obtained by dequantizing the first number of second vectors, the number of the dequantized second vectors is also the first number. In one example, the similarity between the first vector and the dequantized second vector can be calculated respectively, wherein the similarity calculation method can be the same as in the above embodiment and will not be repeated here. The second number of second vectors with the highest similarity is determined. In the embodiment of the present disclosure, the number of resource data pre-searched by the second number, for example, 50 resource data are pre-searched, then the second number is 50. If the first number is 80, it means that the 50 most similar ones are found from the 80 second vectors.

[0084] In the embodiment of the present disclosure, by performing similarity calculation between the quantized second vector of the resource data and the first vector of the resource data to be searched, the efficiency of the calculation can be improved compared to the similarity calculation between the unquantized second vector and the first vector in the prior art. The requirement for resource data search speed is met when the amount of user data is large. After obtaining the first number of second vectors, when dequantizing the first number of second vectors, the embodiment of the present disclosure uses pre-stored floating-point values to replace the preset values, thereby ensuring that there is no information loss in the dequantization of the elements corresponding to the preset values. Among them, the preset value is used to characterize the quantization value of the element that exceeds the preset range. Since there are fewer elements with quantization values exceeding the preset range, and the larger quantization value has a stronger effect on the calculation of similarity, the additional storage of floating-point values of elements with larger quantization values can achieve the beneficial effect of using a small amount of memory in exchange for greater calculation accuracy. Thus, the accuracy of resource data search is improved.

[0085] In a possible implementation, a method of obtaining the second vector includes:

[0086] Get the initial second vector in floating point format from the dataset;

[0087] Multiplying the initial second vector by a scaling factor to obtain an intermediate second vector;

[0088] When the floating-point value of an element in the intermediate second vector exceeds a representation range of a pre-quantized integer format, determining the quantization value of the element to be a preset value;

[0089] When the floating-point values of the elements in the intermediate second vector do not exceed the representation range, the intermediate second vector is rounded to obtain a second vector.

[0090] The names of various vectors involved in the embodiments of the present disclosure are named. In order to more clearly illustrate the differences between the above-mentioned various vectors, the processing relationship of each vector is introduced below. The initial second vector, the intermediate second vector, the quantized second vector and the dequantized second vector have undergone different processing stages. In order to distinguish it from the first vector used during retrieval, the vector in the data set is called the quantized second vector, and the original second vector is called the initial second vector. The values of the elements in the initial second vector are in floating-point format; the initial second vector is multiplied by the scaling factor to obtain the intermediate second vector (data mapping process), and the intermediate second vector is rounded to obtain the quantized second vector; the dequantized second vector is the vector obtained by dequantizing the quantized second vector.

[0091] In an embodiment of the present disclosure, the data set may include multiple resource data. In one example, the data set may exist in a database, storing a second vector for indexing the corresponding resource data. In one example, the data set may also exist in multiple databases, wherein the database may include a master database and a slave database, etc. The second vector obtained by artificial neural network or other means is mostly an initial second vector in floating point format. In the case where the representation range of the floating point format is larger than the representation range of the pre-quantized integer format, it is necessary to use a scaling factor to map the initial second vector in floating point format to within the representation range of the integer format. Specifically, in the case where the floating point value of the element in the initial second vector exceeds the representation range of the pre-quantized integer format, the quantization value of the element is determined to be a preset value. In the case where the floating point value of the element in the initial second vector does not exceed the representation range, the initial second vector is multiplied by the scaling factor to obtain an intermediate second vector. The intermediate second vector is rounded to obtain a second vector. Taking the conversion of the floating point format to the 8-bit integer format as an example, refer to formula (1),

[0092]

[0093] In formula (1), x represents the floating-point value of the element in the initial second vector, and s represents the scaling factor. If the floating-point value of x×s exceeds the representation range of the 8-bit integer format [-128, 127], the quantized value of the element x is set to a preset value. For example, if x×s ≥ 127, the preset value is 127; if x×s ≤ -128, the preset value is -128. If the floating-point value of x×s is within the representation range, the quantized value of the element is the product of the floating-point value x and the scaling factor s, rounded to the nearest integer.

[0094] In the embodiment of the present disclosure, if the floating-point value of the element in the initial second vector exceeds the representation range of the integer format, the quantization value of the element is set to a preset value, and the above floating-point value is additionally stored. Compared with the traditional method of using a scaling factor to map all floating-point values to the representation range of the integer format, for example, s=128 / max(|x|) is selected as the scaling factor, the embodiment of the present disclosure can improve the accuracy of quantization. This is because in actual scenarios, the second vector tends to be normally distributed, that is, a large number of parameters will be concentrated near 0, and only a small number of outliers have larger values. If the scaling factor in the prior art is used for quantization, it will lead to information loss of larger values, and these larger values play a key role in the calculation of similarity. Therefore, the quantization accuracy in the prior art is not high.

[0095] In one possible implementation, if there is a target second vector in the first number of second vectors whose element quantization value is a preset value, replacing the preset value with a pre-stored floating-point value of the element to obtain a dequantization result corresponding to the target second vector includes:

[0096] If there is an element of the target second vector in the first number of second vectors whose quantized value is a preset value, replacing the preset value with a pre-stored floating-point value of the element;

[0097] If an element of the target second vector is a quantized value other than the preset value, a dequantized value of the element is determined according to the scaling factor to obtain a dequantized result corresponding to the target second vector.

[0098] In an embodiment of the present disclosure, if the quantization value of the element of the target second vector in the first number of second vectors is a preset value, the preset value can be replaced by the pre-stored floating-point value of the element to obtain the dequantized value of the element. The pre-storage method may include establishing an additional information lookup table, in which the vector identifier of the vector where the element is located and the floating-point value of the element can be stored. If the quantization values of multiple elements in the vector are set to preset values, the corresponding element positions, such as the vector identifier, the element position and the floating-point value of the element, can also be stored during storage. In an embodiment of the present disclosure, if the element of the target second vector is a quantization value other than the preset value, it means that the element in the second vector can be obtained by a scaling factor, that is, the intermediate second vector is obtained by multiplying the initial second vector by the scaling factor, and the intermediate second vector is rounded off. Therefore, when dequantizing, the quantization value of the element in the quantized second vector can be divided by the scaling factor to obtain the dequantized floating-point value. Taking the conversion of the floating-point format to the 8-bit integer format as an example, refer to formula (2),

[0099]

[0100] Where y represents the quantized second vector, and dict represents our additional information lookup table. If the quantization value of y is a preset value, such as 127 or -128, its dequantized value can be obtained using the above information lookup table. If the quantization value of y is other than the preset value, dequantization can be performed using y / s.

[0101] The disclosed embodiments provide a dequantization method capable of accurately dequantizing elements whose floating-point values exceed the range represented by a prequantized integer format. After dequantization, similarity is calculated between the dequantized second vector and the first vector to determine the second number of second vectors with the highest similarity, thereby more accurately determining the pre-searched number of second vectors.

[0102] In a possible implementation, the scaling factor is obtained by:

[0103] After multiplying the initial second vector by a preset scaling factor, rounding the obtained product to obtain a quantized second vector;

[0104] Dividing the quantized second vector by the scaling factor to obtain a dequantized second vector;

[0105] By using a preset optimization algorithm, a preset scaling factor that satisfies the minimum distance between the initial second vector and the plurality of dequantized second vectors is used as the scaling factor.

[0106] In an embodiment of the present disclosure, the preset factor may include a randomly set scaling factor. The quantization processing of the initial second vector may include multiplying the initial second vector by the scaling factor and then rounding it to obtain a quantized second vector. In one example, the scaling factor is denoted as s, and the initial second vector is denoted as X, then the intermediate second vector can be expressed as [X×s], where [] represents rounding. The dequantized vector U can be expressed as U=[X×s] / s. In one example, the preset optimization algorithm may include a least squares method to calculate min|UX|. The preset scaling factor that meets the min|UX| condition is used as the scaling factor.

[0107] In the disclosed embodiment, by constructing a distance model between the dequantized second vector and the initial second vector, a preset optimization algorithm can be used to solve the optimal scaling factor. This scaling factor can reduce the information loss of the initial second vector caused by quantization, thereby further improving the accuracy of the search.

[0108] In a possible implementation, the method further includes:

[0109] Amplifying the scaling factor by a preset multiple to obtain an amplified scaling factor, wherein the preset multiple is determined according to a storage space where the pre-stored floating-point value of the element is located;

[0110] The step of multiplying the initial second vector by a scaling factor to obtain an intermediate second vector includes:

[0111] The initial second vector is multiplied by the amplified scaling factor to obtain an intermediate second vector.

[0112] In the embodiment of the present disclosure, amplifying the scaling factor will result in an increase in the number of numbers that exceed the representation range of the pre-quantized integer format after the initial second vector is multiplied by the scaling factor, and the number of elements corresponding to the pre-stored floating-point values will increase. In one example, the magnification of the scaling factor can be set according to the storage space requirements. For example, when the storage space is large, the magnification is increased to store more floating-point values, so that a more accurate second vector can be dequantized when the similarity is calculated twice. Conversely, when the storage space is limited, the magnification can be reduced to reduce the number of floating-point values stored and save storage space.

[0113] The embodiment of the present disclosure can balance storage space and accuracy by adjusting the magnification to meet different practical needs.

[0114] In a possible implementation, the method further includes: updating the data set using the quantized multiple second vectors, and storing floating-point values corresponding to the preset values.

[0115] In the disclosed embodiments, since the quantized second vector has a smaller data size than the initial second vector in floating-point format, using multiple quantized second vectors to update the data set can significantly save storage space for the second vectors. Furthermore, in practical scenarios, second vectors tend to follow a normal distribution, meaning that a large number of parameters are concentrated near 0, with only a small number of outliers having larger values. Using scaling factors as used in prior art for quantization would result in information loss for these larger values, which are crucial for calculating similarity. Therefore, storing the floating-point values corresponding to the preset values does not require much storage space.

[0116] Figure 2 FIG. 1 is a flow chart showing a method for searching resource data according to an exemplary embodiment. Figure 2 As shown, the method is used in a server and includes the following steps.

[0117] In step S101 , a first vector corresponding to resource data and a plurality of quantized second vectors are obtained.

[0118] In an embodiment of the present disclosure, the resource data may include video resources, voice resources, picture resources, text resources, etc. The resource data may include resource data to be searched. The first vector may include a vector that can characterize the characteristics of the resource data. In an embodiment of the present disclosure, the second vector may include a second vector in a data set to be searched, and the data set to be searched may include multiple resource data. In one example, the data set may exist in a database, storing the second vector for indexing the corresponding resource data. In one example, the data set may also exist in multiple databases, where the database may include a master database and a slave database, etc.

[0119] In the disclosed embodiment, the quantized second vector may be obtained by quantizing the original second vector. For example, the original second vector exists in floating-point format, and the quantized second vector exists in integer format. In one example, during the quantization process, the quantized values of vector elements whose floating-point values are greater than a preset range may be set to a preset value. In another example, the boundary value of the range represented in integer format may be set to a preset value.

[0120] In step S103 , similarities between the first vector and a plurality of second vectors are calculated respectively, and a first number of second vectors having the highest similarities are determined.

[0121] In an embodiment of the present disclosure, the calculation of the similarity between the first vector and the second vector may include a variety of methods, and the similarity is obtained by calculating the Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, Mahalanobis distance, vector inner product or Pearson correlation coefficient of the two vectors. The present disclosure is not limited. The similarity between the first vector and multiple second vectors is calculated separately, and the first number of second vectors with the highest similarity is determined. In one example, the first number of second vectors with the highest similarity can be determined by comparison. In another example, the first number of second vectors with the highest similarity can be determined by sorting. In an embodiment of the present disclosure, the setting of the first number can be determined based on the number of pre-searched resource data. For example, if 50 video data are pre-searched, the first number can be set to a number greater than 50, such as 80 or 120.

[0122] Step S201 : If there is an element of a target second vector in the first number of second vectors whose quantized value is a preset value, the preset value is replaced by a pre-stored floating-point value of the element.

[0123] In an embodiment of the present disclosure, if an element in the first number of second vectors is the preset value, the preset value can be replaced by the pre-stored floating-point value of the element to obtain the dequantized value of the element. The pre-storage method may include establishing an additional information lookup table, in which the vector identifier of the vector in which the element is located and the floating-point value of the element can be stored. If the quantization values of multiple elements in the vector are set to preset values, the corresponding element positions, such as the vector identifier, the element position, and the floating-point value of the element, can also be stored during storage.

[0124] Step S203 : If an element of the target second vector is a quantized value other than the preset value, a dequantized value of the element is determined according to the scaling factor to obtain a dequantized result corresponding to the target second vector.

[0125] In the disclosed embodiment, if the elements in the first number of second vectors are quantized values other than the preset values, this indicates that the elements in the second vectors are obtained by using a scaling factor, i.e., by multiplying the initial second vector by the scaling factor to obtain an intermediate second vector, and then rounding the intermediate second vector. Therefore, when performing dequantization, the quantized values of the elements in the quantized second vector can be divided by the scaling factor to obtain a dequantized floating-point value.

[0126] Step S107 : determining a second number of second vectors having the highest similarity to the first vector from the dequantized second vectors, and taking resource data corresponding to the second number of second vectors as search results.

[0127] In the disclosed embodiment, since the dequantized second vector is obtained by dequantizing the first number of second vectors, the number of dequantized second vectors is also the first number. In one example, similarities between the first vector and the dequantized second vectors can be calculated. The similarity calculation method can be the same as in the above embodiment and is not further described here. The second number of second vectors with the highest similarity is determined.

[0128] Step S205 : updating the data set using the quantized multiple second vectors, and storing floating-point values corresponding to the preset values.

[0129] In the disclosed embodiments, since the quantized second vector has a smaller data size than the initial second vector in floating-point format, using multiple quantized second vectors to update the data set can significantly save storage space for the second vectors. Furthermore, in practical scenarios, second vectors tend to follow a normal distribution, meaning that a large number of parameters are concentrated near 0, with only a small number of outliers having larger values. Using scaling factors as used in prior art for quantization would result in information loss for these larger values, which are crucial for calculating similarity. Therefore, storing the floating-point values corresponding to the preset values does not require much storage space.

[0130] Table 1

[0131]

[0132] This disclosed embodiment is based on the publicly available DEEP and GLOVE (Global Vectors for Word Representation) datasets. These datasets contain a large number of image vectors and text word vectors. This disclosed embodiment is compared with the aforementioned ANNS using a dimensional quantization approach, yielding the performance metrics shown in Table 1.

[0133] As shown in Table 1, it can be seen that the embodiment of the present disclosure uses very little additional storage space and achieves dual optimization in accuracy and speed.

[0134] Compared to the traditional ANNS + sub-dimensional quantization scheme, the disclosed embodiment can achieve a computational speedup of over 1.5 times. This is due to the Intel AVX512 instruction set's excellent support for INT8 computations, meaning that computations between integer vectors are faster than those between floating-point numbers. Furthermore, it can save 75% of memory overhead, as integer vectors occupy significantly less space than raw floating-point numbers.

[0135] Figure 3 FIG. 1 is a flow chart of a method for searching resource data according to an exemplary embodiment. Figure 3 As shown, the method is used in the server, and Figure 2 The difference between the embodiments described above and the embodiments disclosed herein is that, in step S101, the first vector corresponding to the resource data and the plurality of quantized second vectors are obtained, and the following steps are also included before the step S101:

[0136] Step S301: Obtain an initial second vector in floating point format from a data set.

[0137] Step S303: multiplying the initial second vector by a scaling factor to obtain an intermediate second vector.

[0138] Step S305 : When the floating-point value of an element in the intermediate second vector exceeds a representation range of a pre-quantized integer format, determining that the quantization value of the element is a preset value.

[0139] Step S307 : When the floating-point values of the elements in the intermediate second vector do not exceed the representation range, rounding is performed on the intermediate second vector to obtain a second vector.

[0140] In an embodiment of the present disclosure, the data set may include multiple resource data. In one example, the data set may exist in a database, storing a second vector for indexing the corresponding resource data. In one example, the data set may also exist in multiple databases, wherein the database may include a master database and a slave database, etc. The second vector obtained by an artificial neural network or other means is mostly an initial second vector in a floating-point format. When the representation range of the floating-point format is larger than the representation range of the pre-quantized integer format, it is necessary to use a scaling factor to map the initial second vector in the floating-point format to within the representation range of the integer format. Specifically, when the floating-point value of an element in the initial second vector exceeds the representation range of the pre-quantized integer format, the quantization value of the element is determined to be a preset value. When the floating-point value of the element in the initial second vector does not exceed the representation range, the initial second vector is multiplied by the scaling factor to obtain an intermediate second vector. The intermediate second vector is rounded to obtain the second vector.

[0141] It should be understood that although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0142] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can be referred to each other, and each embodiment focuses on the differences from other embodiments. For related parts, please refer to the description of other method embodiments.

[0143] Figure 4 FIG. 1 is a block diagram of a device for searching resource data according to an exemplary embodiment. Figure 4 , the apparatus 400 comprises:

[0144] A first acquisition module 401 is configured to acquire a first vector corresponding to resource data and a plurality of quantized second vectors;

[0145] A first determining module 403 is configured to respectively calculate similarities between the first vector and a plurality of second vectors, and determine a first number of second vectors having the highest similarities;

[0146] a dequantization module 405 configured to, when a quantization value of an element in the first number of second vectors is a preset value, replace the preset value with a pre-stored floating-point value of the element to obtain a dequantized second vector, wherein the preset value is used to indicate that a product of the floating-point value of the element and a scaling factor exceeds a representation range of a pre-quantized integer format;

[0147] The search module 407 is configured to determine a second number of second vectors having the highest similarity to the first vector from the dequantized second vectors, and use resource data corresponding to the second number of second vectors as a search result.

[0148] In a possible implementation, the method further includes:

[0149] A second acquisition module is used to obtain an initial second vector in a floating point format from the data set;

[0150] A first processing module, configured to obtain an intermediate second vector by multiplying the initial second vector by a scaling factor;

[0151] A second determining module is configured to determine, when a floating-point value of an element in the intermediate second vector exceeds a representation range of a pre-quantized integer format, that the quantized value of the element is a preset value;

[0152] The second processing module is configured to round the intermediate second vector to obtain a second vector if the floating-point values of the elements in the intermediate second vector do not exceed the representation range.

[0153] In a possible implementation, the dequantization module includes:

[0154] a replacement submodule, configured to, when an element in the first number of second vectors is the preset value, replace the preset value with a pre-stored floating-point value of the element;

[0155] The dequantization submodule is configured to determine, when an element in the first number of second vectors has a quantization value other than the preset value, a dequantized value of the element according to the scaling factor to obtain a dequantized second vector.

[0156] In a possible implementation, the method further includes:

[0157] a third processing module, configured to multiply the initial second vector by a preset scaling factor and round the resulting product to obtain a quantized second vector;

[0158] a fourth processing module, configured to divide the quantized second vector by the scaling factor to obtain a dequantized second vector;

[0159] The third determining module is configured to use a preset optimization algorithm to select a preset scaling factor that satisfies the minimum distance between the initial second vector and the plurality of de-quantized second vectors as the scaling factor.

[0160] In a possible implementation, the method further includes:

[0161] The fifth processing module is configured to amplify the scaling factor by a preset multiple to obtain an amplified scaling factor, wherein the preset multiple is determined according to a storage space where the pre-stored floating-point value of the element is located.

[0162] In a possible implementation, the method further includes:

[0163] An updating module is configured to update the data set using the quantized plurality of second vectors and store floating-point values corresponding to the preset values.

[0164] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0165] Figure 5 1 is a block diagram of an electronic device 500 for a method for searching resource data according to an exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0166] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power supply component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .

[0167] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 502 may include one or more modules to facilitate interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.

[0168] The memory 504 is configured to store various types of data to support operations on the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, optical disk, or graphene memory.

[0169] The power supply assembly 506 provides power to the various components of the electronic device 500. The power supply assembly 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.

[0170] The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0171] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 504 or transmitted via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0172] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.

[0173] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500. The sensor assembly 514 can also detect changes in the position of the electronic device 500 or components of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the device 500, and temperature changes of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0174] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0175] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0176] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, which can be executed by the processor 520 of the electronic device 500 to perform the above method. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0177] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions, and the instructions can be executed by the processor 520 of the electronic device 500 to implement the above method.

[0178] Figure 6 FIG. 6 is a block diagram of a server 600 for a method for searching resource data according to an exemplary embodiment. For example, the server 600 may be a server. Figure 6 The server 600 includes a processing component 620, which further includes one or more processors, and a memory resource represented by a memory 622 for storing instructions, such as applications, that can be executed by the processing component 620. The application stored in the memory 622 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 620 is configured to execute the instructions to perform the above-described method.

[0179] The server 600 may further include a power supply component 624 configured to perform power management of the server 600, a wired or wireless network interface 626 configured to connect the server 600 to a network, and an input / output (I / O) interface 628. The server 600 may operate based on an operating system stored in the memory 622, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or the like.

[0180] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 622 including instructions, which can be executed by a processor of the server 600 to perform the above method. The storage medium can be a computer-readable storage medium, such as a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0181] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions, and the instructions can be executed by a processor of the server 600 to implement the above method.

[0182] It should be noted that the above-mentioned devices, electronic devices, computer-readable storage media, computer program products, etc. can also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments and will not be described one by one here.

[0183] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

[0184] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for searching resource data, characterized in that: include: Obtaining a first vector corresponding to the resource data and a plurality of quantized second vectors; calculating similarities between the first vector and a plurality of the second vectors respectively, and determining a first number of the second vectors having the highest similarities; performing a dequantization process on the first number of second vectors to obtain a dequantized second vector; wherein, if a target second vector having an element quantized by a preset value exists in the first number of second vectors, replacing the preset value with a pre-stored floating-point value of the element to obtain a dequantization result corresponding to the target second vector; wherein the preset value is used to indicate that a product of the floating-point value of the element and a scaling factor exceeds a representation range of a pre-quantized integer format; A second number of dequantized second vectors having the highest similarity to the first vector is determined from the dequantized second vectors, and resource data corresponding to the second number of second vectors is used as a search result.

2. The method according to claim 1, characterized in that The second vector is obtained by: Get the initial second vector in floating point format from the dataset; Multiplying the initial second vector by a scaling factor to obtain an intermediate second vector; When the floating-point value of an element in the intermediate second vector exceeds a representation range of a pre-quantized integer format, determining the quantization value of the element to be a preset value; When the floating-point values of the elements in the intermediate second vector do not exceed the representation range, the intermediate second vector is rounded to obtain a second vector.

3. The method according to claim 2, characterized in that If there is a target second vector in which the quantization value of an element is a preset value in the first number of second vectors, replacing the preset value with a pre-stored floating-point value of the element to obtain a dequantization result corresponding to the target second vector includes: If there is an element of the target second vector in the first number of second vectors whose quantized value is a preset value, replacing the preset value with a pre-stored floating-point value of the element; If an element of the target second vector is a quantized value other than the preset value, a dequantized value of the element is determined according to the scaling factor to obtain a dequantized result corresponding to the target second vector.

4. The method according to claim 1, wherein The scaling factor is obtained by: After multiplying the initial second vector by a preset scaling factor, the resulting product is rounded to obtain a quantized second vector; Dividing the quantized second vector by the scaling factor to obtain a dequantized second vector; By using a preset optimization algorithm, a preset scaling factor that satisfies the minimum distance between the initial second vector and the plurality of dequantized second vectors is used as the scaling factor.

5. The method according to claim 4, characterized in that Also includes: Amplifying the scaling factor by a preset multiple to obtain an amplified scaling factor, wherein the preset multiple is determined according to a storage space where the pre-stored floating-point value of the element is located; Multiplying the initial second vector by a scaling factor to obtain an intermediate second vector includes: The initial second vector is multiplied by the amplified scaling factor to obtain an intermediate second vector.

6. The method according to any one of claims 2 to 5, characterized in that The method further comprises: The data set is updated using the quantized multiple second vectors, and the floating-point values corresponding to the preset values are stored.

7. A resource data search device, characterized in that: include: A first acquisition module, configured to acquire a first vector corresponding to resource data and a plurality of quantized second vectors; a first determining module, configured to respectively calculate similarities between the first vector and a plurality of second vectors, and determine a first number of second vectors having the highest similarities; a dequantization module configured to, when a quantization value of an element in the first number of second vectors is a preset value, replace the preset value with a pre-stored floating-point value of the element to obtain a dequantized second vector, wherein the preset value is used to indicate that a product of the floating-point value of the element and a scaling factor exceeds a representation range of a prequantized integer format; A search module is configured to determine a second number of second vectors having the highest similarity to the first vector from the dequantized second vectors, and use resource data corresponding to the second number of second vectors as a search result.

8. A server, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the resource data search method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the resource data search method according to any one of claims 1 to 6.

10. A computer program product comprising instructions, characterized in that: When the instruction is executed by a processor of the server, the server is enabled to execute the resource data search method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image model training method, image processing method, chip, equipment and medium

    CN112287968A

  • Vector quantization method and device for multimedia data processing, and equipment

    CN112558887A