Concurrent file processing method and system
By establishing a virtual file system, a large number of small files are mapped into it, the problems of wasted space and low performance caused by small file storage are solved, and parallel processing of small files is realized, improving the overall processing performance of the system.
Patent Information
- Application Number
- CN202110036795.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-12
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-01-12
AI Technical Summary
The storage of large numbers of small files leads to wasted file system space and inefficient performance, and concurrent access conflicts during large files store reduce processing performance.
By establishing a virtual file system, including file system images and image metadata, the concurrently accessed small files are imaged into the virtual file system. The application process only needs to access the virtual file system to realize parallel processing of small files.
It solves the problems of wasted space and inefficiency in a large number of small file storage, improves the system's processing performance, and avoids concurrent access conflicts when large file storage.
Smart Images

Figure CN112732653B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to data storage technology, and in particular to a concurrent file processing method and system. Background Art
[0002] At present, information technology, especially big data, is developing rapidly, and the amount of data owned by enterprises is increasing. The main ways to store data are files, databases, etc. For example, banks, insurance companies, securities companies, e-commerce companies, etc., have a large number of transactions every day, generating a large amount of transaction-related data. In the transaction processing process, the transaction qualification certificate currently needs to be produced in the form of electronic scanning in the computer system. Image data files (hereinafter referred to as data files) are required in the form of electronic scanning. Due to the large daily transaction volume, a large number of data files are generated every day, and as time accumulates, a huge number of file storage requirements will be generated. The space occupied by such image data files is about 100KB to 5MB, which are considered small files, but the number of such small files is very large, which may be tens of millions or even hundreds of millions, or even more. However, in the file system, there is an upper limit to the number of files stored. For example, the data stored in the file in the Linux system is affected by the number of i-node nodes in the file system. When there is still a large surplus in the total storage space of the file system, a large number of small files may exceed the upper limit of the number of files in the file system, making it impossible for the file system to store more files, wasting the storage space of the file system. On the other hand, the read and write operations of a large number of small files will greatly reduce the read and write throughput of the file system (that is, the number of data bytes read or written per unit time), thereby seriously reducing the overall performance of the system. In addition, the number of sub-files under a single file directory cannot be too large. Too many sub-files will affect the file access performance. For example, when reading and writing files from a directory containing more than 10,000 sub-files, the file retrieval time will be longer, making the file reading and writing response time longer.
[0003] To solve the above problems, some storage methods have emerged that pack a large number of small files into one large file to improve the storage efficiency of the system. However, this method still has a very big flaw, which is that it reduces the concurrency of the file system. For example, if two processes need to open small files that are stored in a large file, a conflict will occur, and one of the processes will need to wait, which reduces the concurrent processing efficiency of the system. Summary of the invention
[0004] In view of the problems of the prior art, the present invention provides a concurrent file processing method, which maps the concurrently accessed small files to an established virtual file system, wherein the virtual file system includes: a file system image and image metadata; the file system image includes: small file data stored in a pre-divided block storage space; the image metadata includes: the file name and location information of the small file data in the file system image, and the storage location of the concurrently accessed small files in the file system image is determined according to the image metadata to obtain the small file data. The application process only needs to access the virtual file system. When the small files accessed by multiple application processes are actually stored in a large file, they can also be processed in parallel without conflict, thereby solving the problem of conflicts in the original large file storage that reduces processing performance, thereby solving the problem of space waste or low system performance efficiency in the storage of a large number of small files, and improving the processing performance of the system.
[0005] The present invention provides a concurrent file processing method, which comprises:
[0006] Determine a small file to be accessed according to the received concurrent access request; the small file is a file smaller than a first predetermined byte;
[0007] According to the accessed small file, the accessed small file data is obtained from a pre-established virtual file system; wherein the virtual file system includes: a file system image and image metadata; wherein,
[0008] The file system image includes: small file data stored in a pre-divided block storage space;
[0009] The image metadata includes: the file name and location information of the small file data in the file system image.
[0010] In the embodiment of the present invention, the method further includes:
[0011] The small file data image to be accessed is obtained from the disk file storage system to establish the virtual file system and cache it in the memory.
[0012] In the embodiment of the present invention, the image metadata also includes: a file mark of a small file and a blank block storage space number.
[0013] In the embodiment of the present invention, the step of obtaining the accessed small file data from the pre-cached virtual file system according to the accessed small file includes:
[0014] Determine the block storage space where the accessed small file is located according to the file name of the accessed small file and the location information in the image metadata;
[0015] The accessed small file data is obtained from the file system image according to the determined block storage space.
[0016] In the embodiment of the present invention, the step of obtaining the accessed small file data from a pre-established virtual file system according to the accessed small file includes:
[0017] When the file name of the accessed small file is not found in the virtual file system, the accessed small file data is obtained from a large file pre-stored in the disk file storage system and stored in the virtual file system; the large file is a file larger than a second preset byte, and the large file stores the small file data according to a pre-divided block storage space, and the block storage space of the large file is equal to the block storage space of the file system image.
[0018] At the same time, the present invention also provides a concurrent file processing system, comprising:
[0019] A concurrent request processing device, used for determining a small file to be accessed according to a received concurrent access request; the small file is a file smaller than a first predetermined byte;
[0020] A data acquisition device is used to acquire accessed small file data from a pre-established virtual file system according to the accessed small file; wherein the virtual file system includes: a file system image and image metadata; wherein,
[0021] The file system image includes: small file data stored in a pre-divided block storage space;
[0022] The image metadata includes: the file name and location information of the small file data in the file system image.
[0023] In an embodiment of the present invention, the system further includes:
[0024] A virtual file driver is used to obtain the small file data image to be accessed from the disk file storage system to establish the virtual file system and cache it to the memory
[0025] In an embodiment of the present invention, the data acquisition device comprises:
[0026] A space determination unit, configured to determine a block storage space where the accessed small file is located according to the file name of the accessed small file and the location information in the image metadata;
[0027] The data acquisition unit is used to acquire the accessed small file data from the file system image according to the determined block storage space.
[0028] In the embodiment of the present invention, the data acquisition device further includes:
[0029] The disk data acquisition unit is used to acquire the accessed small file data from a large file pre-stored in the disk file storage system when the file name of the accessed small file is not found in the virtual file system; the large file is a file larger than a second preset byte, and the large file stores the small file data according to a pre-divided block storage space, and the block storage space of the large file is equal to the block storage space of the file system image.
[0030] At the same time, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the above method is implemented when the processor executes the computer program.
[0031] At the same time, the present invention also provides a computer-readable storage medium, which stores a computer program for executing the above method.
[0032] The concurrent file processing method and system provided by the present invention only require that the application process only needs to access the virtual file system. When small files accessed by multiple application processes are actually stored in a large file, they can also be processed in parallel without conflict. This solves the problem of conflicts in the original large file storage that reduces processing performance, thereby solving the problem of space waste or low system performance efficiency in the storage of a large number of small files, and improving the processing performance of the system.
[0033] In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A flowchart of the concurrent file processing method provided by the present invention;
[0036] Figure 2 A schematic diagram of a concurrent file storage system provided in an embodiment of the present invention;
[0037] Figure 3 A flowchart of a reading method of a concurrent file storage system provided in an embodiment of the present invention;
[0038] Figure 4 A flowchart of file update in a concurrent file storage system according to an embodiment of the present invention;
[0039] Figure 5 A block diagram of a concurrent file processing system provided by the present invention;
[0040] Figure 6 It is a schematic diagram of an electronic device embodiment provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] At present, for a certain number of small files, the time consumed by scattered transmission is much longer than that of package transmission. This is because it takes time for the operating system to open the file (mainly consumed in disk addressing, file retrieval, file buffer preparation, etc.), read and write file data, and close the file (this time is consumed in closing the file buffer, etc.). For large files, the time required to open the file can be ignored compared to the time required to read and write file data. However, for small files, the time required to open the file is relatively large compared to the time required to read and write file data. When the total file size processed is equal, the number of times the scattered transmission opens and closes the file is much greater than the number of times the package transmission opens and closes the file. In scattered transmission, the file must be opened and closed as many times as there are small files, while in package transmission, the file only needs to be opened and closed once, so package transmission is more efficient than scattered transmission.
[0043] The present invention provides a concurrent file processing method, such as Figure 1 It includes:
[0044] Step S101, determining a small file to be accessed according to the received concurrent access request; the small file is a file smaller than a first predetermined byte;
[0045] Step S102, obtaining the accessed small file data from the pre-cached virtual file system according to the accessed small file; wherein the virtual file system includes: a file system image and image metadata; wherein,
[0046] The file system image includes: small file data stored in a pre-divided block storage space;
[0047] The image metadata includes: the file name and location information of the small file data in the file system image.
[0048] The overall idea of the present invention is to pack many small files into a large file, that is, to establish an image virtual file system of the file storage system, and to pack the small files accessed concurrently into the virtual file system. The application process only needs to access the virtual file system. When the small files accessed by multiple application processes are actually stored in a large file, they can also be processed in parallel without conflict, thus solving the problem of conflicts and reduced processing performance when storing large files.
[0049] In the embodiment of the present invention, the method further includes:
[0050] The small file data image to be accessed is obtained from the disk file storage system to establish the virtual file system and cache it in the memory.
[0051] Specifically, in an embodiment of the present invention, the storage space of the file system image is divided into blocks, and a small file is stored in a block storage space. The size of a block storage space can be set according to the average size of each small file to ensure that most small files are stored in one block.
[0052] In the embodiment of the present invention, the image metadata also includes: a file mark of a small file and a blank block storage space number.
[0053] Specifically, in the embodiment of the present invention, the storage space of the file system image is divided into blocks, and the divided block storage spaces are numbered to mark the small files and file flags stored in each block storage space; the following is an example of the image metadata in the embodiment of the present invention:
[0054] File A flag block number 000000001
[0055] File B marker block number 000000002, 000000004
[0056] File C marker block number 000000003
[0057] The blank block space is: 000000005-999999999
[0058] In this embodiment, the file flags include: synchronization, update and close;
[0059] Synchronous, which means that the application has opened the small file and is in use;
[0060] Updated, indicating that the content of the small file in the image file of the virtual file system is updated;
[0061] Closed. The application has closed the small file and the small file is not in use temporarily.
[0062] Specifically, in the embodiment of the present invention, the step of obtaining the accessed small file data from the pre-cached virtual file system according to the accessed small file includes:
[0063] Determine the block storage space where the accessed small file is located according to the file name of the accessed small file and the location information in the image metadata;
[0064] The accessed small file data is obtained from the file system image according to the determined block storage space.
[0065] The concurrent file processing method provided by the present invention caches a large number of small files into a virtual storage device through one file. The application process only needs to access the virtual file system, determine the block storage space where the accessed small file is located according to the location information in the image metadata, and obtain the accessed small file data from the file system image according to the determined block storage space. The present invention stores small files through the file system image and image metadata of the established virtual file system. When the small files accessed by multiple application processes are actually stored in a large file (virtual file system), they can also be processed in parallel without conflict, thereby solving the problem of conflicts and reduced processing performance when storing large files.
[0066] In the embodiment of the present invention, the step of obtaining the accessed small file data from the pre-cached virtual file system according to the accessed small file further includes:
[0067] When the file name of the accessed small file is not found in the virtual file system, the accessed small file data is obtained from a large file pre-stored in the disk file storage system and stored in the virtual file system; the large file is a file larger than a second preset byte, and the large file stores the small file data according to a pre-divided block storage space, and the block storage space of the large file is equal to the block storage space of the file system image.
[0068] In the embodiment of the present invention, the disk file storage system includes: the ext file system in the Linux system and the ntfs file system in the Windows system; in the embodiment of the present invention, the disk file storage system stores large files and stores many small files into one large file. In this embodiment, the storage space of the large file is also divided into blocks, and the small files are stored in the divided block storage space, and the blocks are numbered. In general, the size of the block can be the same as the size of the block in the image file, but the two can also be different.
[0069] In the embodiment of the present invention, the block storage space divided in the large file is the same size as the block storage space in the file system image, which can improve the efficiency of file data replication between the virtual file system and the disk file storage system. The data can be copied by block, avoiding the reallocation of the block size.
[0070] In the embodiment of the present invention, a large file metadata file is pre-established in the database to store the storage location information of the small file data in the large file. The storage location of the small file in the large file of the disk file storage system is determined by the large file metadata file.
[0071] The overall idea of the embodiment of the present invention is to pack many small files into a large file. However, in order to improve the concurrency of the system, a virtual storage device is designed for the application database and memory, and a group of service processes cache a large number of small files in the virtual storage device. The application process only needs to access the virtual storage device. When the small files accessed by multiple application processes are actually stored in a large file, they can also be processed in parallel without conflicts, thus solving the problem of conflicts and reduced processing performance when storing large files.
[0072] like Figure 2 As shown, it is a schematic diagram of a concurrent file storage system provided in an embodiment of the present invention, which includes: a memory virtual file system 1, a virtual file system driver 4, a file storage system 5, and file metadata 6.
[0073] In this embodiment, the memory virtual file system 1 is a storage space in the memory, which caches small files being accessed by the application 7 into the memory. The memory virtual file system 1 includes: a file system image 2 and image metadata 3.
[0074] File system image 2: used to store data of small files. In the embodiment of the present invention, the space of the file system image 2 is divided into blocks, the blocks are numbered, and the size of a block can be set according to the average size of each small file to ensure that most small files are stored in one block.
[0075] For example, if the average size of small files is 1MB, you can set the block size to 1.5MB.
[0076] Image metadata 3: used to store the location of small files in the file system image 2 and to store a list of free blocks.
[0077] An example of data stored in the image metadata 3 in the embodiment of the present invention is as follows:
[0078] File A flag block number 000000001
[0079] File B marker block number 000000002, 000000004
[0080] File C marker block number 000000003
[0081] The blank block space is: 000000005-999999999
[0082] In this embodiment, the flags are divided into: synchronization, updated and closed;
[0083] Synchronous, indicating that the application 7 has opened the small file and is using it, and the contents of the small file in the file system image 2 and the file storage system 5 are the same;
[0084] Updated, indicating that the content in the file system image 2 is updated and waiting to be updated to the file storage system 5;
[0085] Close, the application 7 has closed the small file in the file system image 2. The small file is not used temporarily and can be deleted from the memory virtual file system 1, but it can also be reopened and used by other applications without having to be read from the file storage system 5 again.
[0086] The virtual file driver 4 is one or a group of programs resident in memory, which is responsible for reading files in the file storage system 5 into the file system image 2, or updating the modified files in the file system image 2 to the file storage system 5. When the application 7 opens a small file, the memory virtual file system driver 8 first searches in the image metadata 3. If found, the file location information in the image metadata 3 is read. For example, in the above example 1, the file block number of file B is: 000000002, 000000004, and then the file content can be read in the file system image 2. If not found, the virtual file system driver 4 is notified to copy the small file to the memory virtual file system 1 and wait for completion. After receiving the completion of the small file copy by the virtual file system driver 4, the small file is accessed in the memory virtual file system 1.
[0087] When the application 7 updates the small file content in the memory virtual file system 1, the memory virtual file system driver 8 notifies the virtual file system driver 4 to copy the small file in the memory virtual file system 1 to the file storage system 5 and waits for completion. After receiving the completion of the small file copy from the virtual file system driver 4 to the file storage system 5, the application 7 has truly completed the small file update process.
[0088] File storage system 5: Generally, it is a disk file system, including: ext3 file system in Linux system, ntfs file system in Windows system, which stores large files, that is, many small files are stored in one large file. The space of large files is also divided into blocks, and the blocks are numbered. Generally, the size of the block can be the same as the size of the block in the file system image 2, but the two can be different. If they are the same, the efficiency of file data replication between the memory virtual file system 1 and the file storage system 5 can be improved, and the data can be copied by block, avoiding the reallocation of the block size.
[0089] File metadata 6: generally a database, storing the storage location of small files in the large file in the file storage system 5. Since the number of small files is very large, the advantage of using a database is that the efficiency of small file search can be improved.
[0090] An example of data stored in the file metadata 6 in the embodiment of the present invention is as follows:
[0091] File A Large file 1 Block number 000000001
[0092] File B Large file 1 Block number 000000002, 000000003
[0093] File C Large File 2 Block Number 000000001
[0094] Application 7: is an application that solves user business needs and has the need to access a large number of small files. There can be many applications 7, which can be multiple copies of the same code application or applications with different codes, that is, they solve different business needs. But they all have the same point that they all need to access small files.
[0095] Memory virtual file system driver 8: There are various types of drivers in the operating system responsible for device access. Generally, file systems have drivers responsible for the files of the underlying file system. For example, the ext3 file system in the Linux system and the ntfs file system in the Windows system have corresponding drivers. The memory virtual file system driver 8 implements the same function as the ext3 file system driver, that is, completes function conversion and data exchange between the application 7 and the underlying file system. However, there are differences in the implementation method. The ext3 file system driver directly accesses the Linux ext3 file system. The implementation method of the memory virtual file system driver 8 is: first access the image metadata 3 in the virtual file system 1. If the small file is found, read the block number of the small file, and then read the data from the file system image 2, and can lock the small file (lock the small file to prevent other programs from modifying it). Anyway, if the small file is not found, notify the virtual file system driver 4 to copy the small file from the file storage system 5 to the memory virtual file system. Figure 3 Shown is a flow chart of a file reading method of a concurrent file storage system provided in an embodiment of the present invention.
[0096] like Figure 4 As shown, it is a flowchart of file update of the concurrent file storage system in an embodiment of the present invention, which includes:
[0097] The application updates the data of the applet;
[0098] The memory virtual file system driver 8 looks for small files in the image metadata;
[0099] The memory virtual file system driver 8 reads the block number of the small file in the image metadata;
[0100] The memory virtual file system driver 8 updates the file data in the file system image;
[0101] The memory virtual file system driver 8 notifies the virtual file system driver 4 to copy the file;
[0102] The virtual file system driver 4 searches for the location information of the small file in the file metadata (including the large file population and the file block number in the large file);
[0103] The virtual file system driver 4 copies the small file into the file system image and into the file storage system;
[0104] The virtual file system driver 4 notifies the memory virtual file system driver that the small file has been copied;
[0105] The memory virtual file system driver 8 notifies the application that the small file update is completed.
[0106] This embodiment provides a file concurrent storage system and method, which solves the problem of space waste or low system performance efficiency in the storage of a large number of small files, and improves the processing performance of the system. Many small files are packed into a large file. However, in order to improve the concurrency of the system, a virtual storage device is designed for the application database and memory, and a group of service processes cache a large number of small files in the virtual storage device. The application process only needs to access the virtual storage device. When the small files accessed by multiple application processes are actually stored in a large file, they can also be processed in parallel without conflict, which solves the problem of conflicts and reduced processing performance when storing large files.
[0107] At the same time, the present invention also provides a concurrent file processing system, such as Figure 5 As shown, including:
[0108] The concurrent request processing device 401 is used to determine a small file to be accessed according to the received concurrent access request; the small file is a file smaller than a first predetermined byte;
[0109] The data acquisition device 402 is used to acquire the accessed small file data from a pre-established virtual file system according to the accessed small file; wherein the virtual file system includes: a file system image and image metadata; wherein,
[0110] The file system image includes: small file data stored in a pre-divided block storage space;
[0111] The image metadata includes: the file name and location information of the small file data in the file system image.
[0112] In an embodiment of the present invention, the system further includes:
[0113] The cache device is used to cache each small file in the virtual file system in advance; wherein,
[0114] The data of each small file is stored in the block storage space of the image file respectively, and the block storage space information storing the data of each small file is stored in the metadata file.
[0115] In an embodiment of the present invention, the data acquisition device comprises:
[0116] A space determination unit, configured to determine a block storage space where the accessed small file is located according to the file name of the accessed small file and the location information in the image metadata;
[0117] The data acquisition unit is used to acquire the accessed small file data from the file system image according to the determined block storage space.
[0118] In the embodiment of the present invention, the data acquisition device further includes:
[0119] The disk data acquisition unit is used to acquire the accessed small file data from a large file pre-stored in the disk file storage system when the file name of the accessed small file is not found in the virtual file system; the large file is a file larger than a second preset byte, and the large file stores the small file data according to a pre-divided block storage space, and the block storage space of the large file is equal to the block storage space of the file system image.
[0120] It should be noted that the method and device for concurrent file processing disclosed herein can be used in the processing of concurrent files in the financial field, and can also be used in any field other than the financial field. The application field of the method and device for concurrent file processing disclosed herein is not limited.
[0121] This embodiment also provides an electronic device, which may be a desktop computer, a tablet computer, a mobile terminal, etc., but this embodiment is not limited thereto. In this embodiment, the electronic device may refer to the embodiments of the aforementioned method and device, the contents of which are incorporated herein, and the repeated parts are not repeated.
[0122] Figure 6 FIG. 6 is a schematic block diagram of a system structure of an electronic device 600 according to an embodiment of the present invention. Figure 6As shown, the electronic device 600 may include a central processor 100 and a memory 140; the memory 140 is coupled to the central processor 100. It should be noted that this figure is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0123] In one embodiment, the concurrent file processing function may be integrated into the central processing unit 100. The central processing unit 100 may be configured to perform the following control:
[0124] Determine a small file to be accessed according to the received concurrent access request; the small file is a file smaller than a first predetermined byte;
[0125] According to the accessed small file, the accessed small file data is obtained from a pre-established virtual file system; wherein the virtual file system includes: a file system image and image metadata; wherein,
[0126] The file system image includes: small file data stored in a pre-divided block storage space;
[0127] The image metadata includes: the file name and location information of the small file data in the file system image.
[0128] In another embodiment, the concurrent file processing system may be configured separately from the central processing unit 100. For example, the concurrent file processing system may be configured as a chip connected to the central processing unit 100, and concurrent file processing is implemented under the control of the central processing unit.
[0129] like Figure 6 As shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily have to include Figure 6 In addition, the electronic device 600 may also include Figure 5 For components not shown, reference may be made to the prior art.
[0130] like Figure 6 As shown, the central processor 100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 100 receives inputs and controls the operations of various components of the electronic device 600.
[0131] The memory 140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 100 may execute the program stored in the memory 140 to implement information storage or processing.
[0132] The input unit 120 provides input to the CPU 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0133] The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 600 through the central processor 100.
[0134] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0135] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0136] Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby realizing a common telecommunication function. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 130 is also coupled to the central processor 100, so that recording can be performed on the local machine through the microphone 132, and the sound stored on the local machine can be played through the speaker 131.
[0137] An embodiment of the present invention further provides a computer-readable program, wherein when the program is executed in an electronic device, the program enables a computer to execute the concurrent file processing method as described in the above embodiment in the electronic device.
[0138] An embodiment of the present invention further provides a storage medium storing a computer-readable program, wherein the computer-readable program enables a computer to execute the concurrent file processing described in the above embodiment in an electronic device.
[0139] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings. Many features and advantages of these embodiments are clear from this detailed description, and therefore the appended claims are intended to cover all such features and advantages of these embodiments that fall within their true spirit and scope. In addition, since many modifications and changes are readily apparent to those skilled in the art, the embodiments of the present invention are not intended to be limited to the precise structure and operation illustrated and described, but all suitable modifications and equivalents that fall within their scope may be included.
[0140] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0144] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A concurrent file processing method, characterized in that: The method includes: Determine a small file to be accessed according to the received concurrent access request; the small file is a file smaller than a first predetermined byte; According to the accessed small file, the accessed small file data is obtained from a pre-established virtual file system; wherein the virtual file system includes: a file system image and image metadata; wherein, The file system image includes: small file data stored in a pre-divided block storage space; The image metadata includes: the file name and location information of the small file data in the file system image; The method of obtaining the accessed small file data from a pre-established virtual file system according to the accessed small file includes: Determine the block storage space where the accessed small file is located according to the file name of the accessed small file and the location information in the image metadata; Acquire accessed small file data from the file system image according to the determined block storage space; When the file name of the accessed small file is not found in the virtual file system, the accessed small file data is obtained from a large file pre-stored in the disk file storage system and stored in the virtual file system; the large file is a file larger than a second preset byte, and the large file stores the small file data according to a pre-divided block storage space, and the block storage space of the large file is equal to the block storage space of the file system image.
2. The concurrent file processing method according to claim 1, characterized in that: The method further comprises: The small file data image to be accessed is obtained from the disk file storage system to establish the virtual file system and cache it in the memory.
3. The concurrent file processing method according to claim 2, characterized in that: The image metadata also includes: a file mark of a small file and a blank block storage space number.
4. A concurrent file processing system, characterized in that: The system comprises: A concurrent request processing device, used for determining a small file to be accessed according to a received concurrent access request; the small file is a file smaller than a first predetermined byte; A data acquisition device is used to acquire accessed small file data from a pre-established virtual file system according to the accessed small file; wherein the virtual file system includes: a file system image and image metadata; wherein, The file system image includes: small file data stored in a pre-divided block storage space; The image metadata includes: the file name and location information of the small file data in the file system image; The data acquisition device comprises: A space determination unit, configured to determine a block storage space where the accessed small file is located according to the file name of the accessed small file and the location information in the image metadata; A data acquisition unit, configured to acquire accessed small file data from the file system image according to the determined block storage space; The disk data acquisition unit is used to acquire the accessed small file data from a large file pre-stored in the disk file storage system when the file name of the accessed small file is not found in the virtual file system; the large file is a file larger than a second preset byte, and the large file stores the small file data according to a pre-divided block storage space, and the block storage space of the large file is equal to the block storage space of the file system image.
5. The concurrent file processing system according to claim 4, characterized in that: The system further comprises: The virtual file driver is used to obtain the small file data image to be accessed from the disk file storage system to establish the virtual file system and cache it in the memory.
6. A computer device 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 method according to any one of claims 1 to 3 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Method for managing and allocating resource in parallel file system
CN101567003A
File access method and apparatus, and storage system
CN105580010A