Document Intersection Algorithm Length Difference Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing search engine methods for obtaining the intersection of multiple document collections are inefficient when the length difference between collections is significant, leading to increased response times due to unnecessary traversals and reduced query efficiency.
Innovation Solution
A method that determines an intersection algorithm based on the length difference between document collections, using the shortest collection as a query starting point to traverse the others, thereby optimizing the intersection process and reducing response time.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If linear traversal method is used to obtain document intersection, then the method is simple and easy to implement, but the efficiency is low when length difference between document collections is greater than threshold
Solution Approach 1:
The patent changes the parameter of traversal starting point selection based on the length difference parameter between document collections. When length difference exceeds a threshold, the starting collection is changed from the first collection to the shortest collection, optimizing traversal efficiency while maintaining implementation simplicity
Solution Approach 2:
The patent introduces dynamic selection of traversal strategy based on runtime conditions (length difference threshold). The system dynamically adjusts which collection to start traversing from, making the algorithm adaptive to different data distributions rather than using a fixed linear approach
2Reliability
If sequential comparison of elements is performed in linear traversal, then all elements can be checked, but unnecessary traversals increase response time when length difference is significant
Solution Approach 1:
The patent performs partial traversal by starting from the shortest collection rather than traversing all collections equally. This partial action approach checks only the necessary elements from the most constrained collection, avoiding excessive traversal of larger collections while still ensuring complete intersection detection
Solution Approach 2:
The patent performs preliminary calculation of collection lengths before traversal to identify the shortest collection. This preliminary action enables optimization of the traversal starting point, preventing unnecessary time consumption during the actual intersection computation phase
Data Source
AI summary
The present disclosure provides a method and an apparatus for obtaining an intersection of a plurality of documents and a readable storage medium. According to an example in the method, for at least two document collections for which an intersection needs to be obtained in a search, document collection lengths of the document collections are obtained, and lengths of the at least two document collections are compared. In this way, an intersection algorithm for obtaining a document intersection may be determined according to a length difference between the at least two document collections. For example, when the document collection lengths of the at least two document collections meet a preset condition, an element in a document collection with the shortest length may be used as a query element to sequentially traverse the remaining document collections.


