A processing method and system for cross-model similarity matching query

By constructing an augmented query graph in cross-modal queries and employing a constraint-aware matching order and failure set mechanism, the problems of intermediate result explosion and computational waste in cross-modal queries are solved, achieving efficient and simplified cross-modal similarity matching query processing.

CN121188249BActive Publication Date: 2026-02-24NORTHEASTERN UNIV CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511726107.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-24
Estimated Expiration
2045-11-24

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as intermediate result explosion and wasted computing and storage resources when handling cross-model queries. Furthermore, the query statements are lengthy and complex, resulting in high development and maintenance costs. Existing optimization methods are limited to a single data model and cannot effectively utilize similarity constraints for pruning.

Method used

By constructing an augmented query graph, similarity constraints are transformed into virtual edges. Constraint-aware matching order and failure set mechanisms are adopted, and early pruning and optimization of the subgraph matching process are implemented to achieve efficient processing of cross-model similarity matching queries.

Benefits of technology

It significantly reduces the number of intermediate results and similarity calculations, improves query efficiency, simplifies query statements, reduces development and maintenance costs, and adapts to complex graph pattern matching scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121188249B_ABST
    Figure CN121188249B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of database management, and discloses a processing method and system for cross-mode similarity matching query. A cross-mode similarity matching query is received, and a graph mode structure and a vector similarity constraint are extracted. The similarity constraint is converted into a virtual edge, and an augmented query graph is constructed. The comprehensive weight of a query vertex in the augmented query graph is calculated, and an optimal constraint-aware matching order is generated. According to the matching order, subgraph matching is recursively enumerated on a data graph, and it is checked whether the enumerated subgraph meets the query requirements of the cross-mode similarity matching query. The failure set mechanism is used for pruning. All matching results meeting the conditions are returned. By deeply integrating the similarity constraint into the graph matching process, early pruning and constraint-aware subgraph matching are realized, the problems of intermediate result explosion and calculation waste existing in the existing post-filtering method are solved, and the processing efficiency of the cross-mode query involving structural matching in the graph database and similarity search in the vector database is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database management technology, and in particular to a method for processing cross-model similarity matching queries. Background Technology

[0002] With the development of artificial intelligence and big data technologies, multimodal data (graphs, vectors, and documents) has become an important component of modern information systems. In fields such as academic graph analysis, social network mining, bioinformatics, and intelligent recommendation systems, users need to handle complex tasks involving both graph structural relationships and vector similarity constraints within a single query. For example, in academic collaboration networks, a query might be "find potential collaborators with similar themes to a groundbreaking paper and within a three-hop distance in the collaboration network"; in e-commerce recommendation scenarios, a query might be "discover products purchased by other users with similar historical preferences and close connections in their social networks." These queries involve structural matching in graph databases and similarity searching in vector databases, constituting cross-modal query requirements.

[0003] In existing technologies, traditional database systems face architectural challenges when handling cross-modal queries involving both graph structure matching and vector similarity search: relational databases lack native support for graph relations and vector similarity; graph databases have limited support for high-dimensional vector operations; and vector databases ignore graph structure constraints. Therefore, existing solutions often employ a two-stage "post-filtering" processing model: first, subgraph matching is performed in the graph database to generate intermediate results that satisfy graph pattern constraints; then, corresponding vectors are extracted from the nodes in these intermediate results, and similarity filtering is performed in the vector database or application layer.

[0004] Academic research attempting to integrate similarity search into graph structure matching queries also has limitations: The paper "Diego A, Aidan H, Gonzalo N, et al. Worst-Case Optimal Graph Joins in AlmostNo Space. In Proceedings of the 2021 International Conference on Management of Data (SIGMOD '21). Association for Computing Machinery, New York, NY, USA, 102–114." proposes worst-case optimal similarity joins on graph databases, treating k-NN relationships as a novel type of edge within the graph; the paper "Weiguo Z, Lei Z, Lei C, et al. Efficient SimRank-BasedSimilarity Join. ACM Trans. Database Syst. 42, 3, Article 16 (September 2017), 37 pages." proposes a pruning method based on shortest path distance for SimRank-based join queries; and the paper "Yuxiang W, Jun L, Xiaoliang X, et al. Efficient and Effective AcademicExpert Finding on "Heterogeneous Graphs through (k,p)-Core based Embedding. ACM Trans. Knowl. Discov. Data 17, 6, Article 85 (July 2023), 35 pages." This paper proposes a document embedding model based on (k,p)-cores, which simultaneously considers explicit structural relationships and implicit textual semantics between papers in heterogeneous graph embedding.

[0005] The relevant research has the following main shortcomings:

[0006] The "post-filtering" two-stage processing method inevitably generates a large number of intermediate results that do not meet the similarity constraints because it performs complete graph pattern matching first and then vector similarity filtering. This inherent defect in the processing order requires the system to allocate a large amount of computing resources and storage space for the intermediate results that will eventually be discarded, resulting in huge computational and memory overhead.

[0007] Existing query optimizers fail to incorporate similarity constraints into the graph matching process, thus failing to utilize them to guide search space pruning. This is because traditional optimizers treat graph structure matching and vector similarity search as two separate operational stages, missing crucial optimization opportunities to eliminate invalid branches early in the matching process using similarity constraints, resulting in low search efficiency.

[0008] Due to the lack of a unified query processing framework, users need to write separate graph query statements and vector query statements, and manually coordinate the interaction between the two systems through the application layer. This fragmented architecture makes query statements verbose and complex, not only prone to errors, but also significantly increases development and maintenance costs, severely impacting system usability.

[0009] The optimization methods proposed in academia have significant limitations: the method proposed in the paper "Liana P, Peter K, Carlos G, et al. ACORN: Performant and Predicate-Agnostic Search Over VectorEmbeddings and Structured Data. Proc. ACM Manag. Data 2, 3, Article 120 (June 2024), 27 pages." is limited by its core architecture and can only handle relational filter predicates, making it unsuitable for complex graph pattern matching scenarios; the method proposed in the paper "Weiguo Z, Lei Z, Lei C, et al. Efficient SimRank-Based Similarity Join. ACM Trans. Database Syst. 42, 3, Article 16 (September 2017), 37 pages." is difficult to extend to other similarity metrics because its algorithm design is specifically for the SimRank similarity metric; and the method proposed in the paper "Diego A, Aidan H, Gonzalo N, et al. Worst-Case OptimalGraph Joins in Almost No Space. In Proceedings of the 2021 The worst-case optimal similarity connection method for graph databases proposed at the International Conference on Management of Data (SIGMOD '21). Association for Computing Machinery, New York, NY, USA, 102–114, while extending the connection algorithm, is still limited to a single graph data model. Its k-NN graph needs to be pre-computed and included as part of the graph, and it cannot directly handle the cross-model connection problem between native, independent vector data and graph data, which greatly limits its practical application. Summary of the Invention

[0010] The purpose of this invention is to provide a method for processing cross-modal similarity matching queries, specifically for cross-modal queries involving graph structure matching and vector similarity search. By deeply integrating similarity constraints into the graph matching process, early pruning and constraint-aware subgraph matching are achieved, solving the problems of intermediate result explosion and computational waste in existing post-filtering methods. This significantly improves the processing efficiency of cross-modal queries that simultaneously involve structure matching in graph databases and similarity searches in vector databases.

[0011] The technical solution of the present invention is as follows: A method for processing cross-model similarity matching queries, comprising the following steps:

[0012] Step 1: Receive cross-modal similarity matching queries, parse the query statements, and extract the graph pattern structure and vector similarity constraints.

[0013] Step 2: Based on the extracted graph pattern structure and vector similarity constraints, construct an augmented query graph and transform the similarity constraints into virtual edges;

[0014] Step 3: Based on the statistical information of the existing data graph and the constructed augmented query graph, calculate the comprehensive weight of the query vertices in the augmented query graph, and generate the optimal constraint-aware matching order based on the comprehensive weight of the query vertices.

[0015] Step 4: Based on the optimal constraint-aware matching order, recursively enumerate subgraph matching on the data graph. Check whether the enumerated subgraphs meet the query requirements of cross-modal similarity matching based on the constraints of the augmented query graph pattern structure and vector similarity constraints, and use the failure set mechanism for pruning.

[0016] Step 5: Output the results, returning all matching results that meet the conditions.

[0017] Step 1 specifically involves: receiving a cross-modal similarity matching query submitted by the user; the cross-modal similarity matching query uses an extended graph query syntax, and the query statement explicitly includes a graph pattern structure description and a vector similarity constraint description; the query parser parses the query statement and extracts the graph pattern structure, vector similarity constraints, and connection conditions; the connection conditions are the association relationships between nodes in the data graph and vector data, including the mapping rules between data graph node identifiers and vector identifiers, and the connection keys between data graph nodes and vectors.

[0018] Step 2 specifically involves:

[0019] In the query preprocessing stage, an augmented query graph is constructed based on vector similarity constraints. The specific construction process is as follows: the graph pattern structure of the original query statement is used as the initial state of the augmented query graph. Each vector similarity constraint is traversed. For each pair of nodes involved in the vector similarity constraint, if there is no connecting edge in the graph pattern structure of the original query statement, a virtual edge is added in the augmented query graph. The virtual edge is marked as "virtual" type, and the similarity threshold parameter is stored in the edge attribute to obtain the augmented query graph.

[0020] Step 3 specifically involves:

[0021] Based on the statistical information of the augmented query graph and the data graph, a greedy strategy based on comprehensive weight is adopted to calculate the comprehensive weight value for each query vertex and generate a constraint-aware matching order for the query vertices in the augmented query graph.

[0022] The matching order generation process adopts an iterative selection mechanism: during the initialization phase, all query vertices are placed into an unsorted set; during each iteration, the query vertex with the highest comprehensive weight is selected from the remaining query vertices and added to the matching order; after selecting a query vertex, the candidate set size and comprehensive weight value of the remaining query vertices adjacent to it are updated; this process is repeated until all query vertices are sorted.

[0023] The calculation of the comprehensive weight value includes three factors: the reciprocal of the candidate set size, the number of virtual edges, and the strength of structural constraints. The candidate set size reflects the filtering effect of the query vertex. The number of virtual edges measures the density of vector similarity constraints. The strength of structural constraints is calculated based on node degree and label frequency. The node degree refers to the degree of the query vertex in the augmented query graph, which is the number of edges connected to the query vertex, including real edges and virtual edges. The label frequency is the frequency of the query vertex label appearing in the data graph. The comprehensive weight calculation formula is as follows:

[0024]

[0025] in, `u` is the size of the candidate set for query vertex `u`; `virtual_degree(u)` is the number of virtual edges connected to query vertex `u`; `structural_constraint(u)` is the structural constraint strength based on node degree and label frequency, defined as the node degree multiplied by the reciprocal of the label frequency; parameters The weight parameters are obtained through historical query statistics.

[0026] Step 4 specifically involves: performing a recursive enumeration of subgraph matching processes based on the optimal constraint-aware matching order; checking vector similarity constraints during the enumeration process; and optimizing search efficiency through a failure set mechanism.

[0027] The vector similarity constraint check specifically involves: implementing multi-level dynamic constraint checks during the enumeration process; filtering the failure set during the candidate selection phase; querying the failure set records; and skipping candidate nodes in the candidate set that are known to conflict with the current partial matching state; sequentially checking the graph pattern structure constraints and vector similarity constraints between the remaining candidate nodes and all matched vertices; and performing a comprehensive verification of the current partial matching before recursively entering the next matching depth to ensure that the vector similarity constraints between all matched vertices are satisfied.

[0028] The failure set mechanism dynamically maintains pruning information. The failure set record is in the form of a triple, which is (current vertex, matched vertex, data node corresponding to the matched vertex). It stores which candidate nodes of the current vertex are pruned because they do not meet the similarity constraint when a matched vertex is bound to a specific data node. When the same matching state is encountered in subsequent searches, invalid candidates are skipped directly according to the failure set record to avoid repeated calculations.

[0029] Step 5 specifically involves:

[0030] When a complete subgraph match is found and all graph pattern structure constraints and vector similarity constraints are satisfied, the subgraph match is added to the result set. After the enumeration process is completed, all valid matches are used as query results. The query result set includes graph node attributes and vector similarity scores to meet the user's cross-pattern retrieval needs.

[0031] A cross-modal similarity matching query processing system, comprising:

[0032] The storage layer is used to integrate and manage data graph node data, vector data, and related metadata;

[0033] The query parsing layer extends the query parser to support cross-modal similarity matching operators. It receives cross-modal similarity matching queries, parses the query statements, and extracts the query graph pattern, vector similarity constraint set, and connection conditions.

[0034] A query optimization layer is used to optimize the query execution plan that includes the cross-modal similarity matching operator;

[0035] The execution engine is a processing method for cross-modal similarity matching queries executed by the cross-modal similarity matching operator. During the recursive matching process, it simultaneously verifies graph pattern structure constraints and vector similarity constraints, implements dynamic pruning and failure set optimization, and executes queries according to the process of initialization phase, recursive matching phase, and result collection phase.

[0036] Through the collaboration of the storage layer, query parsing layer, query optimization layer and execution engine, a unified processing framework for cross-model similarity matching queries is constructed.

[0037] The cross-modal similarity matching operator is a wrapper around the cross-modal similarity matching query processing method. Its interface uses a six-tuple definition, including a query graph pattern, a set of similarity constraint pairs, a vector set identifier, connection conditions, similarity parameters, and a distance function. It supports both TOP-K and WITHIN-R query semantics. The query graph pattern structure includes a vertex set, an edge set, label constraints, and attribute constraints, supporting connected graphs, star-shaped graphs, chain-shaped graphs, and ring-shaped graphs. Vector similarity constraints include vertex pairs in the query graph, a similarity threshold, and a distance function. The TOP-K query semantic tracks the top K matches by maintaining a global priority queue, while the WITHIN-R query semantic returns all matches that meet the conditions based on threshold filtering.

[0038] Compared with existing technologies, the cross-modal similarity matching query processing method proposed in this invention involves both graph structure matching and vector similarity search. It proposes to deeply integrate vector similarity constraint checking into the subgraph matching enumeration process, and reduces the number of intermediate results and similarity calculations through early pruning and constraint-aware matching optimization methods. Experiments on the real-world DBLP dataset show that the proposed optimization method significantly shortens the query execution time. Furthermore, this invention proposes a cross-modal similarity matching operator (CMSM) integration scheme for the targeted query, enabling seamless integration of the proposed method into multi-modal database systems, improving development efficiency and system availability. Attached Figure Description

[0039] Figure 1 This is a flowchart illustrating the overall process of the method of the present invention, showing the complete process from receiving a query to outputting a result.

[0040] Figure 2 A flowchart for the constraint-aware matching order generation method.

[0041] Figure 3 This is a flowchart of the cross-model similarity matching query process, including the integrated steps of the storage layer, query processing layer, and optimization strategy. Detailed Implementation

[0042] This invention provides a method for cross-modal similarity matching queries, the overall technical solution of which is as follows: Figure 1 As shown, it includes the following steps:

[0043] Step 1: Receive cross-modal similarity matching queries, parse the query statements, and extract the graph pattern structure and vector similarity constraints.

[0044] First, the system receives cross-modal similarity matching queries submitted by users. These queries employ extended graph query syntax, explicitly including a graph pattern structure description and vector similarity constraints. The query parser then parses the query, extracting the graph pattern structure, vector similarity constraints, and join conditions.

[0045] Step 2: Based on the extracted graph pattern structure and vector similarity constraints, construct an augmented query graph and transform the similarity constraints into virtual edges;

[0046] In the query preprocessing stage, an augmented query graph is constructed based on vector similarity constraints. The specific construction process is as follows: First, the graph schema of the original query statement is used as the initial state of the augmented query graph. Then, each vector similarity constraint is traversed. For each pair of nodes involved in the vector similarity constraint, if there is no connecting edge in the graph schema of the original query statement, a virtual edge is added to the augmented query graph. This virtual edge is marked as "virtual" and its similarity threshold parameter is stored in the edge attribute, resulting in the augmented query graph. In this way, vector similarity constraints are integrated into the graph structure for unified processing.

[0047] Step 3: Based on the statistical information of the existing data graph and the constructed augmented query graph, calculate the comprehensive weight of the query vertices in the augmented query graph, and generate the optimal constraint-aware matching order based on the comprehensive weight of the query vertices.

[0048] Based on statistical information from the augmented query graph and the data graph, a constraint-aware matching order is generated for the query vertices. This process employs a greedy strategy based on comprehensive weights, calculating a comprehensive weight value for each query vertex.

[0049] The weight calculation comprehensively considers three factors: the reciprocal of the candidate set size, the number of virtual edges, and the strength of structural constraints. The candidate set size reflects the filtering effect of vertices, the number of virtual edges measures the density of similarity constraints, and the strength of structural constraints is calculated based on node degree and label frequency. These three factors are weighted and combined using configurable weight parameters, which are learned to default values ​​through historical query statistics.

[0050] The matching order generation process adopts an iterative selection mechanism: during the initialization phase, all query vertices are placed into an unsorted set; during each iteration, the query vertex with the highest comprehensive weight is selected from the remaining query vertices and added to the matching order; after selecting a query vertex, the candidate set size and comprehensive weight value of the remaining query vertices adjacent to it are updated; this process is repeated until all query vertices are sorted.

[0051] Step 4: Based on the optimal constraint-aware matching order, recursively enumerate subgraph matching on the data graph. Check whether the enumerated subgraphs meet the query requirements of cross-modal similarity matching based on the constraints of the augmented query graph pattern structure and vector similarity constraints, and use the failure set mechanism for pruning.

[0052] The enumeration process implements multi-level dynamic constraint checks: First, during the candidate selection phase, the failure set is filtered, the failure set records are queried, and candidate nodes that are known to conflict with the current partial matching state are skipped; then, the remaining candidate nodes are checked in turn for the constraints of the graph pattern structure and vector similarity constraints between them and all matched vertices; before recursively entering the next matching depth, the current partial matching is verified as a whole to ensure that the vector similarity constraints between all matched vertices are satisfied.

[0053] The failure set mechanism dynamically maintains pruning information. The failure set record is in the form of a triple (current vertex, matched vertex, data node corresponding to the matched vertex). It stores which candidate nodes of the current vertex are pruned because they do not meet the similarity constraint when a matched vertex is bound to a specific data node. In subsequent searches, when encountering the same matching state, invalid candidates are skipped directly based on the failure set record, avoiding redundant calculations.

[0054] Step 5: Output the results, returning all matching results that meet the conditions.

[0055] When a complete subgraph match is found, and all graph pattern structure constraints and vector similarity constraints are satisfied, the match is added to the result set. After the enumeration process is complete, all valid matches are considered as query results. The query result set includes information such as graph node attributes and vector similarity scores to meet users' cross-pattern retrieval needs.

[0056] Furthermore, this invention proposes a processing system for cross-modal similarity matching queries that integrates the aforementioned optimization algorithm into a multi-modal database. This invention defines a cross-modal similarity matching operator (CMSM), employing a unified six-tuple definition, including a query graph pattern, a set of similarity constraint pairs, a vector set identifier, a join condition, a similarity parameter, and a distance function. The integration of this operator into the multi-modal database system involves three levels of integration: at the storage layer, graph data storage, vector data storage, and metadata management components are integrated; at the query processing layer, the query parser, optimizer, and execution engine are extended to support the CMSM operator; a cross-modal similarity matching operator query optimization layer is used to optimize the query execution plan containing the cross-modal similarity matching operator; and an execution engine is used for the processing method of cross-modal similarity matching queries executed by the cross-modal similarity matching operator, simultaneously verifying graph pattern structure constraints and vector similarity constraints during recursive matching, implementing dynamic pruning and failure set optimization, and executing the query according to the process of initialization phase, recursive matching phase, and result collection phase.

[0057] This layered integration architecture enables a unified processing framework for cross-model similarity matching queries.

[0058] Traditional methods for handling cross-pattern queries involving both graph pattern matching and vector similarity search employ a "post-filtering" strategy. This involves first performing graph pattern matching to generate all possible results, and then filtering the intermediate results based on vector similarity. This approach results in a large number of intermediate results, and many results that do not meet the similarity constraints are discarded in the final stage, leading to a significant waste of computational resources and storage space.

[0059] To address this issue, this invention constructs an augmented query graph during the query preprocessing stage, representing vector similarity constraints as virtual edges connecting corresponding nodes. This design integrates similarity constraints into the graph structure, enabling the optimizer to process structural and similarity constraints in a unified manner, thus laying the foundation for subsequent optimization.

[0060] To address the problem that traditional methods cannot utilize similarity constraints to guide the matching process, this invention proposes a constraint-aware matching order generation strategy. By comprehensively considering factors such as candidate set size, number of virtual edges, and structural constraint strength, vertex weights are calculated, prioritizing the matching of vertices with strong constraints and small candidate sets. This ensures that vertices with dense similarity constraints are processed first during the matching process, achieving early pruning.

[0061] During the enumeration process, traditional methods repeatedly check for the same similarity constraint conflicts. This invention introduces a failure set mechanism to dynamically record the information of candidate nodes that are pruned due to non-compliance with similarity constraints. When encountering the same constraint conflict pattern, invalid candidates are skipped directly based on the failure set, avoiding redundant calculations and significantly reducing the size of the candidate set and the number of similarity calculations.

[0062] Traditional "post-filtering" methods can only perform constraint checks after matching is completed, and cannot prune branches in a timely manner during the search process. This invention implements multi-level dynamic constraint checks during the recursive enumeration process, including failure set pre-filtering, candidate node verification, and partial matching overall verification, ensuring that branches that do not meet the constraints are discovered and pruned early in the search, avoiding the deepening of ineffective searches.

Claims

1. A method for processing cross-modal similarity matching queries, characterized in that, Includes the following steps: Step 1: Receive cross-modal similarity matching queries, parse the query statements, and extract the graph pattern structure and vector similarity constraints. Step 2: Based on the extracted graph pattern structure and vector similarity constraints, construct an augmented query graph and transform the similarity constraints into virtual edges; Step 3: Based on the statistical information of the existing data graph and the constructed augmented query graph, calculate the comprehensive weight of the query vertices in the augmented query graph, and generate the optimal constraint-aware matching order based on the comprehensive weight of the query vertices. Step 4: Based on the optimal constraint-aware matching order, recursively enumerate subgraph matching on the data graph. Check whether the enumerated subgraphs meet the query requirements of cross-modal similarity matching based on the constraints of the augmented query graph pattern structure and vector similarity constraints, and use the failure set mechanism for pruning. Step 5: Output the results, returning all matching results that meet the conditions.

2. The cross-modal similarity matching query processing method according to claim 1, characterized in that, Step 1 specifically involves: receiving cross-modal similarity matching queries submitted by users; the cross-modal similarity matching queries employ extended graph query syntax, and the query statements explicitly include graph pattern structure descriptions and vector similarity constraint descriptions; The query parser parses the query statement and extracts the graph pattern structure, vector similarity constraints, and connection conditions. The connection conditions are the associations between nodes and vector data in the data graph, including the mapping rules between data graph node identifiers and vector identifiers, and the connection keys between data graph nodes and vectors.

3. The cross-modal similarity matching query processing method according to claim 1, characterized in that, Step 2 specifically involves: In the query preprocessing stage, an augmented query graph is constructed based on vector similarity constraints. The specific construction process is as follows: the graph pattern structure of the original query statement is used as the initial state of the augmented query graph. Each vector similarity constraint is traversed. For each pair of nodes involved in the vector similarity constraint, if there is no connecting edge in the graph pattern structure of the original query statement, a virtual edge is added in the augmented query graph. The virtual edge is marked as "virtual" type, and the similarity threshold parameter is stored in the edge attribute to obtain the augmented query graph.

4. The cross-modal similarity matching query processing method according to claim 1, characterized in that, Step 3 specifically involves: Based on the statistical information of the augmented query graph and the data graph, a greedy strategy based on comprehensive weight is adopted to calculate the comprehensive weight value for each query vertex and generate a constraint-aware matching order for the query vertices in the augmented query graph. The matching order generation process uses an iterative selection mechanism: during the initialization phase, all query vertices are placed into an unsorted set; in each iteration, the query vertex with the highest overall weight is selected from the remaining query vertices and added to the matching order. After selecting a query vertex, update the candidate set size and overall weight value of the remaining query vertices adjacent to it; repeat this process until all query vertices are sorted.

5. The cross-modal similarity matching query processing method according to claim 4, characterized in that, The calculation of the comprehensive weight value includes three factors: the reciprocal of the candidate set size, the number of virtual edges, and the strength of structural constraints. The candidate set size reflects the filtering effect of the query vertex. The number of virtual edges measures the density of vector similarity constraints. The strength of structural constraints is calculated based on node degree and label frequency. The node degree refers to the degree of the query vertex in the augmented query graph, which is the number of edges connected to the query vertex, including real edges and virtual edges. The label frequency is the frequency of the query vertex label appearing in the data graph. The comprehensive weight calculation formula is as follows: in, `u` is the size of the candidate set for query vertex `u`; `virtual_degree(u)` is the number of virtual edges connected to query vertex `u`; `structural_constraint(u)` is the structural constraint strength based on node degree and label frequency, defined as the node degree multiplied by the reciprocal of the label frequency; parameters The weight parameters are obtained through historical query statistics.

6. The cross-modal similarity matching query processing method according to claim 1, characterized in that, Step 4 specifically involves: performing a recursive enumeration of subgraph matching processes based on the optimal constraint-aware matching order; checking vector similarity constraints during the enumeration process; and optimizing search efficiency through a failure set mechanism.

7. The cross-modal similarity matching query processing method according to claim 6, characterized in that, The vector similarity constraint check specifically involves: implementing multi-level dynamic constraint checks during the enumeration process; filtering the failure set during the candidate selection phase; querying the failure set records; and skipping candidate nodes in the candidate set that are known to conflict with the current partial matching state; sequentially checking the graph pattern structure constraints and vector similarity constraints between the remaining candidate nodes and all matched vertices; and performing a comprehensive verification of the current partial matching before recursively entering the next matching depth to ensure that the vector similarity constraints between all matched vertices are satisfied.

8. The cross-modal similarity matching query processing method according to claim 6, characterized in that, The failure set mechanism dynamically maintains pruning information. The failure set record is in the form of a triple, which is (current vertex, matched vertex, data node corresponding to the matched vertex). It stores which candidate nodes of the current vertex are pruned because they do not meet the similarity constraint when a matched vertex is bound to a specific data node. When the same matching state is encountered in subsequent searches, invalid candidates are skipped directly according to the failure set record to avoid repeated calculations.

9. The cross-modal similarity matching query processing method according to claim 1, characterized in that, Step 5 specifically involves: When a complete subgraph match is found and all graph pattern structure constraints and vector similarity constraints are satisfied, the subgraph match is added to the result set. After the enumeration process is completed, all valid matches are used as query results. The query result set includes graph node attributes and vector similarity scores to meet the user's cross-pattern retrieval needs.

10. A processing system for cross-modal similarity matching query, characterized in that, The processing method for cross-modal similarity matching query according to any one of claims 1-9 includes: The storage layer is used to integrate and manage data graph node data, vector data, and related metadata; The query parsing layer extends the query parser to support cross-modal similarity matching operators. It receives cross-modal similarity matching queries, parses the query statements, and extracts the query graph pattern, vector similarity constraint set, and connection conditions. A query optimization layer is used to optimize the query execution plan that includes the cross-modal similarity matching operator; The execution engine is a processing method for cross-modal similarity matching queries executed by the cross-modal similarity matching operator. During the recursive matching process, it simultaneously verifies graph pattern structure constraints and vector similarity constraints, implements dynamic pruning and failure set optimization, and executes queries according to the process of initialization phase, recursive matching phase, and result collection phase. Through the collaboration of the storage layer, query parsing layer, query optimization layer and execution engine, a unified processing framework for cross-modal similarity matching queries is constructed. The cross-modal similarity matching operator is a wrapper around the cross-modal similarity matching query processing method. Its interface adopts a six-tuple definition, including query graph pattern, similarity constraint pair set, vector set identifier, connection condition, similarity parameter and distance function, and supports both TOP-K and WITHIN-R query semantics.

Citation Information

Patent Citations

  • Sub-graph isomorphism constraint solving method based on graph node information aggregation

    CN111445963A

  • Method and system for improving sub-graph matching efficiency

    CN114625811A