Data retrieval method, device, system, electronic device and readable storage medium

By constructing a multi-layered index structure and combining it with an adaptive retrieval model, the problems of low efficiency and accuracy in vector database retrieval were solved, achieving efficient and accurate data retrieval.

CN118093962BActive Publication Date: 2026-11-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410383374.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-31
Publication Date
2026-11-24
Estimated Expiration
2044-03-31

AI Technical Summary

Technical Problem

Existing retrieval methods based on vector databases, which employ static index structures and single retrieval strategies, are difficult to match large-scale, dynamically changing data volumes, resulting in low retrieval efficiency and poor accuracy.

Method used

By constructing a multi-layered index structure and dynamically updating it, combined with an adaptive retrieval model, the index parameters are optimized to adapt to data changes and user query feedback through dynamic adjustment of the index structure and training of the adaptive retrieval model, thereby improving retrieval efficiency and accuracy.

Benefits of technology

By dynamically matching data changes with user query intent, the retrieval efficiency and accuracy of the vector database are improved, thus enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118093962B_ABST
    Figure CN118093962B_ABST
Patent Text Reader

Abstract

This invention discloses a data retrieval method, apparatus, system, electronic device, and readable storage medium, applied in the field of retrieval technology. The method includes pre-constructing a multi-layered index structure with at least two layers of different index precisions based on the data distribution characteristics of a vector dataset, and training an adaptive retrieval model based on a retrieval sample dataset. The index data and index parameters corresponding to the index structure are dynamically updated based on changes in the data within the index and user query feedback analysis information; the retrieval result samples of the retrieval sample dataset are obtained from a vector dataset fused with a knowledge graph through the index structure. By inputting the user's corresponding query vector into the adaptive retrieval model, matching retrieval results can be determined based on the output results. This invention can solve the problem that the retrieval results and efficiency of related technologies cannot meet user needs, and can effectively improve the retrieval efficiency and accuracy based on vector databases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of retrieval technology, and in particular to a data retrieval method, apparatus, system, electronic device, and readable storage medium. Background Technology

[0002] Data retrieval is the process of extracting the data that a user needs from the stored data in a database. With the rapid development of artificial intelligence technology, information retrieval based on numerical vectors in vector databases, also known as vector retrieval, is being applied in fields such as recommendation systems, image recognition, and natural language processing for text retrieval, image retrieval, and audio retrieval.

[0003] When performing searches based on vector databases, related technologies typically employ static index structures and a single search strategy. This results in search results that are difficult to match with large-scale, dynamically changing data volumes, ultimately leading to low search efficiency and poor accuracy.

[0004] Therefore, improving the retrieval efficiency and accuracy of vector databases is a technical problem that needs to be solved by professionals in this field.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] This invention provides a data retrieval method, apparatus, system, electronic device, and readable storage medium, which can effectively improve the retrieval efficiency and accuracy based on vector databases.

[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0008] This invention provides a data retrieval method, comprising:

[0009] A multi-layered index structure with at least two layers of different index precision is constructed in advance based on the data distribution characteristics of the vector dataset; the index data and index parameters corresponding to the index structure are dynamically updated based on the changes in the data in the index and user query feedback analysis information;

[0010] An adaptive retrieval model is pre-trained based on a retrieval sample dataset; the retrieval sample dataset contains multiple sets of query vector-retrieval result sample pairs, each query vector-retrieval result pair includes a query vector sample and a corresponding retrieval result sample, and the retrieval result sample is obtained from the vector dataset fused with the knowledge graph through the index structure;

[0011] When a query instruction is received, the query vector constructed based on the query instruction is input into the adaptive retrieval model, and the retrieval result corresponding to the query instruction is determined based on the output result of the adaptive retrieval model.

[0012] In a first exemplary embodiment, the construction of a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of the vector dataset includes:

[0013] An initial index structure is constructed, which includes a top-level index, intermediate-level indexes, and a bottom-level index. The top-level index contains pointers to the next-level index, and the index data of the intermediate-level indexes is a refinement of the index data within the top-level index. The bottom-level indexes directly point to the target data items. The index precision of the top-level index is less than that of the intermediate-level indexes, and the index precision of the intermediate-level indexes is less than that of the bottom-level indexes.

[0014] Clustering is performed on the vector dataset to determine the cluster to which each data point in the vector dataset belongs and its corresponding cluster center, so as to obtain the cluster center member allocation information;

[0015] Based on the cluster center member allocation information, the distribution of data points in each cluster is determined by iterative analysis of the data points in each cluster, and cluster internal characteristic analysis information is generated based on the distribution of data points in each cluster.

[0016] Based on the cluster internal characteristic analysis information, the data and index precision of each index level of the initial index are adjusted, and the adjusted initial index structure is used as the index structure.

[0017] In a second exemplary embodiment, after constructing a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of the vector dataset, the method further includes:

[0018] Based on the update status of the index structure, determine the data update frequency and change trend in the index structure; based on the time series analysis results of the data update frequency and change trend in the index structure, determine the data update method for adjusting the index data of each index layer.

[0019] Based on the time series analysis results of the data update frequency and change trend in the index structure and the user query feedback results corresponding to each time series point, the parameter update method for adjusting the index parameters of the index structure is determined.

[0020] The index structure is updated based on the data update method and the parameter update method.

[0021] In a third exemplary implementation, the adaptive retrieval model trained based on the retrieval sample dataset includes:

[0022] The entity features and relational structural characteristics of the knowledge graph are analyzed based on graph neural network, and the entity features of the knowledge graph and the vector data representations of the vector database are fused to obtain multiple semantic enhancement vectors. The features of each semantic enhancement vector are extracted to obtain a feature mapping sample set.

[0023] For each query vector sample, calculate the similarity between each query vector sample and each feature vector in the feature mapping sample set, and select the feature vectors whose similarity meets the preset similarity conditions as the retrieval result samples corresponding to each query vector sample.

[0024] Based on the loss between each query vector sample and its corresponding retrieval result sample, the model parameters of the pre-built network model structure are continuously updated iteratively until the preset model iteration stopping condition is met, and then an adaptive retrieval model is obtained.

[0025] In a fourth exemplary embodiment, the adaptive retrieval model outputs a similarity index vector set associated with the query instruction, and determining the retrieval result corresponding to the query instruction based on the output of the adaptive retrieval model includes:

[0026] The candidate search results in the similarity index vector set are sorted according to their similarity to the query vector.

[0027] Based on the analysis of users' historical feedback data, the sorted candidate search results are readjusted, and the adjusted candidate search results are output as the search results corresponding to the query command.

[0028] In the fifth exemplary embodiment, after constructing a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of the vector dataset, the method further includes:

[0029] Obtain the updated data of the index structure; the updated data includes the timestamp of the index structure update, the change type, and the data before and after the update.

[0030] Based on the update time of the index structure and its corresponding update data, an index change record set is generated according to a time sequence; the index change record set is used to analyze the changes in the index structure in chronological order.

[0031] The time series analysis method is used to analyze the periodicity and trend of data changes in the index change record set to obtain statistical update analysis results;

[0032] Based on the statistical update analysis results, an adaptive algorithm is invoked to determine the data update method for automatically adjusting the index structure; the data update method is used to update the index update frequency, index data storage layout, reconstruction cycle, and data failure judgment conditions of each index layer of the index structure.

[0033] Based on the statistical update analysis results, the target time point in which the index structure meets the preset update conditions during the data update process is determined, so as to provide insights into the data through time-series analysis.

[0034] Based on the time-series analysis and insight data, an incremental learning algorithm is invoked to determine the update requirements and time-series characteristics of the index data in the index structure, so as to reflect the relationship between user query patterns and index performance.

[0035] The index parameters of the index structure are adjusted based on the update requirements and the time-series characteristics; the index parameters include index weight adjustment coefficients, query feedback impact factors, and retrieval efficiency optimization indicators.

[0036] Based on the index parameters of the updated index structure and the changes in index data before and after the index structure adjustment, a parameter update method is generated.

[0037] Another aspect of the present invention provides a data retrieval device, comprising:

[0038] The dynamic hierarchical index building module is used to pre-build a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of the vector dataset; the index data and index parameters corresponding to the index structure are dynamically updated based on the changes in the data in the index and user query feedback analysis information;

[0039] The retrieval model training module is used to pre-train an adaptive retrieval model based on the retrieval sample dataset; the retrieval sample dataset contains multiple sets of query vector-retrieval result sample pairs, each query vector-retrieval result pair includes a query vector sample and a corresponding retrieval result sample, and the retrieval result sample is obtained from the vector dataset fused with the knowledge graph through the index structure;

[0040] The retrieval module is used to input a query vector constructed based on the query instruction into the adaptive retrieval model when a query instruction is received, so as to obtain the retrieval result corresponding to the query instruction.

[0041] The present invention also provides an electronic device including a processor, the processor being configured to perform the steps of the data retrieval method as described in any of the preceding claims when executing a computer program stored in a memory.

[0042] The present invention also provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the data retrieval method as described in any of the preceding claims.

[0043] Finally, the present invention also provides a data retrieval system, including a user interface and a retrieval and update subsystem;

[0044] The user interface includes a user search information input page and a search result display page; the search update subsystem is used to determine the search results that match the received query command by running the steps of the data search method described in the preceding item in the background, and display the search results on the search result display page, while realizing the dynamic updating of the index data and index parameters corresponding to the index structure.

[0045] The advantages of the technical solution provided by this invention are that it adopts a multi-layered index structure with different precision and dynamic update characteristics, which can match the changes in the internal distribution of the vector dataset, maintain the timeliness of the index structure, and help improve the efficiency and accuracy of vector database retrieval; by integrating relevant semantic features of knowledge graphs into the vector dataset, the retrieval process can more accurately parse and match query intent, increase the semantic level of the query, further improve retrieval efficiency and accuracy, and through the adaptive retrieval model, it can match new query patterns and data changes, resulting in a better user experience and faster and more accurate retrieval.

[0046] Furthermore, the present invention also provides corresponding implementation devices, systems, electronic devices, and readable storage media for the data retrieval method, further making the method more practical, and the devices, systems, electronic devices, and readable storage media have corresponding advantages.

[0047] The technical features mentioned above, those to be mentioned below, and those shown individually in the accompanying drawings can be arbitrarily combined with each other, provided that the combined technical features are not contradictory. All feasible combinations of features are the technical content explicitly described herein. Any one of the multiple sub-features contained in the same statement can be applied independently, without necessarily being applied together with other sub-features. It should be understood that the above general description and the following detailed description are merely exemplary and do not limit the invention. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the present invention or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 A flowchart illustrating a data retrieval method provided by the present invention;

[0050] Figure 2 A flowchart illustrating another data retrieval method provided by the present invention;

[0051] Figure 3 A schematic diagram of the structural framework of a specific embodiment of the data retrieval device provided by the present invention;

[0052] Figure 4 A schematic diagram of the structural framework of an electronic device provided by the present invention in a specific embodiment;

[0053] Figure 5 This is a schematic diagram of the structural framework of a specific embodiment of the data retrieval system provided by the present invention;

[0054] Figure 6 This is a schematic diagram of the framework of the data retrieval system provided by the present invention in an exemplary application scenario. Detailed Implementation

[0055] To enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. In this specification, the terms "first," "second," and "third" are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. The term "exemplary" means "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior to or better than other embodiments.

[0056] Vector retrieval technology transforms complex data items into numerical vectors, using vector representations of their positions in multidimensional space. Through various mathematical and computational methods, including but not limited to distance calculation, spatial indexing, deep learning, and approximate nearest neighbor search, it can efficiently and accurately retrieve the desired data information from large-scale vector datasets. Because vector retrieval supports fast and accurate query execution, it is widely used in various applications such as recommender systems, image recognition, and natural language processing.

[0057] Vector database-based retrieval refers to using a database system specifically designed for processing and retrieving vector data to perform retrieval tasks, thereby achieving effective management and rapid retrieval of high-dimensional data. However, related technologies often limit vector database-based retrieval methods to static index structures and single retrieval strategies, making them difficult to match large-scale, dynamically changing datasets. This results in low retrieval efficiency, and in environments with frequent data updates, it's difficult to guarantee the timeliness of the index, easily leading to inaccurate query results. Single retrieval strategies lack parameter optimization and query intent parsing mechanisms, resulting in insufficient relevance and accuracy, failing to fully meet user query needs. Furthermore, the lack of effective result sorting and optimization mechanisms leads to slow query response times, disorganized result display, and difficulty in searching and using results. Ultimately, their practicality and efficiency fail to meet real-world requirements, hindering their application in modern big data application scenarios.

[0058] In view of this, the present invention pre-constructs a multi-layered index structure with at least two layers of different index precision based on the data distribution characteristics of the vector dataset, and dynamically updates the index data and index parameters corresponding to the index structure based on the changes in the data in the index and user query feedback analysis information. When a query command is received, the query vector constructed based on the query command is input into an adaptive retrieval model trained based on the retrieval sample dataset. The retrieval result corresponding to the query command is determined according to the output result of the adaptive retrieval model, thereby solving the drawbacks of related technologies in terms of index timeliness, retrieval relevance accuracy, and query result efficiency. After introducing the technical solution of the present invention, various non-limiting embodiments of the present invention are described in detail below. To better illustrate the present invention, numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present invention can be implemented without these specific details. In some other examples, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present invention.

[0059] Please see first. Figure 1 , Figure 1 This is a flowchart illustrating a data retrieval method provided in this embodiment. This embodiment may include the following:

[0060] S101: Construct a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of the vector dataset in advance.

[0061] The vector dataset in this embodiment is any large-scale vector dataset related to retrieval business. Data distribution characteristics are used to reflect the relationships between data points within the vector dataset. The index structure in this embodiment is a dynamic hierarchical index, with at least two layers. Index precision refers to index granularity, i.e., the difference between the final index result and the correct result, such as whether the index result is an exact value or an approximate range. Since the vector dataset changes in real-time over time, to match the large-scale dynamically changing dataset and ensure the effectiveness of the index in an environment with frequent data updates, thereby improving retrieval efficiency and accuracy, the index structure in this embodiment is also dynamically changing. Dynamic change means that the index data and index parameters corresponding to the index structure are adjusted in real-time, at a fixed frequency, or randomly. The adjustment method is based on changes in the data in the index and user query feedback analysis information. User query feedback analysis information refers to the analysis results regarding the accuracy of the provided index structure and which index results the user viewed. By continuously optimizing the relevant parameters and data of the index structure and continuously analyzing the user's query intent, the relevance and accuracy of the retrieval can be improved, fully meeting the user's query needs.

[0062] S102: An adaptive retrieval model is obtained in advance based on the retrieval sample dataset.

[0063] The retrieval sample dataset contains multiple sets of query vector-retrieval result sample pairs. The total number of query vector-retrieval result sample pairs in the retrieval sample dataset can be flexibly adjusted according to actual conditions, and this invention does not impose any limitation on this. For each set of query vector-retrieval result pairs, the query vector-retrieval result pair includes at least one query vector sample and a corresponding retrieval result sample. The retrieval result sample corresponding to each query vector may include one retrieval result or a set of retrieval results, neither of which affects the implementation of this invention. The retrieval results in the retrieval result sample are obtained from the vector dataset that integrates knowledge graphs through an index structure; in other words, the vector data contained in the vector dataset integrates the features of knowledge graphs to enhance the semantic features of each vector data, thereby better and more accurately understanding the user's query intent. From the perspective of indexing, combining knowledge graphs optimizes the limitations in vector retrieval and also improves the efficiency of information acquisition.

[0064] The adaptive retrieval model in this embodiment can be obtained by training any network model structure using any machine learning algorithm, such as convolutional neural network (CNN) models, various improved CNN structures, and artificial neural network models. The network model structure trained using machine learning algorithms and the retrieval sample dataset is the adaptive retrieval model. Before the gradient update iteration of the adaptive retrieval model, the gradient descent algorithm needs to be initialized, setting the epoch (training period), batch size, weight update period t, and iteration number. For example, the total number of samples in the retrieval sample dataset training can be 60,000 pairs. The adaptive retrieval model is trained for at least 100 training periods. One training period refers to updating the model parameters of the neural network using all training samples in the training set without repetition. Each time, a small batch (mini-batch) of data is used to update the model parameters of the adaptive retrieval model, completing one training cycle. During the gradient update iteration, each iteration uses 500 samples. These 500 query vector-retrieval result pairs are called a small batch (mini-batch) of data, which is the batch size of samples. The iteration count refers to the number of times the batch size of samples is used for training. The number of iterations to complete one epoch is 60000 / 500 = 120. The weight update cycle refers to updating the weights once every t iterations during the training of the adaptive retrieval model.

[0065] S103: When a query instruction is received, the query vector constructed based on the query instruction is input into the adaptive retrieval model, and the retrieval result corresponding to the query instruction is determined based on the output result of the adaptive retrieval model.

[0066] In this embodiment, the query command is the query data entered by the user. Since the retrieval is based on a vector database, it is necessary to convert the user-input data into vector form and use an adaptive retrieval model to locate the data items associated with the query vector, thereby achieving a high-efficiency and high-accuracy retrieval effect and improving the speed and quality of information retrieval.

[0067] In the technical solution provided in this embodiment, an index structure with multiple layers of different precision and dynamic update characteristics is adopted. This structure can match changes in the internal distribution of the vector dataset, maintain the timeliness of the index structure, and improve the efficiency and accuracy of vector database retrieval. By integrating relevant semantic features of knowledge graphs into the vector dataset, the retrieval process can more accurately parse and match query intent, increase the semantic level of the query, and further improve retrieval efficiency and accuracy. The adaptive retrieval model can match new query patterns and data changes, resulting in a better user experience and faster and more accurate retrieval.

[0068] In the above embodiments, no limitation is made on how to construct the index structure. This embodiment also provides an exemplary real-time method for constructing a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of a vector dataset, which may include the following:

[0069] An initial index structure is constructed, and the vector dataset is clustered to determine the cluster to which each data point in the vector dataset belongs and its corresponding cluster center, thereby obtaining cluster center member allocation information. Based on the cluster center member allocation information, the distribution of data points within each cluster is determined through iterative analysis, and cluster internal characteristic analysis information is generated based on the distribution of data points within each cluster. Based on the cluster internal characteristic analysis information, the data and index precision of each index level of the initial index are adjusted, and the adjusted initial index structure is used as the index structure.

[0070] In this embodiment, the initial index structure may include a top-level index, intermediate-level indexes, and a bottom-level index. Alternatively, the initial index structure may be described as including a first-level index, a second-level index, and a third-level index. The top-level index contains pointers to the next level of index. The index data of the intermediate-level indexes is a refinement of the index data within the top-level index. The bottom-level index directly points to the target data item. The index precision of the top-level index is less than that of the intermediate-level indexes, and vice versa. In other words, the top-level index primarily provides a highly generalized view of the dataset, where data is roughly grouped, with each group representing a major data category. The intermediate-level indexes further refine the data based on its characteristics, providing more detailed data grouping and organization, potentially with multiple groups—that is, refining the aforementioned major data categories into multiple categories. The bottom-level index directly points to the specific, precisely grouped data item.

[0071] This embodiment can employ any clustering method to cluster the vector dataset, including but not limited to K-means clustering, hierarchical clustering, and Gaussian mixture model clustering. Initial cluster centers can be determined through random selection or a predefined method. The distance from each data point in the vector dataset to the cluster center is calculated, and data points are assigned to cluster centers. This process is repeated until the change in cluster centers is less than a set threshold. The cluster to which each data point belongs and its corresponding cluster center are recorded, generating cluster center member allocation information, which serves as the basis for subsequent data analysis and index structure optimization. The process of determining the distribution of data points within each cluster through iterative analysis may include iteratively analyzing the data points within each cluster based on the cluster center member allocation information, calculating the density, center deviation, and distance dispersion of data points within the cluster, identifying the distribution characteristics and boundaries of the clusters, obtaining a cluster internal characteristic analysis description based on the density, center deviation, and distance dispersion of data points within the clusters, and analyzing the cluster characteristics based on the cluster internal characteristic analysis description, reconstructing the cluster characteristics in a lower-dimensional space, maintaining the distance and distribution between the original data characteristics, thereby better parsing and mapping the internal structure of the dataset, adjusting the index level and granularity of the initial index structure according to the cluster characteristics, thereby optimizing the initial index structure, and obtaining a dynamic hierarchical index structure that can reflect the true distribution and structural characteristics of the data, thus completing the organization and indexing of a large-scale vector dataset.

[0072] As can be seen from the above, the dynamic multi-level index structure of this embodiment maps the multi-level structure and complexity of the vector dataset, which is beneficial to improving the efficiency and accuracy of subsequent retrieval operations and provides a solid foundation for data retrieval and analysis.

[0073] The above embodiments do not limit how the index structure is dynamically updated. Based on the above embodiments, this embodiment also provides an exemplary method for updating the index structure, which may include the following:

[0074] Based on the update status of the index structure, determine the data update frequency and trend of the index structure. Based on the time series analysis results of the data update frequency and trend of the index structure, determine the data update method for adjusting the index data of each index layer. Based on the time series analysis results of the data update frequency and trend of the index structure and the user query feedback results corresponding to each time series point, determine the parameter update method for adjusting the index parameters of the index structure. Update the index structure based on the data update method and the parameter update method.

[0075] In this embodiment, based on the dynamically hierarchical index structure constructed in the above embodiments, a time-series analysis of the update frequency and trend of data in the index is performed using models such as the autoregressive moving average model and the autoregressive sliding average model. The update strategy for each index layer is adjusted according to the time-series analysis results to generate a data update method. For example, the process of determining the data update method may be as follows: Obtain the update data of the index structure; the update data may include the timestamp of the index structure update, the change type, and the data before and after the update. Based on the update time of the index structure and its corresponding update data, an index change record set is generated according to the time-series sequence. This index change record set is used to analyze the changes in the index structure in chronological order. In other words, an index change history record is generated by real-time monitoring and recording each update of the index structure. This index change history record may include the timestamp, change type, and values ​​before and after the change. By tracking index structure changes, integrating time-series data, and analyzing the index change history, an index change record set is finally generated. This approach employs time-series analysis to analyze the periodicity and trends of data changes in the index change log, yielding statistical update analysis results. Based on these results, an adaptive algorithm is used to determine the data update method for automatically adjusting the index structure. This data update method is used to update the index update frequency, index data storage layout, reconstruction cycle, and data failure criteria for each index layer. Once the index change log is obtained, time-series analysis is used to analyze the index change log, identifying the periodicity and trends of data changes to generate statistical update analysis results. Finally, an adaptive algorithm is used to adjust the update strategy for each index layer, automatically modifying the index update frequency, optimizing the data storage layout, and dynamically adjusting the reconstruction cycle and data failure criteria for each index layer, providing a dynamic and efficient data update strategy framework.

[0076] In this embodiment, based on the aforementioned data update strategy, algorithms such as Random Forest and Adaboost (iterative) can be used to perform pattern recognition on user query feedback, i.e., determine whether the user's query pattern is a selection query, parameter query, crosstab query, operation query, or SQL query. The relationship between query patterns and index performance is analyzed, and index parameters are adjusted accordingly to generate parameter optimization strategies. For example, the parameter optimization generation process may include: determining the target time point in the data update process where the index structure meets preset update conditions based on statistical update analysis results, as a time-series analysis insight; based on the time-series analysis insight, calling an incremental learning algorithm to determine the update requirements and time-series characteristics of the index data in the index structure, to reflect the relationship between user query patterns and index performance; adjusting the index parameters of the index structure based on update requirements and time-series characteristics; the index parameters include index weight adjustment coefficients, query feedback influence factors, and retrieval efficiency optimization indicators; wherein, the index weight adjustment coefficients are used to adjust the parameters of different indexes or features in the dataset. The query feedback influence factor is used to adjust parameters or model performance based on user query behavior and feedback; the retrieval efficiency optimization indicators are parameters or standards used to measure and optimize the performance of the retrieval system. Based on the updated index parameters and the changes in index data before and after the index structure adjustment, a parameter update method is generated. In other words, this embodiment first collects and processes associated time series data based on the data update strategy, analyzes the periodicity and trend of the data, identifies key time points for data updates, and achieves insights into time series analysis. Incremental learning algorithms can be used to analyze the update requirements and time series characteristics of the index data, design update strategies that match data changes, adjust the index layer, and generate an optimized update strategy. Based on this optimized update strategy, index operations are performed to update and process the index data after the index structure adjustment.

[0077] As can be seen from the above, this embodiment updates the data of the dynamic hierarchical index structure, which can match the changes in the internal distribution of the vector dataset and maintain the timeliness of the index structure. By optimizing the parameters of the dynamic hierarchical index structure, it is beneficial to more accurately parse and match the query intent in the retrieval process of the user's query needs, improve the retrieval accuracy, and enhance the user experience.

[0078] The above embodiments do not limit the process of training an adaptive retrieval model based on a retrieval sample dataset. This embodiment also provides an exemplary training process for an adaptive retrieval model, which may include the following:

[0079] Based on graph neural network analysis, the structural characteristics of entity features and relationships in the knowledge graph are analyzed. The entity features of the knowledge graph and the vector data representations of the vector database are fused to obtain multiple semantically enhanced vectors. Features of each semantically enhanced vector are extracted to obtain a feature mapping sample set. For each query vector sample, the similarity between each query vector sample and each feature vector in the feature mapping sample set is calculated. Feature vectors whose similarity meets the preset similarity conditions are selected as the retrieval result samples corresponding to each query vector sample. Based on the loss between each query vector sample and its corresponding retrieval result samples, the model parameters of the pre-built network model structure are continuously iterated and updated until the preset model iteration stopping condition is met, resulting in an adaptive retrieval model.

[0080] In this embodiment, the adjustment methods for index weight adjustment coefficients, query feedback influencing factors, and retrieval efficiency optimization indicators are used as rules or references in the process of constructing and optimizing the knowledge graph. Any graph neural network or graph convolutional network algorithm can be used to construct the graph structure of the knowledge graph. The node features of the graph structure are initialized, neighbor node information aggregation is performed, and the node features are updated using a non-linear activation function to generate knowledge graph structure analysis results. Based on these results, the quantity and type of entity features and vector data in the vector database are analyzed. Feature fusion is performed by combining information from inside and outside the knowledge graph, and the fused features are encoded to generate entity fusion vectors. Based on these vectors, semantic attribute analysis is performed to obtain the text description, keywords, and contextual relationships of the entity fusion vectors. The text description, keywords, and contextual relationships are then fused with the entity fusion vectors. This embodiment, based on a parameter optimization strategy, utilizes a graph neural network to analyze the structural characteristics of entities and relationships in the knowledge graph, integrating text descriptions, keywords, and contextual relationships into the vector data representation. This adds a semantic layer to the vector data, improving semantic retrieval and analysis capabilities, and ultimately enhancing vector retrieval accuracy.

[0081] In this embodiment, the entity features of the knowledge graph and the vector data representations of the vector database are fused to obtain multiple semantically enhanced vectors. Then, convolutional neural networks and artificial neural network models are used to extract features from the semantically enhanced vectors, analyze the correlation between the extracted features and the query results, and adjust the model structure and parameters based on the correlation analysis results to generate an adaptive retrieval model. For example, based on the semantically enhanced vectors, convolutional neural network algorithms or other deep learning algorithms are used to extract features from image data. Multiple differentiated convolutional kernels slide across the input semantically enhanced vectors to extract local features, increase the model's expressive power, reduce the spatial size of the features, and generate a feature mapping set. Based on this feature mapping set, similarity calculation methods such as the Jaccard method and cosine similarity method can be used to calculate the similarity between the feature vectors and the query vectors. The feature vectors are ranked according to similarity to generate a similarity score vector. Each feature vector is assigned a quantitative score for the similarity to the query vector. The results are then sorted according to the similarity retrieval results to provide query results to the user. Based on similarity score vectors, backpropagation and gradient descent algorithms are employed to adjust and optimize parameters, update network weights and biases, and iteratively optimize the network structure and parameters, reducing prediction errors and generating an adaptive retrieval model that can dynamically adjust its behavior based on query feedback. The iterative update of the adaptive retrieval model refers to the update of its model parameters. For example, batch stochastic gradient descent can be used to train the adaptive retrieval model until a preset iteration stopping condition is met. When the preset iteration stopping condition is reached, the trained adaptive retrieval model is obtained, which is capable of matching new query patterns and data changes. The preset iteration stopping condition can be, for example, reaching a pre-set number of iterations, the adaptive retrieval model converging, or the adaptive retrieval model's accuracy reaching a preset accuracy threshold; none of these affect the implementation of this application.

[0082] As can be seen from the above, this embodiment adds a semantic layer to the vector data by fusing the relevant semantic features of the knowledge graph with vector data. The adaptive retrieval model trained based on the semantically enhanced vectors can adaptively match new query patterns and data changes, thereby improving semantic retrieval and analysis capabilities and effectively enhancing retrieval accuracy.

[0083] The above embodiments do not limit how to determine the retrieval results corresponding to the query command based on the output of the adaptive retrieval model. Based on the above embodiments, this embodiment also provides a more precise method for determining the retrieval results, which may include the following:

[0084] The candidate search results in the similarity index vector set are sorted according to their similarity to the query vector. Based on the analysis of users' historical feedback data, the sorted candidate search results are readjusted and the adjusted candidate search results are output as the search results corresponding to the query command.

[0085] In this embodiment, the query vector is input into an adaptive retrieval model. The adaptive retrieval model calculates the similarity between the query vector and each semantic enhancement vector, and scores the similarity. Based on the scoring results, it filters the vector set associated with the query and generates a similarity index. For example: the adaptive retrieval model processes the semantic enhancement vectors in the query vector database, treating each semantic enhancement vector and the query vector in the vector database as a point in vector space. By calculating the angular deviation, it obtains the similarity score between each pair of vectors, i.e., the position score between each pair of vectors, generating a relative position score set. Based on the relative position score set, the similarity scores between vectors are analyzed, and a matching score threshold is dynamically determined by referring to the similarity score distribution in the query context. Only when the similarity score between vectors exceeds the threshold is it considered consistent with the query vector and thus selected into the filtered matching set, ultimately generating the filtered matching set. Based on the filtered matching set, an index structure is created and updated, and the filtered vectors are sorted and categorized to optimize the retrieval process and generate a similarity index. Based on the similarity index, the similarity scoring results are sorted, and the display order of the retrieval results is adjusted according to the sorting results, providing vector data arranged in similarity score order, generating sorted retrieval results. For example, the process of generating sorted search results may include: based on a similarity index, such as using a quicksort method to select an element in the data as a benchmark, rearranging the sequence, arbitrarily arranging identical values, sorting sub-sequences with values ​​less than the benchmark and sub-sequences with values ​​greater than the benchmark, generating a segmented sorting score table; based on the segmented sorting score table, dividing the sequence into small units, sorting them, and then merging them into a complete ordered sequence, ensuring that the order of elements is maintained through a stable sorting method, thereby generating a stable score table; indexing the sorted sequence based on the score table, processing the sorted sequence, matching the new position of the element with the corresponding vector in the vector dataset, adjusting the display order of the search results according to the order of the similarity scores, and generating sorted search results.

[0086] Considering the different preferences and characteristics of users, such as their profession, work, and interests, the sorted search results can be further analyzed based on user feedback data to adjust and optimize the results, meeting user query needs and generating targeted search output. For example, during the training process of the adaptive retrieval model, sorting optimization can also be performed: based on the sorted search results, user feedback data is mined and analyzed; key emotion words are extracted using big data language models such as sentiment analysis models; user emotion tendencies are assessed; user satisfaction trends are evaluated; and emotion tendency analysis results are generated. Based on the emotion tendency analysis results, the relationship between emotion data and user query behavior is analyzed, statistical correlations are identified, a connection framework is constructed, and user satisfaction correlation analysis results are generated. Based on the user satisfaction correlation analysis results, index parameters are adjusted; the performance of the adaptive retrieval model is improved by iteratively building a decision tree and optimizing the loss function; index parameters are refined and optimized, including but not limited to the weight allocation of query results and the optimization of the execution path; the search results are re-sorted and adjusted; and finally, targeted search output is generated.

[0087] As shown above, this embodiment iteratively optimizes the retrieval process through an adaptive retrieval model and similarity index, making queries faster and more accurate. By employing an effective result sorting and optimization mechanism to rank the retrieval results, the display order of the results is improved, enhancing the user experience and increasing the practicality of the retrieval.

[0088] To enable those skilled in the art to clearly understand the technical solution of this invention, an exemplary embodiment is also provided. Please refer to [link to example embodiment]. Figure 2 It may include the following:

[0089] S1: Based on a large-scale vector dataset, the data is grouped, initial cluster centers are selected, the distance from data nodes to cluster centers is calculated, data points are assigned to cluster centers, and then the distribution characteristics within the dataset are updated and analyzed. Based on the clustering results, the index level and index precision are dynamically adjusted to generate a dynamically hierarchical index structure.

[0090] S2: Based on dynamic hierarchical indexing, an autoregressive moving average model is applied to perform time-series analysis on the update frequency and trend of index data in the index structure, and the update strategy of each index layer of the index structure is adjusted according to the time-series analysis results to generate a data update strategy.

[0091] S3: Based on the data update strategy, the random forest algorithm is used to perform pattern recognition on user query feedback, analyze the relationship between query patterns and index performance, adapt and adjust the index parameters of the index structure, and generate parameter optimization strategies.

[0092] S4: Based on parameter optimization strategies, graph neural networks are used to analyze the structural characteristics of entities and relationships in knowledge graphs, and semantic information is integrated into vector data representations to generate semantically enhanced vectors.

[0093] S5: Based on semantically enhanced vectors, a convolutional neural network is used to extract features from the vector data, analyze the correlation between the extracted features and the query results, and adjust the model structure and parameters according to the correlation analysis results to generate an adaptive retrieval model.

[0094] S6: Based on the adaptive retrieval model, perform similarity calculation, score the similarity between the query vector and the semantically enhanced vectors in the vector database, filter the vector set associated with the query vector based on the score results, and generate a similarity index.

[0095] S7: Based on the similarity index, sort the similarity score results, adjust the display order of the search results according to the sorting results, provide vector data arranged in the order of similarity scores, and generate sorted search results.

[0096] S8: Based on the sorted search results, analyze user feedback data, adjust and optimize the search results, and output the optimized sorted results as the final search results.

[0097] As shown above, this embodiment employs a dynamic hierarchical index structure and data update strategy, which can match changes in the internal distribution of the dataset, maintain the timeliness of the index structure, and improve the efficiency and accuracy of vector database retrieval. Through parameter optimization strategies and semantically enhanced vectors, the retrieval process can more accurately parse and match query intent, increasing the semantic level of the query and effectively improving retrieval efficiency and user satisfaction. Through the design of an adaptive retrieval model and similarity index, the retrieval process is iteratively optimized, making queries faster and more accurate. The use of a fast sorting algorithm to sort the retrieval results improves the display order of the results, enhances the accuracy of the final retrieval results, and improves the user experience.

[0098] It should be noted that there is no strict order of execution between the steps in this invention. As long as they conform to the logical order, these steps can be executed simultaneously or in a certain preset order. Figures 1-2 This is just an illustrative example and does not mean that this is the only possible execution order.

[0099] This invention also provides a corresponding apparatus for the data retrieval method, further enhancing the method's practicality. The apparatus can be described from both a functional module perspective and a hardware perspective. The data retrieval apparatus provided by this invention is described below. This apparatus is used to implement the data retrieval method provided by this invention. In this embodiment, the data retrieval apparatus may include or be divided into one or more program modules. These one or more program modules are stored in a storage medium and executed by one or more processors to complete the data retrieval method disclosed in Embodiment 1. The program module referred to in this embodiment refers to a series of computer program instruction segments capable of performing a specific function, which is more suitable than the program itself for describing the execution process of the data retrieval apparatus in the storage medium. The following description will specifically introduce the functions of each program module in this embodiment. The data retrieval apparatus described below and the data retrieval method described above can be referred to in correspondence.

[0100] From the perspective of functional modules, see Figure 3 , Figure 3 This is a structural diagram of the data retrieval device provided in this embodiment under one specific implementation. The device may include:

[0101] The dynamic hierarchical index building module 301 is used to pre-build a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of the vector dataset; the index data and index parameters corresponding to the index structure are dynamically updated based on the changes in the data in the index and user query feedback analysis information.

[0102] The retrieval model training module 302 is used to pre-train an adaptive retrieval model based on the retrieval sample dataset. The retrieval sample dataset contains multiple sets of query vector-retrieval result sample pairs. Each query vector-retrieval result pair includes a query vector sample and a corresponding retrieval result sample. The retrieval result sample is obtained from the vector dataset fused with the knowledge graph through an index structure.

[0103] The retrieval module 303 is used to input the query vector constructed based on the query command into the adaptive retrieval model when a query command is received, so as to obtain the retrieval result corresponding to the query command.

[0104] For example, in some embodiments of this example, the dynamic hierarchical index construction module 301 described above can also be used for:

[0105] Construct an initial index structure, which includes a top-level index, intermediate-level indexes, and a bottom-level index. The top-level index contains pointers to the next level index, and the index data of the intermediate-level indexes is a refinement of the index data within the top-level index. The bottom-level index directly points to the target data item. The index precision of the top-level index is less than that of the intermediate-level indexes, and the index precision of the intermediate-level indexes is less than that of the bottom-level indexes.

[0106] Clustering is performed on the vector dataset to determine the cluster to which each data point in the vector dataset belongs and its corresponding cluster center, so as to obtain the cluster center member allocation information;

[0107] Based on the cluster center member allocation information, the distribution of data points in each cluster is determined by iterative analysis of the data points in each cluster, and cluster internal characteristic analysis information is generated based on the distribution of data points in each cluster.

[0108] Based on the cluster internal characteristic analysis information, the data and index precision of each index level of the initial index are adjusted, and the adjusted initial index structure is used as the index structure.

[0109] For example, in some other embodiments of this example, the above-described apparatus further includes an update and maintenance module, which is used for:

[0110] Based on the update status of the index structure, determine the data update frequency and change trend in the index structure; based on the time series analysis results of the data update frequency and change trend in the index structure, determine the data update method used to adjust the index data of each index layer.

[0111] Based on the time series analysis results of the data update frequency and change trend in the index structure and the user query feedback results corresponding to each time series point, the parameter update method for adjusting the index parameters of the index structure is determined.

[0112] The index structure is updated based on data update methods and parameter update methods.

[0113] For example, in some other embodiments of this example, the above-described apparatus further includes an update and maintenance module, which can be further used for:

[0114] Retrieve updated data for the index structure; the updated data includes the timestamp of the index structure update, the change type, and the data before and after the update.

[0115] Based on the update time of the index structure and its corresponding update data, an index change record set is generated according to the time sequence; the index change record set is used to analyze the changes in the index structure in chronological order.

[0116] The time series analysis method is used to analyze the periodicity and trend of data changes in the index change record set in order to obtain statistical update analysis results;

[0117] Based on the statistical update analysis results, an adaptive algorithm is invoked to determine the data update method for automatically adjusting the index structure. The data update method is used to update the index update frequency, index data storage layout, reconstruction cycle, and data failure judgment conditions of each index layer of the index structure.

[0118] Based on the results of statistical update analysis, the target time point in the data update process where the index structure meets the preset update conditions is determined, so as to provide insights into the data through time-series analysis.

[0119] Based on time-series analysis to gain insights into the data, incremental learning algorithms are used to determine the update requirements and time-series characteristics of the index data in the index structure, in order to reflect the relationship between user query patterns and index performance.

[0120] The index parameters of the index structure are adjusted based on update requirements and time-series characteristics; the index parameters include index weight adjustment coefficients, query feedback impact factors, and retrieval efficiency optimization indicators;

[0121] Based on the index parameters of the updated index structure and the changes in index data before and after the index structure adjustment, a parameter update method is generated.

[0122] For example, in some other embodiments of this example, the retrieval model training module 302 described above can also be used for:

[0123] The entity features of the knowledge graph and the vector data representations of the vector database are fused to obtain multiple semantically enhanced vectors. The features of each semantically enhanced vector are extracted to obtain a feature mapping sample set.

[0124] For each query vector sample, calculate the similarity between each query vector sample and each feature vector in the feature mapping sample set, and select the feature vectors whose similarity meets the preset similarity conditions as the retrieval result samples corresponding to each query vector sample.

[0125] Based on the loss between each query vector sample and its corresponding retrieval result sample, the model parameters of the pre-built network model structure are continuously updated iteratively until the preset model iteration stopping condition is met, and then an adaptive retrieval model is obtained.

[0126] For example, in some other embodiments of this example, the retrieval module 303 described above can also be used for:

[0127] The candidate search results in the similarity index vector set are sorted according to their similarity to the query vector.

[0128] Based on the analysis of users' historical feedback data, the sorted candidate search results are readjusted, and the adjusted candidate search results are output as the search results corresponding to the query instructions.

[0129] The functions of each functional module of the data retrieval device in this embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0130] As can be seen from the above, this embodiment can effectively improve the retrieval efficiency and accuracy based on vector databases.

[0131] The data retrieval device mentioned above is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. For example... Figure 4 As shown, the electronic device includes a memory 40 for storing a computer program; and a processor 41 for executing the computer program to implement the steps of the data retrieval method as described in any of the above embodiments.

[0132] The processor 41 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 41 may also be a controller, microcontroller, microprocessor, or other data processing chip. The processor 41 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 41 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 41 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 41 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0133] The memory 40 may include one or more computer-readable storage media, which may be non-transitory. The memory 40 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the memory 40 may be an internal storage unit of an electronic device, such as a server hard drive. In other embodiments, the memory 40 may be an external storage device of an electronic device, such as a plug-in hard drive on a server, a Smart Media Card (SMC), a Secure Digital (SD) card, or a Flash Card. Furthermore, the memory 40 may include both internal and external storage units of the electronic device. The memory 40 can be used not only to store application software and various types of data installed on the electronic device, such as code in the process of executing a data retrieval method, but also to temporarily store data that has been output or will be output. In this embodiment, the memory 40 is used to store at least the following computer program 401, which, after being loaded and executed by the processor 41, can implement the relevant steps of the data retrieval method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, and the storage method may be temporary storage or permanent storage. The operating system 402 may include Windows, Unix, Linux, etc. The data 403 may include, but is not limited to, data corresponding to data retrieval results.

[0134] In some embodiments, the aforementioned electronic device may further include a display screen 42, an input / output interface 43, a communication interface 44 (or network interface), a power supply 45, and a communication bus 46. The display screen 42 and input / output interface 43, such as a keyboard, are user interfaces. Exemplary user interfaces may also include standard wired interfaces, wireless interfaces, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a display screen or display unit, used to display information processed in the electronic device and to display a visual user interface. The communication interface 44 may exemplary include wired and / or wireless interfaces, such as a Wi-Fi interface, a Bluetooth interface, etc., typically used to establish communication connections between the electronic device and other electronic devices. The communication bus 46 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0135] Those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, such as sensors 47 that perform various functions.

[0136] The functions of each functional module of the electronic device in this embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0137] As can be seen from the above, this embodiment can effectively improve the retrieval efficiency and accuracy based on vector databases.

[0138] It is understood that if the data retrieval methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, registers, hard disks, multimedia cards, card-type memories (such as SD or DX memories), magnetic memories, removable disks, CD-ROMs, magnetic disks, or optical disks, and various other media capable of storing program code.

[0139] Based on this, the present invention also provides a readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of the data retrieval method as described in any of the above embodiments are given.

[0140] Finally, the present invention also provides a data retrieval system, see [link to relevant documentation]. Figure 5 It may include:

[0141] The data retrieval system may include a user interface 501 and a retrieval update subsystem 502. The user interface 501 may include a user retrieval information input page and a retrieval result display page. The retrieval update subsystem 502 is used to determine the retrieval result that matches the received query command by running the steps of the data retrieval method as described in any previous embodiment in the background, and to display the retrieval result on the retrieval result display page. At the same time, it realizes dynamic updating of the index data and index parameters corresponding to the index structure.

[0142] For example, such as Figure 6As shown, the retrieval and update subsystem 502 may include a data clustering module, an index building module, a data update and analysis module, a query feedback analysis module, a semantic enhancement processing module, a feature extraction and model adjustment module, and a similarity calculation and ranking module. The system comprises the following modules: a data clustering module, an index building module, and a semantic enhancement module. The data clustering module analyzes the distribution characteristics of a large-scale vector dataset and generates cluster center member allocation information. The index building module analyzes clustering characteristics, adjusts index levels and granularity, optimizes the index structure, and forms a dynamic hierarchical index based on the cluster center member allocation information. The data update analysis module monitors and records index structure updates in real time, analyzes the periodicity and trend of index changes, and generates data update strategies. The query feedback analysis module collects and processes user query information based on the data update strategies, analyzes the relationship between query patterns and index performance, adapts retrieval parameters, and generates parameter optimization strategies. The semantic enhancement module analyzes the structural characteristics of the knowledge graph based on the parameter optimization strategies, integrates vector data into the knowledge graph representation, increases the semantic level of the vector data, and generates semantically enhanced vectors. The feature extraction and model adjustment module extracts features and analyzes correlations based on semantically enhanced vectors, adjusts model structure and parameters, and generates an adaptive retrieval model. The similarity calculation and ranking module scores query vectors and vectors in the database based on the adaptive retrieval model, filters vector sets associated with the query, adjusts the display order of retrieval results, optimizes retrieval results, and generates targeted retrieval output.

[0143] As shown above, the data clustering module in this embodiment analyzes the internal distribution characteristics of the dataset, laying the foundation for data organization and accelerating retrieval speed. The index building module optimizes the index structure through a multi-dimensional scaling algorithm, and the resulting dynamic hierarchical index enhances the system's adaptability to data changes. The data update analysis module monitors index updates in real time to ensure the timeliness and accuracy of retrieval results. The query feedback analysis module applies the random forest algorithm to analyze the relationship between user query patterns and index performance, adapting retrieval parameters to closely meet user needs. The semantic enhancement processing module combines vector data with knowledge graphs to improve the semantic level of data and enhance the relevance of retrieval results. The feature extraction and model adjustment module extracts features and optimizes the model through convolutional neural networks, and the generated adaptive retrieval model self-optimizes according to changes in data and user behavior. The similarity calculation and ranking module ensures that retrieval results are accurately ranked according to relevance, providing targeted output, meeting users' needs for efficient and accurate retrieval, and improving the overall system performance and user experience. For handling large-scale vector data retrieval scenarios, it demonstrates key practical value and significant beneficial effects, including improved retrieval accuracy, enhanced system adaptability, and increased user satisfaction. Therefore, the data retrieval system provided in this embodiment optimizes the performance of large-scale vector data retrieval, and improves accuracy, efficiency and user satisfaction.

[0144] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the hardware disclosed in the embodiments, including devices and electronic equipment, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0145] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0146] The data retrieval method, apparatus, system, electronic device, and readable storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that, based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A data retrieval method, characterized in that, include: A multi-layered index structure with at least two layers of different index precision is constructed in advance based on the data distribution characteristics of the vector dataset; the index data and index parameters corresponding to the index structure are dynamically updated based on the changes in the data in the index and user query feedback analysis information; An adaptive retrieval model is pre-trained based on a retrieval sample dataset. The retrieval sample dataset contains multiple query vector-retrieval result sample pairs. Each query vector-retrieval result pair includes a query vector sample and a corresponding retrieval result sample. The retrieval result samples are obtained from a vector dataset fused with a knowledge graph through the index structure. The training process of the adaptive retrieval model includes: analyzing the entity features and relational structural characteristics of the knowledge graph based on a graph neural network, fusing the entity features of the knowledge graph with the vector data representations of each vector database to obtain multiple semantic enhancement vectors, extracting features from each semantic enhancement vector to obtain a feature mapping sample set; calculating the similarity between each query vector sample and each feature vector in the feature mapping sample set, selecting feature vectors whose similarity satisfies a preset similarity condition as the retrieval result samples corresponding to each query vector sample; iteratively updating the model parameters of the pre-built network model structure based on the loss between each query vector sample and its corresponding retrieval result samples until a preset model iteration stopping condition is met, thus obtaining the adaptive retrieval model; the output of the adaptive retrieval model is a similarity index vector set associated with the query command. When a query command is received, the query vector constructed based on the query command is input into the adaptive retrieval model. The retrieval result corresponding to the query command is determined according to the output of the adaptive retrieval model: the candidate retrieval results in the similarity index vector set are sorted according to their similarity to the query vector; the sorted candidate retrieval results are readjusted based on the analysis of the user's historical feedback data, and the adjusted candidate retrieval results are output as the retrieval result corresponding to the query command.

2. The data retrieval method according to claim 1, characterized in that, The method of constructing a multi-layered index structure with at least two layers of different index precision based on the data distribution characteristics of the vector dataset includes: An initial index structure is constructed, which includes a top-level index, intermediate-level indexes, and a bottom-level index. The top-level index contains pointers to the next-level index, and the index data of the intermediate-level indexes is a refinement of the index data within the top-level index. The bottom-level indexes directly point to the target data items. The index precision of the top-level index is less than that of the intermediate-level indexes, and the index precision of the intermediate-level indexes is less than that of the bottom-level indexes. Clustering is performed on the vector dataset to determine the cluster to which each data point in the vector dataset belongs and its corresponding cluster center, so as to obtain the cluster center member allocation information; Based on the cluster center member allocation information, the distribution of data points in each cluster is determined by iterative analysis of the data points in each cluster, and cluster internal characteristic analysis information is generated based on the distribution of data points in each cluster. Based on the cluster internal characteristic analysis information, the data and index precision of each index level of the initial index are adjusted, and the adjusted initial index structure is used as the index structure.

3. The data retrieval method according to claim 1, characterized in that, After constructing a multi-layered index structure with at least two layers of different index precision based on the data distribution characteristics of the vector dataset, the method further includes: Based on the update status of the index structure, determine the data update frequency and change trend in the index structure; based on the time series analysis results of the data update frequency and change trend in the index structure, determine the data update method for adjusting the index data of each index layer. Based on the time series analysis results of the data update frequency and change trend in the index structure and the user query feedback results corresponding to each time series point, the parameter update method for adjusting the index parameters of the index structure is determined. The index structure is updated based on the data update method and the parameter update method.

4. The data retrieval method according to any one of claims 1 to 3, characterized in that, After constructing a multi-layered index structure with at least two layers of different index precision based on the data distribution characteristics of the vector dataset, the method further includes: Obtain the updated data of the index structure; the updated data includes the timestamp of the index structure update, the change type, and the data before and after the update. Based on the update time of the index structure and its corresponding update data, an index change record set is generated according to a time sequence; the index change record set is used to analyze the changes in the index structure in chronological order. The time series analysis method is used to analyze the periodicity and trend of data changes in the index change record set to obtain statistical update analysis results; Based on the statistical update analysis results, an adaptive algorithm is invoked to determine the data update method for automatically adjusting the index structure; the data update method is used to update the index update frequency, index data storage layout, reconstruction cycle, and data failure judgment conditions of each index layer of the index structure. Based on the statistical update analysis results, the target time point in which the index structure meets the preset update conditions during the data update process is determined, so as to provide insights into the data through time-series analysis. Based on the time-series analysis insights, an incremental learning algorithm is invoked to determine the update requirements and time-series characteristics of the index data in the index structure, in order to reflect the relationship between user query patterns and index performance. The index parameters of the index structure are adjusted based on the update requirements and the time-series characteristics; the index parameters include index weight adjustment coefficients, query feedback impact factors, and retrieval efficiency optimization indicators. Based on the index parameters of the updated index structure and the changes in index data before and after the index structure adjustment, a parameter update method is generated.

5. A data retrieval device, characterized in that, include: The dynamic hierarchical index building module is used to pre-build a multi-layered index structure with at least two layers having different index precisions based on the data distribution characteristics of the vector dataset; the index data and index parameters corresponding to the index structure are dynamically updated based on the changes in the data in the index and user query feedback analysis information; A retrieval model training module is used to pre-train an adaptive retrieval model based on a retrieval sample dataset. The retrieval sample dataset contains multiple sets of query vector-retrieval result sample pairs. Each query vector-retrieval result pair includes a query vector sample and a corresponding retrieval result sample. The retrieval result samples are obtained from the vector dataset fused with the knowledge graph through the index structure. The training process of the adaptive retrieval model includes: analyzing the entity features and structural characteristics of the knowledge graph based on a graph neural network, fusing the entity features of the knowledge graph with the vector data representations of the vector database to obtain multiple semantic enhancement vectors, extracting features from each semantic enhancement vector to obtain a feature mapping sample set; calculating the similarity between each query vector sample and each feature vector in the feature mapping sample set, selecting feature vectors whose similarity satisfies a preset similarity condition as the retrieval result samples corresponding to each query vector sample; iteratively updating the model parameters of the pre-built network model structure based on the loss between each query vector sample and its corresponding retrieval result samples until a preset model iteration stopping condition is met, thus obtaining the adaptive retrieval model; the output of the adaptive retrieval model is a similarity index vector set associated with the query command. The retrieval module is used to input a query vector constructed based on the query instruction into the adaptive retrieval model when a query instruction is received, so as to obtain the retrieval result corresponding to the query instruction; The retrieval module is further configured to: sort the candidate retrieval results in the similarity index vector set according to their similarity to the query vector; readjust the sorted candidate retrieval results based on the analysis of the user's historical feedback data; and output the adjusted candidate retrieval results as the retrieval results corresponding to the query instruction.

6. An electronic device, characterized in that, It includes a processor and a memory, the processor being configured to implement the steps of the data retrieval method as described in any one of claims 1 to 4 when executing a computer program stored in the memory.

7. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data retrieval method as described in any one of claims 1 to 4.

8. A data retrieval system, characterized in that, This includes the user interface and the retrieval and update subsystem; The user interface includes a user search information input page and a search result display page; the search update subsystem is used to determine the search results that match the received query command by running the steps of the data search method as described in any one of claims 1 to 4 in the background, and to display the search results on the search result display page, while simultaneously dynamically updating the index data and index parameters corresponding to the index structure.

Citation Information

Patent Citations

  • Mass big data retrieval method and system

    CN110162528A

  • Graph neural network model and method for performing entity alignment based on relation context

    CN113157935A