Database management method and information processing system
By managing clusters and calculating differences in the vector database, the problems of data volume reduction and search accuracy degradation in large-scale vector databases are solved, achieving efficient data storage and retrieval.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KIOXIA CORP
- Filing Date
- 2025-09-09
- Publication Date
- 2026-07-31
AI Technical Summary
In large-scale vector databases, existing technologies reduce search accuracy while reducing data volume, especially when using inverted index product quantization and inverted index scalar quantization methods, where quantization errors are large.
By managing multiple clusters, the cluster to which a vector belongs is determined, and the difference between the representative vector of the cluster and the vector is calculated. The cluster identifier and the difference are stored as location information, reducing the amount of data while maintaining search accuracy.
While reducing the amount of data, the search accuracy of the vector database was maintained, and data storage efficiency and query speed were improved.
Smart Images

Figure CN122489803A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to a database management method and an information processing system for managing vector databases. Background Technology
[0002] Vector databases are used in various fields such as machine learning and data analysis. In a vector database, each data point is stored as a high-dimensional vector containing multiple feature values corresponding to multiple attributes.
[0003] To build a large-scale vector database capable of storing multiple high-dimensional vectors exceeding one billion, the amount of data in the vector set would increase significantly, thus requiring a storage area with extremely large capacity.
[0004] As methods for reducing the amount of data in a vector set, there are known methods based on inverted file product quantization (IVFPQ) and inverted file scalar quantization (IVFSQ).
[0005] However, in IVFPQ and IVFSQ, the quantization error increases due to variations in the vector distribution within the vector set stored in the vector database, which may lead to a decrease in search accuracy.
[0006] Therefore, in vector databases, there is a need for new technologies that can reduce the amount of data in the vector set stored in the vector database while suppressing the decline in search accuracy. Summary of the Invention
[0007] It provides a database management method and information processing system that can reduce the amount of data in the vector set stored in the vector database while suppressing the decline in search accuracy.
[0008] According to an implementation, a database management method for managing a vector database includes: managing multiple clusters, each having a representative vector, wherein the representative vector is a vector representing a representative point in a D-dimensional (D is an integer greater than 2) vector space and having D dimensions; and when registering a first D-dimensional vector to the vector database, determining the cluster among the multiple clusters that has the representative vector closest to the first D-dimensional vector as the cluster to which the first D-dimensional vector should belong; calculating D differences obtained by subtracting the D elements included in the representative vector of the determined cluster from the D elements included in the first D-dimensional vector; and storing the identifier of the determined cluster and the D differences as position information representing the position of the first D-dimensional vector in the D-dimensional vector space in the vector database. Attached Figure Description
[0009] Figure 1 This is a block diagram illustrating an example of the configuration of an information processing system according to the first embodiment.
[0010] Figure 2 This is a diagram illustrating an example of multiple clusters managed in the information processing system according to the first embodiment.
[0011] Figure 3 It is a graph showing the difference between a vector within a cluster and the representative vector of that cluster.
[0012] Figure 4 This is a diagram showing an example of the number of bits in the data representing each element of the original vector and the number of bits in the data representing each element of the difference (diff).
[0013] Figure 5 This is a diagram showing examples of floating-point data formats representing the elements of the original vector and floating-point data formats representing the elements of the difference (diff).
[0014] Figure 6 This is a diagram showing examples of floating-point data representing the elements of the original vector and fixed-point data representing the elements of the difference (diff).
[0015] Figure 7 This is a diagram illustrating an example of cluster information managed in the information processing system according to the first embodiment.
[0016] Figure 8 This is a diagram illustrating an example of vector location information managed in the information processing system according to the first embodiment.
[0017] Figure 9 This is a diagram illustrating an example of inter-cluster vector movement processing performed in the information processing system according to the first embodiment.
[0018] Figure 10 This is a diagram illustrating an example of the process of calculating the difference between a vector and a representative vector of the destination cluster to which the vector is to be moved.
[0019] Figure 11 This is a diagram illustrating an example of remote vector addition processing performed in the information processing system according to the first embodiment.
[0020] Figure 12 This is a diagram showing an example of a vector of an object whose distance is being calculated.
[0021] Figure 13 This is a diagram illustrating an example of distance calculation processing that calculates the distance between the vector of the distance calculation object and the query vector.
[0022] Figure 14 This is a flowchart illustrating an example of the steps of a cluster creation process performed in the information processing system according to the first embodiment.
[0023] Figure 15 This is a flowchart illustrating an example of the steps of vector registration processing performed in the information processing system according to the first embodiment.
[0024] Figure 16 This is a flowchart illustrating an example of the steps of cluster addition and vector movement processing performed in the information processing system according to the first embodiment.
[0025] Figure 17 This is a flowchart illustrating an example of the steps of vector movement processing performed in the information processing system according to the first embodiment.
[0026] Figure 18 This is a flowchart illustrating an example of the steps of remote vector registration processing performed in the information processing system according to the first embodiment.
[0027] Figure 19 This is a flowchart illustrating an example of the steps of distance calculation processing performed in the information processing system according to the first embodiment.
[0028] Figure 20 This is a block diagram illustrating an example of the configuration of an information processing system according to the second embodiment.
[0029] Figure 21 This is a diagram illustrating an example of multiple clusters managed according to each partial vector space in the information processing system involved in the second embodiment.
[0030] Figure 22 It is a graph showing the difference between a subset of vectors and the representative vector of a subset of vector spaces.
[0031] Figure 23 This is a graph showing an example of the number of bits in the data representing each element of a partial vector and the number of bits in the data representing each element of a difference (diff).
[0032] Figure 24 This is a diagram showing examples of floating-point data formats representing the elements of a partial vector and floating-point data formats representing the elements of a difference (diff).
[0033] Figure 25 This is a diagram showing examples of floating-point data representing the elements of a partial vector and fixed-point data representing the elements of a difference (diff).
[0034] Figure 26 This is a diagram illustrating an example of cluster information managed in the information processing system involved in the second embodiment.
[0035] Figure 27 This is a diagram illustrating an example of vector location information managed in the information processing system according to the second embodiment.
[0036] Figure 28 This is a diagram illustrating an example of a vector added to the information processing system according to the second embodiment.
[0037] Figure 29 This is a diagram illustrating an example of inter-cluster partial vector movement processing performed in the information processing system according to the second embodiment.
[0038] Figure 30 This is a diagram illustrating an example of the process of calculating the difference between a partial vector and the representative vector of the destination cluster to which the partial vector is to be moved.
[0039] Figure 31 This is a diagram illustrating an example of a remote vector added to the information processing system according to the second embodiment.
[0040] Figure 32 This is a diagram illustrating an example of remote vector registration processing performed in the information processing system according to the second embodiment.
[0041] Figure 33 This is a diagram showing an example of a vector of an object whose distance is being calculated.
[0042] Figure 34 This is a diagram illustrating an example of distance calculation processing that calculates the distance between the vectors of the object being calculated and the query vector.
[0043] Figure 35 This is a flowchart illustrating an example of the steps of cluster creation processing performed in the information processing system according to the second embodiment.
[0044] Figure 36 This is a flowchart illustrating an example of the steps of vector registration processing performed in the information processing system according to the second embodiment.
[0045] Figure 37 This is a flowchart illustrating an example of the steps of cluster addition and partial vector movement processing performed in the information processing system according to the second embodiment.
[0046] Figure 38 This is a flowchart illustrating an example of the steps of partial vector movement processing performed in the information processing system according to the second embodiment.
[0047] Figure 39 This is a flowchart illustrating an example of the steps of remote vector registration processing performed in the information processing system according to the second embodiment.
[0048] Figure 40 This is a flowchart illustrating an example of the steps of distance calculation processing performed in the information processing system according to the second embodiment.
[0049] Label Explanation
[0050] 1...Information processing system; 2...External device; 3...Communication path; 11...Processor; 12...Main memory; 13...Communication interface; 14...Secondary storage device; 111...Cluster management unit; 112...Cluster determination unit; 113...Differential calculation unit; 114...Vector position information storage unit; 115...Inter-cluster vector movement unit; 116...Remote vector registration processing unit; 117...Distance calculation unit; 211...Cluster management unit based on vector space of each part; 212...Cluster determination unit based on vector of each part; 213...Differential calculation unit based on vector of each part; 214...Vector position information storage unit; 215...Inter-cluster partial vector movement unit; 216...Remote vector registration processing unit; 217...Distance calculation unit. Detailed Implementation
[0051] Hereinafter, the embodiments will be described with reference to the accompanying drawings.
[0052] (First Embodiment)
[0053] Figure 1 This is a block diagram illustrating a configuration example of the information processing system 1 according to the first embodiment. The information processing system 1 is a computer system configured to manage a vector database 20.
[0054] Vector Database 20 is a database that stores and manages multiple vectors. Each of these vectors is an uncompressed vector, i.e., a full-precision vector.
[0055] Multiple vectors each include multiple feature values corresponding to multiple dimensions. When the dimension of each vector is set to D, each vector (D-dimensional vector) is equivalent to a point (data point) in a D-dimensional vector space. The D features included in the D-dimensional vector each represent the feature value (real number) of each of the D attributes. Each vector includes high-dimensional vectors whose dimension D is hundreds or thousands. The dimension D is an integer of at least 2; specifically, the dimension D of high-dimensional vectors is, for example, 256, 1024, or 2048. Hereinafter, the vector space is also referred to as the data space.
[0056] Information processing system 1 performs the process of registering each vector in vector database 20 based on a request from external device 2.
[0057] Additionally, information processing system 1 receives a query vector based on a query from external device 2. The query vector represents the target data (target vector) to be searched from vector database 20. The query vector has the same dimension D as each vector in vector database 20. That is, like each vector in vector database 20, the query vector also includes D feature values corresponding to each of the D dimensions. Hereinafter, the query vector will be simply referred to as the query.
[0058] Information processing system 1 performs an approximate nearest neighbor search on the vector database based on the received query. Approximate nearest neighbor search is a method for quickly searching for vectors (approximate nearest neighbor vectors) that are sufficiently close to the query at a certain distance scale.
[0059] In the first embodiment, the distance scale used to represent the distance between vectors is, for example, Euclidean distance. In this case, several candidate vectors are basically selected from all vectors in the vector database. Then, the Euclidean distance from the query (query vector) is calculated for each of the selected candidate vectors, and a search is performed to find the candidate vector with the shortest Euclidean distance from the query as the solution for the nearest neighbor search (the approximate nearest neighbor vector of the query).
[0060] Furthermore, the distance scale is not limited to Euclidean distance; it can be any other distance that can represent the distance between vectors.
[0061] Next, the configuration of the information processing system 1 will be described. The information processing system 1 includes a processor 11, a main memory 12, a communication interface 13, and a secondary storage device 14. These components, including the processor 11, the main memory 12, the communication interface 13, and the secondary storage device 14, are interconnected via a bus 10.
[0062] Processor 11 is, for example, a central processing unit (CPU). Processor 11 can access main memory 12 and secondary storage device 14. Processor 11 performs various processes, including creating cluster information 21 and vector position information 22, and saving and searching the cluster information 21 and vector position information 22 in the vector database 20 of secondary storage device 14, by executing a computer program (here, database management program 121) stored in main memory 12. Cluster information 21 and vector position information 22 are used as index information. Index information is a data structure used to search for target vectors (the approximate nearest neighbor vectors to be queried) in vector database 20.
[0063] Main memory 12 is a low-access-latency storage device, such as dynamic random access memory (DRAM). Storage areas of main memory 12 are used to store programs to be executed by processor 11, as well as the working area of processor 11. Furthermore, vector database 20 (that is, cluster information 21 and vector location information 22) can also be stored in main memory 12.
[0064] Communication interface 13 is a communication device. Communication interface 13 performs communication with external device 2, for example, via communication path 3 such as a network or bus.
[0065] Secondary storage device 14 is a storage device with a larger capacity than main memory 12 but a slower access speed. Secondary storage device 14 can be implemented using a hard disk drive (HDD) or a solid-state drive (SSD). Hereinafter, we assume that secondary storage device 14 is implemented using an SSD.
[0066] An SSD is a storage system that includes non-volatile memory and a controller configured to control the non-volatile memory.
[0067] Non-volatile memory comprises multiple blocks (also referred to as "memory blocks," "physical blocks," or "flash memory blocks"), each of which is a unit for data erasure operations. Each block comprises multiple pages, each of which is a unit for data write operations and data read operations. Non-volatile memory is, for example, NAND flash memory. NAND flash memory is, for example, a three-dimensional flash memory. Non-volatile memory is not limited to NAND flash memory; other data storage devices such as MRAM can also be used.
[0068] The controller is a memory controller with circuitry, implemented, for example, as an LSI such as a System-On-a-Chip (SoC).
[0069] Next, the functional configuration of processor 11 will be explained.
[0070] The processor 11 functions as a cluster management unit 111, a cluster determination unit 112, a differential calculation unit 113, a vector position information storage unit 114, an inter-cluster vector movement unit 115, a remote vector registration processing unit 116, and a distance calculation unit 117 by executing the database management program 121. Furthermore, each of these units—cluster management unit 111, cluster determination unit 112, differential calculation unit 113, vector position information storage unit 114, inter-cluster vector movement unit 115, remote vector registration processing unit 116, and distance calculation unit 117—can also be implemented using dedicated hardware (circuit) within the information processing system 1.
[0071] Cluster Management Department 111 creates and manages multiple clusters. Each cluster has a representative vector, which is a vector representing a representative point in a D-dimensional vector space and has D dimensions.
[0072] In each of several clusters, the group of vectors that are closest to its representative vector (representative point) belongs to that cluster. The relationship between a cluster and the group of vectors belonging to that cluster is determined as follows.
[0073] For example, suppose we are managing a cluster X with a representative vector x, a cluster Y with a representative vector y, and a cluster Z with a representative vector z.
[0074] In this case, vectors that are close to the representative vector x are managed to belong to cluster X, vectors that are close to the representative vector y are managed to belong to cluster Y, and vectors that are close to the representative vector z are managed to belong to cluster Z.
[0075] The distance from each vector belonging to a certain cluster to the representative vector x of that cluster is shorter than the distance from each vector to the representative vectors of other clusters. In other words, each vector belongs to the cluster with the shortest distance from that vector to the representative vector.
[0076] A representative vector for a cluster can be, for example, the vector representing the centroid of that cluster. Alternatively, any vector belonging to a cluster can also be used as the representative vector for that cluster. This arbitrary vector can be either the vector closest to the centroid of the cluster, or a vector whose distance from the centroid is irrelevant. Furthermore, the centroid of a cluster is a vector representing the center of multiple data points corresponding to multiple vectors belonging to that cluster, determined by calculating the average of these vectors for each element.
[0077] When a vector (the first-dimensional vector) is registered in the vector database 20, the cluster determination unit 112 determines the cluster among multiple clusters that has the representative vector that is closest to the first-dimensional vector as the cluster to which the first-dimensional vector should belong.
[0078] The difference calculation unit 113 calculates D differences obtained by subtracting the D elements included in the representative vector of the determined cluster from the D elements included in the first D-dimensional vector. These D differences are the D elements included in the vector difference between the first D-dimensional vector and the representative vector of the determined cluster. The vector difference between the first D-dimensional vector and the representative vector of the determined cluster, that is, the D differences obtained by subtracting the D elements included in the representative vector of the determined cluster from the D elements included in the first D-dimensional vector, are also called difference diffs or difference vectors.
[0079] The vector position information storage unit 114 stores the identifier of the determined cluster and the calculated D differences (that is, the difference diff between the first D-dimensional vector and the representative vector of the determined cluster) as position information (vector position information 22) representing the position of the first D-dimensional vector in the D-dimensional vector space in the vector database 20.
[0080] The 1D-dimensional vector is a vector that approximates the representative vector of the determined cluster. Therefore, the absolute values of the D differences obtained by subtracting the D elements of the representative vector of the determined cluster from the D elements included in the 1D-dimensional vector are each much smaller than the absolute values of the elements in the 1D-dimensional vector. In other words, the data representing each of the D differences can be represented by a small number of bits that can only represent a narrow range within the D-dimensional vector space. Therefore, the number of bits representing each of the D differences can be reduced to fewer bits than the number of bits representing the elements of the original vector (here, the 1D-dimensional vector, also known as the full-precision vector).
[0081] Therefore, compared with storing each original vector itself as vector position information 22 in the vector database 20 without compression, the amount of data (size of vector position information 22) of the vector set stored in the vector database 20 can be reduced.
[0082] Thus, storing the identifier of the determined cluster and the calculated D differences (that is, the difference diff between the 1D-dimensional vector and the representative vector of the determined cluster) as positional information representing the position of the 1D-dimensional vector in the vector database 20 is equivalent to performing vector quantization of the 1D-dimensional vector using the determined cluster, and storing the data representing the quantization error (the difference diff between the 1D-dimensional vector and the representative vector of the determined cluster) as positional information representing the position of the 1D-dimensional vector.
[0083] As needed, the D elements (D real numbers) of the 1D-dimensional vector can be recovered by adding the representative vector of the determined cluster to the difference diff corresponding to the 1D-dimensional vector.
[0084] In addition, the distance between two vectors (Euclidean distance) can also be calculated by the following process: restore the two vectors respectively, find the sum of squares of the differences between the D elements of one vector and the D elements of the other vector, and then find the square root of the sum of squares.
[0085] However, the process of restoring a vector involves adding the representative point vector to only the difference (diff) corresponding to that vector. Therefore, given that the two difference (diff) corresponding to the two vectors of the distance calculation object have been calculated beforehand, the Euclidean distance between the two vectors can be calculated by finding the sum of the squares of the D differences between the D elements included in one difference (diff) and the D elements included in the other difference (diff), and then finding the square root of this sum. Thus, the Euclidean distance between the two vectors can be calculated by omitting fewer computational steps, such as adding the representative vectors.
[0086] For example, when calculating the distance (Euclidean distance) between a query vector and each of multiple vectors belonging to a certain cluster, the following (1) and (2) processes can be used to calculate the Euclidean distance without restoring the difference dif of each vector to the original vector.
[0087] (1) Calculate the D differences (the D differences corresponding to the query vector) obtained by subtracting the D elements of the cluster's representative vector from the D elements included in the query vector.
[0088] (2) Obtain the D differences (the D differences corresponding to the first vector) from the vector database 20 by subtracting the D elements of the representative vector of the cluster from the D elements included in the first vector in the cluster. Calculate the sum of squares of the D differences between the query vector and the first vector, and then calculate the square root of the sum of squares.
[0089] The square root of the sum of squares is the same as the square root of the sum of squares of the D differences between the D features included in the query vector and the D features included in the first vector.
[0090] For each vector within the cluster after the first one, the Euclidean distance between the first and subsequent vectors and the query vector can be calculated using the same process as for the first vector. Furthermore, since the D differences corresponding to the query vector have already been calculated during the processing of the first vector, they do not need to be calculated again during the processing of the second and subsequent vectors. Additionally, when searching for the vector closest to the query vector among vectors belonging to a certain cluster, it is sufficient to compare the distances from the query vector among vectors belonging to that cluster. Therefore, for each vector belonging to that cluster, the sum of the squares of the D differences corresponding to that vector and the D differences corresponding to the query vector can be calculated as the distance from the query vector (squared distance), and the squared distances from the query vector can be compared among these vectors.
[0091] Through the processing described above in (1) and (2), the distance between the query vector and each of the multiple vectors belonging to a certain cluster can be correctly calculated using D differences obtained by subtracting the D elements of the representative vector of the cluster from the D elements of the query vector (corresponding to the D differences of the query vector) and D differences obtained by subtracting the D elements of the representative vector from the D elements of each vector (corresponding to the D differences of each vector).
[0092] Therefore, without storing each D-dimensional vector itself as vector position information 22 in the vector database 20, it is possible to obtain the same level of search accuracy as when storing each D-dimensional vector itself as vector position information 22 in the vector database 20.
[0093] The inter-cluster vector movement unit 115 performs a process of changing the cluster to which a vector belongs from the cluster to which the vector belongs to a new cluster. Specifically, when creating a new cluster with a representative vector, the inter-cluster vector movement unit 115 determines a vector (the second D-dimensional vector) from the set of D-dimensional vectors belonging to the cluster (the first cluster) that is closer to the representative vector of the new cluster than to the representative vector of the first cluster. Then, the inter-cluster vector movement unit 115 performs a movement process to move the second D-dimensional vector from the first cluster to the new cluster.
[0094] During the movement process, the inter-cluster vector movement unit 115 obtains D first differences from the vector position information 22 in the vector database 20, which are obtained by subtracting the D elements included in the representative vector of the first cluster from the D elements included in the second D-dimensional vector. The D first differences are the difference diff between the second D-dimensional vector and the representative vector of the first cluster, which has been calculated in advance.
[0095] Next, the inter-cluster vector movement unit 115 calculates D second differences obtained by subtracting the D elements included in the representative vector of the new cluster from the D elements included in the representative vector of the first cluster. Then, the inter-cluster vector movement unit 115 calculates D third differences obtained by adding the D second differences to the D first differences. The D third differences represent the difference diff between the 2D-dimensional vector and the representative vector of the new cluster, that is, the D differences obtained by subtracting the D elements included in the representative vector of the new cluster from the D elements included in the 2D-dimensional vector. Therefore, the difference diff between the 2D-dimensional vector and the representative vector of the new cluster can be calculated without restoring the difference diff corresponding to the 2D-dimensional vector, that is, the difference diff between the 2D-dimensional vector and the representative vector of the first cluster, to the 2D-dimensional vector (original vector).
[0096] Then, the inter-cluster vector movement unit 115 saves the identifier of the new cluster and the D third differences (diff between the second-D dimension vector and the representative vector of the new cluster) as information representing the position of the second-D dimension vector in the D-dimensional vector space in the vector database 20.
[0097] If, within the set of D-dimensional vectors belonging to the first cluster, there exist multiple vectors whose distance to the representative vector of the new cluster is shorter than their distance to the representative vector of the first cluster, then a move operation is performed on all of these vectors. The D second differences computed at once can be shared in the move operation on all of these vectors.
[0098] The remote vector registration processing unit 116 performs processing to reduce errors during remote vector registration. A remote vector is a vector whose distance from all representative vectors of the multiple created clusters exceeds the maximum value of the difference that can be represented by data with reduced bits (second data). For any of the multiple created clusters, the values of the D differences obtained by subtracting the D elements of the representative vector of that cluster from the D elements of the remote vector are all greater than the maximum value of the difference that can be represented by the second data. Therefore, if a remote vector is registered in one of the multiple created clusters, the values of the D differences obtained by subtracting the D elements of the representative vector of that cluster from the D elements of the remote vector cannot be correctly represented, resulting in larger errors in each of the D differences.
[0099] Therefore, the remote vector registration processing unit 116 creates a new cluster with representative vectors that are close to the remote vector. The representative vector that is close to the remote vector is a representative vector that represents any position within a predetermined range of the position of the remote vector in the vector space. For example, a vector that represents the same position as the remote vector in the vector space can also be used as the representative vector that is close to the remote vector.
[0100] Next, the remote vector registration processing unit 116 calculates the D fourth differences obtained by subtracting the D elements of the representative vector of the new cluster from the D elements included in the remote vector. Then, the remote vector registration processing unit 116 stores the identifier of the new cluster and the D fourth differences as information representing the position of the new vector in the D-dimensional vector space (vector position information 22) in the vector database 20. As a result, the error during remote vector registration can be reduced.
[0101] When a D-dimensional query vector is given, the distance calculation unit 117 calculates the distance (Euclidean distance) between the vector of the distance calculation object (the 3D-dimensional vector) and the query vector. Specifically, the distance calculation unit 117 obtains the D fifth differences from the vector position information 22 of the vector database 20, obtained by subtracting the D elements included in the representative vector of the second cluster to which the 3D-dimensional vector belongs from the D elements included in the 3D-dimensional vector. The D fifth differences are the difference diff between the 3D-dimensional vector and the representative vector of the second cluster to which the 3D-dimensional vector belongs, which has been calculated in advance. Next, the distance calculation unit 117 calculates the D sixth differences, obtained by subtracting the D elements included in the representative vector of the second cluster from the D elements included in the query vector. Then, the distance calculation unit 117 calculates the sum of squares (squared distance) or the square root of the sum of squares (Euclidean distance) of the D seventh differences between the D fifth differences and the D sixth differences.
[0102] Next, we will explain the multiple clusters created in the D-dimensional vector space. Figure 2 This is a diagram illustrating an example of multiple clusters managed in the information processing system 1 according to the first embodiment.
[0103] exist Figure 2 In this context, a D-dimensional vector space is represented as a vector space VS. Figure 2 The example shown is the creation of five clusters CL0 to CL4 in the vector space VS.
[0104] Cluster CL0 has a representative vector RV0 representing a point in vector space VS. Four vectors V1 to V4 belong to cluster CL0. Each of vectors V1 to V4 is a D-dimensional vector that is close to the representative vector RV0 of cluster CL0. The arrows from the representative vector RV0 to each of vectors V1 to V4 represent the differences (vector differences) between each of vectors V1 to V4 and the representative vector RV0.
[0105] Cluster CL1 has a representative vector RV1 representing another representative point in vector space VS. Four vectors V5 to V8 belong to cluster CL1. Each of vectors V5 to V8 is a D-dimensional vector that is close to the representative vector RV1 of cluster CL1. The arrows from the representative vector RV1 to each of vectors V5 to V8 represent the difference (vector difference) between each of vectors V5 to V8 and the representative vector RV1.
[0106] Cluster CL2 has a representative vector RV2 representing another representative point in vector space VS. Four vectors V9 to V12 belong to cluster CL2. Each of vectors V9 to V12 is a D-dimensional vector that is close to the representative vector RV2 of cluster CL2. The arrows from the representative vector RV2 to each of vectors V9 to V12 represent the difference (vector difference) between each of vectors V9 to V12 and the representative vector RV2.
[0107] Cluster CL3 has a representative vector RV3 representing another representative point in vector space VS. Four vectors V13 to V16 belong to cluster CL3. Each of vectors V13 to V16 is a D-dimensional vector that is close to the representative vector RV3 of cluster CL3. The arrows from the representative vector RV3 to each of vectors V13 to V16 represent the difference (vector difference) between each of vectors V13 to V16 and the representative vector RV3.
[0108] Cluster CL4 has a representative vector RV4 representing another representative point in vector space VS. Four vectors V17 to V20 belong to cluster CL4. Each of vectors V17 to V20 is a D-dimensional vector that is close to the representative vector RV4 of cluster CL4. The arrows from the representative vector RV4 to each of vectors V17 to V20 represent the difference (vector difference) between each of vectors V17 to V20 and the representative vector RV4.
[0109] Figure 3 It is a graph showing the difference between a vector within a cluster and the representative vector of that cluster.
[0110] exist Figure 3 The example shown illustrates the differences diff1 to diff4 corresponding to vectors V1 to V4 belonging to cluster CL0. The following explanation will use the case where the dimension D of each vector to be registered in vector database 20 is 256 as an example.
[0111] For example, consider the cases where vectors V1 = (a1, a2, ..., a256), V2 = (b1, b2, ..., b256), V3 = (c1, c2, ..., c256), V4 = (d1, d2, ..., d256), and the representative vector of cluster CL0 is RV0 = (x1, x2, ..., x256).
[0112] The difference diff1 between vector V1 and the representative vector RV0 of cluster CL0 comprises D differences (a1-x1, a2-x2, ..., a256-x256) obtained by subtracting the D elements of the representative vector RV0 of cluster CL0 (x1, x2, ..., x256) from the D elements of vector V1 (a1, a2, ..., a256) respectively. In other words, the difference diff1 is expressed by the following formula.
[0113] diff1=((a1-x1), (a2-x2),..., (a256-x256))
[0114] Therefore, regarding vector V1, the identifier of cluster CL0 and the difference diff1 (here (a1-x1), (a2-x2), ..., (a256-x256)) are stored in vector database 20 as position information representing the position of vector V1 in vector space VS.
[0115] The difference diff2 between vector V2 and the representative vector RV0 of cluster CL0 comprises D differences (b1-x1, (b2-x2), ..., (b256-x256)) obtained by subtracting the D elements of the representative vector RV0 of cluster CL0 (x1, x2, ..., x256) from the D elements of vector V2 (b1, b2, ..., b256) respectively. In other words, the difference diff2 is expressed by the following formula.
[0116] diff2=((b1-x1), (b2-x2),..., (b256-x256))
[0117] Therefore, regarding vector V2, the identifier of cluster CL0 and the difference diff2 (here (b1-x1), (b2-x2), ..., (b256-x256)) are stored in vector database 20 as position information representing the position of vector V2 in vector space VS.
[0118] The difference diff3 between vector V3 and the representative vector RV0 of cluster CL0 comprises D differences (c1-x1, (c2-x2), ..., (c256-x256)) obtained by subtracting the D elements of the representative vector RV0 of cluster CL0 (x1, x2, ..., x256) from the D elements of vector V3 (c1, c2, ..., c256) respectively. In other words, the difference diff3 is expressed by the following formula.
[0119] diff3=((c1-x1), (c2-x2),..., (c256-x256))
[0120] Therefore, regarding vector V3, the identifier of cluster CL0 and the difference diff3 (here (c1-x1), (c2-x2), ..., (c256-x256)) are stored in vector database 20 as position information representing the position of vector V3 in vector space VS.
[0121] The difference diff4 between vector V4 and the representative vector RV0 of cluster CL0 comprises D differences ((d1-x1), (d2-x2), ..., (d256-x256)) obtained by subtracting the D elements of the representative vector RV0 of cluster CL0 (x1, x2, ..., x256) from the D elements of vector V4 (d1, d2, ..., d256) respectively. In other words, the difference diff4 is expressed by the following formula.
[0122] diff4=((d1-x1), (d2-x2),..., (d256-x256))
[0123] Therefore, regarding vector V4, the identifier of cluster CL0 and the difference diff4 (here (d1-x1), (d2-x2), ..., (d256-x256)) are stored in vector database 20 as position information representing the position of vector V4 in vector space VS.
[0124] Next, refer to Figures 4-6 This describes the data format used to represent the differences (diff) corresponding to each vector. Figures 4-6 In this process, each D-dimensional vector to be registered in the vector database 20 is represented as a fully accurate original vector.
[0125] Figure 4 This is a diagram showing an example of the number of bits in the data representing each element of the original vector V and the number of bits in the data representing each element of the difference diff.
[0126] like Figure 4 As shown in (a), the D elements included in the original vector V are each represented by a first data point with a first digit. On the other hand, as... Figure 4 As shown in (b), each of the D elements included in the difference diff corresponding to the original vector V, that is, each of the D differences obtained by subtracting the D elements representing the vector from the D elements of the original vector V, is represented by a second digit having a second digit less than the first digit. Therefore, the magnitude of the difference diff corresponding to the original vector V is smaller than the magnitude of the original vector V.
[0127] Figure 5 This is a diagram showing examples of floating-point forms representing the elements of the original vector V and the elements of the difference diff.
[0128] like Figure 5 As shown in (a), the first data representing the elements of the original vector V is, for example, a bit string used to represent a floating-point number (binary floating-point number) that includes a 1-bit sign indicating positive or negative, a third-bit exponent (e.g., 8 bits), and a fourth-bit mantissa (e.g., 23 bits). The exponent is used to normalize the value of the mantissa using a power of 2. The larger the number of bits in the exponent, the larger the value that can be represented.
[0129] On the other hand, such as Figure 5 As shown in (b), the second data representing the elements of the difference diff corresponding to the original vector V is a bit string used for a floating-point number (binary floating-point number), including a 1-bit sign indicating positive or negative, a 5th bit (e.g., (8-J) bits) exponent (less than the 3rd bit), and a 6th bit (e.g., (23-K) bits) mantissa (less than the 4th bit). J is an integer greater than or equal to 1, and K is an integer greater than or equal to 1. The absolute value of each element (value) of the difference diff is smaller than the absolute value of each element (value) of the original vector; therefore, when storing the difference diff, most of the 8 bits of the exponent are wasted. Therefore, it is possible to... Figure 5 The number of bits in the exponent is reduced as shown in (b). Furthermore, in small values, the value corresponding to the lower bits of the mantissa is an extremely small value including zero. Therefore, the number of bits in the mantissa can also be reduced while preserving the difference (diff).
[0130] Figure 6 This is a diagram showing examples of floating-point forms representing the elements of the original vector V and fixed-point forms representing the elements of the difference diff.
[0131] like Figure 6 As shown in (a), the first data representing each element of the original vector V has the following characteristics: Figure 5 The 32-bit floating-point form described in (a).
[0132] On the other hand, such as Figure 6 As shown in (b), the second data representing the elements of the difference diff corresponding to the original vector V is a bit string consisting of a 1-bit sign, a 7-bit integer part, and an 8-bit fractional part, excluding the exponent (binary fixed-point number). The sum of the 7th and 8th bits can be, for example, less than or equal to the number of bits (4th bit) in the mantissa of the original vector V. Figure 6 In (b), an example is shown where both the integer and fractional parts are 8 bits each. Since the absolute values of the elements (numerical values) of the difference diff are smaller than the absolute values of the elements (numerical values) of the original vector, the difference diff can be represented in a fixed-point form with fewer bits than a 32-bit floating-point form.
[0133] Figure 7 This is a diagram illustrating an example of cluster information 21 managed in the information processing system 1 according to the first embodiment.
[0134] Cluster information 21 includes multiple entries corresponding to multiple clusters. Each entry includes a cluster ID field and a representative vector field.
[0135] The Cluster ID field represents the identifier (cluster ID) assigned to the corresponding cluster. The Representative Vector field represents the representative vector of the corresponding cluster. The representative vector is represented using a full-precision vector. That is, each of the D features included in the representative vector is represented by the same first data (e.g., ...) as each of the D features included in each D-dimensional vector. Figure 5 (a) or Figure 6 It is represented by (a) in 32-bit floating-point form.
[0136] Figure 8 This is a diagram illustrating an example of vector position information 22 managed in the information processing system 1 according to the first embodiment.
[0137] The vector position information 22 includes multiple entries corresponding to multiple D-dimensional vectors. Each entry includes a vector ID field, a cluster ID field, and a difference (diff) field.
[0138] The Vector ID field represents the identifier (vector ID) assigned to the corresponding D-dimensional vector. The Cluster ID field represents the identifier (cluster ID) assigned to the cluster to which the corresponding D-dimensional vector belongs. The Difference field represents the difference (diff) between the corresponding D-dimensional vector and the representative vector of the cluster to which the corresponding D-dimensional vector belongs; that is, it represents the D differences obtained by subtracting the D elements of the representative vector of the cluster to which the corresponding D-dimensional vector belongs from the D elements of the corresponding D-dimensional vector. Each of the D elements of the difference (diff), i.e., each of the D differences, is represented by a second data point with fewer bits than the first data point (e.g., ...). Figure 5 The floating-point form shown in (b) or Figure 6 It is represented by the fixed-point number form shown in (b).
[0139] Next, the inter-cluster vector movement process will be explained. Figure 9 This is a diagram illustrating an example of inter-cluster vector movement processing performed in the information processing system 1 according to the first embodiment.
[0140] Inter-cluster vector movement is the process of moving a D-dimensional vector from an existing cluster to a new cluster when a new cluster is created. For example, a new cluster can be created when the number of vectors already belonging to the cluster closest to the new vector to be added has reached a limit, or when the new vector to be added is a distant vector.
[0141] For example, suppose in such Figure 9 The case where a new vector Va is added to the vector database 20 under the state of managing three clusters CL31 to CL33 as shown in (a).
[0142] The cluster CL32 is the one among the three clusters CL31 to CL33 that has the representative vector closest to the new vector Va. The representative vector of cluster CL32 is the representative vector RV32, and vectors V39 to V42 belong to cluster CL32. Given that the upper limit for the number of vectors that can belong to any cluster is 4, a new vector Va cannot be added to cluster CL32.
[0143] Therefore, as Figure 9 As shown in (b), the processor 11 creates a new cluster CL34 with a representative vector RV34. The representative vector RV34 of the new cluster CL34 may, for example, be a vector representing a position close to the new vector Va.
[0144] The processor 11 calculates the difference diff between the new vector Va and the representative vector RV34 (that is, the D differences obtained by subtracting the D elements included in the representative vector RV34 from the D elements included in the new vector Va respectively), and saves the identifier (cluster ID) of the new cluster CL34 and the calculated difference diff (D differences) as the position information of the new vector Va in the vector database 20.
[0145] Furthermore, the processor 11 determines from the vectors V39 to V49 of cluster CL32 that belong to the cluster CL34 and are closer to the new cluster CL34's representative vector RV3, the vectors (2D-dimensional vectors) whose distance to the new cluster CL34's representative vector RV3 is shorter than the distance to the cluster CL32's representative vector RV32. Figure 9 In (b), the vector V41 belonging to cluster CL32 is determined as the 2D dimension vector.
[0146] Then, processor 11 performs a move process to move vector V41 from cluster CL32 to the new cluster CL34.
[0147] When performing move processing, such as Figure 10 As shown, the processor 11 obtains the difference diff_A between vector V41 and the representative vector RV32 of the cluster CL32 to which vector V41 belongs from the vector position information 22 of the vector database 20 (that is, D differences obtained by subtracting the D elements included in the representative vector RV32 of cluster CL32 from the D elements included in vector V41). The difference diff_A is the vector difference between vector V41 and the representative vector RV32, that is, (V41-RV32).
[0148] Next, processor 11 calculates the difference diff_C between the representative vector RV32 of cluster CL32 and the representative vector RV34 of the new cluster CL34 (i.e., the D differences obtained by subtracting the D elements included in representative vector RV34 from the D elements included in representative vector RV32). The difference diff_C is the vector difference between representative vector RV32 and representative vector RV34, i.e., (RV32-RV34).
[0149] Then, the processor 11 calculates the difference diff_B between vector V41 and representative vector RV34 by adding the difference diff_C to the difference diff_A (that is, by subtracting the D elements included in the representative vector RV34 of the new cluster CL34 from the D elements included in vector V41). In other words, since diff_A + diff_C = (V41 - RV32) + (RV32 - RV34) = (V41 - RV34), the difference diff_B(V41 - RV34) can be calculated by adding the difference diff_C to the difference diff_A.
[0150] Next, the remote vector registration process will be explained. Figure 11 This is a diagram illustrating an example of remote vector addition processing performed in the information processing system 1 according to the first embodiment.
[0151] For example, such as Figure 11 As shown in (a), assume that a new vector Va is added to the vector database 20 while managing three clusters CL31 to CL33. The new vector Va is a long-range vector whose distance from all representative vectors of the multiple clusters (in this case, the representative vectors RV31 to RV33 of clusters CL31 to CL33) exceeds the maximum value of the difference that can be represented by the second data.
[0152] The cluster with the representative vector closest to the new vector Va is cluster CL32. However, the absolute values of the D differences obtained by subtracting the D elements of the representative vector RV32 of cluster CL32 from the D elements of the new vector Va exceed the maximum value of the difference that can be represented by the second data. Therefore, if the new vector Va is registered in cluster CL32, then as Figure 11 As shown by the dashed line in (a), the absolute values of the D differences obtained by subtracting the D elements of the representative vector RV32 of cluster CL32 from the D elements of the new vector Va will be significantly reduced compared with the actual values of the D differences. As a result, the errors of these D differences will increase.
[0153] Therefore, as Figure 11 As shown in (b), processor 11 creates a new cluster CL34 with a representative vector RV34 that is close to the new vector Va. The representative vector RV34 may be a vector representing the position in vector space VS that is the same as the position of the new vector Va.
[0154] Next, processor 11 calculates the D fourth differences obtained by subtracting the D elements of the representative vector RV32 of the new cluster CL34 from the D elements included in the new vector Va. Then, processor 11 stores the identifier of the new cluster CL and the D fourth differences as information representing the position of the new vector Va in the vector space VS in the vector database 20.
[0155] Next, refer to Figure 12 as well as Figure 13 The distance calculation process is explained. Figure 12 This is a diagram showing an example of a vector of an object whose distance is being calculated. Figure 13 This is a diagram illustrating an example of distance calculation processing that calculates the distance between the vector of the distance calculation object and the query vector.
[0156] exist Figure 12 as well as Figure 13 In this context, we assume that the distance dis1 between the query vector Q1 and the vector V36 within cluster CL33 is calculated.
[0157] like Figure 13 As shown, in the distance calculation process used to calculate distance dis1, the difference diff_D between vector V36 and the representative vector RV33 of cluster CL33 (i.e., the D fifth differences obtained by subtracting the D elements representing vector RV33 from the D elements of vector V36) is obtained from the vector database 20. In the case of V36 = (a1, a2, ..., a256) and RV33 = (x1, x2, ..., x256), the difference diff_D is expressed by the following formula.
[0158] diff_D=((a1-x1), (a2-x2),..., (a256-x256))
[0159] Among them, (a1-x1), (a2-x2), ..., (a256-x256) are D fifth differences.
[0160] Next, the difference diff_E between the query vector Q1 and the representative vector RV33 is calculated (i.e., the D sixth differences obtained by subtracting the D elements of the representative vector RV33 from the D elements of the query vector Q1 respectively). In the case of Q1 = (z1, z2, ..., z256), the difference diff_E is expressed by the following formula.
[0161] diff_E=((z1-x1), (z2-x2),..., (z256-x256))
[0162] Among them, (z1-x1), (z2-x2), ..., (z256-x256) are D sixth differences.
[0163] Then, calculate the sum of squares (squared distance) or the square root of the sum of squares (Euclidean distance) of the D fifth differences ((a1-x1), (a2-x2), ..., (a256-x256)) included in diff_D and the D sixth differences ((z1-x1), (z2-x2), ..., (z256-x256)) included in diff_E as the distance dis1.
[0164] The D seventh differences are (a1-x1)-(z1-x1), (a2-x2)-(z2-x2), ..., (a256-x256)-(z256-x256). The sum of the squares of the D seventh differences is expressed by the following formula.
[0165] ((a1-x1)-(z1-x1)) 2 +((a²-x²)-(z²-x²)) 2 +......+((a256-x256)-(z256-x256))2
[0166] Next, the steps for cluster creation will be explained. Figure 14 This is a flowchart illustrating an example of the steps of a cluster creation process performed in the information processing system 1 according to the first embodiment. The cluster creation process is the process of creating multiple clusters, each having a representative vector, which is a D-dimensional vector representing a representative point in the vector space VS.
[0167] Processor 11 determines multiple representative vectors for each representative point in the vector space VS (step S11). As a method for determining the multiple representative vectors, for example, k-means or other methods can be used. Then, processor 11 generates cluster information 21 based on the determined multiple representative vectors, and uses the cluster information 21 to manage multiple clusters, each with the determined representative points (step S12).
[0168] Through the above cluster creation process, the processor 11 can manage multiple clusters, each with representative points in the vector space VS and representative vectors of D dimensions.
[0169] Next, the steps of vector registration processing will be explained. Figure 15 This is a flowchart illustrating an example of the steps of a vector registration process performed in the information processing system 1 according to the first embodiment. The vector registration process is the process of registering each of a plurality of vectors (D-dimensional vectors) in the vector database 20.
[0170] Processor 11 determines the cluster among multiple clusters that has the representative vector closest to the vector of the registered object (the first D-dimensional vector) (step S21). Next, processor 11 calculates D differences obtained by subtracting the D elements of the representative vector of the determined cluster from the D elements of the first D-dimensional vector (step S22). Then, processor 11 stores the ID of the determined cluster and the calculated D differences as position information of the first D-dimensional vector in vector database 20 (step S23). In this case, processor 11 stores each of the D differences in vector database 20 in a data format with fewer bits than the data representing each of the D elements of the first D-dimensional vector.
[0171] Processor 11 determines whether all vectors of the registered object have been registered in vector database 20 (step S24). If all vectors of the registered object have been registered in vector database 20 ("Yes" in step S24), processor 11 ends the vector registration process. If there are unregistered vectors remaining in the vectors of the registered object ("No" in step S24), processor 11 performs the processing of steps S21 to S23 on the next vector of the registered object.
[0172] Through the above vector registration process, the processor 11 can save the difference (vector difference) between the first-dimensional vector and the representative vector of the cluster to which the first-dimensional vector belongs as position information representing the position of the first-dimensional vector in the vector database 20.
[0173] Next, the steps for cluster addition and vector movement processing will be explained. Figure 16 This is a flowchart illustrating an example of the cluster addition and vector movement processing steps performed in the information processing system 1 according to the first embodiment. The cluster addition and vector movement processing is a process of moving a vector that is close to the representative vector of the new cluster from the cluster to which the vector belongs when a new cluster is created.
[0174] For example, if the number of vectors belonging to the cluster where a new vector is to be added and which is closest to the new vector reaches the upper limit, or if the new vector is a remote vector, the processor 11 creates a new cluster with a representative vector representing a representative point in the vector space VS (step S31).
[0175] Processor 11 determines the cluster (cluster 1) with a representative vector that is close to the representative vector of the new cluster from the multiple clusters that have been created (step S32).
[0176] Processor 11 determines the vector of the object to be moved from the set of vectors (D-dimensional vectors) belonging to the first cluster (step S33). The vector of the object to be moved is the vector whose distance to the representative vector of the new cluster is shorter than its distance to the representative vector of the first cluster (second-D-dimensional vector). Then, processor 11 performs vector movement processing to move the second-D-dimensional vector from the first cluster to the new cluster (step S34) and ends the cluster addition and vector movement processing.
[0177] Figure 17 This is a flowchart illustrating an example of the steps of vector movement processing performed in the information processing system 1 according to the first embodiment. Figure 16 In step S34, the vector shifting process described below is performed.
[0178] Processor 11 obtains the difference (called diff_A) between the vector of the moving object (the 2D-dimensional vector) and the representative vector of the first cluster from the vector database 20 (step S41). diff_A is information stored in the vector database 20 as position information of the 2D-dimensional vector, including D first differences obtained by subtracting D elements of the representative vector of the first cluster from D elements of the 2D-dimensional vector, which are used as D elements of diff_A.
[0179] Processor 11 calculates the difference (called diff_C) between the representative vector of the first cluster and the representative vector of the new cluster (step S42). diff_C includes D second differences obtained by subtracting the D elements of the representative vector of the new cluster from the D elements of the representative vector of the first cluster, respectively, as the D elements of diff_C.
[0180] Processor 11 calculates the difference (called diff_B) between the 2D-dimensional vector and the representative vector of the new cluster by adding diff_A and diff_C for each corresponding feature (step S43). That is, in step S43, processor 11 calculates D third differences obtained by adding D second differences to D first differences respectively. The D third differences are the D features of diff_B.
[0181] Processor 11 saves the new cluster ID and diff_B (D third differences) as information representing the position of the 2D-dimensional vector within the vector space VS in vector database 20 (step S44), and then ends the vector movement process. Through step S44, the cluster ID corresponding to the 2D-dimensional vector is updated from the ID of the first cluster to the ID of the new cluster; additionally, the difference diff corresponding to the 2D-dimensional vector is updated from diff_A to diff_B.
[0182] Through the vector shifting process described above, processor 11 can update the difference diff corresponding to the 2D-dimensional vector from diff_A to diff_B without restoring the original D-dimensional vector to its original form. For example, if each of the D elements of each D-dimensional vector is represented in floating-point form and each of the D elements of each diff is represented in fixed-point form, computationally expensive floating-point operations are not required; fixed-point operations alone are sufficient to update the difference diff corresponding to the 2D-dimensional vector from diff_A to diff_B.
[0183] Next, the steps of remote vector registration processing will be explained. Figure 18 This is a flowchart illustrating an example of the steps of a remote vector registration process performed in the information processing system 1 according to the first embodiment. The remote vector registration process is a process used to reduce the error of the difference diff corresponding to the new vector when a new vector of an added object is a remote vector.
[0184] Based on the representative vectors of each cluster that have already been created and the new vector to be added, the processor 11 determines whether the new vector to be added is a remote vector (step S51).
[0185] If the new vector is determined to be a remote vector (No in step S51), the processor 11 ends the remote vector registration process.
[0186] If the new vector is determined to be a remote vector ("Yes" in step S51), the processor 11 creates a new cluster with a representative vector that is close to the new vector (step S52).
[0187] Processor 11 calculates the difference between the new vector and the representative vector of the new cluster, that is, the D fourth differences obtained by subtracting the D elements included in the representative vector of the new cluster from the D elements included in the new vector (step S53).
[0188] The processor 11 saves the ID of the new cluster and the calculated difference (D fourth differences) as information representing the position of the new vector in the vector space VS in the vector database 20 (step S54), and then ends the remote vector registration process.
[0189] Through the above remote vector registration process, the processor 11 can reduce the error contained in the difference stored as the location information of the remote vector.
[0190] Next, the steps for distance calculation and processing will be explained. Figure 19This is a flowchart illustrating an example of the steps of a distance calculation process performed in the information processing system 1 according to the first embodiment. The distance calculation process is the process of calculating the distance between each vector of the distance calculation object and the query vector. Here, it is assumed that the vector of the distance calculation object is a 3D-dimensional vector.
[0191] Processor 11 receives a D-dimensional query vector based on a query from external device 2 (step S61).
[0192] Processor 11 obtains D fifth differences from vector database 20 by subtracting D elements of the representative vector of the cluster (second cluster) to which the third-dimensional vector belongs from D elements of the vector (third-dimensional vector) of the distance calculation object (third-dimensional vector) (step S62).
[0193] Processor 11 calculates the D sixth differences obtained by subtracting the D elements of the representative vector of the second cluster from the D elements of the query vector (step S63).
[0194] Processor 11 calculates the sum of squares of the D seventh differences between the D fifth differences and the D sixth differences, or the square root of the sum of squares as the distance between the 3D dimension vector and the query vector (step S64), and ends the distance calculation process.
[0195] Through the above distance calculation process, the processor 11 can calculate the distance between the 3D dimension vector and the query vector without restoring the difference (D fifth differences) corresponding to the 3D dimension vector to the original D dimension vector.
[0196] As explained above, according to the first embodiment, when a vector (the first D-dimensional vector) is registered in the vector database 20, a cluster with a representative vector closest to the first D-dimensional vector is determined, and D differences are calculated by subtracting the D elements of the representative vector of the determined cluster from the D elements included in the first D-dimensional vector. Then, the identifier of the determined cluster and the calculated D differences are stored in the vector database 20 as position information (vector position information 22) representing the position of the first D-dimensional vector in the D-dimensional vector space. Since the absolute value of each of the D differences is much smaller than the absolute value of each element of the first D-dimensional vector, the number of bits representing each of the D differences can be reduced to fewer bits than the number of bits representing each element of the original vector (here, the first D-dimensional vector).
[0197] Therefore, compared with storing each original vector (full-precision vector) itself as vector position information 22 in the vector database 20, the amount of data (size of vector position information 22) of the vector set stored in the vector database 20 can be reduced.
[0198] Furthermore, the distance between a vector belonging to a certain cluster and the query vector can be correctly calculated using the D differences between the query vector and the representative vector of that cluster, and the D differences corresponding to that vector.
[0199] Therefore, without storing each D-dimensional vector itself as vector position information 22 in the vector database 20, it is possible to obtain the same level of search accuracy as when storing each D-dimensional vector itself as vector position information 22 in the vector database 20.
[0200] Therefore, it is possible to reduce the amount of data in the vector set stored in the vector database while suppressing the decline in search accuracy.
[0201] (Second Implementation)
[0202] Next, the following processing will be described as the second implementation method: For each of the multiple partial vector spaces divided into multiple vector spaces by the vector space VS, multiple clusters are managed. Based on dividing each D-dimensional vector into multiple partial vectors, for each partial vector, the difference between the partial vector and the representative vector of the cluster to which the partial vector belongs is saved as the position information of the partial vector.
[0203] Figure 20 This is a block diagram illustrating a configuration example of the information processing system 1 according to the second embodiment. In the information processing system 1 according to the second embodiment, only the functional configuration of the processor 11 differs from that of the first embodiment; the other configurations are essentially the same as those of the first embodiment.
[0204] Next, the functional configuration of the processor 11 of the information processing system 1 according to the second embodiment will be described.
[0205] The processor 11 functions as a cluster management unit 211 based on each part of the vector space, a cluster determination unit 212 based on each part of the vector, a difference calculation unit 213 based on each part of the vector, a vector position information storage unit 214, an inter-cluster part vector movement unit 215, a remote vector registration processing unit 216, and a distance calculation unit 217 by executing the database management program 121. Furthermore, these units can also be implemented using dedicated hardware (circuit) within the information processing system 1.
[0206] The cluster management unit 211 manages multiple clusters for each of the R partial vector spaces, each having a dimension of D / R, which are formed by dividing the vector space VS (D-dimensional vector space). R is an integer less than D and greater than 2. Each of the multiple clusters included in each of the R partial vector spaces has a representative vector having a dimension of D / R, representing a representative point within the corresponding partial vector space.
[0207] When a vector (the 1D-dimensional vector) is registered in the vector database 20, the 1D-dimensional vector is divided into R partial vectors, each with D / R dimensions, according to the cluster determination unit 212 for each of the R partial vectors. Then, for each of the R partial vectors, the cluster with the representative vector closest to that partial vector among the multiple clusters in the partial vector space corresponding to that partial vector is determined as the cluster to which that partial vector should belong.
[0208] The difference calculation unit 213 calculates, for each of the R partial vectors of the first D-dimensional vector, D / R differences obtained by subtracting the D / R elements included in the representative vector of the determined cluster from the D / R elements included in that partial vector. These D / R differences are the D / R elements included in the vector difference between the partial vector and the representative vector of the determined cluster. The vector difference between the partial vector and the representative vector of the determined cluster, that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector of the determined cluster from the D / R elements included in the partial vector, are also called differences (diff).
[0209] For each of the R partial vectors of the first D-dimensional vector, the vector position information storage unit 214 stores the identifier of the determined cluster and the calculated D / R differences (i.e., the difference diff between the partial vector and the representative vector of the determined cluster) as position information (vector position information 22) representing the position of the partial vector in the corresponding partial vector space in the vector database 20.
[0210] The inter-cluster partial vector movement unit 215 performs inter-cluster partial vector movement processing. This inter-cluster partial vector movement processing is the process of performing the inter-cluster vector movement processing of the first embodiment on each partial vector. For details of the inter-cluster partial vector movement processing, please refer to... Figures 28-30 To be described later.
[0211] The remote vector registration processing unit 216 performs processing to reduce errors during the registration of the partial vectors included in the remote vector. In the second embodiment, a remote vector is a vector whose distance from at least one of the R partial vector spaces to all representative vectors of the plurality of clusters included in the partial vector space exceeds the maximum value of the difference that can be represented by the second data. For details of the remote vector registration processing in the second embodiment, please refer to... Figure 31 as well as Figure 32 To be described later.
[0212] When a D-dimensional query vector is given, the distance calculation unit 217 calculates the distance (Euclidean distance) between the vector of the distance calculation object (the 3D-dimensional vector) and the query vector. For details of the distance calculation in the second embodiment, please refer to... Figure 33 as well as Figure 34To be described later.
[0213] Next, the multiple clusters managed according to each partial vector space will be explained. Figure 21 This is a diagram illustrating an example of multiple clusters managed according to each partial vector space in the information processing system 1 according to the second embodiment.
[0214] Here, we assume that each D-dimensional vector is divided into R partial vectors. Furthermore, we will use the case where the dimension D is 256, the number of partial vectors R is 8, and the dimension D / R of each partial vector is 32 as an example for illustration.
[0215] For example, a D-dimensional vector V1 (a1, a2, ..., a256) is divided into R partial vectors (8 partial vectors SV1, SV2, ..., SV8), each containing D / R elements (32 elements in this case). Other D-dimensional vectors are also divided into 8 partial vectors SV1, SV2, ..., SV8 in the same way as the D-dimensional vector V1.
[0216] The vector space (D-dimensional vector space) SV is divided into R partial vector spaces SVS, each with D / R dimensions (32 dimensions in this case) (here, there are 8 partial vector spaces SVS1, SVS2, ..., SVS8).
[0217] For each of the partial vector spaces SVS1 to SVS8, multiple clusters are managed. Figure 21 The example shown illustrates the case where five clusters CL0 to CL4 are managed according to each partial vector space SVS. In other words, in the second embodiment, each of the multiple clusters described in the first embodiment is divided into a cluster of partial vector space SVS1, a cluster of partial vector space SVS2, ..., and a cluster of partial vector space SVS8.
[0218] Cluster CL0 of partial vector space SVS1 has a representative vector RV0 representing a representative point within partial vector space SVS1. Cluster CL1 of partial vector space SVS1 has a representative vector RV1 representing another representative point within partial vector space SVS1. Cluster CL2 of partial vector space SVS1 has a representative vector RV2 representing yet another representative point within partial vector space SVS1. Cluster CL3 of partial vector space SVS1 has a representative vector RV3 representing yet another representative point within partial vector space SVS1. Cluster CL4 of partial vector space SVS1 has a representative vector RV4 representing yet another representative point within partial vector space SVS1. The dimension of each of the representative vectors RV0 to RV4 is D / R.
[0219] Cluster CL0 of partial vector space SVS2 has a representative vector RV10 representing a representative point within partial vector space SVS2. Cluster CL1 of partial vector space SVS2 has a representative vector RV11 representing another representative point within partial vector space SVS2. Cluster CL2 of partial vector space SVS2 has a representative vector RV12 representing yet another representative point within partial vector space SVS2. Cluster CL3 of partial vector space SVS2 has a representative vector RV13 representing yet another representative point within partial vector space SVS2. Cluster CL4 of partial vector space SVS2 has a representative vector RV14 representing yet another representative point within partial vector space SVS2. The dimension of each of the representative vectors RV10 to RV14 is D / R.
[0220] Cluster CL0 of partial vector space SVS8 has a representative vector RV70 representing a representative point within partial vector space SVS8. Cluster CL1 of partial vector space SVS8 has a representative vector RV71 representing another representative point within partial vector space SVS8. Cluster CL2 of partial vector space SVS8 has a representative vector RV72 representing yet another representative point within partial vector space SVS8. Cluster CL3 of partial vector space SVS8 has a representative vector RV73 representing yet another representative point within partial vector space SVS8. Cluster CL4 of partial vector space SVS8 has a representative vector RV74 representing yet another representative point within partial vector space SVS8. The dimension of each of the representative vectors RV70 to RV74 is D / R.
[0221] For example, the vector registration process of registering a D-dimensional vector V1 in the vector database 20 is described.
[0222] First, the D-dimensional vector V1 is divided into R partial vectors SV (here, 8 partial vectors SV1 to SV8). Then, for each of the R partial vectors SV, the cluster with the closest representative vector to that partial vector SV is determined from the multiple clusters (here, clusters CL0 to CL4) of the partial vector space SVS corresponding to that partial vector SV.
[0223] For example, in a partial vector space SVS1, the cluster CL1 of the partial vector space SVS1 is determined to be the cluster with the representative vector that is closest to the partial vector SV1 (a1, a2, ..., a32) of vector V1. In this case, the difference diff between the partial vector SV1 of vector V1 and the representative vector RV1 of the cluster CL1 of the partial vector space SVS1 is calculated, and the identifier of the cluster CL1 and the calculated difference diff are stored in the vector database 20 as the position information of the partial vector SV1 of vector V1 within the partial vector space SVS1.
[0224] Furthermore, in the partial vector space SVS2, the cluster CL3 of the partial vector space SVS2 is determined to be the cluster with the representative vector that is closest to the partial vector SV2 (a33, a34, ..., a64) of vector V1. In this case, the difference diff between the partial vector SV2 of vector V1 and the representative vector RV13 of the cluster CL3 of the partial vector space SVS2 is calculated, and the identifier of the cluster CL3 and the calculated difference diff are stored in the vector database 20 as the position information of the partial vector SV2 of vector V1 within the partial vector space SVS2.
[0225] Furthermore, in the partial vector space SVS8, the cluster CL0 of the partial vector space SVS8 is determined to be the cluster with the representative vector that is closest to the partial vector SV8 (a225, a226, ..., a256) of vector V1. In this case, the difference diff between the partial vector SV8 of vector V1 and the representative vector RV70 of the cluster CL0 of the partial vector space SVS8 is calculated, and the identifier of the cluster CL0 and the calculated difference diff are stored in the vector database 20 as the position information of the partial vector SV8 of vector V1 within the partial vector space SVS8.
[0226] Figure 22 This is a graph showing the difference between the partial vector SV and the representative vector RV of the cluster CL of the partial vector space SVS.
[0227] exist Figure 22 The example shows the difference between a partial vector SV1 of vector V1 and a representative vector RV1 of the cluster CL1 of partial vector space SVS1.
[0228] The difference diff between the partial vector SV1 of vector V1 and the representative vector RV1 of the cluster CL1 of the partial vector space SVS1 is represented by D / R differences (here, (a1-x1), (a2-x2), ..., (a32-x32)) obtained by subtracting the D / R elements (here, x1, x2, ..., x32) of the representative vector RV1 of the cluster CL1 of the partial vector space SVS1 from the D / R elements (here, a1, a2, ..., a32) of the partial vector SV1 of vector V1 respectively.
[0229] Next, refer to Figures 23-25 This describes the data format used to represent the differences (diff) corresponding to the partial vectors (SV).
[0230] Figure 23 This is a diagram showing an example of the number of bits in the data representing each element of a partial vector SV and the number of bits in the data representing each element of a difference diff.
[0231] like Figure 23 As shown in (a), each of the D / R elements included in the partial vector SV is represented by a first data point with a first digit. On the other hand, as Figure 23 As shown in (b), each of the D / R elements included in the difference diff corresponding to the partial vector SV, that is, each of the D / R differences obtained by subtracting the D / R elements representing the vector from the D / R elements of the partial vector SV, is represented by a second data point with a second data point less than the first data point. Therefore, the size of the difference diff corresponding to the partial vector SV is smaller than the size of the partial vector SV.
[0232] Figure 24 This is a diagram showing examples of floating-point forms representing the elements of a partial vector SV and floating-point forms representing the elements of a difference diff.
[0233] like Figure 24 As shown in (a), the first data representing each element of a partial vector SV is, for example, a bit string for a floating-point number (binary floating-point number) that includes a sign of 1 bit representing positive or negative, an exponent with a third bit (e.g., 8 bits), and a mantissa with a fourth bit (e.g., 23 bits).
[0234] On the other hand, such as Figure 24 As shown in (b), the second data representing the elements of the difference diff corresponding to the partial vector SV is a bit string used for a floating-point number (binary floating-point number), including a 1-bit sign indicating positive or negative, a 5th bit (e.g., (8-J) bits) exponent (less than the 3rd bit), and a 6th bit (e.g., (8-K) bits) mantissa (less than the 4th bit). J is an integer greater than or equal to 1, and K is an integer greater than or equal to 1. The absolute value of each element (value) of the difference diff is less than the absolute value of each element (value) of the partial vector SV; therefore, when storing the difference diff, most of the 8 bits of the exponent are wasted. Therefore, as Figure 24 As shown in (b), the number of bits in the exponent can be reduced. Furthermore, in small values, the value corresponding to the lower bits of the mantissa is an extremely small value including zero. Therefore, even while preserving the difference (diff), the number of bits in the mantissa can also be reduced.
[0235] Figure 25 This is a diagram showing examples of floating-point form representing the elements of a partial vector SV and fixed-point form representing the elements of a difference diff.
[0236] like Figure 25 As shown in (a), the first data representing each element of the partial vector SV has in Figure 24 The 32-bit floating-point form described in (a).
[0237] On the other hand, such as Figure 25 As shown in (b), the second data representing the elements of the difference diff corresponding to the partial vector SV is a bit string consisting of a 1-bit sign, a 7-bit integer part, and an 8-bit fractional part, excluding the exponent. The sum of the 7th and 8th bits can, for example, be less than or equal to the number of bits (4th bit) in the mantissa of the partial vector SV. Figure 25 In (b), an example is shown where both the integer and fractional parts are 8 bits each. Since the absolute values of the elements (numerical values) of the difference diff are smaller than the absolute values of the elements (numerical values) of the partial vector SV, the difference diff can be represented in a fixed-point form with fewer bits than the 32-bit floating-point form.
[0238] Figure 26 This is a diagram illustrating an example of cluster information 21 managed in the information processing system 1 according to the second embodiment.
[0239] Cluster information 21 includes multiple entries corresponding to multiple clusters. Each entry includes a cluster ID field, a representative vector field for a portion of vector space SVS1, a representative vector field for a portion of vector space SVS2, ..., and a representative vector field for a portion of vector space SVS8.
[0240] The cluster ID field represents the identifier (cluster ID) assigned to the corresponding cluster.
[0241] The representative vector field of the partial vector space SVS1 represents the representative vector of the corresponding cluster within the partial vector space SVS1. Each of the D / R features of the representative vector is represented by the first data in the same way as each of the D / R features of each partial vector SV.
[0242] The representative vector field of the partial vector space SVS2 represents the representative vector of the corresponding cluster within the partial vector space SVS2. Each of the D / R features of the representative vector is represented by its first data element.
[0243] The representative vector field of the partial vector space SVS8 represents the representative vector of the corresponding cluster within the partial vector space SVS8. Each of the D / R features of the representative vector is represented by its first data element.
[0244] Figure 27 This is a diagram illustrating an example of vector position information 22 managed in the information processing system 1 according to the second embodiment.
[0245] The vector position information 22 includes multiple entries corresponding to multiple D-dimensional vectors. Each entry includes a vector ID field, a cluster ID field and a difference field corresponding to a portion of the vector space SVS1, a cluster ID field and a difference field corresponding to a portion of the vector space SVS2, ... and a cluster ID field and a difference field corresponding to a portion of the vector space SVS8.
[0246] The vector ID field represents the identifier (vector ID) assigned to the corresponding D-dimensional vector.
[0247] The cluster ID field corresponding to the partial vector space SVS1 represents the identifier (cluster ID) of the cluster within the partial vector space SVS1 to which the partial vector SV1 of the corresponding D-dimensional vector belongs. The difference diff field corresponding to the partial vector space SVS1 represents the difference diff between the partial vector SV1 of the corresponding D-dimensional vector and the representative vector of the cluster to which the partial vector SV1 belongs.
[0248] The cluster ID field corresponding to the partial vector space SVS2 represents the identifier (cluster ID) of the cluster within the partial vector space SVS2 to which the partial vector SV2 of the corresponding D-dimensional vector belongs. The difference diff field corresponding to the partial vector space SVS2 represents the difference diff between the partial vector SV2 of the corresponding D-dimensional vector and the representative vector of the cluster to which the partial vector SV2 belongs.
[0249] The cluster ID field corresponding to the partial vector space SVS8 represents the identifier (cluster ID) of the cluster within the partial vector space SVS8 to which the partial vector SV8 of the corresponding D-dimensional vector belongs. The difference diff field corresponding to the partial vector space SVS8 represents the difference diff between the partial vector SV8 of the corresponding D-dimensional vector and the representative vector of the cluster to which the partial vector SV8 belongs.
[0250] Next, the processing of partial vector shifts between clusters will be explained. Figure 28 This is a diagram showing an example of a vector added to the information processing system 1 according to the second embodiment.
[0251] Inter-cluster partial vector movement is the process of moving a partial vector from an existing cluster to a new cluster when a new cluster is created in each partial vector space (SVS). The creation of a new cluster can be performed, for example, if the number of partial vectors already belonging to the cluster closest to the partial vector included in the new vector to be added has reached the upper limit, or if the new vector to be added is a remote vector.
[0252] For example, such as Figure 28As shown, assume that a new vector Va is added to the vector database 20 while each of the partial vector spaces SVS1 to SVS8 manages 3 clusters CL0 to CL2.
[0253] The cluster CL2 of the partial vector space SVS1 that has the representative vector that is closest to the partial vector SV1 (s1, s2, ..., s32) of the new vector Va is, for example, the cluster of the partial vector space SVS1. The representative vector of the cluster CL2 of the partial vector space SVS1 is the representative vector RV2. The three vectors V2, V8, and V9, or more specifically, the three partial vectors SV1 corresponding to the three vectors V2, V8, and V9, belong to the cluster CL2 of the partial vector space SVS1. Given that the upper limit of the number of partial vectors that may belong to each cluster of the partial vector space SVS1 is 3, it is not possible to add a new vector Va (more specifically, the partial vector SV1 of the new vector Va) to the cluster CL2 of the partial vector space SVS1.
[0254] The cluster CL2 of the partial vector space SVS2 that has the representative vector closest to the partial vector SV2 (s33, s34, ..., s64) of the new vector Va is, for example, the cluster CL2 of the partial vector space SVS2. The representative vector of the cluster CL2 of the partial vector space SVS2 is the representative vector RV12. The three vectors V1, V3, and V4, or more specifically, the three partial vectors SV2 corresponding to the three vectors V1, V3, and V4, belong to the cluster CL2 of the partial vector space SVS2. Given that the upper limit of the number of partial vectors that may belong to each cluster of the partial vector space SVS2 is 3, it is not possible to add a new vector Va (more specifically, the partial vector SV2 of the new vector Va) to the cluster CL2 of the partial vector space SVS2.
[0255] The cluster CL0-CL2 of the partial vector space SVS8 that has the representative vector closest to the partial vector SV8 (s225, s226, ..., s256) of the new vector Va is, for example, cluster CL1 of the partial vector space SVS8. The representative vector of cluster CL1 of the partial vector space SVS8 is the representative vector RV71. The three vectors V2, V5, and V9, or more specifically, the three partial vectors SV8 corresponding to the three vectors V2, V5, and V9, belong to cluster CL1 of the partial vector space SVS8. Given that the upper limit for the number of partial vectors that may belong to each cluster of the partial vector space SVS8 is 3, it is not possible to add a new vector Va (more specifically, a partial vector SV8 of the new vector Va) to cluster CL1 of the partial vector space SVS8.
[0256] Furthermore, this example illustrates the case where the number of partial vectors belonging to the cluster closest to the partial vector SV of the new vector Va has reached its upper limit in all partial vector spaces SVS1 to SVS8. However, the process of creating new clusters in partial vector spaces SVS1 to SVS8 can also be performed in the following case: the number of partial vectors belonging to the cluster closest to the partial vector SV of the new vector Va has reached its upper limit in at least one partial vector space SVS.
[0257] Figure 29 This is a diagram illustrating an example of inter-cluster partial vector movement processing performed in the information processing system 1 according to the second embodiment.
[0258] like Figure 29 As shown, processor 11 creates a new cluster (in this case, cluster CL3) for each partial vector space SVS.
[0259] A new cluster CL3 in partial vector space SVS1 has, for example, a representative vector RV3 representing the position of partial vector SV1 that is close to the new vector Va. A new cluster CL3 in partial vector space SVS2 has, for example, a representative vector RV13 representing the position of partial vector SV2 that is close to the new vector Va. A new cluster CL3 in partial vector space SVS8 has, for example, a representative vector RV73 representing the position of partial vector SV8 that is close to the new vector Va.
[0260] First, processor 11 performs vector addition processing related to a portion of the vector space SVS1.
[0261] In the vector addition process related to the partial vector space SVS1, the processor 11 calculates the difference diff between the partial vector SV1 of the new vector Va and the representative vector RV3 of the new cluster CL3 of the partial vector space SVS1 (that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector RV3 from the D / R elements included in the partial vector SV1 of the new vector Va respectively). The identifier (cluster ID) of the new cluster CL3 and the calculated difference diff (D / R differences) are stored in the vector database 20 as the position information of the partial vector SV1 of the new vector Va.
[0262] Next, processor 11 performs inter-cluster partial vector movement processing related to the partial vector space SVS1.
[0263] In the inter-cluster partial vector movement processing related to the partial vector space SVS1, the processor 11 determines, from the partial vectors belonging to the cluster (here, cluster CL2 of the partial vector space SVS1) of the cluster whose representative vector RV3 of the new cluster CL3 of the partial vector space SVS1 is closer than the distance to the representative vector RV2 of the cluster CL2 of the partial vector space SVS1 (the first partial vector). Vectors V2, V8, and V9 (more specifically, the three partial vectors SV1 corresponding to vectors V2, V8, and V9 respectively) belong to cluster CL2 of the partial vector space SVS1. Here, the partial vector SV1 of vector V2 is determined as the first partial vector.
[0264] Processor 11 performs a move process that moves a portion of vector V2, SV1, from cluster CL2 of partial vector space SVS1 to a new cluster CL3 of partial vector space SVS1.
[0265] In the motion processing, the processor 11 calculates the difference between the partial vector SV1 of vector V2 and the representative vector RV3 of the new cluster CL3 of the partial vector space SVS1, and saves the identifier of the new cluster CL3 and the calculated difference as the position information of the partial vector SV1 of vector V2 in the vector database 20.
[0266] When calculating the difference between a partial vector SV1 of vector V2 and the representative vector RV3 of the new cluster CL3 of partial vector space SVS1, as follows: Figure 30 As shown, the processor 11 obtains the difference diff_f between vector V2 (more specifically, a partial vector SV1 of vector V2) and the representative vector RV2 of cluster CL2 of partial vector space SVS1 from the vector position information 22 of vector database 20. (That is, it is obtained by subtracting the D / R elements included in the representative vector RV2 of cluster CL2 of partial vector space SVS1 from the D / R elements included in the partial vector SV1 of vector V2). The difference diff_f is the vector difference between the partial vector SV1 and the representative vector RV2 of vector V2.
[0267] Next, processor 11 calculates the difference diff_h between the representative vector RV2 of cluster CL2 in partial vector space SVS1 and the representative vector RV3 of the new cluster CL3 in partial vector space SVS1 (that is, the D / R differences obtained by subtracting the D / R elements included in representative vector RV3 from the D / R elements included in representative vector RV2). The difference diff_h is the vector difference between representative vector RV2 and representative vector RV3.
[0268] Then, the processor 11 calculates the difference diff_g between the partial vector SV1 and the representative vector RV3 of vector V2 by adding the difference diff_h and the difference diff_f (that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector RV3 of the new cluster CL3 of the partial vector space SVS1 from the D / R elements included in the partial vector SV1 of vector V2).
[0269] return Figure 29 This section explains the vector addition process related to a portion of the vector space SVS2.
[0270] In the vector addition process related to the partial vector space SVS2, the processor 11 calculates the difference diff between the partial vector SV2 of the new vector Va and the representative vector RV13 of the new cluster CL3 of the partial vector space SVS2 (that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector RV13 from the D / R elements included in the partial vector SV2 of the new vector Va respectively). The identifier (cluster ID) of the new cluster CL3 and the calculated difference diff (D / R differences) are stored in the vector database 20 as the position information of the partial vector SV2 of the new vector Va.
[0271] Next, the inter-cluster partial vector movement processing related to the partial vector space SVS2 will be explained.
[0272] In the inter-cluster partial vector movement processing related to the partial vector space SVS2, the processor 11 determines, from the partial vectors belonging to the cluster (here, cluster CL2 of the partial vector space SVS2) whose representative vector RV13 of the new cluster CL3 of the partial vector space SVS2 is closer to it, the partial vectors whose distance to RV13 of the new cluster CL3 of the partial vector space SVS2 is shorter than their distance to RV12 of the representative vector RV13 of the cluster CL2 of the partial vector space SVS2 (the first partial vector). Vectors V1, V3, and V4 (more specifically, the three partial vectors SV2 corresponding to vectors V1, V3, and V4 respectively) belong to cluster CL2 of the partial vector space SVS2. Here, the partial vector SV2 of vector V3 is determined as the first partial vector.
[0273] Processor 11 performs a move process that moves a portion of vector V3, SV2, from cluster CL2 of partial vector space SVS2 to a new cluster CL3 of partial vector space SVS2.
[0274] In the motion processing, the processor 11 calculates the difference between the partial vector SV2 of vector V3 and the representative vector RV13 of the new cluster CL3 of the partial vector space SVS2, and saves the identifier of the new cluster CL3 and the calculated difference as the position information of the partial vector SV2 of vector V3 in the vector database 20.
[0275] The calculation of the difference between the partial vector SV2 of vector V3 and the representative vector RV13 of the new cluster CL3 of partial vector space SVS2 is performed by the same steps as the calculation of the difference between the partial vector SV1 of vector V2 in partial vector space SVS1 and the representative vector RV3 of the new cluster CL3 of partial vector space SVS1.
[0276] Next, the vector addition process related to the SVS8 vector space will be explained.
[0277] In the vector addition process related to the partial vector space SVS8, the processor 11 calculates the difference diff between the partial vector SV8 of the new vector Va and the representative vector RV73 of the new cluster CL3 of the partial vector space SVS8 (that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector RV73 from the D / R elements included in the partial vector SV8 of the new vector Va respectively). The identifier (cluster ID) of the new cluster CL3 and the calculated difference diff (D / R differences) are stored in the vector database 20 as the position information of the partial vector SV8 of the new vector Va.
[0278] Next, the inter-cluster partial vector movement processing related to the partial vector space SVS8 will be explained.
[0279] In the inter-cluster partial vector movement processing related to the partial vector space SVS8, the processor 11 determines, from the partial vectors belonging to the cluster (here, cluster CL1 of the partial vector space SVS8) whose representative vector RV73 of the new cluster CL3 of the partial vector space SVS8 is closer to the partial vector space SVS8, the partial vectors whose distance to the representative vector RV73 of the new cluster CL3 of the partial vector space SVS8 is shorter than the distance to the representative vector RV71 of the cluster CL1 of the partial vector space SVS8 (the first partial vector). Vectors V2, V5, and V9 (more specifically, the three partial vectors SV8 corresponding to vectors V2, V5, and V9 respectively) belong to cluster CL1 of the partial vector space SVS8. Here, the partial vector SV8 of vector V5 is determined as the first partial vector.
[0280] Processor 11 performs a move process that moves a portion of vector V5, SV8, from cluster CL1 of partial vector space SVS8 to a new cluster CL3 of partial vector space SVS8.
[0281] In the motion processing, the processor 11 calculates the difference between the partial vector SV8 of vector V5 and the representative vector RV73 of the new cluster CL3 of the partial vector space SVS8, and saves the identifier of the new cluster CL3 and the calculated difference as the position information of the partial vector SV8 of vector V5 in the vector database 20.
[0282] The calculation of the difference between the partial vector SV8 of vector V5 and the representative vector RV73 of the new cluster CL3 of partial vector space SVS8 is performed by the same steps as the calculation of the difference between the partial vector SV1 of vector V2 in partial vector space SVS1 and the representative vector RV3 of the new cluster CL3 of partial vector space SVS1.
[0283] Next, the remote vector registration process will be explained. Figure 31 This is a diagram illustrating an example of a remote vector added to the information processing system 1 according to the second embodiment. Figure 32 This is a diagram illustrating an example of remote vector registration processing performed in the information processing system 1 according to the second embodiment.
[0284] For example, such as Figure 31 As shown, assume that a new vector Vx(t1, t2, ..., t256) is added to the vector database 20 while each partial vector space SVS manages three clusters CL0 to CL2. The new vector Vx is a long-range vector whose distance from all representative vectors of clusters CL0 to CL2 within at least one of the partial vector spaces SVS1 to SVS8 exceeds the maximum value of the difference that can be represented by the second data.
[0285] For example, in the partial vector space SVS1, the cluster with the representative vector that is closest to the partial vector SV1 of the new vector Vx is cluster CL2. However, the absolute values of the D / R differences obtained by subtracting the D / R elements of the representative vector RV2 of cluster CL2 from the D / R elements of the partial vector SV1 of the new vector Vx exceed the maximum value of the difference that can be represented by the second data. Therefore, if the partial vector SV1 of the new vector Vx is registered in cluster CL2 of the partial vector space SVS1, the errors of these D / R differences will increase.
[0286] Therefore, as Figure 32 As shown, for each of the partial vectors SV1 to SV8 included in the new vector Vx, the processor 11 creates a new cluster in the corresponding partial vector space SVS with a representative vector close to that partial vector SV.
[0287] In the partial vector space SVS1, the processor 11 creates a new cluster CL3 with a representative vector RV3 that is close to the partial vector SV1 of the new vector Vx. The representative vector RV3 can also be a vector (partial vector) that represents the same position as the partial vector SV1 of the new vector Vx in the partial vector space SVS1.
[0288] In the partial vector space SVS2, the processor 11 creates a new cluster CL3 with a representative vector RV13 that is close to the partial vector SV2 of the new vector Vx. The representative vector RV13 can also be a vector (partial vector) that represents the same position as the partial vector SV2 of the new vector Vx in the partial vector space SVS2.
[0289] In the partial vector space SVS8, the processor 11 creates a new cluster CL3 with a representative vector RV73 that is close to the partial vector SV8 of the new vector Vx. The representative vector RV73 can also be a vector (partial vector) that represents the position of the partial vector SV8 of the new vector Vx within the partial vector space SVS8.
[0290] Next, the processor 11 performs vector addition processing related to the partial vector space SVS1, vector addition processing related to the partial vector space SVS2, ..., and vector addition processing related to the partial vector space SVS8.
[0291] In the vector addition process related to the partial vector space SVS1, the processor 11 calculates the difference diff between the partial vector SV1 of the new vector Vx and the representative vector RV3 of the new cluster CL3 of the partial vector space SVS1 (that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector RV3 from the D / R elements included in the partial vector SV1 of the new vector Vx respectively). The identifier (cluster ID) of the new cluster CL3 and the calculated difference diff (D / R differences) are stored in the vector database 20 as the position information of the partial vector SV1 of the new vector Vx.
[0292] In the vector addition process related to the partial vector space SVS2, the processor 11 calculates the difference diff between the partial vector SV2 of the new vector Vx and the representative vector RV13 of the new cluster CL3 of the partial vector space SVS2 (that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector RV13 from the D / R elements included in the partial vector SV2 of the new vector Vx respectively). The identifier (cluster ID) of the new cluster CL3 and the calculated difference diff (D / R differences) are stored in the vector database 20 as the position information of the partial vector SV2 of the new vector Vx.
[0293] In the vector addition process related to the partial vector space SVS8, the processor 11 calculates the difference diff between the partial vector SV8 of the new vector Vx and the representative vector RV73 of the new cluster CL3 of the partial vector space SVS8 (that is, the D / R differences obtained by subtracting the D / R elements included in the representative vector RV73 from the D / R elements included in the partial vector SV8 of the new vector Vx respectively). The identifier (cluster ID) of the new cluster CL3 and the calculated difference diff (D / R differences) are stored in the vector database 20 as the position information of the partial vector SV8 of the new vector Vx.
[0294] Next, refer to Figure 33 as well as Figure 34 The distance calculation process is explained. Figure 33 This is a diagram showing an example of a vector of an object whose distance is being calculated. Figure 34 This is a diagram illustrating an example of distance calculation processing, where the distances to the constituent vectors of the object being calculated are compared to the query vector. Figure 33 as well as Figure 34 In this case, we assume the calculation of the distance between query vector Q1 and vector V1.
[0295] like Figure 33 As shown, some vectors of vector V1, SV1, belong to cluster CL1 of partial vector space SVS1, some vectors of vector V1, SV2, belong to cluster CL2 of partial vector space SVS2, ..., some vectors of vector V1, SV8, belong to cluster CL1 of partial vector space SVS8.
[0296] The processor 11 calculates the distance dis1 between the partial vector SV1 of query vector Q1 and the partial vector SV1 of vector V1, the distance dis2 between the partial vector SV2 of query vector Q1 and the partial vector SV2 of vector V1, ..., and the distance dis8 between the partial vector SV8 of query vector Q1 and the partial vector SV8 of vector V1.
[0297] like Figure 34As shown in (a), in the distance calculation process related to the distance dis1 within the partial vector space SVS1, the processor 11 obtains the difference diff_i between the partial vector SV1 of vector V1 and the representative vector RV1 of the cluster CL1 of the partial vector space SVS1 from the vector database 20 (that is, the D / R fifth difference obtained by subtracting the D / R elements of the representative vector RV1 from the D / R elements of the partial vector SV1 of vector V1). For example, in the case where the partial vector SV1 of vector V1 = (a1, a2, ..., a32) and RV1 = (y1, y2, ..., y32), the difference diff_i is expressed by the following formula.
[0298] diff_i=((a1-y1), (a2-y2),..., (a32-y32))
[0299] Among them, (a1-y1), (a2-y2), ..., (a32-y32) are the fifth difference of D / R.
[0300] Next, the difference diff_j between the partial vector SV1 and the representative vector RV1 of the query vector Q1 is calculated (that is, the D / R sixth difference obtained by subtracting the D / R elements of the representative vector RV1 from the D / R elements of the partial vector SV1 of the query vector Q1). When the partial vector SV1 of the query vector Q1 = (q1, q2, ..., q32), the difference diff_j is expressed by the following formula.
[0301] diff_j=((q1-y1), (q2-y2),..., (q32-y32))
[0302] Among them, (q1-y1), (q2-y2), ..., (q32-y32) are the 6th difference in D / R.
[0303] Then, the sum of squares (squared distance) of the D / R seventh differences between the D / R fifth differences ((a1-y1), (a2-y2), ..., (a32-y32)) included in diff_i and the D / R sixth differences ((q1-y1), (q2-y2), ..., (q32-y32)) included in diff_j is calculated as the distance dis1.
[0304] The D / R seventh differences are (a1-y1)-(q1-y1), (a2-y2)-(q2-y2), ..., (a32-y32)-(q32-y32). The sum of squares of the D / R seventh differences is expressed by the following formula.
[0305] ((a1-y1)-(q1-y1)) 2 +((a2-y2)-(q2-y2)) 2 +......+((a32-y32)-(q32-y32)) 2
[0306] like Figure 34 As shown in (b), in the distance calculation process related to the distance dis2 within the partial vector space SVS2, the processor 11 obtains the difference diff_m between the partial vector SV2 of vector V1 and the representative vector RV12 of the cluster CL2 of the partial vector space SVS2 from the vector database 20 (that is, the D / R fifth difference obtained by subtracting the D / R elements of the representative vector RV12 from the D / R elements of the partial vector SV2 of vector V1). For example, in the case where the partial vector SV2 of vector V1 = (a33, a34, ..., a64) and RV12 = (y33, y34, ..., y64), the difference diff_m is expressed by the following formula.
[0307] diff_m=((a33-y33), (a34-y34),..., (a64-y64))
[0308] Among them, (a33-y33), (a34-y34), ..., (a64-y64) are the fifth difference in D / R.
[0309] Next, the difference diff_n between the partial vector SV2 of query vector Q1 and the representative vector RV12 is calculated (that is, the D / R sixth difference obtained by subtracting the D / R elements of the representative vector RV12 from the D / R elements of the partial vector SV2 of query vector Q1). For example, in the case where the partial vector SV2 of query vector Q1 = (q33, q34, ..., q64), the difference diff_n is expressed by the following formula.
[0310] diff_n=((q33-y33), (q34-y34),..., (q64-y64))
[0311] Among them, (q33-y33), (q34-y34), ..., (q64-y64) are the 6th difference in D / R.
[0312] Then, the sum of squares (squared distance) of the D / R seventh differences between the D / R fifth differences ((a33-y33), (a34-y34), ..., (a64-y64)) included in diff_m and the D / R sixth differences ((q33-y33), (q34-y34), ..., (q64-y64)) included in diff_j is calculated as the distance dis2.
[0313] The D / R seventh differences are (a33-y33)-(q33-y33), (a34-y34)-(q34-y34), ..., (a64-y64)-(q64-y64). The sum of squares of the D / R seventh differences is expressed by the following formula.
[0314] ((a33-y33)-(q33-y33)) 2 +((a34-y34)-(q34-y34)) 2 +......+((a64-y64)-(q64-y64))2
[0315] like Figure 34 As shown in (c), in the distance calculation process related to the distance dis8 within the partial vector space SVS8, the processor 11 obtains the difference diff_s between the partial vector SV8 of vector V1 and the representative vector RV70 of the cluster CL0 of the partial vector space SVS8 from the vector database 20 (that is, the D / R fifth difference obtained by subtracting the D / R elements of the representative vector RV70 from the D / R elements of the partial vector SV8 of vector V1). For example, in the case where the partial vector SV8 of vector V1 = (a225, a226, ..., a256) and RV70 = (y225, y226, ..., y256), the difference diff_s is expressed by the following formula.
[0316] diff_s=((a225-y225), (a226-y226),..., (a256-y256))
[0317] Among them, (a225-y225), (a226-y226), ..., (a256-y256) are the fifth difference in D / R.
[0318] Next, the difference diff_t between the partial vector SV8 of query vector Q1 and the representative vector RV70 is calculated (that is, the D / R sixth difference obtained by subtracting the D / R elements of the representative vector RV70 from the D / R elements of the partial vector SV8 of query vector Q1). For example, in the case where the partial vector SV8 of query vector Q1 = (q225, q226, ..., q256), the difference diff_t is expressed by the following formula.
[0319] diff_t=((q225-y225), (q226-y226),..., (q256-y256))
[0320] Among them, (q225-y225), (q226-y226), ..., (q256-y256) are the 6th difference in D / R.
[0321] Then, the sum of squares (squared distance) of the D / R seventh differences between the D / R fifth differences ((a225-y225), (a226-y226), ..., (a256-y256)) included in diff_s and the D / R sixth differences ((q225-y225), (q226-y226), ..., (q256-y256)) included in diff_t is calculated as the distance dis8.
[0322] The D / R seventh differences are (a225-y225)-(q225-y225), (a226-y226)-(q226-y226), ..., (a256-y256)-(q256-y256). The sum of squares of the D / R seventh differences is expressed by the following formula.
[0323] ((a225-y225)-(q225-y225)) 2 +((a226-y226)-(q226-y226)) 2 +......+((a256-y256)-(q256-y256)) 2
[0324] Then, by calculating the sum of dis1 to dis8, the distance (squared distance) between query vector Q1 and vector V1 can be obtained.
[0325] Next, the steps for cluster creation will be explained. Figure 35This is a flowchart illustrating an example of the steps of a cluster creation process performed in the information processing system 1 according to the second embodiment. The cluster creation process is the process of creating multiple clusters, each having a representative vector representing a representative point within that partial vector space SVS and having D / R dimensions, for each partial vector space SVS.
[0326] Processor 11 determines multiple representative vectors representing representative points within each partial vector space (SVS) (step S111). Methods for determining these representative vectors include, for example, the k-means method or various other methods. Then, processor 11 generates cluster information 21 based on the determined representative vectors and uses the cluster information 21 to manage multiple clusters within each partial vector space (SVS) (step S112).
[0327] Through the above cluster creation process, the processor 11 can manage multiple clusters, each having a representative vector representing a representative point within that partial vector space SVS and having D / R dimensions, according to each partial vector space SVS.
[0328] Next, the steps of vector registration processing will be explained. Figure 36 This is a flowchart illustrating an example of the steps of a vector registration process performed in the information processing system 1 according to the second embodiment. The vector registration process is the process of registering each of a plurality of vectors (D-dimensional vectors) in the vector database 20.
[0329] Processor 11 divides the vector of the registered object (the 1D-dimensional vector) into R partial vectors (step S121). For each partial vector of the 1D-dimensional vector, processor 11 determines the cluster with the representative vector closest to that partial vector (step S122). Next, for each partial vector of the 1D-dimensional vector, processor 11 calculates D / R differences obtained by subtracting D / R elements of the representative vector of the determined cluster from each of the D / R elements of that partial vector (step S123). Then, for each partial vector of the 1D-dimensional vector, processor 11 stores the ID of the determined cluster and the calculated D / R differences as position information of that partial vector in vector database 20 (step S124). In this case, processor 11 stores each of the D / R differences in vector database 20 in a data format with fewer bits than the number of bits representing each of the D / R elements of each partial vector of the 1D-dimensional vector.
[0330] Processor 11 determines whether all vectors of the registered object have been registered in vector database 20 (step S125). If all vectors of the registered object have been registered in vector database 20 ("Yes" in step S125), processor 11 ends the vector registration process. If there are unregistered vectors remaining in the vectors of the registered object ("No" in step S125), processor 11 performs the processing of steps S121 to S124 on the next vector of the registered object.
[0331] Through the above vector registration process, the processor 11 saves the difference (vector difference) between each part vector of the 1D-dimensional vector and the representative vector of the cluster to which the part vector belongs as the position information representing the position of the part vector in the corresponding part vector space in the vector database 20.
[0332] Next, the steps for cluster addition and vector movement processing will be explained. Figure 37 This is a flowchart illustrating an example of the cluster addition and partial vector movement processing steps performed in the information processing system 1 according to the second embodiment. The cluster addition and partial vector movement processing is a process in which, when a new cluster is created in each partial vector space, a partial vector that is close to the representative vector of the new cluster is moved from the cluster to which the partial vector belongs to the new cluster.
[0333] For example, if the number of partial vectors belonging to the cluster closest to a partial vector of the newly added vector reaches the upper limit, or if the newly added vector is a remote vector, the processor 11 creates a new cluster with a representative vector representing a representative point within the partial vector space SVS for each partial vector space SVS (step S131).
[0334] Processor 11 determines, according to each partial vector space SVS, the cluster (cluster 1) with the representative vector of the representative vector that is close to the new cluster from the multiple clusters that have been created (step S132).
[0335] Processor 11 determines the partial vectors of the object to be moved from the set of partial vectors (D / R-dimensional vectors) belonging to the first cluster (step S133). The partial vector of the object to be moved is the vector whose distance to the representative vector of the new cluster is shorter than its distance to the representative vector of the first cluster (first partial vector). Then, processor 11 performs vector movement processing to move the first partial vector from the first cluster to the new cluster according to each partial vector space SVS (step S134), and ends the cluster addition and partial vector movement processing.
[0336] Figure 38 This is a flowchart illustrating an example of the steps of partial vector movement processing performed in the information processing system 1 according to the first embodiment. Figure 37 In step S134, the following vector shifting process is performed.
[0337] Processor 11 obtains the difference (called diff_f) between the partial vector of the moving object (first partial vector) and the representative vector of the first cluster from vector database 20 according to each partial vector space SVS (step S141). diff_f is information stored in vector database 20 as position information of the first partial vector, including D / R first differences obtained by subtracting D / R elements of the representative vector of the first cluster from D / R elements of the first partial vector.
[0338] Processor 11 calculates the difference (called diff_h) between the representative vector of the first cluster and the representative vector of the new cluster (step S42). diff_h includes D / R second differences obtained by subtracting D / R elements of the representative vector of the new cluster from D / R elements of the representative vector of the first cluster, respectively, as D / R elements of diff_h.
[0339] Processor 11 calculates the difference (called diff_g) between the first part vector and the representative vector of the new cluster by adding diff_f and diff_g for each corresponding feature in each partial vector space SVS (step S143). That is, in step S143, processor 11 calculates the D / R third differences obtained by adding D / R second differences to D / R first differences for each partial vector space SVS. The D / R third differences are the D / R features of diff_g.
[0340] Processor 11 stores the new cluster ID and diff_f (D / R third difference) as information representing the position of the first part vector within each partial vector space (SVS) in vector database 20 (step S144), and then ends the partial vector movement process. Through step S144, the cluster ID corresponding to the first part vector is updated from the ID of the first cluster to the ID of the new cluster, and the difference diff corresponding to the first part vector is updated from diff_f to diff_g.
[0341] Through the above partial vector shifting process, the processor 11 can update the difference diff corresponding to the first partial vector from diff_f to diff_g without restoring the original partial vector to its original form. For example, when each of the D / R elements of the R partial vectors of each D-dimensional vector is represented in floating-point form and each of the D / R elements of each diff is represented in fixed-point form, the difference diff corresponding to the first partial vector can be updated from diff_f to diff_g using only fixed-point operations without performing computationally expensive floating-point operations.
[0342] Next, the steps of remote vector registration processing will be explained. Figure 39 This is a flowchart illustrating an example of the steps of remote vector registration processing performed in the information processing system 1 according to the second embodiment.
[0343] Processor 11 determines whether the new vector to be added is a remote vector (step S151).
[0344] If the new vector is determined to be a remote vector (No in step S151), the processor 11 ends the remote vector registration process.
[0345] If the new vector is determined to be a remote vector ("Yes" in step S151), the processor 11 creates a new cluster in the corresponding partial vector space with a representative vector close to the partial vector for each partial vector included in the new vector (step S152).
[0346] Processor 11 calculates the difference between each part vector of the new vector and the representative vector of the new cluster in the partial vector space SVS corresponding to that part vector, that is, the fourth difference of D / R obtained by subtracting the D / R elements included in the representative vector of the new cluster from the D / R elements included in the part vector (step S153).
[0347] Processor 11 saves the ID of the new cluster and the calculated difference (D / R fourth difference) as position information representing the position of the corresponding partial vector in the partial vector space SVS for each part vector of the new vector in vector database 20 (step S154), and then ends the remote vector registration process.
[0348] Through the above remote vector registration process, the processor 11 can reduce the error contained in the difference stored in the position information of the R partial vectors that are remote vectors.
[0349] Next, the steps for distance calculation and processing will be explained. Figure 40This is a flowchart illustrating an example of the steps of a distance calculation process performed in the information processing system 1 according to the second embodiment. Here, it is assumed that the vector of the distance calculation object is a 2D-dimensional vector.
[0350] Processor 11 receives a D-dimensional query vector based on a query from external device 2 (step S161).
[0351] For each partial vector space SVS, the processor 11 obtains the D / R fifth difference from the vector database 20 by subtracting the D / R elements of the representative vector of the cluster to which the partial vector belongs from the D / R elements of the partial vector corresponding to the second D dimension vector of the partial vector space SVS (step S162).
[0352] Processor 11 divides the query vector into R partial vectors (step S163). For each partial vector space SVS, processor 11 calculates the D / R sixth difference obtained by subtracting the D / R elements of the representative vector of the cluster to which the partial vector of the second D dimension vector of the partial vector space SVS belongs from the D / R elements of the partial vector of the query vector corresponding to the partial vector space SVS (step S164).
[0353] Processor 11 calculates the sum of squares of the D / R seventh differences between the D / R fifth differences and the D / R sixth differences according to each partial vector space SVS (step S165).
[0354] Then, processor 11 calculates the sum of the R squares corresponding to the R partial vector spaces SVS as the distance (squared distance) between the 2D dimension vector and the query vector (step S166), and ends the distance calculation process.
[0355] As explained above, according to the second embodiment, when a vector (the first-dimensional vector) is registered in the vector database 20, for each part vector of the first-dimensional vector, a cluster with a representative vector closest to that part vector is determined, and D / R differences are calculated by subtracting the D / R elements included in the representative vector of the determined cluster from the D / R elements included in that part vector. Then, for each part vector of the first-dimensional vector, the identifier of the determined cluster and the calculated D / R differences are stored in the vector database 20 as position information (vector position information 22) representing the position of that part vector in the part vector space corresponding to that part vector. Since the absolute value of each of the D / R differences is much smaller than the absolute value of each element of each of the R part vectors of the first-dimensional vector, the number of bits representing each of the D / R differences can be reduced to fewer bits than the number of bits representing each element of each of the R part vectors.
[0356] Furthermore, the distance between a D-dimensional vector and a query vector can be correctly calculated using D / R differences corresponding to each of the R partial vectors of the D-dimensional vector and D / R differences corresponding to each of the R partial vectors of the query vector.
[0357] Therefore, in the second embodiment, it is also possible to reduce the amount of data in the vector set stored in the vector database 20 while suppressing the decrease in search accuracy.
[0358] The various functions described in each of the first and second embodiments can also be implemented by circuits (processing circuits). Examples of processing circuits include a programmed processor, such as a central processing unit (CPU). This processor executes the described functions by executing a computer program (command set) stored in memory. The processor can be a microprocessor that includes electrical circuitry. Examples of processing circuits also include digital signal processors (DSPs), application-specific integrated circuits (ASICs), microcontrollers, controllers, and other electrical circuit components. Other components besides the CPU described in the first and second embodiments can also be implemented by processing circuits.
[0359] While several embodiments of the invention have been described, these embodiments are merely illustrative and not intended to limit the scope of the invention. These new embodiments can be implemented in a wide variety of other ways, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and / or variations thereof are included within the scope and spirit of the invention, and are included within the scope of the claims and their equivalents.
Claims
1. A database management method for managing a vector database, comprising: Manage multiple clusters, each with a representative vector, where the representative vector is a vector representing a representative point in a D-dimensional vector space and has D dimensions, where D is an integer greater than 2; and When registering the 1D-dimensional vector into the vector database The cluster that has the representative vector that is closest to the first D-dimensional vector is determined as the cluster to which the first D-dimensional vector should belong; Calculate the D differences obtained by subtracting the D elements of the representative vector of the determined cluster from the D elements included in the first D-dimensional vector; and The identifier of the determined cluster and the D differences are stored in the vector database as position information representing the position of the first D-dimensional vector in the D-dimensional vector space.
2. The database management method according to claim 1, The first D-dimensional vector includes D elements, each with a first-digit first data representation. Each of the D differences has a second data representation with a second digit less than the first digit.
3. The database management method according to claim 2, The first data is a bit string for floating-point numbers, including a 1-bit sign bit, a 3-bit exponent part, and a 4-bit mantissa part. The second data is (1) a bit string for a floating-point number that includes a 1-bit sign, an exponent part having a 5th bit less than the 3rd bit, and a mantissa part having a 6th bit less than the 4th bit, or (2) a bit string for a fixed-point number that includes a 1-bit sign, an integer part having a 7th bit, and a fractional part having an 8th bit, and does not include the exponent part, wherein the sum of the 7th bit and the 8th bit is less than or equal to the 4th bit.
4. The database management method according to claim 1 further includes: Create a new cluster with representative vectors; From the set of D-dimensional vectors belonging to the first cluster that is close to the representative vector of the new cluster, determine the second D-dimensional vector whose distance from the representative vector of the new cluster is shorter than its distance from the representative vector of the first cluster. as well as Perform a move process to move the 2D-dimensional vector from the 1st cluster to the new cluster. The movement process includes: The process of obtaining D first differences from the vector database by subtracting the D elements included in the representative vector of the first cluster from the D elements included in the second D-dimensional vector; The calculation involves subtracting the D elements of the representative vector of the new cluster from the D elements included in the representative vector of the first cluster, respectively, to obtain D second differences. The calculation of the D third differences obtained by adding the D second differences to the D first differences respectively; and The process of storing the identifier of the new cluster and the D third differences as information representing the position of the second D-dimensional vector in the vector database.
5. The database management method according to claim 2 further includes: When adding a new D-dimensional vector whose distance from all representative vectors of the plurality of clusters exceeds the maximum value of the difference that can be represented by the second data to the vector database. Construct a new cluster with representative vectors that approximate the new D-dimensional vector; Calculate the D fourth differences obtained by subtracting the D elements included in the representative vector of the new cluster from the D elements included in the new D-dimensional vector; and The identifier of the new cluster and the D fourth differences are stored in the vector database as information representing the position of the new D-dimensional vector in the D-dimensional vector space.
6. The database management method according to claim 1, comprising: Receives a query vector with D dimensions; and When calculating the distance between the query vector and the 3D-dimensional vector, which is one of the D-dimensional vectors registered in the vector database, D fifth differences are obtained from the vector database by subtracting the D elements of the representative vector of the second cluster to which the 3D-dimensional vector belongs from the D elements included in the 3D-dimensional vector. Calculate the D sixth differences obtained by subtracting the D elements included in the representative vector of the second cluster from the D elements included in the query vector; and Calculate the sum of squares of the D seventh differences between the D fifth differences and the D sixth differences, or the square root of the sum of squares.
7. A database management method for managing a vector database, comprising: For each of the R partial vector spaces, each with dimensions D / R, obtained by partitioning a D-dimensional vector space, manage multiple clusters, each with a representative vector. The representative vector is a vector representing a representative point within the partial vector space and having dimensions D / R, where D is an integer greater than or equal to 2, and R is an integer greater than or equal to 2 but less than D; and When registering the 1D-dimensional vector into the vector database The first D-dimensional vector is divided into R partial vectors, each with D / R dimensions; For each of the R partial vectors, the cluster with the representative vector closest to the partial vector among the plurality of clusters in the partial vector space corresponding to the partial vector is determined as the cluster to which the partial vector should belong; For each of the R partial vectors, calculate D / R differences obtained by subtracting the D / R elements included in the representative vector of the determined cluster from the D / R elements included in the partial vector; and For each of the R partial vectors, the identifier of the determined cluster and the D / R differences are stored in the vector database as position information representing the position of the partial vector in the partial vector space corresponding to the partial vector.
8. The database management method according to claim 7, Each of the R partial vectors includes D / R elements, each with a first-digit first data representation. Each of the D / R differences has a second data representation with a second digit less than the first digit.
9. The database management method according to claim 8, The first data is a bit string for floating-point numbers, including a 1-bit sign bit, a 3-bit exponent part, and a 4-bit mantissa part. The second data is (1) a bit string for a floating-point number that includes a 1-bit sign, an exponent part having a 5th bit less than the 3rd bit, and a mantissa part having a 6th bit less than the 4th bit, or (2) a bit string for a fixed-point number that includes a 1-bit sign, an integer part having a 7th bit, and a fractional part having an 8th bit, and does not include the exponent part, wherein the sum of the 7th bit and the 8th bit is less than or equal to the 4th bit.
10. The database management method according to claim 7, further comprising: For each of the R partial vector spaces, create a new cluster; For each of the R partial vector spaces, from the set of partial vectors belonging to the first cluster that has a representative vector close to the representative vector of the new cluster, determine the first partial vector whose distance to the representative vector of the new cluster is shorter than its distance to the representative vector of the first cluster. as well as For each of the R partial vector spaces, a move process is performed to move the first partial vector from the first cluster to the new cluster. The movement process includes: For each of the R partial vector spaces, the processing of obtaining the D / R first differences from the vector database by subtracting the D / R elements included in the representative vector of the first cluster from the D / R elements included in the first partial vector; For each of the R partial vector spaces, the processing of D / R second differences obtained by subtracting the D / R elements included in the representative vector of the new cluster from the D / R elements included in the representative vector of the first cluster respectively is performed. For each of the R partial vector spaces, calculate the processing of the D / R third differences obtained by adding the D / R second differences to the D / R first differences respectively; as well as For each of the R partial vector spaces, the identifier of the new cluster and the D / R third differences are stored in the vector database as position information representing the position of the first partial vector within the partial vector space.
11. The database management method according to claim 8, further comprising: When adding a new D-dimensional vector to the vector database, which includes partial vectors whose distances to all representative vectors of the plurality of clusters within at least one of the R partial vector spaces exceed the maximum value of the difference that can be represented by the second data. For each of the R partial vectors included in the new D-dimensional vector, a new cluster with a representative vector close to the partial vector is created in the corresponding partial vector space; For each of the R partial vectors included in the new D-dimensional vector, calculate the D / R fourth difference obtained by subtracting the D / R elements included in the representative vector of the new cluster of the corresponding partial vector space from the D / R elements included in the partial vector. as well as For each of the R partial vectors included in the new D-dimensional vector, the identifier of the new cluster created in the corresponding partial vector space and the D / R fourth difference are stored in the vector database as information representing the position of the partial vector in the corresponding partial vector space.
12. The database management method according to claim 7, further comprising: Receives a query vector with D dimensions; and When calculating the distance between the query vector and the second D-dimensional vector, which is a D-dimensional vector registered in the vector database, For each of the R partial vector spaces, the D / R fifth difference is obtained from the vector database by subtracting the D / R elements included in the representative vector of the cluster to which the partial vector of the second-D dimension vector corresponding to the partial vector space belongs from the D / R elements included in the partial vector of the second-D dimension vector corresponding to the partial vector space. The query vector is divided into R partial vectors, each with D / R dimensions; For each of the R partial vector spaces, calculate the D / R sixth difference obtained by subtracting the D / R elements included in the representative vector of the cluster to which the partial vector of the second D-dimensional vector to which the partial vector of the query vector corresponding to the partial vector space belongs from the D / R elements included in the partial vector of the query vector corresponding to the partial vector space. For each of the R partial vector spaces, calculate the sum of squares of the D / R fifth differences between the D / R fifth differences corresponding to the partial vector space and the D / R sixth differences corresponding to the partial vector space; as well as Calculate the sum of the R sums of squares corresponding to the R partial vector spaces respectively.
13. An information processing system for managing a vector database, and comprising a processor, The processor is configured such that, managing a plurality of clusters each having a representative vector, the representative vector being a vector of D dimensions representing a representative point in a D-dimensional vector space, wherein, D is an integer greater than or equal to 2; When registering the 1D-dimensional vector into the vector database The cluster that has the representative vector that is closest to the first D-dimensional vector is determined as the cluster to which the first D-dimensional vector should belong; Calculate the D differences obtained by subtracting the D elements of the representative vector of the determined cluster from the D elements included in the first D-dimensional vector; The identifier of the determined cluster and the D differences are stored in the vector database as position information representing the position of the first D-dimensional vector in the D-dimensional vector space.
14. The information processing system according to claim 13, The first D-dimensional vector includes D elements, each with a first-digit first data representation. Each of the D differences has a second data representation with a second digit less than the first digit.
15. The information processing system according to claim 14, The first data is a bit string for floating-point numbers, including a 1-bit sign bit, a 3-bit exponent part, and a 4-bit mantissa part. The second data is (1) a bit string for a floating-point number including a 1-bit sign, an exponent part having a 5th bit less than the 3rd bit, and a mantissa part having a 6th bit less than the 4th bit, or (2) a bit string for a fixed-point number including a 1-bit sign, an integer part having a 7th bit, and a fractional part having an 8th bit, and excluding the exponent part, wherein the sum of the 7th bit and the 8th bit is less than or equal to the 4th bit.
16. The information processing system according to claim 13, The processor is further configured to, Create a new cluster with representative vectors; From the set of D-dimensional vectors belonging to the first cluster that is close to the representative vector of the new cluster, determine the second D-dimensional vector whose distance from the representative vector of the new cluster is shorter than its distance from the representative vector of the first cluster. Perform a move process to move the 2D-dimensional vector from the 1st cluster to the new cluster. The movement process includes: The process of obtaining D first differences from the vector database by subtracting the D elements included in the representative vector of the first cluster from the D elements included in the second D-dimensional vector; The calculation involves subtracting the D elements of the representative vector of the new cluster from the D elements included in the representative vector of the first cluster, respectively, to obtain D second differences. The calculation of the D third differences obtained by adding the D second differences to the D first differences respectively; and The process of storing the identifier of the new cluster and the D third differences as information representing the position of the second D-dimensional vector in the vector database.
17. The information processing system according to claim 14, The processor is further configured to, When adding a new D-dimensional vector whose distance from all representative vectors of the plurality of clusters exceeds the maximum value of the difference that can be represented by the second data to the vector database. Construct a new cluster with representative vectors that approximate the new D-dimensional vector; Calculate the D fourth differences obtained by subtracting the D elements included in the representative vector of the new cluster from the D elements included in the new D-dimensional vector; The identifier of the new cluster and the D fourth differences are stored in the vector database as information representing the position of the new vector in the D-dimensional vector space.
18. The information processing system according to claim 13, The processor is further configured to, Receives a query vector with D dimensions; When calculating the distance between the query vector and the 3D-dimensional vector, which is one of the D-dimensional vectors registered in the vector database, D fifth differences are obtained from the vector database by subtracting the D elements of the representative vector of the second cluster to which the 3D-dimensional vector belongs from the D elements included in the 3D-dimensional vector. Calculate the D sixth differences obtained by subtracting the D elements included in the representative vector of the second cluster from the D elements included in the query vector; Calculate the sum of squares of the D seventh differences between the D fifth differences and the D sixth differences, or the square root of the sum of squares.