Method for quickly querying file

By creating TAB files in each partition of the file system, storing brief information of the files, and updating them synchronously when the files are generated or the information changes, the existing file system solves the problem of slow query and retrieval speed in large-scale file sets, and achieves Provides an efficient file retrieval experience.

CN119336712APending Publication Date: 2025-01-21V & G INFORMATION SYSTEM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411591521.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

When existing file systems process large-scale file sets, they have slow query and retrieval speeds and high response latency, resulting in system performance bottlenecks.

Method used

By creating a tab file in each partition, it is used to store the brief information of the file, including the file serial number, name, operation time, size, and data sector code. Whenever the file is generated or the information is changed, the TAB file is updated simultaneously. When querying the file, read the required information directly from the TAB file to avoid traditional directory traversal.

Benefits of technology

The method of fast query files is achieved, which significantly improves the efficiency of file retrieval, reduces computing resources, and enhances the user's operating experience, especially when dealing with large -scale file sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336712A_ABST
    Figure CN119336712A_ABST
Patent Text Reader

Abstract

The invention provides a method for quickly querying files, which comprises the following steps of: after a memory disk is partitioned, creating a TAB (Tracking Area Block) file for each partition; the TAB file is used for storing brief information related to the file in the partition where the TAB file is located, and the brief information comprises a file serial number; after each partition is formatted, the corresponding TAB file is initialized, so that the TAB file is in a normal working state; when a new file is generated or the information of the stored file is changed, recording detailed file information items in the original file system, and synchronously updating the basic information of the file into the TAB file; when the file is inquired, the TAB file is opened, and required file information is read through the TAB file according to user requirements. According to the method and the device, the problem of low retrieval efficiency caused by a large number of files in a traditional file system is solved, and more efficient and quicker file retrieval experience is provided for users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a method for quickly querying files. Background Art

[0002] With the rapid development of information technology and the advent of the era of big data, the amount of data has exploded. From scientific research to business intelligence, to various applications in daily life, massive data is everywhere. In order to meet this challenge, it is necessary not only to achieve effective storage of these data, but also to ensure that they can be quickly retrieved and processed. Especially in some high-performance computing environments, such as the big data storage system of radar equipment, it is necessary not only to store a large amount of radar raw waveform data, but also to process a large number of result image files. Although many current file systems provide detailed directory information management, their query performance is inadequate when facing large-scale data sets. When the number of files reaches a certain scale, the traditional directory traversal method will significantly prolong the query response time. This is because, in the existing file system architecture, the file name is the main identifier to establish a connection between the user and the file system, and its creation and retrieval process often relies on comparing the file names one by one. Although this one-to-one linear search strategy is intuitive and simple, it has inherent limitations in terms of efficiency.

[0003] In actual applications, whether creating a new file or searching for an existing file, the system needs to check each entry in the directory tree one by one until the target file is found. This method not only consumes a lot of computing resources, but also greatly affects the user's operating experience, especially in scenarios where a large number of files need to be frequently accessed or modified. This inefficient query mechanism becomes a bottleneck for system performance. In the early stage of use, when there are few files, the file directory query can meet the needs. Once the number of files increases to a certain extent, the traditional file directory query mechanism cannot meet the needs. Especially when the number of files increases sharply, the query efficiency decreases significantly, seriously affecting the performance of the system.

[0004] It can be seen that the existing file systems have common problems such as slow query and retrieval speed and high response delay when processing large-scale file collections, which have become one of the key factors restricting system performance. In order to solve the above problems, a new method that can efficiently manage and quickly access large-scale file collection lists is urgently needed. Summary of the invention

[0005] The purpose of the present invention is to provide a method for quickly searching for files, which can solve the problem of low retrieval efficiency caused by a large number of files in a traditional file system.

[0006] In order to achieve the above object, the present invention provides a method for quickly searching files, comprising:

[0007] After the storage disk is partitioned, a TAB file is created for each partition;

[0008] The TAB file is used to store brief information related to the files in the partition, and the brief information includes the file sequence number;

[0009] After each partition is formatted, the corresponding TAB file is initialized to make it work properly.

[0010] Whenever a new file is generated or the information of an existing file is changed, the basic information of the file is synchronously updated to the TAB file while recording the detailed file information entries in the original file system;

[0011] When querying a file, the TAB file is opened, and the required file information is read through the TAB file according to user requirements.

[0012] In an optional solution, the brief information also includes: file name, file operation time, file size, and file data start and end sector numbers.

[0013] In the optional scheme, a threshold value for the number of files in a folder is set; before creating a file, the system first checks the number of existing files in the current folder. If it detects that the number of files in the folder is greater than or equal to the threshold, the system creates a new subfolder to store the files to be added; if the number of files is less than the threshold, a new file is created directly under the current path without creating an additional subfolder.

[0014] In an optional solution, the step of reading the required file information through the TAB file according to user requirements includes:

[0015] The user enters a file number within a specified range and reads file information within the corresponding file number range from the TAB file.

[0016] In an optional solution, the step of reading the required file information through the TAB file according to user requirements includes:

[0017] The user enters the serial number of a single file to query the information of a single file, and the file information is displayed; if the file needs to be read and written after retrieving the file, the file name is obtained, and then the file entry information under the corresponding folder is traversed to retrieve the corresponding file detailed information.

[0018] In an optional solution, the step of reading the required file information through the TAB file according to user requirements includes:

[0019] The user enters a specified time range and reads file information within the corresponding time range from the TAB file.

[0020] The beneficial effects of the present invention are:

[0021] The present invention not only solves the problem of low retrieval efficiency caused by a large number of files in a traditional file system, but also provides users with a more efficient and quick file retrieval experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, in which like reference numerals generally represent like components.

[0023] Figure 1 The present invention is a flowchart of creating and updating a TAB file in a method for quickly querying files in an embodiment of the present invention.

[0024] Figure 2 The present invention is a flowchart of a method for quickly searching for files in a file list according to an embodiment of the present invention.

[0025] Figure 3 The present invention is a flowchart of a method for quickly searching for files in accordance with an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. According to the following description and drawings, the advantages and features of the present invention will become clearer. However, it should be noted that the concept of the technical solution of the present invention can be implemented in a variety of different forms and is not limited to the specific embodiments described herein. The drawings are all in a very simplified form and are not in precise proportions, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention.

[0027] It should be understood that when an element or layer is referred to as being "on, adjacent to, connected to or coupled to other elements or layers, it may be directly on, adjacent to, connected to or coupled to other elements or layers, or there may be intervening elements or layers. In contrast, when an element is referred to as being "directly on, directly adjacent to, directly connected to or directly coupled to other elements or layers, there may be no intervening elements or layers. It should be understood that, although the terms first, second, third, etc. may be used to describe various elements, components, regions, layers and / or parts, these elements, components, regions, layers and / or parts should not be limited by these terms. These terms are only used to distinguish one element, component, region, layer or part from another element, component, region, layer or part. Therefore, without departing from the teachings of the present invention, the first element, component, region, layer or part discussed below may be represented as a second element, component, region, layer or part.

[0028] Spatially relative terms such as "under," "below," "below," "under," "above," "above," etc., may be used herein for ease of description to describe the relationship of an element or feature shown in the figures to other elements or features. It should be understood that in addition to the orientations shown in the figures, the spatially relative terms are intended to include different orientations of the device in use and operation. For example, if the device in the accompanying drawings is flipped, then the elements or features described as "under other elements" or "under" or "under" will be oriented as "on" the other elements or features. Therefore, the exemplary terms "under" and "under" may include both upper and lower orientations. The device may be oriented otherwise (rotated 90 degrees or other orientations) and the spatial descriptors used herein are interpreted accordingly.

[0029] The purpose of the terms used herein is only to describe specific embodiments and is not intended to be limiting of the present invention. When used herein, the singular forms "one", "an" and "said / the" are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "consisting of" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.

[0030] Example 1

[0031] Reference Figures 1 to 3 This embodiment provides a method for quickly searching for files, including:

[0032] After the storage disk is partitioned, a TAB file is created for each partition;

[0033] The TAB file is used to store brief information related to the files in the partition, and the brief information includes the file sequence number;

[0034] After each partition is formatted, the corresponding TAB file is initialized to make it work properly.

[0035] Whenever a new file is generated or the information of an existing file is changed, the basic information of the file is synchronously updated to the TAB file while recording the detailed file information entries in the original file system;

[0036] When querying a file, the TAB file is opened, and the required file information is read through the TAB file according to user requirements.

[0037] Specifically, this method is closely related to file system management and optimization, and is particularly suitable for efficient data storage and query in self-developed file systems. The method mainly includes a storage information part, a query file list part, and a retrieval file part.

[0038] In terms of storage information, based on the traditional file system, this embodiment introduces a simplified file list information recording mechanism, which we call a "TAB file". The TAB file is created when the system partition is created and initialized after formatting. Whenever a new file is generated or the information of an existing file is changed, in addition to recording detailed file information entries in the original file system, the basic information of the file will also be synchronously updated to the TAB file. This is done to build a concise and efficient index system to facilitate subsequent rapid search and location of files.

[0039] The TAB file mainly records the following key brief information:

[0040] File serial number: Assign a unique serial number to each file to quickly locate the file in the TAB file.

[0041] File name: It serves as an intuitive identifier for users to identify files, making it easier to manage and identify them.

[0042] File operation time: includes the file's creation time, last modification time, and most recent access time, which helps track the file's historical status.

[0043] File size: When the file data size changes, the actual size of the current file is updated each time.

[0044] File data start and end sector numbers: mark the start and end positions of file data on the storage medium to speed up data reading.

[0045] This basic information can highly summarize the core attributes of the file, allowing the system to maintain efficient query and retrieval capabilities when processing a large number of files.

[0046] 2. Query file list: In order to further optimize the efficiency of file query, this embodiment proposes a query mechanism that does not require traversing all entries through the traditional file system. Users no longer need to read all file entry information from the storage medium, but complete the query task by reading the brief file list information in the pre-created and maintained TAB file. This method not only simplifies the query process, but also greatly improves the query speed. The specific functional advantages of the query mechanism are as follows:

[0047] Quick location query: Since the TAB file contains a unique corresponding file number, users can directly jump to the specific information of the required file based on the file number without having to perform a full disk scan or traversal search. This one-step location method greatly shortens the query time.

[0048] Precise query: By specifying a file number range, you can quickly obtain all file information within a specific interval. This precise query capability enables users to manage large numbers of files more efficiently.

[0049] Time range query: Considering that the TAB file contains the operation time information of the file, and the file information is stored in chronological order, the user can obtain all the files created or modified within the specified time range. This method is particularly suitable for application scenarios that require archiving or retrieving files in chronological order.

[0050] 3. File retrieval method, this embodiment proposes a two-level retrieval mechanism in file retrieval to support different levels of requirements. The first level retrieval is used to quickly find the information of a single file, while the second level retrieval further realizes the acquisition from file information to file data.

[0051] First level search: quickly obtain single file information

[0052] In the first-level search process, users can directly locate the required file information by file number. Since the file number is unique in the TAB file, the corresponding file record can be found immediately without traversing the entire disk. This method greatly simplifies the search process and reduces unnecessary computing overhead.

[0053] Second level search: Get file data

[0054] If the user needs not only the basic information of the file but also the actual content of the file, the second level search stage is required. In this stage, the system first determines the file name by the file serial number, and then searches for the specific information of the file in the corresponding location of the file system. In order to further improve the search efficiency, this embodiment adopts the following improvement measures:

[0055] File grouping: When creating a file, place it in a specific folder, and each folder can only store up to 200 files. This means that under any specified absolute path, the system only needs to traverse up to 200 files to find the target file, greatly reducing the traversal time. Through the above two steps, users can efficiently obtain the required file information and perform further operations on their data.

[0056] Using this method, administrators only need to enter the file number to immediately obtain the basic information of the document. If they need to further view the document content, the system will quickly search under the specified path and only need to traverse up to 200 files to find the target document, thus significantly shortening the waiting time.

[0057] Through such a design, this method not only solves the problem of low retrieval efficiency caused by the huge number of files in the traditional file system, but also provides users with a more efficient and quick file retrieval experience.

[0058] More specifically, the steps include:

[0059] (1) After the storage disk is partitioned, a dedicated TAB file is created for each partition. This TAB file acts as an information carrier and exists in the file system as a lightweight file list information storage medium. Specifically, the TAB file is used to store brief information related to the files in the partition, such as the file name, path, and other key metadata, thereby providing fast access support for subsequent file query, retrieval, and management. This design not only helps improve the overall efficiency of the file system, but also simplifies the management and query process of file information.

[0060] (2) After each partition is formatted, the corresponding TAB file will be initialized to make it work properly. This initialization process is particularly important because it ensures that when the user chooses to use the formatting function, all file list information in the TAB file will be cleared to be consistent with the actual file entry information in the formatted partition. This can avoid information mismatch problems caused by residual old data and ensure that the information recorded in the TAB file is always up-to-date and accurate, thereby supporting the efficient operation of the file system.

[0061] (3) Before creating a file, the system will first check the number of files in the current folder. If it detects that the number of files in the folder exceeds or equals a threshold (such as 200), the system will create a new subfolder to store the files to be added. Conversely, if the number of files is less than 200, a new file is created directly in the current path without creating an additional subfolder. This mechanism helps to maintain a neat folder structure and facilitates file management and retrieval.

[0062] (4) When creating user files, all query and retrieval optimization methods are based on the information of the user files. The first step is to ensure that there is an information object (i.e., brief information about each file in the TAB file), which contains the key attributes and metadata of the user file. Through such an information object, the system can effectively organize and process file data, thereby achieving faster and more accurate file query and retrieval functions. This step is the basis for achieving subsequent efficient file management.

[0063] (5) When adding file list information in the TAB file, when user files are created through the file system, these files will naturally have certain attribute information. This method extracts brief file information from it, including but not limited to file sequence number, file name, file size, file time (such as creation or last modification time) and the start and end sector numbers of the file, and records this information in the corresponding TAB file. In fact, when the file system using this method works normally, it is a process of constantly repeating steps (3), (4), and (5). The process of collecting file information currently stored in the file system.

[0064] (6) When updating the corresponding file information in the TAB file, whenever a file is being operated (such as a read or write operation), the file system will update the attribute information of the file in real time. At the same time, the present invention will also synchronously update the brief attribute information of the current file to the TAB file. This update process will be repeated continuously during the file operation until the file operation is finally completed. In this way, it can be ensured that the information in the TAB file always maintains the latest status information.

[0065] The above process is the preparation work for the data required for the quick query of the file information list of this embodiment, or in other words, the process of data collection and recording. The implementation of the quick query function is completed based on the above steps. Through this series of steps, the system can effectively maintain the accuracy and timeliness of the file information, thereby ensuring that the required file information can be quickly and accurately queried when needed.

[0066] After completing the data preparation work, the next step is to implement the quick query function. There are three specific implementations of the method, namely, querying the specified file number range, querying the single file information, and querying the specified time range. The following are the specific implementations of the three cases:

[0067] Case 1: When opening a TAB file, the user can enter a file number within a specified range. There is no need to traverse the actual file entry information stored by the file system on the disk. Instead, the file information within the corresponding file number range can be directly read from the TAB file, thereby realizing fast query of file information.

[0068] Case 2: When opening a TAB file, the user can enter the serial number of a single file to query the information of a single file. In this case, the system will directly read the file information at the corresponding file number from the TAB file. For the query of single file information, the system will return the query results hierarchically.

[0069] This embodiment is aimed at single file information query, also called single file retrieval. Figure 3 This is a single file search flow chart. Single file search is mainly divided into two levels to search for file information. The first level, as long as the file information is retrieved for display only, without further action, only read the corresponding file information in the TAB file; the second level search, if the file needs to be read and written after the file is retrieved, it is necessary to obtain the file name based on the first level search results, and then traverse the file entry information under the corresponding folder to retrieve the corresponding file details, and the search is completed.

[0070] The creation of folders mentioned in step (3) of the file system modification execution is an optimization to increase the speed of the second-level traversal of the file directory, because in this case, only a maximum of 200 file entries need to be traversed.

[0071] Case 3: When opening a TAB file, the user can enter a specified time range to query file information. Since the data in the TAB file is stored in sequence and contains detailed file time information, the file information query within the specified time range can be completed very quickly.

[0072] For example, when a user needs to query a file generated on February 11, 2024, and wants to copy the file data, he is not sure which specific file it is. First, the user enters the query date from February 11, 2024 to February 12, 2024, retrieves 30 files in the TAB file, and displays brief information about each file, including the file number, file name, file operation time, file size, and file data start and end sector numbers. Based on the above information, the user confirms that the file required is file number 15 (first-level search completed). The user selects file No. 15, sends a request to continue searching for file No. 15 information, obtains the file name, finds the corresponding folder according to the file name (absolute path), and compares the corresponding entry information of the folder in the file system one by one to find the corresponding file information (second-level search completed). After obtaining the specific information of file No. 15, you can execute the file data copy.

[0073] The above description is only a description of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any changes or modifications made by a person skilled in the art in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.

Claims

1. A method for quickly querying files, characterized in that: include: After the storage disk is partitioned, a TAB file is created for each partition; The TAB file is used to store brief information related to the files in the partition, and the brief information includes the file sequence number; After each partition is formatted, the corresponding TAB file is initialized to make it work properly. Whenever a new file is generated or the information of an existing file is changed, the basic information of the file is synchronously updated to the TAB file while recording the detailed file information entries in the original file system; When querying a file, the TAB file is opened, and the required file information is read through the TAB file according to user requirements.

2. The method for quickly searching files according to claim 1, characterized in that: The brief information also includes: file name, file operation time, file size, and file data start and end sector numbers.

3. The method for quickly searching files according to claim 1, characterized in that: Preset a threshold for the number of files in a folder; before creating a file, the system first checks the number of files in the current folder. If it detects that the number of files in the folder is greater than or equal to the threshold, the system creates a new subfolder to store the files to be added; If the number of files is less than the threshold, a new file is created directly in the current path without creating an additional subfolder.

4. The method for quickly searching files according to claim 1, characterized in that: The method of reading the required file information through the TAB file according to user requirements includes: The user enters a file number within a specified range and reads file information within the corresponding file number range from the TAB file.

5. The method for quickly searching files according to claim 2, characterized in that: The method of reading the required file information through the TAB file according to user requirements includes: The user enters the file number of a single file to query the information of a single file and display the file information; if the file needs to be read and written after retrieving the file, the file name is obtained, and then the file entry information under the corresponding folder is traversed to retrieve the corresponding file detailed information.

6. The method for quickly searching files according to claim 2, characterized in that: The method of reading the required file information through the TAB file according to user requirements includes: The user enters a specified time range and reads file information within the corresponding time range from the TAB file.