Graph Query Path Filtering via Node Set Matching

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Graph database queries with filtering conditions involving path patterns suffer from low efficiency due to the need to traverse paths, which consumes significant computing resources and time, especially with longer path patterns and multiple node hops.

Innovation Solution

The method converts path pattern filtering into node set matching by first identifying nodes that meet a matching condition and then determining if they belong to a pre-identified node set, optimizing the query process to reduce traversal and improve efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If path traversal is performed to filter nodes based on path pattern, then filtering accuracy is improved, but query efficiency deteriorates

Engineering Contradiction:
Improvefiltering accuracyVSAvoidquery efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent pre-calculates and stores path patterns in a specialized data structure (path pattern index) before queries are executed. When a query arrives, the system retrieves pre-computed path patterns rather than traversing paths in real-time, significantly improving query efficiency while maintaining filtering accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a path pattern index as an intermediary data structure between the graph database and the query processor. This index acts as a mediator that stores pre-computed path information, allowing efficient retrieval and matching without direct path traversal during query execution.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If path traversal is performed for filtering, then filtering condition is satisfied, but computing resources are consumed

Engineering Contradiction:
Improvefiltering condition satisfactionVSAvoidcomputing resources
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The system performs path pattern computation in advance and stores results in the path pattern index. During query execution, pre-computed paths are retrieved and matched against query conditions, eliminating the need for expensive real-time path traversal and reducing computing resource consumption while ensuring filtering conditions are met.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a copy of path pattern information in the path pattern index, which can be efficiently queried and matched without traversing the actual graph paths. This copy mechanism allows filtering condition satisfaction through quick lookups rather than resource-intensive path traversals.

Inventive Principle:
Principle #26Copying

3Measurement precision

If path traversal is performed, then path pattern filtering is achieved, but query time increases

Engineering Contradiction:
Improvepath pattern filteringVSAvoidquery time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

Path patterns are pre-computed and stored in the path pattern index before queries are executed. When a query arrives, the system performs quick lookups in the index rather than time-consuming path traversals, significantly reducing query time while maintaining accurate path pattern filtering.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent replaces the mechanical process of traversing graph paths during query execution with a more efficient data structure-based lookup system. The path pattern index enables filtering through index-based retrieval mechanisms rather than sequential path traversal, dramatically reducing query time.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS12475122B2Data query method and apparatus, storage medium, and device
Publication Date: 2025.11.18 ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
  • US12475122B2 patent drawing
  • US12475122B2 patent drawing
  • US12475122B2 patent drawing

AI summary

This specification discloses a method. The method includes: when a received match statement includes a filtering condition of a path pattern, a node that matches a path in the path pattern is queried from all nodes in the graph database based on the path, to obtain a first node set. A node that meets a matching condition in the match statement is determined from all the nodes in the graph database based on the matching condition. For each node that meets the matching condition, whether the node falls within the first node set is determined. Whether the node belongs to a query result of the match statement is determined based on a determining result. Traversing, based on the path pattern, a path of a node that matches the match statement can be simplified as matching between a node and a node set.