Document processing methods, apparatus, equipment and storage media
By dividing the target file into file units and establishing an information record table, the problem that other fragmented objects cannot be found or deleted after the first object is deleted in the object storage system is solved, realizing fast and orderly search and deletion of file units and improving storage efficiency.
Patent Information
- Application Number
- CN202010664811.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-10
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2040-07-10
AI Technical Summary
In existing object storage systems, once the first object is deleted, other shard objects are considered garbage data and cannot be deleted or retrieved in a timely manner, resulting in storage space not being released quickly and the garbage collection process affecting read and write operations.
The target file is divided into file units, and an information record table is established in random access memory to record file unit information. The file unit can be searched in the external memory through the information record table, which solves the problem of fast search and deletion of file units.
It enables fast and orderly searching and deletion of file units, improves storage efficiency, and avoids waste of storage space and impact on read and write operations.
Smart Images

Figure CN113918518B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of object storage technology, and in particular to a file processing method, apparatus, device, and storage medium. Background Technology
[0002] Object storage is an object-based storage device with intelligent, self-managing capabilities. It enables reading and writing of objects and access to storage resources through web service protocols such as REST and SOAP. An object is the basic unit of data storage in an object storage system. Each object is a combination of data and a set of data attributes. Data attributes can be configured according to application needs, including data distribution and quality of service. Objects maintain their own attributes, thereby simplifying storage system management tasks and increasing flexibility.
[0003] When a client stores a file, the object gateway segments the file and converts it into storage objects. The file's attributes are stored in the extended attributes of the first object. However, since segmentation information is stored in the extended attributes of the first object, deleting the first object results in the loss of these extended attributes, and other segment objects will be considered garbage data. If the first object is lost or corrupted, other segment objects will also be considered garbage data. Segmented data is stored out of order, making it impossible to read ordered segment objects. Furthermore, if garbage collection is disabled, only the first object is deleted; other segment objects cannot be deleted, preventing the rapid release of storage space and hindering the writing of new recordings. If garbage collection is enabled, the garbage collection process is constantly busy in the background cleaning up garbage, impacting read and write operations. Summary of the Invention
[0004] This invention provides a file processing method, apparatus, device, and storage medium to quickly and promptly retrieve fragmented objects, solving the problem that after the first object is deleted, other fragmented objects are considered as garbage data and cannot be successfully read or deleted.
[0005] In one embodiment, this application provides a file processing method, the method comprising:
[0006] If the target file size is larger than the preset file unit size, the target file will be processed according to the preset file unit size to determine at least two file units;
[0007] Based on the target file and the at least two file units, determine the file unit information;
[0008] An information record table is established based on the file unit information and recorded in random access memory, so as to search for at least two file units in external memory based on the information record table.
[0009] In another embodiment, this application also provides a document processing apparatus, the apparatus comprising:
[0010] The file unit determination module is used to process the target file according to the preset file unit specification and determine at least two file units if the target file size is larger than the preset file unit specification.
[0011] The file unit information determination module is used to determine file unit information based on the target file and the at least two file units;
[0012] The storage module is used to establish an information record table based on the file unit information and record it in the random access memory, so as to search for at least two file units in the external memory based on the information record table.
[0013] In yet another embodiment, this application also provides a file processing device, including: one or more processors;
[0014] Memory, used to store one or more programs;
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the file processing method described in any one of the embodiments of this application.
[0016] In yet another embodiment, this application also provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the file processing method as described in any one of the embodiments of this application.
[0017] In this embodiment, the target file is processed to obtain file units based on its size and preset file unit specifications, thereby achieving efficient object storage of the target file. After the target file is divided into file units, the relevant file unit information is extracted and recorded in an information record table in random access memory. This solves the problem of not being able to find or promptly delete other file units after any file unit is deleted, enabling fast and orderly searching of file units. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a file processing method provided in one embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram of the information record table structure provided in one embodiment of the present invention;
[0020] Figure 3 A flowchart of a file processing method provided in another embodiment of the present invention;
[0021] Figure 4 A flowchart of a file processing method provided in another embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram of the structure of a document processing device provided in one embodiment of the present invention;
[0023] Figure 6 This is a schematic diagram of the structure of a file processing device provided in one embodiment of the present invention. Detailed Implementation
[0024] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0025] Figure 1 This is a flowchart illustrating a file processing method according to an embodiment of the present invention. The file processing method provided in this embodiment is applicable to situations where target files are stored as objects. Typically, this method is applicable when a target object is divided into file units for storage, and an information record table is established based on the file unit information and stored in random access memory for easy searching and other processing. This method can be specifically executed by a file processing device, which can be implemented in software and / or hardware, and can be integrated into a file processing equipment. See also... Figure 1 The method in this application embodiment specifically includes:
[0026] S110. If the target file size is larger than the preset file unit size, the target file is processed according to the preset file unit size to determine at least two file units.
[0027] In this embodiment, the file processing method can be executed by an object gateway. When a client needs to store a file in the storage system, the object gateway processes and stores the file. The format of the target file is not limited and can be images, documents, tables, or other formats. The preset file unit specifications can be set according to actual needs and can be the size of a basic object storage unit.
[0028] If the target file size is less than or equal to the preset file unit size, the target file is stored directly as a single storage unit. If the target file size is greater than the preset file unit size, the target file needs to be split into file units smaller than or equal to the preset file unit size for storage. For example, if the preset file unit size is 4MB and the target file a.jpg is 20MB, the target file will be split into 5 file units, each 4MB in size, named obj0, obj1, obj2, obj3, and obj4.
[0029] S120. Determine file unit information based on the target file and the at least two file units.
[0030] The file unit information includes the target file identifier, the name of any file unit, and the number of file units; or, the file unit information includes the target file identifier, the target file size, the preset file unit specification, and the name of any file unit; or, the file unit information includes the target file identifier, the name of the first file unit, and the name of the last file unit.
[0031] The target file identifier includes a target file name and / or target file ID. For example, file unit information is needed to locate and process file units. If the file unit information includes the target file identifier, the name of any file unit, and the number of file units, then the target file identifier can be matched first. Then, the prefix name of each file unit can be determined based on its name, and the name of each file unit can be determined based on its number. For example, if the name of any file unit is obj3, then the prefix name of the file unit is determined to be obj. If there are 5 file units, then the names of each file unit can be determined as obj0, obj1, obj2, obj3, and obj4.
[0032] If the file unit information includes the target file identifier, target file size, preset file unit specifications, and the name of any file unit, then the target file identifier can be matched first. Then, the number of file units can be determined based on the target file size and preset file unit specifications. Next, the prefix name of the file unit can be determined based on the name of any file unit. Finally, the name of each file unit can be determined based on the number of file units, so that the file units can be searched based on the name of each file unit.
[0033] If the file unit information includes the target file identifier, the name of the first file unit, and the name of the last file unit, then the target file identifier can be matched first, and then the names of each file unit can be determined based on the names of the first and last file units. For example, if the name of the first file unit is obj0 and the name of the last file unit is obj4, then the names of each file unit can be determined as obj0, obj1, obj2, obj3, and obj4, respectively.
[0034] S130. Establish an information record table based on the file unit information and record it in the random access memory, so as to search for at least two file units in the external memory according to the information record table.
[0035] Currently, the object gateway divides a target file into at least two file units and stores the file unit information in the extended attributes of the first file unit. When deleting a target file, only the first file unit is deleted; the remaining file units are treated as garbage data and deleted by the garbage collection process. For example, if the garbage collection process time is set to 2 hours, the garbage data will not be deleted until 2 hours later. For instance, if a client needs to delete 20MB of a.jpg, only 4MB of storage space will be released from the first file unit obj0; the remaining 16MB of file units will not be released immediately. If the garbage collection process is disabled, only the first file unit will be deleted, and other file units cannot be deleted, preventing the storage space from being released quickly and making it impossible to write new files. If the garbage collection process is enabled, it will be constantly busy cleaning up garbage in the background, affecting read and write operations. Since the file unit information is stored in the extended attributes of the first file unit, if the first file unit is deleted, lost, or corrupted, the extended attributes will be deleted, and the remaining file units will be considered garbage data, making it impossible to query other file units.
[0036] In this embodiment, an information record table is established based on the file unit information and recorded in random access memory (RAM). This allows for the search of at least two file units in external storage based on the information record table, rather than treating the file unit information as part of the file unit itself. This solves the problem that if the first file unit is deleted, other file units are considered junk files, making it impossible to search for them. Furthermore, since the information record table is stored in RAM, which has a fast read / write speed, processing efficiency is improved.
[0037] After establishing an information record table based on the file unit information and recording it in random access memory, the method further includes: backing up the file unit information in external storage for use in establishing the information record table based on the file unit information.
[0038] In this embodiment, an information record table can be generated based on file unit information, as shown in Table 1, forming structured data for easy querying and retrieval. The record information in the information record table is not limited to the information in Table 1; it can also be other information, see S120. Since random access memory (RAM) has a fast and efficient speed for reading and writing file data, the information record table is stored in RAM, and the file unit information is backed up and stored in external storage for persistent storage. This allows the information record table to be rebuilt promptly by accessing the file unit information in external storage when the device loses power or malfunctions.
[0039] Table 1
[0040] Target file identifier a.jpg target file size 20MB Preset file unit specifications 4MB The name of the first file unit obj0 Name of the last file unit obj4
[0041] In this embodiment of the application, the method further includes: establishing a mapping relationship between a storage bucket identifier for storing the at least two file units and the file unit information corresponding to the at least two file units, for determining the corresponding file unit information based on the storage bucket identifier.
[0042] For example, such as Figure 2 As shown, the information record table includes bucket identifiers and corresponding file unit information. At least two file units may be stored in the same bucket or in different buckets. To facilitate file unit retrieval, when storing at least two file units, the bucket identifier is determined, and a mapping relationship is established between the bucket identifier of the bucket storing the at least two file units and the corresponding file unit information. The bucket identifier can be a bucket name, bucket ID, etc. When subsequently retrieving file unit information, the bucket identifier corresponding to the file to be processed is first determined, and then the corresponding file unit information is determined based on the bucket identifier, thereby narrowing the search range for file unit information, enabling rapid retrieval of file unit information, and improving processing efficiency.
[0043] In this embodiment of the application, the method further includes: if the size of the information record table exceeds a first preset capacity threshold, determining first target record information based on the storage time of the information recorded in the information record table; and deleting the first target record information from the information record table. The method further includes: if the size of the information record table is lower than a second preset capacity threshold, determining target file unit information based on the storage time of the file unit information; determining second target record information based on the target file unit information; and adding the second target record information to the information record table.
[0044] The first target record information can be record information stored earlier. The target file unit information can be file unit information stored later. For example, if the size of the information record table exceeds a first preset capacity threshold, and includes a large amount of record information, the first target record information stored earlier can be deleted to save storage space and improve search and read efficiency. If the size of the information record table is lower than a second preset capacity threshold, the target file unit information stored later can be read from external storage to generate second target record information, which is then added to the information record table to enrich its content.
[0045] In this embodiment of the application, after establishing an information record table based on the file unit information and recording it in the random access memory, the method further includes: if a processing request for the file to be processed is received, determining whether there is an information record table associated with the file to be processed in the random access memory; wherein, the processing request is a processing request other than a storage request; if so, processing the file to be processed according to the information record table.
[0046] The processing request can be any request other than a file storage request, such as a deletion request, a read request, or a modification request. For example, if a processing request for a file to be processed is received, it is determined whether an information record table exists in the random access memory (RAM). If it exists, it indicates that the file to be processed was stored in fragments, consisting of at least two file units. Therefore, it is necessary to search for at least two file units according to the information record table to ensure that all file units corresponding to the file to be processed are found completely. If the information record table does not exist, it is determined that the file to be processed is stored directly as a single file, and therefore, the file to be processed is directly searched for in the external storage. Because the information record table is stored in the RAM in this embodiment, even if the first file unit or other file units of the at least two file units are deleted, lost, or damaged, the other file units can still be accurately found and processed using the information record table in the RAM.
[0047] In this embodiment, the target file is processed into file units according to its size and a preset file unit specification, thereby achieving efficient object storage of the target file. By extracting and storing the relevant file unit information after dividing the target file into file units, the problem of not being able to find or promptly delete other file units after any file unit is deleted is solved, enabling fast and orderly searching of file units.
[0048] Figure 3This is a flowchart illustrating a file processing method according to another embodiment of the present invention. This application provides a detailed description of the target file deletion process after the target file storage process has been completed, based on the above embodiments. Details not described in detail in this embodiment can be found in the above embodiments. See also... Figure 3 The file processing method provided in this embodiment may include:
[0049] S210. If the target file size is larger than the preset file unit size, the target file is processed according to the preset file unit size to determine at least two file units.
[0050] S220. Determine file unit information based on the target file and the at least two file units.
[0051] S230. Establish an information record table based on the file unit information and record it in the random access memory, so as to search for at least two file units in the external memory according to the information record table.
[0052] S240. If a deletion request for the target file is received, determine whether an information record table associated with the file to be processed exists in the random access memory.
[0053] The deletion request is sent by the client. If a file processing request is received from the client, it is parsed to determine the type of file processing. If it is a deletion request for the target file, the system checks whether the random access memory stores an information record table associated with the file to be processed, and performs the deletion operation according to the information record table.
[0054] For example, the file identifier to be processed can be matched with the target file identifier in the information record table. If the match is successful, it means that the information record table is the information record table associated with the target file.
[0055] S250. If so, then according to the information record table, query at least two file units associated with the file to be processed.
[0056] If an information record table exists in the random access memory, then at least two file units associated with the file to be processed are retrieved from the external storage according to the information record table, and deletion operations are performed on at least two file units. See the description section of S120 for the specific retrieval scheme.
[0057] S260. Delete the at least two file units from the external storage and delete the record information in the information record table associated with the file to be processed from the random access memory to complete the deletion process of the target file.
[0058] For example, deletion operations are performed on at least two retrieved file units. Alternatively, records associated with the file to be processed can be deleted, and backed-up file unit information can be removed from external storage to save storage space.
[0059] In this embodiment of the application, if the information record table associated with the file to be processed does not exist in the memory, the file to be processed is directly deleted from the external memory.
[0060] The technical solution of this application embodiment determines whether an information record table associated with the file to be processed exists in the random access memory when a deletion request for the target file is received. If so, at least two file units associated with the file to be processed are queried according to the information record table, and then the deletion operation is performed. In this way, even if the first file unit is deleted, damaged or lost, other file units can be found and deleted in a timely manner, thereby improving the efficiency of file processing.
[0061] Figure 4 This is a flowchart illustrating a file processing method according to another embodiment of the present invention. This application provides a detailed description of the target file reading process after the target file storage process has been completed, based on the above embodiments. Details not described in detail in this embodiment can be found in the above embodiments. See also... Figure 4 The file processing method provided in this embodiment may include:
[0062] S310. If the target file size is larger than the preset file unit size, the target file is processed according to the preset file unit size to determine at least two file units.
[0063] S320. Determine file unit information based on the target file and the at least two file units.
[0064] S330. Establish an information record table based on the file unit information and record it in the random access memory, so as to search for at least two file units in the external memory according to the information record table.
[0065] S340. If a read processing request for the target file is received, determine whether there is an information record table associated with the file to be processed in the random access memory.
[0066] The read processing request is sent by the client. If a file processing request is received from the client, it is parsed to determine the type of file to be processed. If it is a read processing request for a file to be processed, the system checks whether the random access memory stores an information record table associated with the file to be processed, and performs the read processing operation based on the information record table.
[0067] For example, the file identifier to be processed can be matched with the target file identifier in the information record table. If the match is successful, it means that the information record table is the information record table associated with the target file.
[0068] S350. If so, then according to the information record table, query at least two file units associated with the file to be processed.
[0069] If an information record table exists in the random access memory, at least two file units associated with the file to be processed are retrieved from the external memory according to the information record table, and read processing operations are performed on at least two file units. See the description section of S120 for the specific retrieval scheme.
[0070] S360. Based on the information record table, sort the at least two file units and then read them to complete the reading process of the target file.
[0071] For example, since file units may be stored out of order in memory, they can be retrieved based on their information and then sorted to achieve ordered reading. For instance, if the retrieved file units are obj3, obj4, obj1, obj0, and obj2, they can be sorted to obtain obj0, obj1, obj2, obj3, and obj4, then read and returned to the client.
[0072] In this embodiment of the application, if the information record table associated with the file to be processed does not exist in the memory, the target file is read directly from the memory.
[0073] The technical solution of this application embodiment, upon receiving a request to read the target file, determines whether an information record table associated with the file to be processed exists in the random access memory. If so, it queries at least two file units associated with the file to be processed according to the information record table to read the file units. This ensures that even if file units are deleted, damaged, or lost, the file units associated with the file to be processed can be read accurately and promptly based on the file unit information. Furthermore, by sorting the at least two file units before reading, ordered reading of file units is achieved.
[0074] Figure 5 This is a schematic diagram of a file processing apparatus according to an embodiment of the present invention. This apparatus is applicable to situations where a target object is divided into file units for storage, and an information record table is established based on the file unit information and stored in random access memory for easy searching and other processing. This apparatus can be implemented in software and / or hardware, and can be integrated into a file processing device. See also... Figure 5 The device specifically includes:
[0075] The file unit determination module 410 is used to process the target file according to the preset file unit specification if the target file size is larger than the preset file unit specification, and determine at least two file units.
[0076] The file unit information determination module 420 is used to determine file unit information based on the target file and the at least two file units;
[0077] Storage module 430 is used to establish an information record table based on the file unit information and record it in random access memory, so as to search for at least two file units in external memory based on the information record table.
[0078] In this embodiment of the application, the device further includes:
[0079] The processing request receiving module is used to determine whether an information record table associated with the file to be processed exists in the random access memory if a processing request for the file to be processed is received; wherein the processing request is a processing request other than a storage request.
[0080] The processing module is used to process the file to be processed according to the information record table if the condition is met.
[0081] In this embodiment of the application, the device further includes:
[0082] The deletion processing request receiving module is used to determine whether an information record table associated with the file to be processed exists in the random access memory if a deletion processing request for the target file is received.
[0083] The first query module is used to query at least two file units associated with the file to be processed based on the information record table if the condition is met.
[0084] The deletion processing module is used to delete the at least two file units from the external storage and delete the record information in the information record table associated with the file to be processed from the random access memory, so as to complete the deletion processing of the target file.
[0085] In this embodiment of the application, the device further includes:
[0086] The read processing request receiving module is used to determine whether an information record table associated with the file to be processed exists in the random access memory if a read processing request for the target file is received.
[0087] The second query module is used to query at least two file units associated with the file to be processed based on the information record table if the condition is met.
[0088] The read processing module is used to sort the at least two file units according to the information record table and then read them to complete the read processing of the target file.
[0089] In this embodiment of the application, the file unit information includes the target file identifier, the name of any file unit, and the number of file units;
[0090] Alternatively, the file unit information may include the target file identifier, the target file size, the preset file unit specification, and the name of any file unit;
[0091] Alternatively, the file unit information may include the target file identifier, the name of the first file unit, and the name of the last file unit.
[0092] In this embodiment of the application, the device further includes:
[0093] The backup module is used to back up the file unit information to an external storage device and to establish the information record table based on the file unit information.
[0094] In this embodiment of the application, the device further includes:
[0095] The first threshold comparison module is used to determine the first target record information based on the storage time of the recorded information in the information record table if the specifications of the information record table exceed the first preset capacity threshold.
[0096] The deletion module is used to delete the first target record information from the information record table;
[0097] The second threshold comparison module is used to determine the target file unit information based on the storage time of the file unit information if the specification of the information record table is lower than the second preset capacity threshold.
[0098] An adding module is used to determine the second target record information based on the target file unit information and add the second target record information to the information record table.
[0099] In this embodiment of the application, the device further includes:
[0100] The storage bucket identifier recording module is used to record the storage bucket identifiers of the at least two file units, and to determine the storage bucket of the at least two file units based on the storage bucket identifiers, and to find the at least two file units from the storage buckets.
[0101] The document processing apparatus provided in this application embodiment can execute the document processing method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.
[0102] Figure 6 This is a schematic diagram of the structure of a file processing device provided in one embodiment of the present invention. Figure 6 A block diagram is shown of an exemplary file processing device 512 suitable for implementing embodiments of this application. Figure 6 The file processing device 512 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0103] like Figure 6 As shown, the file processing device 512 may include: one or more processors 516; and a memory 528 for storing one or more programs, which, when executed by the one or more processors 516, cause the one or more processors 516 to implement the file processing method provided in this embodiment, including:
[0104] If the target file size is larger than the preset file unit size, the target file will be processed according to the preset file unit size to determine at least two file units;
[0105] Based on the target file and the at least two file units, determine the file unit information;
[0106] An information record table is established based on the file unit information and recorded in random access memory, so as to search for at least two file units in external memory based on the information record table.
[0107] The components of the file processing device 512 may include, but are not limited to: one or more processors or processor 516, memory 528, and bus 518 connecting different device components (including memory 528 and processor 516).
[0108] Bus 518 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0109] The file processing device 512 typically includes a variety of computer-readable storage media. These storage media can be any available storage media that can be accessed by the file processing device 512, including volatile and non-volatile storage media, removable and non-removable storage media.
[0110] Memory 528 may include computer device readable storage media in the form of volatile memory, such as random access memory (RAM) 530 and / or cache memory 532. File processing device 512 may further include other removable / non-removable, volatile / non-volatile computer device storage media. By way of example only, storage system 534 may be used to read and write non-removable, non-volatile magnetic storage media (…). Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a CD-ROM, DVD-ROM, or other optical storage medium) may be provided. In these cases, each drive may be connected to bus 518 via one or more data storage medium interfaces. Memory 528 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0111] A program / utility 540 having a set (at least one) of program modules 542 may be stored, for example, in memory 528. Such program modules 542 include, but are not limited to, operating devices, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 542 typically perform the functions and / or methods described in the embodiments of the present invention.
[0112] The file processing device 512 can also communicate with one or more external devices 514 (e.g., keyboard, pointing device, display 526, etc.), and with one or more devices that enable a user to interact with the file processing device 512, and / or with any device that enables the file processing device 512 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via the input / output (I / O) interface 522. Furthermore, the file processing device 512 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via the network adapter 520. Figure 6 As shown, network adapter 520 communicates with other modules of file processing device 512 via bus 518. It should be understood that, although... Figure 6 As not shown, other hardware and / or software modules may be used in conjunction with file processing device 512, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, and data backup storage devices.
[0113] The processor 516 performs various functional applications and data processing by running at least one of the multiple programs stored in the memory 528, such as implementing a file processing method provided in the embodiments of this application.
[0114] One embodiment of the present invention provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a file processing method, including:
[0115] If the target file size is larger than the preset file unit size, the target file will be processed according to the preset file unit size to determine at least two file units;
[0116] Based on the target file and the at least two file units, determine the file unit information;
[0117] An information record table is established based on the file unit information and recorded in random access memory, so as to search for at least two file units in external memory based on the information record table.
[0118] The computer storage medium in this application embodiment can be any combination of one or more computer-readable storage media. The computer-readable storage medium can be a computer-readable signal storage medium or a computer-readable storage medium in general. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application embodiment, the computer-readable storage medium can be any tangible storage medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or device.
[0119] Computer-readable signal storage media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal storage media may also be any computer-readable storage medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution device, apparatus, or apparatus.
[0120] Program code contained on a computer-readable storage medium may be transmitted using any suitable storage medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0121] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0122] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A file processing method, characterized in that, The method includes: During the object storage process of the target file, if the target file size is larger than the preset file unit specification, the target file is processed according to the preset file unit specification to determine at least two file units. Based on the target file and the at least two file units, file unit information is determined; the file unit information includes the target file identifier, the name of any file unit, and the number of file units. Alternatively, the file unit information may include the target file identifier, the target file size, the preset file unit specification, and the name of any file unit; Alternatively, the file unit information includes the target file identifier, the name of the first file unit, and the name of the last file unit; The file unit information is no longer stored as a component of the file unit in the file unit's extended attributes. An information record table is established based on the file unit information and recorded in random access memory. At least two file units are searched in external memory based on the information record table. If the size of the target file is less than or equal to the preset file unit specification, the target file is directly stored as a storage unit, and the information record table associated with the target file is not recorded in the random access memory.
2. The method according to claim 1, characterized in that, After establishing an information record table based on the file unit information and recording it in random access memory, the method further includes: If a processing request for a file to be processed is received, it is determined whether an information record table associated with the file to be processed exists in the random access memory; wherein, the processing request is a processing request other than a storage request; If so, the file to be processed is processed according to the information record table.
3. The method according to claim 2, characterized in that, If the processing request is a deletion processing request, then after establishing an information record table based on the file unit information and recording it in the random access memory, the method further includes: Determine whether an information record table associated with the file to be processed exists in the random access memory; If so, then according to the information record table, query at least two file units associated with the file to be processed; The at least two file units are deleted from the external storage, and the record information in the information record table associated with the file to be processed is deleted from the random access memory to complete the deletion process of the file to be processed.
4. The method according to claim 2, characterized in that, If the processing request is a read processing request, then after establishing an information record table based on the file unit information and recording it in the random access memory, the method further includes: If a request to read the file to be processed is received, it is determined whether an information record table associated with the file to be processed exists in the random access memory; If so, then according to the information record table, query at least two file units associated with the file to be processed; According to the information record table, the at least two file units are sorted and then read to complete the reading and processing of the file to be processed.
5. The method according to claim 1, characterized in that, After establishing an information record table based on the file unit information and recording it in random access memory, the method further includes: The file unit information is backed up in external storage and used to create the information record table based on the file unit information.
6. The method according to claim 1, characterized in that, The method further includes: If the specifications of the information record table exceed the first preset capacity threshold, the first target record information is determined based on the storage time of the information recorded in the information record table. Delete the first target record information from the information record table; If the specifications of the information record table are lower than the second preset capacity threshold, the target file unit information is determined based on the storage time of the file unit information. The second target record information is determined based on the target file unit information, and the second target record information is added to the information record table.
7. A document processing device, characterized in that, The device includes: The file unit determination module is used to process the target file according to the preset file unit specification and determine at least two file units if the target file size is larger than the preset file unit specification during the object storage process of the target file. The file unit information determination module is used to determine file unit information based on the target file and the at least two file units; the file unit information includes the target file identifier, the name of any file unit, and the number of file units; Alternatively, the file unit information may include the target file identifier, the target file size, the preset file unit specification, and the name of any file unit; Alternatively, the file unit information includes the target file identifier, the name of the first file unit, and the name of the last file unit; The storage module is used to store the file unit information as no longer a component of the file unit in the extended attributes of the file unit, establish an information record table based on the file unit information, record it in random access memory, and search for at least two file units in external memory based on the information record table. The file unit determination module is specifically used to store the target file as a storage unit if the size of the target file is less than or equal to the preset file unit specification, and not to record the relevant information of the target file in the information record table of the random access memory.
8. A document processing device, characterized in that, The document processing device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the file processing method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the file processing method as described in any one of claims 1-6.
Citation Information
Patent Citations
File storage system and file storage control method thereof
CN105718530A