File Processing Method Reducing Disk IO via Memory Exception Handling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The Windows operating system experiences reduced file reading speed due to frequent disk IO operations caused by frequent calls to the SetFilePointer and ReadFile functions, leading to inefficient use of system resources.

Innovation Solution

A file processing method and system that registers a memory access exception handler function to manage memory areas, setting them as non-readable and non-writable initially, allowing data to be read from disk only when needed, and storing it in memory for subsequent reads, thereby reducing disk IO and conserving system resources.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the Windows operating system frequently calls SetFilePointer and ReadFile functions to read file data, then the file reading operation can be completed, but the disk IO operations increase frequently which reduces reading speed and consumes system resources

Engineering Contradiction:
Improvefile reading speedVSAvoidsystem resource consumption
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent pre-allocates a memory area for storing file data before actual reading operations occur. This preliminary action prepares the system to cache data in memory, reducing the need for repeated disk IO operations during file reading, thereby improving reading speed and reducing system resource consumption

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a memory area as an intermediary between the disk and the file reading process. By setting specific memory pages as read-only and using exception handlers to intercept access attempts, the system can load data once from disk into memory and serve subsequent reads from the memory cache, significantly reducing disk IO frequency and improving overall reading efficiency

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If the memory area is set as non-readable and non-writable initially, then direct memory access is prevented, but accessing the memory area requires exception handling which adds complexity

Engineering Contradiction:
Improvememory access controlVSAvoidexception handler complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent employs a self-service mechanism where the exception handler automatically loads the required data page from disk into memory when a read attempt occurs on a non-readable page. This self-service approach maintains reliable memory access control while reducing the apparent complexity for the application layer, as the exception handling is transparent and automatic

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent dynamically changes the accessibility parameters of memory pages during runtime. Pages are initially set as non-readable and non-writable, but when accessed through the exception handler, they are loaded into memory and their permissions are changed to readable, allowing subsequent direct access without exception handling. This dynamic parameter change balances reliability with operational simplicity

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS9684660B2File processing method and system
Publication Date: 2017.06.20 TENCENT TECHNOLOGY (SHENZHEN) CO LTD
  • US9684660B2 patent drawing
  • US9684660B2 patent drawing
  • US9684660B2 patent drawing

AI summary

Various embodiments provide a file processing method and system. An exemplary file processing method can include receiving a request for opening a file, applying for a memory area corresponding to the file requested for opening and setting a property of the memory area as non-readable and non-writable. After receiving a request for reading the file, the memory area corresponding to the file requested for reading can be accessed. If the accessing fails for a failure reason that the property of the memory area is non-readable and non-writable, file data requested for reading can be obtained from a disk by calling a memory access exception handler function registered in an operating system. The obtained file data can be stored in the memory area. The property of the memory area can be set as readable and writable and the file data can be read from the memory area.