Data retrieval system based on vector library
The data retrieval system based on vector libraries solves the problems of low efficiency and insufficient semantic understanding in large-scale multimodal data retrieval, realizes fast and accurate cross-modal retrieval, adapts to large-scale data environments, reduces costs, and expands application boundaries.
Patent Information
- Application Number
- CN202511597663.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-02-17
AI Technical Summary
Existing data retrieval methods are inefficient and costly when processing large-scale multimodal data, and lack a unified semantic representation method, failing to meet real-time requirements and cross-modal retrieval capabilities.
A data retrieval system based on a vector library is adopted. By preprocessing, vectorizing, creating index structures, and distributing storage of data of different modalities, and using an efficient approximate nearest neighbor search algorithm for retrieval, fast and accurate retrieval of cross-modal data is achieved.
It significantly improves retrieval efficiency, enhances semantic understanding capabilities, supports joint retrieval of multimodal data, adapts to large-scale data environments, reduces costs, and expands application boundaries.
Smart Images

Figure CN121542470A_ABST
Abstract
Description
Technical Field
[0001] This invention discloses a data retrieval system based on a vector library, relating to the fields of information retrieval and database technology. Background Technology
[0002] Existing data retrieval methods primarily rely on keyword matching and Boolean logic operations, which are insufficient when handling semantically complex and diverse data. Furthermore, most current systems suffer from low computational efficiency, high storage costs, and insufficient retrieval accuracy when processing large-scale vector data. On the other hand, with the widespread adoption of the internet, multimedia, and smart devices, data volume is exploding, and data types are becoming increasingly diverse, including text, images, audio, and video. Existing retrieval methods based on relational databases or inverted indexes experience a significant drop in retrieval efficiency and increased response latency when dealing with TB-level or even PB-level data volumes, failing to meet real-time requirements. Simultaneously, existing systems lack a unified semantic representation method, rendering them virtually incapable of joint retrieval of cross-modal data. Summary of the Invention
[0003] This invention addresses the problems of existing technologies by providing a data retrieval system based on a vector library. This system can map data from different modalities to a unified high-dimensional vector space and utilizes efficient indexing and retrieval algorithms to achieve fast, accurate, and intelligent semantic search of massive datasets. This invention significantly improves the performance of information retrieval systems in complex semantic understanding, multimodal processing, and large-scale data environments, thereby better serving application scenarios such as intelligent search, recommendation systems, intelligent question answering, public opinion analysis, and human-computer interaction. It has significant technical and application value.
[0004] The specific solution proposed in this invention is as follows:
[0005] This invention provides a data retrieval method based on a vector library, comprising:
[0006] Step 1: Preprocessing input data for different modalities: Perform data preprocessing and data cleaning according to the data modality.
[0007] Step 2: Vectorize the preprocessed data according to its data modality, and then align the vectorized data.
[0008] Step 3: Perform vector storage:
[0009] Creating the index structure: An index structure is created using an approximate nearest neighbor ANN.
[0010] Distributed deployment of storage: Data vectors are sharded for storage, and queries are distributed to different nodes using load balancing strategies to achieve horizontal scaling.
[0011] Step 4: Perform search management:
[0012] Query processing: Convert the multimodal query data input by the user into a high-dimensional vector.
[0013] Preliminary retrieval: An ANN search is performed using the index structure to obtain a set of candidate vectors.
[0014] Re-rank the candidate vector set: Perform a second calculation on the candidate set, and sort them using cosine similarity or Euclidean distance.
[0015] Return results: The results are output in multiple modalities according to user needs.
[0016] Furthermore, step 1 of the data retrieval method based on a vector library specifically includes:
[0017] For text data preprocessing, including word segmentation, stop word removal, spell correction, synonym normalization, entity recognition, and structured annotation, the consistency and standardization of the input data are ensured.
[0018] Image data preprocessing includes scaling, normalization, color space conversion, denoising, and edge enhancement to provide standardized images for deep learning model input.
[0019] For speech data preprocessing, this includes removing silence segments through endpoint detection, unifying the sampling rate, and extracting MFCC or spectral features to adapt the audio for subsequent model processing.
[0020] Data cleaning includes deleting invalid and duplicate data, standardizing storage formats, and ensuring the reliability of system operation and data quality.
[0021] Furthermore, in step 2 of the data retrieval method based on a vector library, vectorization processing is performed, including:
[0022] Vectorization of text data includes using deep learning language models to extract context-sensitive dense vector representations of the text data.
[0023] Vectorization of image data includes extracting semantic features from images using CNN, ResNet, or VisionTransformer models.
[0024] Vectorization of speech data includes extracting speech features using Wav2Vec or Conformer models.
[0025] Furthermore, in step 3 of the data retrieval method based on a vector library, data management is performed on the stored data vectors, including: performing hierarchical storage of hot and cold data, storing commonly used vectors in high-performance storage media, and transferring cold data to inexpensive storage media, in order to balance performance and cost.
[0026] Furthermore, in step 4 of the data retrieval method based on a vector library, when re-ranking the candidate vector set, the similarity between the query vector and the vectors in the library is calculated using a similarity metric function. When using cosine similarity, the formula is as follows:
[0027] sim(q,v_i)=(q·v_i) / (||q||||v__i||)
[0028] q is the query vector, and v_i is the vector in the vector library;
[0029] When using Euclidean distance for calculation, the formula is as follows:
[0030] dist(q, vi) = ||q - vi||
[0031] q is the query vector, and vi is a vector in the vector library.
[0032] The top k candidate results with the smallest distance or the highest similarity are selected for fine sorting.
[0033] This invention also provides a data retrieval system based on a vector library, including a data preprocessing module, a vectorization module, a storage and indexing module, and a retrieval module.
[0034] The data preprocessing module preprocesses input data of different modalities: it performs data preprocessing and data cleaning according to the data modality.
[0035] The vectorization module performs vectorization processing on the preprocessed data according to the data modality, and then performs vector alignment on the vectorized data.
[0036] The storage and indexing modules use vector storage:
[0037] Creating the index structure: An index structure is created using an approximate nearest neighbor ANN.
[0038] Distributed deployment of storage: Data vectors are sharded for storage, and queries are distributed to different nodes using load balancing strategies to achieve horizontal scaling.
[0039] The search module manages search operations.
[0040] Query processing: Convert the multimodal query data input by the user into a high-dimensional vector.
[0041] Preliminary retrieval: An ANN search is performed using the index structure to obtain a set of candidate vectors.
[0042] Re-rank the candidate vector set: Perform a second calculation on the candidate set, and sort them using cosine similarity or Euclidean distance.
[0043] Return results: The results are output in multiple modalities according to user needs.
[0044] Furthermore, the data preprocessing module of the data retrieval system based on a vector library performs text data preprocessing, including word segmentation, stop word removal, spell correction, synonym normalization, entity recognition, and structured annotation, to ensure the consistency and standardization of the input data.
[0045] Image data preprocessing includes scaling, normalization, color space conversion, denoising, and edge enhancement to provide standardized images for deep learning model input.
[0046] For speech data preprocessing, this includes removing silence segments through endpoint detection, unifying the sampling rate, and extracting MFCC or spectral features to adapt the audio for subsequent model processing.
[0047] Data cleaning includes deleting invalid and duplicate data, standardizing storage formats, and ensuring the reliability of system operation and data quality.
[0048] Furthermore, the vectorization module of the data retrieval system based on a vector library performs vectorization processing, including:
[0049] Vectorization of text data includes using deep learning language models to extract context-sensitive dense vector representations of the text data.
[0050] Vectorization of image data includes extracting semantic features from images using CNN, ResNet, or VisionTransformer models.
[0051] Vectorization of speech data includes extracting speech features using Wav2Vec or Conformer models.
[0052] Furthermore, the storage and indexing module of the data retrieval system based on a vector library performs data management for the stored data vectors, including: performing tiered storage of hot and cold data, storing commonly used vectors in high-performance storage media, and transferring cold data to inexpensive storage media, in order to balance performance and cost.
[0053] Furthermore, when the retrieval module of the data retrieval system based on a vector library performs fine-grained reordering on the candidate vector set sim(q,v_i)=(q·v_i) / (||q||||v__i||), it calculates the similarity between the query vector and the vectors in the library using a similarity metric function. When using cosine similarity for calculation, the formula is as follows:
[0054] q is the query vector, and v_i is the vector in the vector library;
[0055] When using Euclidean distance for calculation, the formula is as follows:
[0056] dist(q, vi) = ||q - vi||
[0057] q is the query vector, and vi is a vector in the vector library.
[0058] The top k candidate results with the smallest distance or the highest similarity are selected for fine sorting.
[0059] Compared with the prior art, the present invention has the following significant advantages:
[0060] (1) Improved retrieval efficiency: By adopting an efficient approximate nearest neighbor search algorithm, this invention can complete the retrieval within a logarithmic complexity, which greatly improves the system's response speed.
[0061] (2) Enhanced Semantic Understanding: This invention employs a deep learning model for vectorized representation, enabling it to capture deep semantic relationships within the data and overcome the reliance on literal matching in traditional keyword retrieval. The system can identify synonyms, contextual information, and implicit semantics, thereby better understanding the user's true intent.
[0062] (3) Multimodal support: This invention achieves cross-modal retrieval capabilities through multimodal alignment and fusion. When a user inputs text, it can return relevant images or videos; when a user inputs speech, it can also be converted into vectors and matched with corresponding document content. This capability greatly expands the application boundaries of retrieval.
[0063] (4) Strong scalability and applicability: The storage of this invention adopts a distributed architecture, which can add storage and computing nodes as needed to ensure efficient operation even as the data scale continues to expand. It can be flexibly adapted to both small-scale enterprise applications and large-scale Internet-level data scenarios. At the same time, it supports plug-in model updates, and users can replace or upgrade the vectorized model according to their needs to maintain the best semantic retrieval effect.
[0064] (5) Economic and social benefits: It can reduce the time and hardware costs of data retrieval and improve the utilization rate of enterprise information; at the social level, this technology can be widely used in education, medical care, government affairs, public opinion analysis and other fields, providing technical support for intelligent information services. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0067] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0068] Example 1
[0069] This invention provides a data retrieval method based on a vector library, comprising:
[0070] Step 1: Preprocess the input data for different modalities: Perform data preprocessing and data cleaning according to the modality of the data.
[0071] Specifically, this may include:
[0072] For text data preprocessing, including word segmentation, stop word removal, spell correction, synonym normalization, entity recognition, and structured annotation, the consistency and standardization of the input data are ensured.
[0073] Image data preprocessing includes scaling, normalization, color space conversion, denoising, and edge enhancement to provide standardized images for deep learning model input.
[0074] For speech data preprocessing, this includes removing silence segments through endpoint detection, unifying the sampling rate, and extracting MFCC or spectral features to adapt the audio for subsequent model processing.
[0075] Data cleaning includes deleting invalid and duplicate data, standardizing storage formats, and ensuring the reliability of system operation and data quality.
[0076] The processed data can be represented as follows:
[0077] D′=fpre(D)
[0078] Where fpre represents the preprocessing function, D is the original data, and D′ is the standardized data.
[0079] Step 2: Vectorize the preprocessed data according to its modality, and then align the vectorized data. Through a cross-modal training method, data from different modalities are mapped to a unified high-dimensional semantic space, enabling cross-modal retrieval.
[0080] Vectorization processing may include:
[0081] Vectorization of text data involves using deep learning language models such as BERT, ERNIE, and GPT to extract context-dependent dense vector representations of the text data, generating dense vector representations:
[0082] v = feathered(D′)
[0083] Here, feather is the embedding function, and its output vector is... The dimension n is typically in the hundreds to thousands. The closer the vectors are, the stronger the semantic relevance of the data.
[0084] Vectorization of image data includes extracting semantic features from images using CNN, ResNet, or Vision Transformer models.
[0085] Vectorization of speech data includes extracting speech features using Wav2Vec or Conformer models.
[0086] Step 3: Perform vector storage:
[0087] Creating index structures: Index structures can be created using Approximate Nearest Neighbor ANNs, such as Hierarchical Navigable Small World Graph (HNSW), Inverted Index File + Product Quantization (IVF-PQ), FAISS, Annoy, etc.
[0088] Distributed deployment of storage is implemented: data vectors are sharded for storage, and queries are distributed to different nodes using a load balancing strategy to achieve horizontal scaling. All generated vectors are stored in a vector database. To improve retrieval efficiency, an approximate nearest neighbor ANN index structure is established.
[0089] The goal of indexing is to find vectors in a vector set V = {v1, v2, ..., vm}, where Vi represents a vector within the vector library.
[0090] Data management is performed on stored data vectors, including: tiered storage of hot and cold data, with commonly used vectors stored in high-performance storage media and cold data transferred to inexpensive storage media, in order to balance performance and cost.
[0091] Step 4: Perform search management:
[0092] Query processing: Convert the multimodal query data input by the user into a high-dimensional vector, and map it to the query vector:
[0093] q = feathered(Q)
[0094] Preliminary retrieval: Perform an ANN search using the index structure to obtain a set of candidate vectors.
[0095] Re-rank the candidate vector set: Perform a second calculation on the candidate set, and sort them using cosine similarity or Euclidean distance.
[0096] Return results: The results are output in multiple modalities according to user needs.
[0097] When performing fine-grained reordering of the candidate vector set, the similarity between the query vector and the vectors in the database is calculated using a similarity metric function. When using cosine similarity, the formula is as follows:
[0098] q is the query vector, and v_i is the vector in the vector library;
[0099] When using Euclidean distance for calculation, the formula is as follows:
[0100] dist(q, vi) = ||q - vi||
[0101] q is the query vector, and vi is a vector in the vector library.
[0102] The top k candidate results with the smallest distance or the highest similarity are selected and sorted from high to low relevance.
[0103] This invention not only solves the limitations of traditional retrieval methods in terms of efficiency and semantic understanding, but also demonstrates great value in terms of multimodal support, scalability, and application prospects, and has significant implications for promotion.
[0104] Example 2
[0105] This invention also provides a data retrieval system based on a vector library, including a data preprocessing module, a vectorization module, a storage and indexing module, and a retrieval module.
[0106] The data preprocessing module preprocesses input data of different modalities: it performs data preprocessing and data cleaning according to the data modality.
[0107] The vectorization module performs vectorization processing on the preprocessed data according to the data modality, and then performs vector alignment on the vectorized data.
[0108] The storage and indexing modules use vector storage:
[0109] Creating the index structure: An index structure is created using an approximate nearest neighbor ANN.
[0110] Distributed deployment of storage: Data vectors are sharded for storage, and queries are distributed to different nodes using load balancing strategies to achieve horizontal scaling.
[0111] The search module manages search operations.
[0112] Query processing: Convert the multimodal query data input by the user into a high-dimensional vector.
[0113] Preliminary retrieval: An ANN search is performed using the index structure to obtain a set of candidate vectors.
[0114] Re-rank the candidate vector set: Perform a second calculation on the candidate set, and sort them using cosine similarity or Euclidean distance.
[0115] Return results: The results are output in multiple modalities according to user needs.
[0116] The information interaction and execution process between the modules in the above system are based on the same concept as the method embodiment of the present invention, and the specific details can be found in the description in the method embodiment of the present invention, and will not be repeated here.
[0117] Similarly, the advantages of the system of the present invention are:
[0118] (1) Improved retrieval efficiency: By adopting an efficient approximate nearest neighbor search algorithm, this invention can complete the retrieval within logarithmic complexity, which greatly improves the system's response speed.
[0119] (2) Enhanced Semantic Understanding: This invention employs a deep learning model for vectorized representation, enabling it to capture deep semantic relationships within the data and overcome the reliance on literal matching in traditional keyword retrieval. The system can identify synonyms, contextual information, and implicit semantics, thereby better understanding the user's true intent.
[0120] (3) Multimodal support: This invention achieves cross-modal retrieval capabilities through multimodal alignment and fusion. When a user inputs text, it can return relevant images or videos; when a user inputs speech, it can also be converted into vectors and matched with corresponding document content. This capability greatly expands the application boundaries of retrieval.
[0121] (4) Strong scalability and applicability: The storage of this invention adopts a distributed architecture, which can add storage and computing nodes as needed to ensure efficient operation even as the data scale continues to expand. It can be flexibly adapted to both small-scale enterprise applications and large-scale Internet-level data scenarios. At the same time, it supports plug-in model updates, and users can replace or upgrade the vectorized model according to their needs to maintain the best semantic retrieval effect.
[0122] (5) Economic and social benefits: It can reduce the time and hardware costs of data retrieval and improve the utilization rate of enterprise information; at the social level, this technology can be widely applied in education, medical care, government affairs, public opinion analysis and other fields, providing technical support for intelligent information services. Furthermore, this invention provides a computer-readable medium storing computer instructions, which, when executed by a processor, cause the processor to execute the Velocity-based customizable code generation method. Specifically, a system or device equipped with a storage medium can be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or device can read and execute the program code stored in the storage medium.
[0123] It should be noted that not all steps and modules in the above processes and system structures are mandatory; some steps or modules can be omitted as needed. The execution order of the steps is not fixed and can be adjusted as required. The system structures described in the above embodiments can be physical or logical structures. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or they may be implemented by certain components in multiple independent devices.
[0124] The above-described embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention. The scope of protection of the present invention is defined by the claims.
Claims
1. A method for data retrieval based on a vector library, characterized in that Comprise: Step 1: Preprocessing of input data of different modalities: data preprocessing and data cleaning according to the modalities of the data, Step 2: After preprocessing the data, vectorize the data according to the data modalities, and align the vectorized data, Step 3: Vector storage: Create an index structure: create an index structure using Approximate Nearest Neighbor (ANN), Distributed deployment of storage: shard the data vectors and distribute queries to different nodes through load balancing strategies to achieve horizontal expansion, Step 4: Retrieval management: Query processing: convert the user's multi-modal query data into a high-dimensional vector, Initial retrieval: perform ANN search using the index structure to obtain a candidate vector set, Refine and reorder the candidate vector set: perform secondary calculations on the candidate set, and use cosine similarity or Euclidean distance for sorting, Return the result: output the result in multiple modalities according to user demand.
2. The data retrieval method based on vector library according to claim 1, characterized in that step 1 specifically comprises: For text data preprocessing, including word segmentation, stop word removal, spelling correction, synonym normalization, entity recognition and structured annotation, to ensure the consistency and standardization of input data, For image data preprocessing, including scaling, normalization, color space conversion, denoising, and edge enhancement to provide standardized images for deep learning model input, For speech data preprocessing, including removing silent segments through endpoint detection, unifying sampling rate, and extracting MFCC or spectral features to adapt audio for subsequent model processing, Data cleaning, including deleting invalid data, duplicate data, and unifying storage format to ensure system reliability and data quality.
3. The vector library based data retrieval method of claim 1, wherein Step 2: Vectorization processing includes: Vectorization of text data, including using deep learning language models to extract context-related dense vector representations of text data, Vectorization of image data, including using CNN, ResNet or Vision Transformer models to extract image semantic features, Vectorization of speech data, including using Wav2Vec or Conformer models to extract speech features.
4. The vector library based data retrieval method of claim 1, wherein Step 3: Data management of stored data vectors includes: cold and hot data layering storage, commonly used vectors are stored in high-performance storage media, and cold data is transferred to inexpensive storage media to balance performance and cost.
5. The vector library based data retrieval method of claim 1, wherein In step 4, when refining and reordering the candidate vector set, the similarity between the query vector and the vector in the library is calculated using the similarity measure function, where the cosine similarity calculation formula is as follows: sim(q, v_i) = q(q · v_i) / (||q|| ||v_i||) q is the query vector, v_i is the vector in the vector library; When using Euclidean distance calculation, the formula is as follows: dist(q, vi) = ||q-vi|| q is the query vector, vi is the vector in the vector library, Select the top k candidate results with the smallest distance or the largest similarity for refined sorting.
6. A vector library based data retrieval system, characterized by The system comprises a data preprocessing module, a vectorization module, a storage and indexing module, and a retrieval module, The data preprocessing module preprocesses input data of different modalities: data preprocessing and data cleaning are performed according to the modality of the data, The vectorization module performs vectorization processing on the preprocessed data according to the data modality, and aligns the vectorized data, The storage and indexing module stores the vectors: Create an index structure: use approximate nearest neighbor (ANN) to create an index structure, Distributed deployment of storage: shard the data vectors and distribute queries to different nodes through load balancing strategies to achieve horizontal expansion, The retrieval module manages retrieval: Query processing: convert the user's multi-modal query data into high-dimensional vectors, Initial retrieval: perform ANN search using the index structure to obtain a candidate vector set, Refine and reorder the candidate vector set: perform secondary calculations on the candidate set, and use cosine similarity or Euclidean distance for sorting, Return the results: output the results in multiple modalities according to user needs.
7. A vector library based data retrieval system as claimed in claim 6, wherein The data preprocessing module preprocesses text data, including word segmentation, stop word removal, spelling correction, synonym normalization, entity recognition, and structured annotation, to ensure the consistency and standardization of input data, For image data preprocessing, including scaling, normalization, color space conversion, denoising, and edge enhancement, to provide standardized images for deep learning model input, For speech data preprocessing, including removing silent segments through endpoint detection, unifying sampling rate, and extracting MFCC or spectral features to adapt audio for subsequent model processing, Data cleaning, including deleting invalid and duplicate data, and unifying storage formats to ensure system reliability and data quality.
8. A vector library based data retrieval system as claimed in claim 6, wherein The vectorization module performs vectorization processing, including: Vectorization of text data, including using deep learning language models to extract context-related dense vector representations of text data, Vectorization of image data, including using CNN, ResNet, or Vision Transformer models to extract image semantic features, Vectorization of speech data, including using Wav2Vec or Conformer models to extract speech features.
9. A vector library based data retrieval system as claimed in claim 6, wherein The storage and indexing module manages data vectors for storage, including:
10. A vector library based data retrieval system as claimed in claim 6, wherein Cold and hot data layering storage: frequently used vectors are stored in high-performance storage media, and cold data is transferred to inexpensive storage media to balance performance and cost. When the retrieval module refines and reorders the candidate vector set, it calculates the similarity between the query vector and the vectors in the library using a similarity measure function. When using cosine similarity, the formula is as follows: sim(q, v_i) = q(q, v_i) / (||q|| ||v_i||) q is the query vector, and v_i is the vector in the vector library; When using Euclidean distance, the formula is as follows: dist(q, vi) = ||q-vi|| q is the query vector, and vi is the vector in the vector library, Select the top k candidate results with the smallest distance or the largest similarity for refined sorting.