File Scanning Hard Link Caching for IO Reduction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing file scanning technologies incur high IO and CPU overhead due to repeated scanning of files with multiple hard links, leading to decreased efficiency.

Innovation Solution

A method and apparatus that store a file identifier and scanning result for files with multiple hard links, allowing for direct retrieval when the file is scanned again, reducing the need for repeated scanning by using the storage location as a unique identifier.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a scanning engine is invoked to scan files according to a file traversing sequence, then all files can be scanned, but files with multiple hard links are scanned repeatedly causing high IO and CPU overhead

Engineering Contradiction:
Improvefile scanning completenessVSAvoidscanning efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies preliminary action by checking the hard link count of each file before invoking the scanning engine. When a file with multiple hard links is encountered, the system performs the scanning operation once and stores the result, then retrieves the stored result for subsequent encounters with the same file (identified by its hard link count and file path), thereby avoiding repeated scanning operations and reducing IO and CPU overhead while maintaining complete file scanning coverage

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses copying by storing the scanning result of a file with multiple hard links in a cache or storage structure. When the same file is encountered again through different hard link paths, the system copies the previously stored scanning result and returns it directly, eliminating the need to re-execute the scanning engine and significantly improving scanning efficiency

Inventive Principle:
Principle #26Copying

Data Source

PatentUS10049113B2File scanning method and apparatus
Publication Date: 2018.08.14 BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
  • US10049113B2 patent drawing
  • US10049113B2 patent drawing
  • US10049113B2 patent drawing

AI summary

Disclosed are a file scanning method and apparatus. The method includes: obtaining a quantity of hard links of a to-be-scanned file used as a scanning target; if the quantity of hard links of the to-be-scanned file is greater than 1, when the to-be-scanned file is used as the scanning target for the first time, invoking a scanning engine to scan the to-be-scanned file to obtain a scanning result, and storing a file identifier uniquely identifying the to-be-scanned file and the scanning result to a storage unit, and when the to-be-scanned file is used as the scanning target again, querying for and obtaining the scanning result of the to-be-scanned file from the storage unit according to the file identifier.