File integration reading method and terminal

By establishing integrated files when file read requests and decompressing and organizing files in memory, the problem of slow reading of compressed files is solved, improving efficiency and security.

CN119576878APending Publication Date: 2025-03-07FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411511627.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

When existing compressed file formats such as RAR and ZIP read a large number of fragmented files, the file reading speed is significantly reduced and needs to be decompressed to disk and accessed, which affects efficiency and security.

Method used

Through a file integration reading method, an integrated file is established in response to file reading requests. If the file is of compression type, decompress and establish a corresponding storage structure in memory, fill the file into memory space, and release the integrated file.

Benefits of technology

Reduces the number of accesses to disk, improves file reading speed, reduces memory usage, and ensures the security and stability of file data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576878A_ABST
    Figure CN119576878A_ABST
Patent Text Reader

Abstract

The invention discloses a file integration reading method and a terminal, and the method comprises the steps: responding to a file reading request, and building an integrated file according to a to-be-read file and a directory structure of the to-be-read file; and if the integrated file is of a compression type, decompressing the integrated file, establishing a memory space in a memory according to a directory structure in the decompressed file, filling a file to be read in the decompressed file into the memory space, and releasing the integrated file. According to the method, the integrated file is established, the integrated file is decompressed into the memory, the memory space is pre-applied according to the directory structure in the decompressed file, and the to-be-read file in the decompressed file is filled into the memory space, so that the file data loading time is shortened, the file reading speed is increased, the integrated file is released, the memory space is optimized, and the memory utilization rate is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a file integration reading method and terminal. Background Art

[0002] In the field of data processing, compression technology is one of the key technologies to improve storage efficiency and speed up data transmission. RAR and ZIP are two widely used compressed file formats. They both provide the function of compressing one or more files into a single file to reduce the storage space occupied by the files and simplify the file transfer process. RAR files can also provide encryption and splitting functions, which is conducive to the secure transmission of large files. However, a common limitation of RAR and ZIP files is that in order to access the files in the compressed package, they usually need to be decompressed to the disk first, and then the files in the compressed package need to be obtained by reading the disk data. If a large number of fragmented files need to be read, the file reading speed will drop significantly. Therefore, there is an urgent need for a file integration reading method and terminal that can solve the above problems. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a file integration reading method and terminal, which can integrate fragmented files and associated files, allow users to access them directly in memory, improve file reading speed, reduce fragmented files and file storage space, and ensure the security and stability of file data.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: A file integration reading method comprises the steps of: S1. In response to a file read request, create an integrated file based on the file to be read and its directory structure; S2. If the integrated file is of a compressed type, decompress the integrated file, create a memory space in the memory according to the directory structure in the decompressed file, fill the file to be read in the decompressed file into the memory space, and release the integrated file.

[0005] In order to solve the above technical problems, another technical solution adopted by the present invention is: A file integration reading terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned file integration reading method is implemented.

[0006] The beneficial effects of the present invention are as follows: a file integration and reading method and terminal provided by the present invention establish an integrated file according to the file to be read and its directory structure in response to a file reading request, thereby reducing the number of disk reads, improving data access efficiency, and integrating multiple files into one file to reduce memory usage; if the integrated file is of a compressed type, the integrated file is decompressed, and memory space is established in the memory according to the directory structure in the decompressed file, and the file to be read in the decompressed file is filled into the memory space, and the original file is restored, providing the possibility for subsequent users to directly access the file in the memory, releasing the integrated file, managing the memory space, ensuring the effective use of system resources, and saving memory space. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 A flowchart of a file integration reading method according to an embodiment of the present invention; Figure 2 A schematic diagram of a file integration and reading terminal according to an embodiment of the present invention; Figure 3 This is an internal flow chart of a file integration reading method according to an embodiment of the present invention; Figure 4 A schematic diagram of the composition of a storage structure according to an embodiment of the present invention; Figure 5 Schematic diagram of the composition of the memory usage of the memory structure of an embodiment of the present invention.

[0008] Description of labels: 1. A file integration and reading terminal; 2. A memory; 3. A processor. DETAILED DESCRIPTION

[0009] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.

[0010] Please refer to Figure 1 , an embodiment of the present invention provides a file integration reading method, comprising the steps of: S1. In response to a file read request, create an integrated file based on the file to be read and its directory structure; S2. If the integrated file is of a compressed type, decompress the integrated file, create a memory space in the memory according to the directory structure in the decompressed file, fill the file to be read in the decompressed file into the memory space, and release the integrated file.

[0011] From the above description, it can be seen that the beneficial effects of the present invention are: by responding to a file reading request, an integrated file is established according to the file to be read and its directory structure, the number of disk reading times is reduced, the data access efficiency is improved, and multiple files are integrated into one file to reduce memory usage; if the integrated file is of a compressed type, the integrated file is decompressed, and memory space is established in the memory according to the directory structure in the decompressed file, the file to be read in the decompressed file is filled into the memory space, and the original file is restored, providing a possibility for subsequent users to access the file directly in the memory, releasing the integrated file, managing the memory space, ensuring the effective use of system resources, and saving memory space.

[0012] Furthermore, the step of establishing a memory space in the memory according to the directory structure in the decompressed file includes: A corresponding storage structure is created in the memory according to the directory structure in the decompressed file, and a corresponding memory space is established in the memory according to the storage structure and the memory occupancy of the to-be-read file in the decompressed file.

[0013] From the above description, it can be seen that the required memory space is accurately established according to the storage structure and the memory usage of the files to be read in the decompressed files, avoiding excessive allocation of memory space, dynamically allocating memory according to actual needs, and improving memory usage efficiency and flexibility.

[0014] Furthermore, the corresponding storage structure is created in the memory according to the directory structure in the decompressed file, specifically: Obtain a binary tree directory structure in the decompressed file, and create a corresponding storage structure in the memory according to the binary tree directory structure.

[0015] From the above description, it can be seen that a corresponding storage structure is created in the memory through the binary tree directory structure, so that the file storage path can be filled and the files to be read can be stored according to the binary tree structure, thereby improving the file search efficiency and thus improving the file reading speed. In addition, the use of the binary tree directory structure can reduce the occupancy of the index structure in the memory and optimize memory usage.

[0016] Furthermore, the step of filling the memory space with the file to be read from the decompressed file is as follows: Obtain the directory structure in the decompressed file, obtain the branch of the file to be read in the decompressed file according to the directory structure, configure the branch name of the corresponding storage structure in the memory according to the file name corresponding to the branch, fill in the memory path of the file to be read corresponding to the decompressed file according to the branch name, and fill the file to be read in the decompressed file into the memory space according to the memory path.

[0017] From the above description, it can be seen that by obtaining the directory structure of the decompressed file, the organization of the file can be quickly understood, which is helpful for subsequent file access. The branch of the file to be read is obtained according to the directory structure, and the branch name of the corresponding storage structure in the memory is configured according to the file name corresponding to the branch. The memory path of the file to be read corresponding to the decompressed file is filled in according to the branch name. By establishing a mapping of the file to be read in the memory, the number of accesses to the disk is reduced, so that the file can be quickly accessed directly through the memory path, thereby improving the file reading speed. The file to be read in the decompressed file is filled into the memory space according to the memory path, and the file to be read is stored in the memory to ensure the security and stability of the file data.

[0018] Furthermore, the step S2 further includes: If the integrated file is not of a compressed type, the memory usage of the integrated file is calculated, and corresponding memory space is allocated to the integrated file according to the memory usage, and the integrated file is stored in the memory.

[0019] Please refer to Figure 2 Another embodiment of the present invention provides a file integration reading terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned file integration reading method is implemented.

[0020] The above-mentioned file integration and reading method and terminal of the present invention are suitable for integrating fragmented files and associated files to improve the file reading speed. The following is an explanation of the specific implementation method: Please refer to Figure 1 and Figure 3 , Embodiment 1 of the present invention is: a file integration reading method, comprising the steps of: S1. In response to a file read request, an integrated file is created according to the file to be read and its directory structure.

[0021] In this embodiment, by responding to a file read request, an integrated file is created based on the file to be read and its directory structure, thereby reducing the number of disk reads and improving data access efficiency. At the same time, multiple files are integrated into one file to reduce memory usage.

[0022] S2. If the integrated file is of a compressed type, decompress the integrated file, create a memory space in the memory according to the directory structure in the decompressed file, fill the file to be read in the decompressed file into the memory space, and release the integrated file.

[0023] The integrated file stores the data stream of the file to be read, and the directory structure and file information can be previewed by opening the integrated file. During the preview process, since the integrated file is in the memory, it does not need to be released to the disk.

[0024] In this embodiment, the integrated file is compressed by a compression algorithm, and the compressed integrated file is decompressed. Memory space is established in the memory according to the directory structure in the decompressed file, and the file to be read in the decompressed file is filled into the memory space, and the original file is restored, providing a possibility for subsequent users to access the file directly in the memory, releasing the integrated file, and managing the memory space to ensure the effective use of system resources and save memory space.

[0025] For further information, please refer to Figure 4 and Figure 5 , Figure 4 Schematic diagram of the composition of the storage structure of an embodiment of the present invention, Figure 5 This is a schematic diagram of the composition of the memory occupancy of the memory structure of an embodiment of the present invention. In this embodiment, the storage structure establishes memory space in the memory according to the directory structure in the decompressed file, including: creating a corresponding storage structure in the memory according to the directory structure in the decompressed file, and establishing a corresponding memory space in the memory according to the storage structure and the memory occupancy of the file to be read in the decompressed file. The data type of the storage structure includes the directory structure, the file and its file type, and the memory structure includes: the storage structure and the file data, for example: CI / ci.dll, the directory structure is CI, ci.dll, and the memory occupancy of the file is 120KB. It is necessary to create a corresponding storage structure in the memory according to the directory structure, and at the same time apply for the memory space corresponding to the ci.dll file and wait for filling to avoid over-allocation of memory space. The memory is dynamically pre-allocated according to actual needs, thereby improving the file filling efficiency and improving the efficiency and flexibility of memory use.

[0026] Furthermore, in this embodiment, the corresponding storage structure is created in the memory according to the directory structure in the decompressed file, specifically: a binary tree directory structure in the decompressed file is obtained, and a corresponding storage structure is created in the memory according to the binary tree directory structure, so as to facilitate the subsequent filling of the file storage path and storage of the files to be read according to the binary tree structure, thereby improving the file search efficiency and thus improving the file reading speed, and the use of the binary tree directory structure can reduce the occupancy of the index structure in the memory and optimize memory usage.

[0027] Furthermore, in this embodiment, the file to be read in the decompressed file is filled into the memory space, specifically: obtaining the directory structure in the decompressed file, obtaining the branch of the file to be read in the decompressed file according to the directory structure, configuring the branch name of the corresponding storage structure in the memory according to the file name corresponding to the branch, filling the memory path of the file to be read corresponding to the decompressed file according to the branch name, and filling the file to be read in the decompressed file into the memory space according to the memory path. For example, the original access path for reading 1.dll in the integrated file is D:\test\1.dll. After filling the file to be read in the decompressed file into the memory space, the access path for reading 1.dll in the integrated file is changed to \test\1.dll. By establishing a mapping of the file to be read in the memory, the number of accesses to the disk is reduced, so that the file can be quickly accessed directly through the memory path, the file reading speed is improved, and the file to be read is stored in the memory to ensure the security and stability of the file data.

[0028] Furthermore, step S2 also includes: if the integrated file is not of a compressed type, calculating the memory usage of the integrated file, and allocating corresponding memory space to the integrated file according to the memory usage, and storing the integrated file in the memory. By calculating the memory usage of the integrated file and pre-allocating the corresponding memory space, system resources can be better managed, memory waste can be avoided, the use of memory space can be optimized, the integrated file can be stored in the memory space, the file data loading time can be reduced, and the file access speed and processing speed can be improved.

[0029] Please refer to Figure 2 , embodiment 2 of the present invention is: a file integration reading terminal 1, comprising a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3, wherein the processor 3 implements each step of a file integration reading method of embodiment 1 when executing the computer program.

[0030] In summary, the present invention provides a file integration reading method and terminal, which, by responding to a file reading request, establishes an integrated file according to the file to be read and its directory structure, integrates multiple files into one file, and reduces memory usage; if the integrated file is of a compressed type, decompresses the integrated file, obtains the binary tree directory structure in the decompressed file, creates a corresponding storage structure in the memory according to the binary tree directory structure, establishes a corresponding memory space in the memory according to the storage structure and the memory usage of the file to be read in the decompressed file, dynamically pre-allocates memory according to actual needs, improves file filling efficiency and improves memory utilization; obtains the directory structure of the decompressed file, obtains the branch of the file to be read in the decompressed file according to the directory structure, and creates a file according to the file corresponding to the branch. The branch name of the corresponding storage structure in the memory is configured by name, and the memory path of the file to be read corresponding to the decompressed file is filled in according to the branch name. By establishing a mapping of the file to be read in the memory, the number of accesses to the disk is reduced, so that the file can be quickly accessed directly through the memory path, and the file reading speed is improved. The file to be read in the decompressed file is filled into the memory space according to the memory path, and the file to be read is stored in the memory to ensure the security and stability of the file data; if the integrated file is not a compressed type, the memory occupancy of the integrated file is calculated, and the corresponding memory space is allocated to the integrated file according to the memory occupancy, so as to avoid memory waste, optimize the use of memory space, store the integrated file in the memory, reduce file data loading time, and improve file access speed.

[0031] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A file integration reading method, characterized in that: Includes steps: S1. In response to a file reading request, an integrated file is created according to the file to be read and its directory structure; S2. If the integrated file is of a compressed type, the integrated file is decompressed, a memory space is created in a memory according to the directory structure in the decompressed file, the files to be read in the decompressed file are filled into the memory space, and the integrated file is released.

2. A file integration reading method according to claim 1, characterized in that: The step of establishing a memory space in the memory according to the directory structure in the decompressed file includes: A corresponding storage structure is created in the memory according to the directory structure in the decompressed file, and a corresponding memory space is established in the memory according to the storage structure and the memory occupancy of the to-be-read file in the decompressed file.

3. A file integration reading method according to claim 2, characterized in that: The corresponding storage structure is created in the memory according to the directory structure in the decompressed file, specifically: Obtain a binary tree directory structure in the decompressed file, and create a corresponding storage structure in the memory according to the binary tree directory structure.

4. A file integration reading method according to claim 1, characterized in that: The step of filling the file to be read in the decompressed file into the memory space is specifically as follows: Obtain a directory structure in the decompressed file, obtain a branch of the file to be read in the decompressed file according to the directory structure, configure a branch name of the corresponding storage structure in the memory according to the file name corresponding to the branch, fill in a memory path of the file to be read corresponding to the decompressed file according to the branch name, and fill the file to be read in the decompressed file into the memory space according to the memory path.

5. A file integration reading method according to claim 1, characterized in that: The step S2 further comprises: If the integrated file is not of a compressed type, the memory usage of the integrated file is calculated, and corresponding memory space is allocated to the integrated file according to the memory usage, and the integrated file is stored in the memory.

6. A file integration reading terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: S1. In response to a file reading request, an integrated file is created according to the file to be read and its directory structure; S2. If the integrated file is of a compressed type, the integrated file is decompressed, a memory space is created in a memory according to the directory structure in the decompressed file, the files to be read in the decompressed file are filled into the memory space, and the integrated file is released.

7. A file integration reading terminal according to claim 6, characterized in that: The step of establishing a memory space in the memory according to the directory structure in the decompressed file includes: A corresponding storage structure is created in the memory according to the directory structure in the decompressed file, and a corresponding memory space is established in the memory according to the storage structure and the memory occupancy of the to-be-read file in the decompressed file.

8. A file integration reading terminal according to claim 7, characterized in that: The corresponding storage structure is created in the memory according to the directory structure in the decompressed file, specifically: Obtain a binary tree directory structure in the decompressed file, and create a corresponding storage structure in the memory according to the binary tree directory structure.

9. A file integration reading terminal according to claim 6, characterized in that: The step of filling the file to be read in the decompressed file into the memory space is specifically as follows: Obtain a directory structure in the decompressed file, obtain a branch of the file to be read in the decompressed file according to the directory structure, configure a branch name of the corresponding storage structure in the memory according to the file name corresponding to the branch, fill in a memory path of the file to be read corresponding to the decompressed file according to the branch name, and fill the file to be read in the decompressed file into the memory space according to the memory path.

10. The file integration reading terminal according to claim 6, characterized in that: The step S2 further comprises: If the integrated file is not of a compressed type, the memory usage of the integrated file is calculated, and corresponding memory space is allocated to the integrated file according to the memory usage, and the integrated file is stored in the memory.