Distributed Range Lock Search for Fast Interval Conflict Checks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing method of using a red-black tree to manage range locks in a distributed system is inefficient due to the need for continuous traversal as the number of locks increases, leading to high time consumption and low efficiency in obtaining range locks, especially in scenarios with a large quantity of concurrent read-write access.
Innovation Solution
A method that involves a first device obtaining a packet requesting a range lock, determining intersection of intervals with existing locks without traversing all locks, and sending a packet to the second device to obtain the lock when no intersection is found, utilizing a multi-level search structure to quickly identify neighboring points for efficient endpoint determination.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a red-black tree is used to manage range locks, then the locks can be organized in a structured manner, but the time needed for traversing the structure continuously increases as the quantity of obtained range locks increases, resulting in low efficiency of obtaining the range lock
Solution Approach 1:
The patent segments the red-black tree traversal into multiple levels. Instead of traversing the entire tree structure, the system divides the traversal into level-by-level processing, where each level handles a subset of range locks. This segmentation reduces the traversal depth and time required at each query step, directly addressing the efficiency problem while maintaining the structured organization of locks.
Solution Approach 2:
The patent introduces a multi-level hierarchical dimension to the range lock management. By organizing range locks across multiple levels with different granularities, the system transforms a single-dimension linear traversal into a multi-dimensional hierarchical search. This allows queries to eliminate large portions of the search space at each level, significantly reducing traversal time while maintaining comprehensive lock coverage.
2Reliability
If all obtained range locks are traversed to check for interval intersection, then conflict detection is thorough, but the processing time increases significantly with the quantity of locks
Solution Approach 1:
The patent performs preliminary organization of range locks into a multi-level hierarchical structure before conflict detection is needed. At each level, range locks are pre-sorted and organized by their interval characteristics. This preliminary action enables efficient conflict detection by allowing the system to quickly identify which locks could potentially conflict with a new lock request, eliminating the need to check all locks thoroughly each time.
Solution Approach 2:
The patent implements partial traversal of the range lock structure by stopping the search early when conflicts are detected or when the search space is exhausted at a given level. Instead of always performing complete traversal of all locks, the system performs only the necessary partial traversal required to determine conflict status, significantly reducing average processing time while maintaining reliable conflict detection.
Data Source
AI summary
This application discloses a method. The method includes: A first device obtains a first packet sent by a second device, where the first packet is for requesting to obtain a first range lock, the first packet includes a type and an interval that are of the first range lock, and the first range lock is used to lock data stored in a distributed manner; then, obtains a second range lock corresponding to the type of the first range lock, to determine whether the interval of the first range lock intersects an interval of the second range lock; and sends a second packet to the second device based on a case in which the interval of the first range lock does not intersect the interval of the second range lock, where the second packet indicates the second device to obtain the first range lock.


