Search

CN-122019630-A - Semiconductor device, system and method for calculating distance

CN122019630ACN 122019630 ACN122019630 ACN 122019630ACN-122019630-A

Abstract

The invention provides a semiconductor device, a system and a method for calculating distance. The semiconductor device includes a memory cell array for storing data in a plurality of memory cells and a circuit coupled to the memory cell array. The circuit is configured to perform a plurality of operations in the memory cell array. The circuitry performs operations including receiving a request indicating a query vector, obtaining a plurality of clusters of a plurality of feature vectors, wherein each cluster of the clusters is associated with a corresponding centroid vector, determining a plurality of distances between the query vector and the plurality of centroid vectors of the cluster, selecting one or more clusters from the clusters based on the distances between the query vector and the centroid vectors of the cluster, determining a distance between the query vector and the feature vector for each feature vector of the one or more clusters, and selecting one or more feature vectors from the one or more clusters based on the plurality of distances between the query vector and the plurality of feature vectors of the one or more clusters.

Inventors

  • HU HANWEN
  • LIN BAIRONG
  • Wang Huaimu

Assignees

  • 旺宏电子股份有限公司

Dates

Publication Date
20260512
Application Date
20250529
Priority Date
20250311

Claims (10)

  1. 1.A semiconductor device, comprising: A memory cell array for storing data in the memory cells, and A circuit coupled to the memory cell array and configured to perform a plurality of operations in the memory cell array, the operations comprising: Receiving a request indicating a query vector; obtaining a plurality of clusters of a plurality of feature vectors, wherein each cluster of the clusters is associated with a corresponding centroid vector; determining a plurality of distances between the query vector and a plurality of centroid vectors of the clusters; Selecting one or more clusters from the clusters based on the query vector and the distances between the centroid vectors of the clusters; For each feature vector of the one or more clusters, determining a distance between the query vector and the feature vector, and One or more feature vectors are selected from the one or more clusters based on a plurality of distances between the query vector and a plurality of feature vectors of the one or more clusters.
  2. 2. The semiconductor device of claim 1, wherein determining the distance between the query vector and the feature vector comprises: Determining a distance between the feature vector and a centroid vector of a cluster to which the feature vector belongs; determining a distance between the query vector and the centroid vector of the cluster to which the feature vector belongs; determining a dot product of the query vector and the feature vector, and The distance between the query vector and the feature vector is determined based on the distance between the feature vector and the centroid vector, the distance between the query vector and the centroid vector, and the dot product.
  3. 3. The semiconductor device of claim 2, wherein determining the distance between the feature vector and the centroid vector of the cluster to which the feature vector belongs comprises: Determining the distance between the feature vector and the centroid vector using a mapping table associated with the cluster, wherein the mapping table indicates a mapping relationship between: A plurality of feature vectors of the cluster, and The feature vectors and the distances between the centroid vectors of the cluster.
  4. 4. The semiconductor device of claim 2, wherein determining the distance between the feature vector and the centroid vector of the cluster to which the feature vector belongs comprises: Determining a scale level of the feature vector in the cluster to which the feature vector belongs; Determining a first value indicative of a spacing between adjacent scale levels of the cluster; determining a second value indicative of an amplitude of a minimum scale level of the cluster, and The distance between the feature vector and the centroid vector is determined based on the scale level, the first value, and the second value of the feature vector.
  5. 5. The semiconductor device of claim 4, wherein determining the scale level of the feature vector in the cluster to which the feature vector belongs comprises: the scale level of the feature vector is determined based on the proximity of the feature vector to the adjacent scale levels in the cluster.
  6. 6. A system for calculating distance, comprising: a semiconductor device, and A controller coupled to the semiconductor device for controlling the semiconductor device, Wherein the semiconductor device comprises: A memory cell array for storing data in the memory cells, and A circuit coupled to the memory cell array and configured to perform a plurality of operations in the memory cell array, the operations comprising: Receiving a request from the controller indicating a query vector; obtaining a plurality of clusters of a plurality of feature vectors, wherein each cluster of the clusters is associated with a corresponding centroid vector; determining a plurality of distances between the query vector and a plurality of centroid vectors of the clusters; Selecting one or more clusters from the clusters based on the query vector and the distances between the centroid vectors of the clusters; For each feature vector of the one or more clusters, determining a distance between the query vector and the feature vector, and One or more feature vectors are selected from the one or more clusters based on a plurality of distances between the query vector and a plurality of feature vectors of the one or more clusters.
  7. 7. The system of claim 6, wherein determining the distance between the query vector and the feature vector comprises: Determining a distance between the feature vector and a centroid vector of a cluster to which the feature vector belongs; determining a distance between the query vector and the centroid vector of the cluster to which the feature vector belongs; determining a dot product of the query vector and the feature vector, and The distance between the query vector and the feature vector is determined based on the distance between the feature vector and the centroid vector, the distance between the query vector and the centroid vector, and the dot product.
  8. 8. A method of calculating a distance, comprising: Receiving a request indicating a query vector; obtaining a plurality of clusters of a plurality of feature vectors, wherein each cluster of the clusters is associated with a corresponding centroid vector; determining a plurality of distances between the query vector and a plurality of centroid vectors of the clusters; Selecting one or more clusters from the clusters based on the query vector and the distances between the centroid vectors of the clusters; For each feature vector of the one or more clusters, determining a distance between the query vector and the feature vector, and One or more feature vectors are selected from the one or more clusters based on a plurality of distances between the query vector and a plurality of feature vectors of the one or more clusters.
  9. 9. The method of claim 8, wherein determining the distance between the query vector and the feature vector comprises: Determining a distance between the feature vector and a centroid vector of a cluster to which the feature vector belongs; determining a distance between the query vector and the centroid vector of the cluster to which the feature vector belongs; determining a dot product of the query vector and the feature vector, and The distance between the query vector and the feature vector is determined based on the distance between the feature vector and the centroid vector, the distance between the query vector and the centroid vector, and the dot product.
  10. 10. The method of claim 9, wherein determining the distance between the feature vector and the centroid vector of the cluster to which the feature vector belongs comprises: Determining the distance between the feature vector and the centroid vector using a mapping table associated with the cluster, wherein the mapping table indicates a mapping relationship between: A plurality of feature vectors of the cluster, and The feature vectors and the distances between the centroid vectors of the cluster.

Description

Semiconductor device, system and method for calculating distance Technical Field The present invention relates to a distance calculating technology, and more particularly, to a semiconductor device, a distance calculating system and a distance calculating method. Background Database searching involves the process of retrieving specific information from a large collection of structured data through a query operation. These queries define criteria for filtering and extracting relevant records quickly and accurately. Searches can range from simple exact matches to more advanced queries, such as range searches, pattern matches, or full text searches, as desired. Efficient database searching ensures that users can efficiently access the desired data and support a variety of analysis and operational tasks. Disclosure of Invention Methods, apparatus, systems, and techniques are described for efficient retrieval and searching of information by computing Euclidean distances between query vectors and feature vectors in a dataset, facilitating precise search and data retrieval based on similarity. One aspect of the invention includes a semiconductor device. The semiconductor device includes a memory cell array for storing data in a plurality of memory cells and a circuit coupled to the memory cell array. Circuitry is used to perform a plurality of operations in the memory cell array. The operations performed by the circuitry include receiving a request indicating a query vector, obtaining a plurality of clusters of feature vectors, wherein each cluster of the clusters is associated with a corresponding centroid vector, determining a plurality of distances between the query vector and the plurality of centroid vectors of the clusters, selecting one or more clusters from the clusters based on the query vector and the plurality of distances between the centroid vectors of the clusters, determining a distance between the query vector and the feature vector for each feature vector of the one or more clusters, and selecting one or more feature vectors from the one or more clusters based on the plurality of distances between the query vector and the plurality of feature vectors of the one or more clusters. Another aspect of the invention includes a system for calculating a distance. The system includes a semiconductor device and a controller coupled to the semiconductor device for controlling the semiconductor device. The semiconductor device includes a memory cell array for storing data in a plurality of memory cells and a circuit coupled to the memory cell array. Circuitry is used to perform a plurality of operations in the memory cell array. The operations performed by the circuitry include receiving a request indicating a query vector, obtaining a plurality of clusters of feature vectors, wherein each cluster of the clusters is associated with a corresponding centroid vector, determining a plurality of distances between the query vector and the plurality of centroid vectors of the clusters, selecting one or more clusters from the clusters based on the query vector and the plurality of distances between the centroid vectors of the clusters, determining a distance between the query vector and the feature vector for each feature vector of the one or more clusters, and selecting one or more feature vectors from the one or more clusters based on the plurality of distances between the query vector and the plurality of feature vectors of the one or more clusters. Yet another aspect of the present invention includes a method of computing a distance comprising receiving a request indicative of a query vector, obtaining a plurality of clusters of feature vectors, wherein each cluster of the clusters is associated with a corresponding centroid vector, determining a plurality of distances between the query vector and the plurality of centroid vectors of the clusters, selecting one or more clusters from the clusters based on the distances between the query vector and the centroid vectors of the clusters, determining a distance between the query vector and the feature vector for each feature vector of the one or more clusters, and selecting one or more feature vectors from the one or more clusters based on the distances between the query vector and the plurality of feature vectors of the one or more clusters. The details of one or more disclosed embodiments are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages will become apparent from the description, the drawings, and the claims. Drawings FIG. 1A is a diagram of an example of a system according to one or more embodiments of the invention. FIG. 1B is a diagram illustrating another example of a system including a controller and a memory device in accordance with one or more embodiments of the present invention. FIG. 1C is a diagram of another example of a system according to one or more embodiments of the invention. FIG. 2 is a d