A query processing method and system of fusing multi-source heterogeneous storage engines
By integrating query processing methods from multiple heterogeneous storage engines, a directed acyclic execution dependency graph is compiled in real time and cascading queries are performed. This solves the problems of I/O congestion and memory overflow in complex systems, achieves efficient resource scheduling and result fusion, and improves system availability and response speed.
Patent Information
- Application Number
- CN202611708973.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-11-02
- Publication Date
- 2026-11-27
AI Technical Summary
Existing multimodal retrieval solutions suffer from low-level computer I/O congestion and memory overflow when faced with complex long-link requests. They lack resource scheduling mechanisms under high concurrency, cannot adapt to data distribution and workload time drift, and lack efficient cache invalidation and fault degradation transfer mechanisms, which affect the availability of complex industrial systems.
A query processing method integrating multi-source heterogeneous storage engines is adopted. By obtaining the request feature vector of composite query requests, a directed acyclic execution dependency graph is compiled in real time using a two-level caching architecture and adaptive weight dynamic calibration loop. The heterogeneous storage nodes are scheduled to execute queries in a cascade manner. Combined with memory level monitoring, streaming batch execution scheduling is performed to achieve dynamic reversible cascading and result fusion of heterogeneous database nodes.
It significantly reduces cross-database computational redundancy and memory overhead, solves the problems of system I/O overload and search space explosion in large-scale heterogeneous storage systems during concurrent queries, and improves system availability and response efficiency.
Smart Images

Figure CN123178698A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of multi-source data scheduling and complex system architecture design, and in particular to a query processing method and system that integrates multi-source heterogeneous storage engines. Background Technology
[0002] With the evolution of enterprise management system architecture, multimodal retrieval (such as a simple overlay of RAG+GraphRAG) has become the industry norm. Existing solutions mostly employ static compilation, failing to establish underlying constraints on the retrieval scope between heterogeneous databases. Furthermore, they lack resource scheduling mechanisms for high concurrency, leading to indiscriminate full-database scans when facing complex, long-chain requests, causing severe low-level I / O congestion and memory overflows. In addition, existing technologies often use static weight allocation, which cannot adapt to data distribution and workload temporal shifts, and lacks efficient cache invalidation and fault tolerance mechanisms, limiting their availability in complex industrial systems.
[0003] Based on the above problems, there is an urgent need to provide a new multi-source data scheduling scheme. Summary of the Invention
[0004] The purpose of this application is to provide a query processing method and system that integrates multiple heterogeneous storage engines, which can effectively solve engineering and technical problems such as system I / O overload, parameter drift and single point of failure faced by large-scale heterogeneous storage systems (relational databases, graph databases, vector databases, data lakes) during concurrent queries.
[0005] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a query processing method that integrates multiple heterogeneous storage engines, including: Obtain a composite query request and extract the request feature vector of the composite query request; the request feature vector is used to characterize the retrieval capability requirements of the composite query request for multiple heterogeneous storage nodes; the multiple heterogeneous storage nodes include nodes of at least two different storage types; Based on request feature vectors, a two-level caching architecture is used to determine the corresponding directed acyclic execution dependency graph. The two-level caching mechanism works as follows: if the request feature vector hits the compilation result cache of the directed acyclic execution dependency graph, the corresponding directed acyclic execution dependency graph is directly retrieved; if it misses, the directed acyclic execution dependency graph is generated in real-time based on the request feature vector and a feature discrimination weight matrix with adaptive weight dynamic calibration loops. The directed acyclic execution dependency graph includes multiple dynamically instantiated execution nodes and edges representing the execution order and parameter passing dependencies; each execution node corresponds to a corresponding heterogeneous storage node among the multiple heterogeneous storage nodes. Based on the directed acyclic execution dependency graph, the underlying heterogeneous storage nodes are scheduled to execute queries in a cascade manner; re-optimization checkpoints are set between each execution node, and streaming batch execution scheduling is performed in conjunction with memory level monitoring; the search results of the preceding heterogeneous storage nodes are used as the filtering or starting conditions of the subsequent heterogeneous storage nodes to converge the search space of the subsequent heterogeneous storage nodes. Based on a unified entity identifier, the retrieval results returned by each heterogeneous storage node are associated, merged, and prioritized to obtain the merged query results.
[0006] Secondly, this application provides a query processing system that integrates multiple heterogeneous storage engines, including: Heterogeneous data storage and execution nodes include link-independent relational database nodes, vector database nodes, graph database nodes, and data lake nodes. Among them, relational database nodes are responsible for strong transaction detail storage; vector database nodes are responsible for high-dimensional floating-point feature storage and distance calculation; graph database nodes are responsible for entity topology association and edge density calculation; and data lake nodes are responsible for persistent storage and append writing of historical logs, semi-structured data, or large-scale data. The underlying log capture and synchronization bus module is connected to the underlying change log of the main storage node. It is used to listen for data change events and, after event format conversion and unified entity identifier mapping, asynchronously synchronize the change events to the vector database node, graph database node and data lake node through a distributed message queue and corresponding storage adapter. The flow is directed to a dynamic compilation and scheduling gateway, which receives composite query requests and extracts request feature vectors, and compiles and generates a directed acyclic execution dependency graph in real time based on the request feature vectors, and schedules the heterogeneous data storage and execution nodes to execute queries in a cascade manner based on the directed acyclic execution dependency graph; wherein, the retrieval results of the preceding nodes are used as filtering conditions or starting conditions for the following nodes to converge the search space of the following nodes. The cross-database association and fusion module is connected to the output end of each heterogeneous data storage and execution node, and is used to associate, fuse and sort the retrieval results returned by each heterogeneous data storage and execution node based on a unified entity identifier.
[0007] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a query processing method and system that integrates multiple heterogeneous storage engines. By extracting the request feature vector of the composite query request, it ensures that the multi-dimensional features of the query request can be extracted. Combined with an adaptive weight dynamic calibration mechanism based on execution feedback, and based on a preset feature discrimination weight matrix, a Directed Acyclic Graph (DAG) is generated in real time to determine the triggering order of different underlying storage engines in real time (e.g., whether the graph database first converges the topological boundary and then passes the entity identifier to the vector library for local scanning; or whether the vector library first performs synonym generalization and then drives the graph database retrieval). The search space of the subsequent nodes is strictly converged through the retrieval results of the preceding nodes. This allows heterogeneous database nodes to achieve dynamic and reversible cascading based on request features, significantly reducing cross-database computational redundancy and memory overhead. During the cascading execution, the system introduces a two-level caching architecture and a runtime DAG dynamic re-optimization mechanism. When the result set returned by the preceding node exceeds a threshold, a re-optimization checkpoint is triggered to avoid search space explosion. Meanwhile, through memory pressure-aware streaming execution scheduling and unified entity identification, the retrieval results returned by each heterogeneous storage node are correlated, fused, and sorted. This application can solve the engineering problems of system I / O overload and search space explosion faced by large-scale heterogeneous storage systems (relational databases, graph databases, vector databases, data lakes) during concurrent queries. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a schematic diagram of a query processing method integrating multi-source heterogeneous storage engines in one embodiment of this application. Detailed Implementation
[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0011] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0012] In one exemplary embodiment, such as Figure 1 As shown, a query processing method integrating multi-source heterogeneous storage engines is provided, suitable for high-concurrency business scenarios such as semiconductor manufacturing and complex industrial supply chain workflows that require processing massive amounts of entity nodes and multi-dimensional heterogeneous data associations. This method is executed by computer devices, specifically by a terminal or server alone, or by both. In this embodiment, the method includes the following steps S101 to S104: S101, Obtain the composite query request and extract the request feature vector of the composite query request; the request feature vector is used to characterize the retrieval capability requirements of the composite query request for multiple heterogeneous storage nodes; the multiple heterogeneous storage nodes include nodes of at least two different storage types; S101 specifically includes: The composite query request is subjected to lexical parsing (using word segmentation and entity recognition algorithms in natural language processing to extract query keywords and intent range) and feature processing (mapping the parsed intent into specific numerical features based on a preset rule engine or classification model) to extract request feature vectors that quantitatively represent the technical requirements of the composite query request; the technical requirements include accurate matching weight, semantic ambiguity tolerance weight, graph network traversal hop count weight, and time sensitivity weight.
[0013] Specifically, request feature vectors for A dimensional vector whose internal elements can be represented, for example, as These represent the technical requirements of the query for precise matching weight, semantic ambiguity tolerance weight, graph network traversal hop count weight, and time sensitivity weight, respectively.
[0014] As a specific example, the specific process for assigning each weight is as follows: 1. Precisely match weights ( The process of determining ) (1) Extraction logic: Using the Named Entity Recognition (NER) model and regular expressions, the query request is scanned to identify strongly constrained entities (such as primary key ID, order number, device MAC address) and absolute semantic modifiers (such as "strictly equal to", "must contain", "exact search").
[0015] (2) Quantification rules: When the query request contains a clear unique identifier or strong constraint words, the system assigns a higher score (e.g., close to 1.0) through the preset rule engine; if it only contains common nouns and no strong constraint words, the score is lower.
[0016] (3) Example: "Query the detailed status of order number PO-20261001". Since an exact order number is present, the system calculates .
[0017] 2. Determination process of semantic ambiguity tolerance weight ( ): (1) Extraction logic: The system detects whether there are indicator words of ambiguous intent in the query statement (such as "similar", "approximately", "potential", "related recommendations") through lexical analysis. Meanwhile, a pre-trained natural language classification model can be used to calculate the cosine similarity between the semantic vector of the current query intent and the preset "exploratory query" sample library.
[0018] (2) Quantification rule: The more indicator words there are, or the higher the vector similarity with "exploratory queries", the larger the weight; when is extremely high, the system usually performs reverse suppression to lower .
[0019] (3) Example: "Help me find potential risk cases similar to ERP system crashes". The system recognizes "similar" and "potential", determines strong semantic divergence, and calculates .
[0020] 3. Determination process of graph network traversal hop count weight ( ): (1) Extraction logic: The system invokes the Dependency Parsing algorithm to parse the entity association chain in the query request. It focuses on counting the possessive conjunctions between entities (such as consecutive occurrences of "的") and the nesting depth of relational verbs (for example, "A 的 B 的 C" or "A invested in B, and B holds controlling stake in C").
[0021] (2) Quantification rule: The system maps the identified relational nesting depth to a specific hop count weight and processes it through a normalization function. For example, when there is no nesting relationship, the hop count weight approaches 0; 1 layer of nesting corresponds to 0.3, 2 layers correspond to 0.6, and 3 or more layers of complex network relationships approach 1.0.
[0022] (3) Example: "Find the ultimate controlling shareholder of all secondary suppliers of the involved enterprise A". The system identifies the multi-hop network relationship of "Enterprise A > Secondary Supplier > Ultimate Controlling Shareholder" and calculates .
[0023] 4. Determination process of time sensitivity weight ( ): (1) Extraction logic: The system uses the TimeNER engine to extract time adverbs (such as "latest", "past 24 hours", "2022 year") from the query request, and combines them with the preset timeliness attributes of the queried business entity (for example, the timeliness of "transaction flow" is inherently higher than that of "basic business information").
[0024] (2) Quantification rules: When extracting modifiers that represent the near-term, or when the time is not specified but involves high-frequency changing entities, the system assigns high weight; when querying a large historical interval, it assigns low weight.
[0025] (3) Example: "Monitor abnormal access logs of this IP address in the past 10 minutes". Since it clearly includes a very short recent time window, the system calculates that .
[0026] S102, based on the request feature vector, a two-level caching architecture is used to determine the corresponding directed acyclic execution dependency graph. The two-level caching architecture works as follows: if the request feature vector hits the compilation result cache of the directed acyclic execution dependency graph, the corresponding directed acyclic execution dependency graph is directly retrieved; if it misses, the directed acyclic execution dependency graph is generated in real-time based on the request feature vector and a feature discrimination weight matrix with adaptive weight dynamic calibration loops. The directed acyclic execution dependency graph includes multiple dynamically instantiated execution nodes and edges representing the execution order and parameter passing dependencies. The execution nodes correspond to the corresponding heterogeneous storage nodes among the multiple heterogeneous storage nodes. As a specific embodiment, the feature discrimination weight matrix with adaptive weight dynamic calibration loop is generated through machine learning training. The specific training process includes: constructing a training data structure containing feature vectors and corresponding optimal path labels; setting a loss function aimed at reducing routing latency and improving cache hit rate; and using a gradient descent optimizer to iteratively optimize the matrix parameters.
[0027] That is, the feature discrimination weight matrix is not solely based on empirical configuration, but is generated through training a machine learning model. The system constructs a training data structure, with historical query feature vectors as input and optimal path labels determined comprehensively based on metrics such as execution latency, resource consumption, and cache hit rate of different cascaded paths. The training objective function (LossFunction) is designed to minimize the cross-entropy loss between the predicted path label and the optimal path label, and convergence training is performed using gradient descent optimizers such as Adam.
[0028] To address the issue of static parameter drift over time, an adaptive weight dynamic calibration loop based on execution feedback is introduced, thus forming an adaptive weight dynamic calibration mechanism. After each cascaded query, underlying runtime metrics (such as response latency, result set cardinality, and peak memory usage) are collected. Based on a preset online loss function, online gradient descent is used to calculate the parameter gradient according to the deviation between the actual execution cost and the target execution cost, thereby dynamically and periodically calibrating the weight matrix parameters.
[0029] Static parameters mainly include the following three categories: 1. Mapping weight coefficients (core parameters) from intent features to execution paths In the matrix In the table, rows represent preset execution paths (such as "graph-first", "vector-first", "relation-first", etc.), and columns represent extracted query feature vectors (such as...). Precise matching Vague tolerance traversal jump count, (Time sensitivity).
[0030] In the static state: each element in the matrix It's a static parameter. It represents the "original voting weight" of a certain query feature on a certain execution path.
[0031] For example, in the initial "static parameters" of the system, it might be possible to set the "fuzziness tolerance (...)" If the value is very high, there is a strong tendency to choose the "vector priority" path, and the corresponding weight parameter may be statically fixed at 0.85.
[0032] 2. The "Baseline Bias" in the execution path Similar to the bias term in neural networks, it provides a fallback path selection preference when the feature vector score is zero or the feature is not obvious.
[0033] In a static state: To ensure system stability, a higher static bias baseline score may be set for the path of "relational database priority (most stable, fastest query)" (e.g., b = +2.0), while a negative static bias may be set for "parallel scan of the entire database (extremely resource-intensive)" (e.g., b = -3.0).
[0034] 3. The "Prior Penalty Factor" of Resource Consumption When calculating the theoretically optimal path, the matrix contains prior evaluation coefficients for the underlying I / O and memory overhead of different databases.
[0035] In a static state: Before the system goes live, it may be statically assumed that "multi-hop traversal of the graph database" consumes a fixed 500MB of memory. This 500MB or the corresponding resource penalty coefficient is a static parameter.
[0036] Runtime DAG Dynamic Re-optimization Mechanism: During the execution of heterogeneous storage engines, the actual return results of the preceding nodes may far exceed expectations. This application sets "re-optimization checkpoints" between the cascaded execution nodes. When the cardinality of the result set returned by the preceding node exceeds a preset convergence threshold, runtime DAG reconstruction is automatically triggered: dynamically inserting additional attribute filtering nodes, reversing the execution order of subsequent engines, or enabling parallel branching, thereby effectively converging the search space in the execution state.
[0037] Feature discrimination weight matrix The dimension is ;in, The total number of preset cascading execution paths supported by the platform (such as "graph-first", "vector-first", "parallel verification", etc.) is represented by n, where n represents the extracted query feature vector. The feature discrimination weight matrix... It can be generated by human experience configuration, historical query log statistical learning or machine learning training, and stored in the flow determination module; As a specific implementation, a path score is calculated for each candidate execution path, and the optimal execution path label is determined based on the path score. : ; Where the superscript T stands for transpose, according to The directed acyclic execution dependency graph (DAG) is compiled and generated in real-time within the server's RAM. Specifically, the nodes of the DAG are not statically pre-defined, but rather dynamically instantiated based on the underlying heterogeneous storage structure (e.g., node...). For graph database nodes, nodes For vector database nodes), edges (such as...) This indicates the execution order and parameter inheritance relationship (e.g.) Input parameter inheritance Output entity ID).
[0038] Specifically, the two-level caching architecture includes: a compilation result cache and an intermediate result set cache for the directed acyclic execution dependency graph; The compilation result cache of the directed acyclic execution dependency graph uses the hash value of the request feature vector as the key to cache the compiled directed acyclic execution dependency graph; The intermediate result set cache uses the set of execution node identifiers and input entity identifiers as keys to cache the retrieval results of each node; The system monitors data change events via the log synchronization bus. If the data change event involves changes to the heterogeneous storage node mode, node availability, or execution configuration that affect the directed acyclic execution dependency graph, the corresponding directed acyclic execution dependency graph compilation result is invalidated. If the data change event involves data on the heterogeneous storage nodes on which the cached retrieval results in the intermediate result set cache depend, the corresponding retrieval results are invalidated. This application employs multi-level caching and event-driven invalidation, introducing a two-level caching architecture. The first level caches the DAG compilation results using the request feature vector hash value as the key; the second level caches intermediate retrieval results using the "node identifier + input entity identifier set" as the key. By reading the Binlog / WAL change logs of the data lake and the main database, and utilizing the event-driven mechanism of the message bus, precise targeted invalidation of cached results is achieved, significantly reducing the computational waste caused by repeated compilation.
[0039] S103, according to the directed acyclic execution dependency graph, schedule the underlying heterogeneous storage nodes to perform query in a cascade manner; set re-optimization checkpoints between each execution node, and perform streaming batch execution scheduling in combination with memory level monitoring; use the retrieval results of the preceding heterogeneous storage nodes as the filtering conditions or starting conditions of the subsequent heterogeneous storage nodes to converge the search space of the subsequent heterogeneous storage nodes. The process of executing queries in a cascaded manner across heterogeneous storage nodes at the underlying scheduling level also includes fault tolerance and failover mechanisms: 1. During the compilation phase of the directed acyclic execution dependency graph, critical execution nodes are marked with criticality levels, and alternative execution paths are maintained; 2. When a critical node fails or the timeout reaches the circuit breaker threshold, the system automatically switches to a degraded execution path; 3. Incremental recovery is performed using state snapshots with unified entity identifiers.
[0040] As can be seen, the fault tolerance and failover mechanism addresses the risk of single-point failures in heterogeneous nodes. During the DAG compilation phase, backup execution paths are maintained and marked with criticality levels. When a primary path node (e.g., determined to be "graph-first") experiences a timeout and circuit breaker failure, it automatically switches to a suboptimal degraded path (e.g., "vector-first") calculated by the feature discrimination weight matrix. Combined with state snapshots of unified entity identifiers, semantic consistency and incremental recovery are ensured when the cascading execution order is reversibly reversed. Specifically, the setting of re-optimization checkpoints between execution nodes and the use of memory level monitoring for streaming batch execution scheduling include: S31, set re-optimization checkpoints between adjacent execution nodes in the directed acyclic execution dependency graph; S32, at the re-optimization checkpoint, determine whether the cardinality of the result set returned by the preceding execution node exceeds a preset convergence threshold; the cardinality of the result set is the number of entity identifiers returned by the preceding execution node; S33, if the preset convergence threshold is exceeded, the directed acyclic execution dependency graph is reconstructed to obtain the reconstructed directed acyclic execution dependency graph; the reconstruction includes at least one of inserting additional filter nodes, adjusting the execution order between unexecuted execution nodes, or enabling parallel branches without violating existing data dependency relationships and result semantic equivalence constraints. S34, perform acyclicity verification on the reconstructed directed acyclic execution dependency graph, and perform streaming batch execution scheduling based on the reconstructed directed acyclic execution dependency graph that has passed the verification, combined with memory level monitoring.
[0041] S34 specifically includes: S341, when dynamically compiling and generating the directed acyclic execution dependency graph, the execution nodes are marked with criticality levels, and alternative execution paths are generated based on the feature discrimination weight matrix; S342, when a critical execution node fails or times out to the circuit breaker threshold, the current execution path corresponding to the directed acyclic execution dependency graph is switched to the backup execution path; the backup execution path and the current execution path correspond to different heterogeneous storage node calling orders; S343, Based on the state snapshot of the unified entity identifier, perform incremental recovery of the execution state after switching to the backup execution path.
[0042] As a specific embodiment, this application also includes a runtime resource control step; the runtime resource control step includes memory pressure-aware scheduling and concurrent resource scheduling; The memory pressure-aware scheduling includes: monitoring the system memory level; when the system memory level exceeds a preset high-level threshold, streaming the result sets returned by the front-end execution nodes in batches to the back-end execution nodes, and having the back-end execution nodes perform incremental fusion after retrieving each batch of result sets; when the system memory level is lower than a preset low-level threshold, resuming full transmission. The concurrent resource scheduling includes: when there are multiple concurrently executing directed acyclic execution dependency graph instances, using a weighted fair queue to manage the access requests of each directed acyclic execution dependency graph instance to the multiple heterogeneous storage nodes, and allocating resource quotas to each directed acyclic execution dependency graph instance according to the time sensitivity weight in the request feature vector corresponding to each composite query request.
[0043] Specifically, the memory pressure-aware streaming execution scheduling in this application introduces high and low memory level monitoring during cascading data transmission. If the system memory level exceeds the threshold, the front-end node will abandon full transmission and instead use a streaming batching mechanism to transmit entity identifiers in segments to the back-end node. The back-end node performs batch retrieval and incremental fusion in the fusion module to avoid triggering OOM (Out of Memory).
[0044] Concurrent resource isolation and priority scheduling introduce a weighted fair queue to address resource contention among multiple DAG instances in a production environment. Scheduling is based directly on the "time-sensitivity weight" in the request feature vector, dynamically allocating and preempting I / O bandwidth and computing quotas for heterogeneous storage nodes to ensure QoS for core industrial production query tasks.
[0045] To reduce system bus bandwidth usage and disk I / O overhead, the execution flow is reversible: (1) Flow to branch A (topology convergence execution): When the directed acyclic execution depends on the graph indicating that the graph database node is executed first, the graph database node is used to obtain the local entity identifier set. If the vector database node supports metadata filtering or partition retrieval based on entity identifier, the entity identifier set is used as a filter condition and cascaded into the vector database node to limit the candidate range of the vector database node. When the vector database supports the corresponding filtering capability, the high-dimensional vector retrieval can be converged from the global candidate set to the local candidate set, thereby greatly reducing the CPU / GPU computing power consumption of vector approximate nearest neighbor calculation.
[0046] (2) Flow to branch B (semantic rewriting execution): When the directed acyclic execution depends on the vector database node of the graph indicator to be executed first, the vector database node is used to retrieve and output a standardized set of entity identifiers (IDs), and the set of entity identifiers is cascaded and pushed to the graph database node as the starting anchor point of the graph traversal algorithm, so as to avoid the graph database to perform a memory-intensive blind traversal of the entire graph.
[0047] S104. Based on the unified entity identifier, the retrieval results returned by each heterogeneous storage node are associated, merged, and prioritized to obtain the merged query results.
[0048] S104 specifically includes: S41, In-memory hash table structure: When concatenating data using an in-memory hash table, the hash table employs a segmented lock concurrency control bucketing strategy and separate chaining to resolve hash collisions for mappings with the same primary key. Intermediate results can be stored in off-heap memory or memory-mapped memory, and a reference-count-based object reclamation mechanism is used to manage the corresponding memory, thereby reducing memory fragmentation during the concatenation of long-chain, large result sets.
[0049] S42, Dynamic Weighted Scoring Mechanism: Employing a formula Determine the score for the composite record; in, All are dynamic weighting coefficients, derived through the adaptive weighting dynamic calibration loop based on query type and execution feedback. Scoring the matching degree of structured business records for relational database nodes. The cosine similarity between feature vectors returned by the vector database nodes. This refers to the association coverage within the k-hop range returned by the graph database node. The path attenuation constant is This is the time decay penalty coefficient. The time decay coefficient, This is the difference between the data write time and the current timestamp; S43, Priority rearrangement based on the scores of composite records; As a specific embodiment, when scoring the composite records after association and splicing, the specific determination process and calculation logic of each indicator in the above formula are as follows: 1. Structured business record matching score ( The process of determining ) Calculation Logic: This score is calculated by executing a low-level structured SQL query on a relational database node. The system first parses the fields involved in the query conditions and assigns an initial weight to each field. (For example, primary key fields have the highest weight, while ordinary memo fields have a lower weight).
[0050] Calculation formula: The system calculates the degree to which the conditions are met for each field of the returned record. If it is an exact match (e.g., the enumerated values are equal), then If it is a range match or a fuzzy like match, the result is determined based on the coverage ratio. If it does not match, then it is ; These represent the weights of each field. The final match score is the weighted average of all fields, calculated using the following formula: ; Example: Query "orders with a status of 'approved' and an amount greater than 10,000". If a record matches the status and has an amount of 15,000 (fully satisfied), then... Approaching 1.
[0051] 2. Cosine similarity between feature vectors ( The process of determining ) Calculation logic: This metric is directly returned by the high-dimensional spatial distance operator within the vector database node (e.g., based on engines like Faiss or Milvus). The system extracts the feature vector of the current request intent. Entity feature vectors retrieved from the vector library .
[0052] Calculation formula: The cosine of the spatial angle is determined by calculating the dot product of two vectors and dividing by the product of their magnitudes. The formula is as follows: ; The larger this value (approaching 1), the more similar the two are in their potential semantics in the multidimensional semantic space.
[0053] 3. The association coverage of this node within the k-hop range ( The process of determining ) The calculation logic is derived from graph database nodes (e.g., based on engines like Neo4j) using a graph traversal algorithm. The system uses the current entity ID as the central anchor point and traverses outwards. Jump( It is a positive integer, usually Subgraph networks within the range of ).
[0054] Calculation formula: The association coverage is defined as the number N of effective target nodes actually associated with the entity within a k-hop range. valid The number of target nodes is compared with the system's preset threshold or the theoretical maximum number of target nodes N. max The ratio: ; If an entity has a highly dense network of connections in the graph (such as a core supplier or a multi-shareholding parent company), the density value will increase significantly, thereby improving its recommendation priority in complex queries.
[0055] 4. Path attenuation constant ( The process of determining ) Calculation logic: Belongs to the system's dynamic scheduling hyperparameters ( Its value is the same as the "graph network traversal hop count weight" extracted in the previous step 1. "is positively correlated with "
[0056] Determination Mechanism: When a query request exhibits a strong intent to perform "multi-hop depth exploration" (i.e.) When the value is relatively high, the system dynamically assigns... Larger values (e.g.) This reduces the weight decay as the graph network expands outwards, protecting the scores of long-tail relation nodes; conversely, if only shallow queries are needed, a smaller weight is assigned. (For example This accelerates the decay of scores in external noise data.
[0057] S44, rearranges the preset quantity ( The composite record is used as the fused query result, encapsulated, and finally returned to the calling end to release temporary memory.
[0058] As another specific embodiment, this application also provides a query processing system that integrates multiple heterogeneous storage engines. The system is located on a server computing cluster and specifically includes: heterogeneous data storage and execution nodes, an underlying log capture and synchronization bus module, a flow-oriented dynamic compilation and scheduling gateway, and a cross-database association and fusion module; wherein, the flow-oriented dynamic compilation and scheduling gateway is a specific logic control module responsible for resource scheduling and cascading triggering. The heterogeneous data storage and execution nodes include link-independent relational database nodes, vector database nodes, graph database nodes, and data lake nodes. Among them, relational database nodes are responsible for strong transaction detail storage; vector database nodes are responsible for high-dimensional floating-point feature storage and distance calculation; graph database nodes are responsible for entity topology association and edge density calculation; and data lake nodes are responsible for persistent storage and append writing of historical logs, semi-structured data, or other large-scale data. The underlying log capture and synchronization bus module is connected to the underlying change log (Binlog / WAL) of the main storage node to listen for data change events. After event format conversion and unified entity identifier mapping, the change events are asynchronously synchronized to the vector database node, graph database node and data lake node through a distributed message queue and corresponding storage adapter. The flow-oriented dynamic compilation and scheduling gateway is used to receive composite query requests and extract request feature vectors, and to compile and generate a directed acyclic execution dependency graph in real time based on the request feature vectors, and to schedule the heterogeneous data storage and execution nodes to perform queries in a cascade manner based on the directed acyclic execution dependency graph; wherein, the retrieval results of the preceding nodes are used as filtering conditions or starting conditions for the following nodes to converge the search space of the following nodes; The cross-database association and fusion module is connected to the output end of each of the heterogeneous data storage and execution nodes, and is used to associate, fuse and sort the retrieval results returned by each of the heterogeneous data storage and execution nodes based on a unified entity identifier.
[0059] As a specific embodiment, the flow-oriented dynamic compilation and scheduling gateway includes: a query feature extraction unit and an execution dependency graph real-time generation unit; The query feature extraction unit is used to perform lexical parsing and feature processing on the composite query request, and extract the request feature vector; The execution dependency graph real-time generation unit is used to calculate the request feature vector and the preset feature discrimination weight matrix to determine the execution path label, and accordingly instantiate execution nodes, construct dependency edges and perform topological sorting in the running memory to generate the directed acyclic execution dependency graph.
[0060] As a specific embodiment, the cross-library association fusion module integrates a memory alignment operator and a weighted fusion calculation component; The memory alignment operator and weighted fusion calculation component are used to concatenate the unified entity identifier in memory as the primary key, calculate the score of the composite record based on the structured business record matching score, the cosine similarity between feature vectors, the association coverage of graph nodes and the time decay penalty coefficient, and perform priority rearrangement of the composite records.
[0061] The memory alignment operator and weighted fusion calculation component concatenate and weight sort the scattered fields returned by each library in memory based on the unique entity ID as the primary key, according to the terminal output instructions of the DAG; This application has the following technical advantages: (1) This application achieves rapid convergence of the search space by first executing the graph database and using the accurate topological relationships returned by it as the pre-filtering condition for vector library retrieval. Compared with the fixed parallel retrieval architecture, it can significantly reduce the volume of the candidate set for concurrent search of the vector library and effectively reduce the time consumption of approximate nearest neighbor retrieval. It also reduces the invalid memory overhead and CPU computing power consumption of the vector database. (2) When faced with semantically ambiguous requests, this application first performs semantic recall and outputs standardized entity identifiers by the vector retrieval node, providing the starting anchor point for graph database traversal, thereby reducing the unconstrained expansion of the graph database. In networks with massive edge density, the memory usage of multi-hop graph traversal can be significantly reduced.
[0062] (3) This application generates the dependency graph in real time, completely eliminating the rigid logic waiting at the application layer and sinking the data dependency relationship down to the gateway layer for instruction-level cascading compilation and scheduling. For complex cascading fusion queries across four libraries, it can significantly reduce the average system response time. It reduces the overall system response latency of complex heterogeneous queries and provides a unified scheduling framework at the underlying level for the next generation of AI systems with multi-hop inference capabilities.
[0063] As a specific implementation, multiple independent hard-coded retrieval subsystems can be deployed to meet different query flow requirements; however, this can easily lead to a significant increase in the connection overhead of the underlying heterogeneous databases, and there is a lack of a unified state-aware compiler for coordination. When faced with mixed and complex requests, the application layer cannot smoothly determine and switch the best subsystem at runtime, which can easily lead to frequent system timeouts and architectural redundancy. As a specific implementation, it can also perform a full parallel search of four types of databases, and then let the upper-level natural language model perform text-level merging using a large context window; however, it lacks cascading filtering and search space convergence between front-end nodes. In a massive data environment, full concurrency can lead to severe low-level I / O contention and lock waiting among various storage engines; massive fragmented information that has not been cascaded and merged can easily break through the model's context constraints, triggering an inference computation avalanche.
[0064] In an exemplary embodiment, a computer device is provided, which may be a server or a terminal. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a query processing method that integrates multiple heterogeneous memory engines.
[0065] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0066] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0067] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0068] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0069] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0070] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0071] In this application, all actions to acquire signals, information, or data are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with the authorization granted by the owner of the relevant device.
[0072] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0073] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A query processing method integrating multi-source heterogeneous storage engines, characterized in that, include: Obtain the composite query request and extract the request feature vector of the composite query request; The The request feature vector is used to characterize the retrieval capability requirements of the composite query request for multiple heterogeneous storage nodes; the heterogeneous storage nodes include nodes of at least two different storage types; Based on request feature vectors, a two-level caching architecture is used to determine the corresponding directed acyclic execution dependency graph. The two-level caching mechanism works as follows: if the request feature vector hits the compilation result cache of the directed acyclic execution dependency graph, the corresponding directed acyclic execution dependency graph is directly retrieved; if it misses, the directed acyclic execution dependency graph is generated in real-time based on the request feature vector and a feature discrimination weight matrix with adaptive weight dynamic calibration loops. The directed acyclic execution dependency graph includes multiple dynamically instantiated execution nodes and edges representing the execution order and parameter passing dependencies; each execution node corresponds to a corresponding heterogeneous storage node among the multiple heterogeneous storage nodes. Based on the directed acyclic execution dependency graph, the underlying heterogeneous storage nodes are scheduled to execute queries in a cascading manner; Re-optimization checkpoints are set between each execution node, and streaming batch execution scheduling is performed in conjunction with memory level monitoring; the search results of the front heterogeneous storage node are used as the filtering or starting conditions of the back heterogeneous storage node to converge the search space of the back heterogeneous storage node. Based on a unified entity identifier, the retrieval results returned by each heterogeneous storage node are associated, merged, and prioritized to obtain the merged query results.
2. The query processing method for integrating multi-source heterogeneous storage engines according to claim 1, characterized in that, If a match is not found, a directed acyclic execution dependency graph is generated in real time based on the requested feature vector and a feature discrimination weight matrix with adaptive weight dynamic calibration loop. Specifically, this includes: After each cascaded query is completed, runtime metrics for each execution node are collected; runtime metrics include response latency, result set cardinality, peak memory usage, and cache hit rate. The deviation between the actual execution path and the theoretical optimal path is calculated based on runtime metrics, and the static parameters in the feature discrimination weight matrix are periodically calibrated using online gradient descent or Bayesian update methods.
3. The query processing method for integrating multi-source heterogeneous storage engines according to claim 1, characterized in that, The two-level caching architecture includes: a cache of compilation results and a cache of intermediate result sets for a directed acyclic execution dependency graph; The compilation result cache of the directed acyclic execution dependency graph uses the hash value of the request feature vector as the key to cache the compiled directed acyclic execution dependency graph; The intermediate result set cache uses the set of execution node identifiers and input entity identifiers as keys to cache the retrieval results of each node; The system monitors data change events via a log synchronization bus. If the data change event involves changes to the heterogeneous storage node mode, node availability, or execution configuration that affect the directed acyclic execution dependency graph, the corresponding directed acyclic execution dependency graph compilation result is invalidated. If the data change event involves data on heterogeneous storage nodes that the cached retrieval results in the intermediate result set cache depend on, the corresponding retrieval results are invalidated.
4. The query processing method for integrating multi-source heterogeneous storage engines according to claim 1, characterized in that, The process of scheduling the cascading execution of queries by the underlying heterogeneous storage nodes according to the directed acyclic execution dependency graph also includes fault tolerance and failover mechanisms: During the compilation phase of the directed acyclic execution dependency graph, critical execution nodes are marked with criticality levels, and alternative execution paths are maintained. When a critical node fails or times out and reaches the circuit breaker threshold, the system automatically switches to a degraded execution path. Incremental recovery is performed using state snapshots with a unified entity identifier.
5. The query processing method for integrating multi-source heterogeneous storage engines according to claim 1, characterized in that, The step of setting re-optimization checkpoints between execution nodes and combining memory level monitoring for streaming batch execution scheduling specifically includes: Set re-optimization checkpoints between adjacent execution nodes in the directed acyclic execution dependency graph; At the re-optimization checkpoint, it is determined whether the cardinality of the result set returned by the preceding execution node exceeds a preset convergence threshold; the cardinality of the result set is the number of entity identifiers returned by the preceding execution node. If the preset convergence threshold is exceeded, the directed acyclic execution dependency graph is reconstructed to obtain a reconstructed directed acyclic execution dependency graph. The reconstruction includes at least one of the following: inserting additional filter nodes, adjusting the execution order between unexecuted execution nodes, or enabling parallel branches, without violating existing data dependencies and result semantic equivalence constraints. The reconstructed directed acyclic execution dependency graph is subjected to acyclicity verification, and based on the reconstructed directed acyclic execution dependency graph that has passed the verification, streaming batch execution scheduling is performed in conjunction with memory level monitoring.
6. The query processing method for integrating multi-source heterogeneous storage engines according to claim 5, characterized in that, The process of performing acyclicity verification on the reconstructed directed acyclic execution dependency graph, and then performing streaming batch execution scheduling based on the verified reconstructed directed acyclic execution dependency graph in conjunction with memory level monitoring, specifically includes: When dynamically compiling and generating the directed acyclic execution dependency graph, the execution nodes are marked with criticality levels, and alternative execution paths are generated based on the feature discrimination weight matrix; When a critical execution node fails or times out to the circuit breaker threshold, the current execution path corresponding to the directed acyclic execution dependency graph is switched to the backup execution path; the backup execution path and the current execution path correspond to different heterogeneous storage node calling orders. Based on the state snapshot of the unified entity identifier, the execution state after switching to the backup execution path is incrementally restored.
7. The query processing method for integrating multi-source heterogeneous storage engines according to claim 1, characterized in that, It also includes runtime resource control steps; the runtime resource control steps include memory pressure-aware scheduling and concurrent resource scheduling; The memory pressure-aware scheduling includes: monitoring the system memory level; when the system memory level exceeds a preset high-level threshold, streaming the result sets returned by the front-end execution nodes in batches to the back-end execution nodes, and having the back-end execution nodes perform incremental fusion after retrieving each batch of result sets; when the system memory level is lower than a preset low-level threshold, resuming full transmission. The concurrent resource scheduling includes: when there are multiple concurrently executing directed acyclic execution dependency graph instances, using a weighted fair queue to manage the access requests of each directed acyclic execution dependency graph instance to the multiple heterogeneous storage nodes, and allocating resource quotas to each directed acyclic execution dependency graph instance according to the time sensitivity weight in the request feature vector corresponding to each composite query request.
8. The query processing method for integrating multi-source heterogeneous storage engines according to claim 1, characterized in that, The feature discrimination weight matrix with adaptive weighted dynamic calibration loop is generated through machine learning training. The specific training process includes: Construct a training data structure that includes feature vectors and corresponding optimal path labels; Set a loss function with the goal of reducing routing latency and improving cache hit rate; The gradient descent optimizer is used to iteratively optimize the matrix parameters.
9. The query processing method for integrating multi-source heterogeneous storage engines according to claim 1, characterized in that, The process of associating, fusing, and prioritizing the retrieval results returned by each heterogeneous storage node based on a unified entity identifier to obtain the fused query results specifically includes: Based on the memory hash table, the unified entity identifier is used as the primary key for association and concatenation; the memory hash table adopts a bucketing strategy with a segmented locking mechanism, handles hash collisions through chaining, and is configured with a garbage collection strategy based on reference counting to manage memory layout. Using formula Determine the score for the composite record; Priority rearrangement based on the scores of composite records; in, All are dynamic weighting coefficients, derived through the adaptive weighting dynamic calibration loop based on query type and execution feedback. Scoring the matching degree of structured business records for relational database nodes. The cosine similarity between feature vectors returned by the vector database nodes. This refers to the association coverage within the k-hop range returned by the graph database node. The path attenuation constant is This is the time decay penalty coefficient. The time decay coefficient, This is the difference between the data write time and the current timestamp.
10. A query processing system integrating multi-source heterogeneous storage engines, characterized in that, include: Heterogeneous data storage and execution nodes include link-independent relational database nodes, vector database nodes, graph database nodes, and data lake nodes. Among them, relational database nodes are responsible for strong transaction detail storage; vector database nodes are responsible for high-dimensional floating-point feature storage and distance calculation; graph database nodes are responsible for entity topology association and edge density calculation; and data lake nodes are responsible for persistent storage and append writing of historical logs, semi-structured data, or large-scale data. The underlying log capture and synchronization bus module is connected to the underlying change log of the main storage node. It is used to listen for data change events and, after event format conversion and unified entity identifier mapping, asynchronously synchronize the change events to the vector database node, graph database node and data lake node through a distributed message queue and corresponding storage adapter. The flow is directed to a dynamic compilation and scheduling gateway, which receives composite query requests and extracts request feature vectors, and compiles and generates a directed acyclic execution dependency graph in real time based on the request feature vectors, and schedules the heterogeneous data storage and execution nodes to execute queries in a cascade manner based on the directed acyclic execution dependency graph; wherein, the retrieval results of the preceding nodes are used as filtering conditions or starting conditions for the following nodes to converge the search space of the following nodes. The cross-database association and fusion module is connected to the output end of each heterogeneous data storage and execution node, and is used to associate, fuse and sort the retrieval results returned by each heterogeneous data storage and execution node based on a unified entity identifier.
