A method, system, device and storage medium for softcopy query acceleration
Patent Information
- Application Number
- CN202311111958.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2043-08-31
AI Technical Summary
[0002]在高性能计算场景中,基于快照技术实现的软拷贝功能解决了百G文件的拷贝性能慢和空间重复占用的问题;原文件可以进行多级(最多5级)软拷贝,文件以固定大小的数据段为单位进行管理,软拷贝的文件会进行部分数据的差异化修改,在读取软拷贝文件时,需要找到当前读取数据所在的原文件,部分数据需要经过级联查找,最终找到数据所在的原文件;每次读取软拷贝文件时,都需要先判断自身是否有要读取的数据块,若有,直接读取;若没有,需要通过文件记录的软拷贝元数据信息找到关联的上级软拷贝文件,查找效率较差,严重影响软拷贝文件的读取性能
[0014]本发明具有以下有益技术效果:只需要在第一次读取软拷贝文件时判断自身数据块是否在数据块映射表中存在记录,如果没有记录就更新数据块映射表,后续有新写入的数据就更新文件本身的数据块映射表;下次读取软拷贝文件时通过文件的数据块映射表,快速查找到数据所在的原文件,读取数据并返回;当文件的数据缓存被无效掉时,清空文件的数据块映射表,在内存占用较少的情况下,解决了软拷贝文件读取时重复查找数据所在原文件的问题,实现了一次构建多次使用,缩短了软拷贝文件的数据查找时间,提升了软拷贝文件的读取性能。
Smart Images

Figure CN117093155B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed systems, and more specifically, to a method, system, device, and storage medium for accelerating soft copy lookups. Background Technology
[0002] In high-performance computing scenarios, the soft copy function based on snapshot technology solves the problems of slow copying performance and duplicate space occupation for hundreds of gigabytes of files. The original file can be soft copied in multiple levels (up to 5 levels). The file is managed in units of fixed-size data segments. The soft copy file will have some data modified differently. When reading the soft copy file, it is necessary to find the original file where the data to be read is located. Some data needs to be cascaded to finally find the original file where the data is located. Each time the soft copy file is read, it is necessary to first determine whether the data block to be read exists. If it does, it is read directly; if not, it is necessary to find the associated parent soft copy file through the soft copy metadata information recorded in the file. The search efficiency is poor and seriously affects the reading performance of soft copy files. Summary of the Invention
[0003] In view of this, the purpose of this invention is to provide a method, system, electronic device, and computer-readable storage medium for accelerating soft copy lookup. This invention only needs to determine whether its own data block exists in the data block mapping table when reading the soft copy file for the first time. If no record exists, the data block mapping table is updated. Subsequent reads of newly written data update the file's own data block mapping table. The next time the soft copy file is read, the original file containing the data is quickly located through the file's data block mapping table, the data is read, and returned. When the file's data cache is invalidated, the file's data block mapping table is cleared. With minimal memory usage, this solves the problem of repeatedly searching the original file when reading soft copy files, enabling one-time construction and multiple uses, shortening the data lookup time for soft copy files, and improving the reading performance of soft copy files.
[0004] To achieve the above objectives, one aspect of the present invention provides a method for accelerating soft copy lookup, comprising the following steps: performing a soft copy on an original file to obtain a soft copy file, and recording the data information of the original file in a data block mapping table; in response to receiving a read request for the soft copy file, traversing the data block mapping table according to the read request to determine whether a record corresponding to the read request exists in the data block mapping table; in response to the existence of a record corresponding to the read request in the data block mapping table, determining the original file according to the read request for data reading operation; and in response to receiving a write request for the soft copy file, updating the data block mapping table of the original file corresponding to the soft copy file according to the write request.
[0005] In some implementations, the step of recording the data information of the original file into the data block mapping table includes: writing the label and data block number of the original file into the data block mapping table, and saving the data block number in the form of an array.
[0006] In some implementations, the step of traversing the data block mapping table according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table includes: determining the range of data to be read according to the read request, and calculating the corresponding data block number according to the range of data to be read; and traversing the data block mapping table to find whether there is a record corresponding to the corresponding data block number.
[0007] In some implementations, the method further includes: in response to the absence of a record corresponding to the read request in the data block mapping table, detecting whether a data block corresponding to the read request exists in the current soft copy file; in response to the absence of a data block corresponding to the read request in the current soft copy file, determining all associated files of the current soft copy file through soft copy metadata concatenation information recorded in the current soft copy file; traversing all associated files to detect whether a data block corresponding to the read request exists in the associated files; in response to the presence of a data block corresponding to the read request in the associated files, updating the data block mapping table of the corresponding associated file according to the data block; and in response to the absence of a data block corresponding to the read request in the associated files, updating the data block mapping table of the current soft copy file according to the data block.
[0008] In some implementations, the step of updating the data block mapping table of the corresponding associated file or updating the data block mapping table of the current soft copy file according to the data block includes: dividing the data block number by a preset value to obtain the index in the bitmap array, and setting the bit corresponding to the index to one.
[0009] In some implementations, the step of updating the data block mapping table of the original file corresponding to the soft copy file according to the write request includes: dividing the data block number corresponding to the write request by a preset value to obtain the index in the bitmap array, and setting the bit position corresponding to the index to zero.
[0010] In some implementations, the method further includes: clearing the corresponding data block mapping table in response to the invalidation of the cache of the original file or soft copy file.
[0011] In another aspect, this invention provides a system for accelerating soft copy lookup, comprising: a setting module, configured to perform a soft copy on an original file to obtain a soft copy file, and record the data information of the original file in a data block mapping table; a traversal module, configured to, in response to receiving a read request for the soft copy file, traverse the data block mapping table according to the read request to determine whether a record corresponding to the read request exists in the data block mapping table; a reading module, configured to, in response to the existence of a record corresponding to the read request in the data block mapping table, determine the original file according to the read request for data reading operation; and a writing module, configured to, in response to receiving a write request for the soft copy file, update the data block mapping table of the original file corresponding to the soft copy file according to the write request.
[0012] In another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory storing computer instructions executable on the processor, the instructions, when executed by the processor, implementing the steps of the method described above.
[0013] In another aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method steps.
[0014] This invention offers the following beneficial technical effects: It only requires checking whether the data block exists in the data block mapping table during the first read of the soft copy file. If no record exists, the data block mapping table is updated. Subsequent reads update the file's own data block mapping table whenever new data is written. The next time the soft copy file is read, the original file containing the data is quickly located using the file's data block mapping table, and the data is read and returned. When the file's data cache is invalidated, the file's data block mapping table is cleared. This solves the problem of repeatedly searching the original file when reading a soft copy file with minimal memory usage, enabling one-time builds for multiple uses, shortening the data search time for soft copy files, and improving the reading performance of soft copy files. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0016] Figure 1 A schematic diagram illustrating an embodiment of the method for accelerating soft copy lookup provided by the present invention;
[0017] Figure 2This invention provides a schematic representation of the distributed system soft copy file data block mapping.
[0018] Figure 3 A schematic diagram of an embodiment of the system for accelerating soft copy lookup provided by the present invention;
[0019] Figure 4 A schematic diagram of the hardware structure of an embodiment of the electronic device for accelerating soft copy lookup provided by the present invention;
[0020] Figure 5 This is a schematic diagram of an embodiment of a computer storage medium for accelerating soft copy lookup provided by the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0022] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.
[0023] In a first aspect, an embodiment of a method for accelerating soft copy lookups is proposed. Figure 1 The diagram shown is an embodiment of the method for accelerating soft copy lookup provided by the present invention. Figure 1 As shown, the embodiments of the present invention include the following steps:
[0024] S1. Perform a soft copy on the original file to obtain a soft copy file, and record the data information of the original file in the data block mapping table;
[0025] S2. In response to receiving a read request for the soft copy file, traverse the data block mapping table according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table;
[0026] S3. In response to the existence of a record corresponding to the read request in the data block mapping table, determine the original file based on the read request to perform a data read operation; and
[0027] S4. In response to receiving a write request for the soft copy file, update the data block mapping table of the original file corresponding to the soft copy file according to the write request.
[0028] This invention accelerates soft copy lookup by using a data block mapping table. The soft copy file data block mapping table records the ino number of the original file and the data block number. The data block number is stored in an array, with each array member being a 32-bit unsigned integer. A 1TB file will occupy a maximum of about 32KB. When reading data, the original file containing the data and the corresponding data block number can be quickly found through the data block mapping table. This achieves fast data lookup, saves memory usage of the data block mapping table, and improves the read performance of soft copy files.
[0029] Figure 2 This invention provides a schematic representation of the distributed system soft copy file data block mapping, combined with... Figure 2 The embodiments of the present invention will be described.
[0030] A soft copy is performed on the original file to obtain a soft copy file, and the data information of the original file is recorded in a data block mapping table. In some embodiments, the step of recording the data information of the original file in the data block mapping table includes: writing the label and data block number of the original file into the data block mapping table, and storing the data block number in an array.
[0031] In response to receiving a read request for the soft copy file, the data block mapping table is traversed according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table.
[0032] In some implementations, the step of traversing the data block mapping table to determine whether a record corresponding to the read request exists in the data block mapping table includes: determining the range of data to be read based on the read request, and calculating the corresponding data block number based on the range of data to be read; and traversing the data block mapping table to search for a record corresponding to the data block number. The process involves receiving a read request from an upper-layer application; calculating the relevant data block number based on the range of data to be read; and traversing the data block mapping table (DataMap) to search for a record corresponding to the data block number.
[0033] If a record corresponding to the read request exists in the data block mapping table, the original file is determined based on the read request for data reading operation. If a record corresponding to the data block number exists in the data block mapping table, the original file corresponding to the data block is directly obtained, and data reading operation is performed.
[0034] In some implementations, the method further includes: in response to the absence of a record corresponding to the read request in the data block mapping table, detecting whether a data block corresponding to the read request exists in the current soft copy file; in response to the absence of a data block corresponding to the read request in the current soft copy file, determining all associated files of the current soft copy file through soft copy metadata concatenation information recorded in the current soft copy file; traversing all associated files to detect whether a data block corresponding to the read request exists in the associated files; in response to the presence of a data block corresponding to the read request in the associated files, updating the data block mapping table of the corresponding associated file according to the data block; and in response to the absence of a data block corresponding to the read request in the associated files, updating the data block mapping table of the current soft copy file according to the data block.
[0035] In some implementations, the step of updating the data block mapping table of the corresponding associated file or updating the data block mapping table of the current soft copy file according to the data block includes: dividing the data block number by a preset value to obtain the index in the bitmap array, and setting the bit corresponding to the index to one.
[0036] If the record corresponding to the data block number does not exist in the data block mapping table, check if the current soft copy file contains the data block. If it does, update the DataMap by recording the file's ino number in the DataMap, dividing the data block number by 32 to determine its index in the bitmap array, and then dividing the data block number by 32 to determine its position in the corresponding 32 bits, setting that position to 1. If it does not exist, cascade the soft copy metadata information recorded in the current file to search for the data block number in the associated file. If found, update the DataMap with the file's ino number and the corresponding position of the data block number. The next time the file is read, directly find the file corresponding to the data in the DataMap and read it directly.
[0037] In response to receiving a write request for the soft copy file, the data block mapping table of the original file corresponding to the soft copy file is updated according to the write request.
[0038] In some implementations, the step of updating the data block mapping table of the original file corresponding to the soft copy file according to the write request includes: dividing the data block number corresponding to the write request by a preset value to obtain the index in the bitmap array, and setting the bit position corresponding to the index to zero. When the soft copy file is modified and written, the DataMap corresponding to the current file is updated, and the position corresponding to the latest recorded data block number is set to zero (invalid).
[0039] In some implementations, the method further includes clearing the corresponding data block mapping table in response to the invalidation of the cache of the original file or soft copy file. When cached data of a file is about to be evicted, clearing the DataMap ensures that the correct data can be found on the next read. The DataMap uses multi-level hash mapping acceleration technology to realize the cascading dependency relationship of multiple versions of data.
[0040] Specifically, upon receiving a write request from the upper layer, the DataMap is updated, setting the position corresponding to the data block number of the current record to 0; at the same time, the positions corresponding to the ino and data block number of the current file are set to 1; when the file cache is evicted, the DataMap is cleared to ensure that the correct data can be found the next time it is read.
[0041] It should be noted that the steps in each embodiment of the above-mentioned method for accelerating soft copy queries can be interleaved, substituted, added, or deleted. Therefore, these reasonable permutations and combinations of the method for accelerating soft copy queries should also fall within the protection scope of this invention, and the protection scope of this invention should not be limited to the embodiments.
[0042] Based on the above objectives, a second aspect of this invention proposes a system for accelerating soft copy lookups. For example... Figure 3 As shown, system 200 includes the following modules: a setting module, used to perform a soft copy of the original file to obtain a soft copy file, and record the data information of the original file in a data block mapping table; a traversal module, used to, in response to receiving a read request for the soft copy file, traverse the data block mapping table according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table; a reading module, used to, in response to the existence of a record corresponding to the read request in the data block mapping table, determine the original file according to the read request for data reading operation; and a writing module, used to, in response to receiving a write request for the soft copy file, update the data block mapping table of the original file corresponding to the soft copy file according to the write request.
[0043] In some implementations, the setting module is also used to: write the original file's label and data block number into a data block mapping table, and save the data block number as an array.
[0044] In some implementations, the traversal module is further configured to: determine the range of data to be read based on the read request, and calculate the corresponding data block number based on the range of data to be read; and traverse the data block mapping table to find whether there is a record corresponding to the corresponding data block number.
[0045] In some implementations, the system further includes an execution module, which is configured to: detect whether a data block corresponding to the read request exists in the current soft copy file in response to the absence of a record corresponding to the read request in the data block mapping table; determine all associated files of the current soft copy file through the soft copy metadata concatenation information recorded in the current soft copy file in response to the absence of a data block corresponding to the read request in the current soft copy file; traverse all associated files to detect whether a data block corresponding to the read request exists in the associated files; update the data block mapping table of the corresponding associated file according to the data block in response to the presence of a data block corresponding to the read request in the associated files; and update the data block mapping table of the current soft copy file according to the data block in response to the absence of a data block corresponding to the read request in the associated files.
[0046] In some implementations, the execution module is further configured to: divide the data block number by a preset value to obtain the index in the point map array, and set the bit corresponding to the index to one.
[0047] In some implementations, the writing module is further configured to: divide the data block number corresponding to the write request by a preset value to obtain the index in the bitmap array, and set the bit corresponding to the index to zero.
[0048] In some implementations, the system further includes a caching module, which is used to: clear the corresponding data block mapping table in response to the invalidation of the cache of the original file or soft copy file.
[0049] Based on the above objectives, a third aspect of the present invention provides an electronic device, comprising: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executed by the processor to perform the following steps: S1, performing a soft copy of an original file to obtain a soft copy file, and recording the data information of the original file in a data block mapping table;
[0050] S2. In response to receiving a read request for the soft copy file, traverse the data block mapping table according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table; S3. In response to the existence of a record corresponding to the read request in the data block mapping table, determine the original file according to the read request to perform a data reading operation; and S4. In response to receiving a write request for the soft copy file, update the data block mapping table of the original file corresponding to the soft copy file according to the write request.
[0051] In some implementations, the step of recording the data information of the original file into the data block mapping table includes: writing the label and data block number of the original file into the data block mapping table, and saving the data block number in the form of an array.
[0052] In some implementations, the step of traversing the data block mapping table according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table includes: determining the range of data to be read according to the read request, and calculating the corresponding data block number according to the range of data to be read; and traversing the data block mapping table to find whether there is a record corresponding to the corresponding data block number.
[0053] In some implementations, the steps further include: in response to the absence of a record corresponding to the read request in the data block mapping table, detecting whether a data block corresponding to the read request exists in the current soft copy file; in response to the absence of a data block corresponding to the read request in the current soft copy file, determining all associated files of the current soft copy file through the soft copy metadata concatenation information recorded in the current soft copy file; traversing all associated files to detect whether a data block corresponding to the read request exists in the associated files; in response to the presence of a data block corresponding to the read request in the associated files, updating the data block mapping table of the corresponding associated file according to the data block; and in response to the absence of a data block corresponding to the read request in the associated files, updating the data block mapping table of the current soft copy file according to the data block.
[0054] In some implementations, the step of updating the data block mapping table of the corresponding associated file or updating the data block mapping table of the current soft copy file according to the data block includes: dividing the data block number by a preset value to obtain the index in the bitmap array, and setting the bit corresponding to the index to one.
[0055] In some implementations, the step of updating the data block mapping table of the original file corresponding to the soft copy file according to the write request includes: dividing the data block number corresponding to the write request by a preset value to obtain the index in the bitmap array, and setting the bit position corresponding to the index to zero.
[0056] In some implementations, the steps further include: clearing the corresponding data block mapping table in response to the cache of the original file or soft copy file being invalidated.
[0057] like Figure 4 The diagram shown is a hardware structure schematic of an embodiment of the electronic device for accelerating soft copy lookup provided by the present invention.
[0058] For example Figure 4 Taking the device shown as an example, the device includes a processor 301 and a memory 302.
[0059] Processor 301 and memory 302 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0060] The memory 302, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the soft copy query acceleration method in this embodiment. The processor 301 executes various server functions and data processing by running the non-volatile software programs, instructions, and modules stored in the memory 302, thereby implementing the soft copy query acceleration method.
[0061] Memory 302 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created using a method that accelerates access via soft copy lookup. Furthermore, memory 302 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 302 may optionally include memory remotely located relative to processor 301, and these remote memories may be connected to the local module via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0062] The computer instructions 303 corresponding to one or more methods for accelerating soft copy lookups are stored in memory 302. When executed by processor 301, the method for accelerating soft copy lookups in any of the above method embodiments is executed.
[0063] Any embodiment of the electronic device that performs the above-described method for accelerating soft copy lookup can achieve the same or similar effects as any of the aforementioned method embodiments.
[0064] The present invention also provides a computer-readable storage medium storing a computer program that performs a method for accelerating soft copy lookup when executed by a processor.
[0065] like Figure 5 The diagram shown is a schematic representation of an embodiment of the computer storage medium for accelerating soft copy lookup provided by the present invention. Figure 5 Taking the computer storage medium shown as an example, the computer-readable storage medium 401 stores a computer program 402 that, when executed by a processor, performs the above method.
[0066] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program for the soft copy query acceleration method can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The storage medium for the program can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The above computer program embodiments can achieve the same or similar effects as any of the corresponding foregoing method embodiments.
[0067] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0068] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0069] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0070] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0071] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for accelerating soft copy lookup, characterized in that, Includes the following steps: A soft copy is performed on the original file to obtain a soft copy file, and the data information of the original file is recorded in the data block mapping table; In response to receiving a read request for the soft copy file, the data block mapping table is traversed according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table; In response to the existence of a record corresponding to the read request in the data block mapping table, the original file is determined according to the read request to perform a data reading operation; as well as In response to receiving a write request for the soft copy file, the data block mapping table of the original file corresponding to the soft copy file is updated according to the write request; If no record corresponding to the read request exists in the data block mapping table, check if the data block corresponding to the read request exists in the current soft copy file; In response to the absence of the data block corresponding to the read request in the current soft copy file, all associated files of the current soft copy file are determined through the soft copy metadata concatenation information recorded in the current soft copy file; Traverse all associated files to check if the data block corresponding to the read request exists in any of the associated files; In response to the existence of a data block corresponding to the read request in the associated file, the data block mapping table of the corresponding associated file is updated according to the data block; as well as If the data block corresponding to the read request does not exist in the associated file, the data block mapping table of the current soft copy file is updated according to the data block.
2. The method for accelerating soft copy lookup according to claim 1, characterized in that, The step of recording the data information of the original file into the data block mapping table includes: Write the original file's label and data block number into the data block mapping table, and save the data block number as an array.
3. The method for accelerating soft copy lookup according to claim 1, characterized in that, The step of traversing the data block mapping table according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table includes: The data reading range is determined based on the read request, and the corresponding data block number is calculated based on the reading range; and Traverse the data block mapping table to check if there is a record corresponding to the data block number.
4. The method for accelerating soft copy lookup according to claim 3, characterized in that, The steps of updating the data block mapping table of the corresponding associated file based on the data block or updating the data block mapping table of the current soft copy file based on the data block include: Divide the data block number by a preset value to obtain the index in the point map array, and set the bit corresponding to the index to 1.
5. The method for accelerating soft copy lookup according to claim 1, characterized in that, The step of updating the data block mapping table of the original file corresponding to the soft copy file according to the write request includes: Divide the data block number corresponding to the write request by a preset value to obtain the index in the bitmap array, and set the bit corresponding to the index to zero.
6. The method for accelerating soft copy lookup according to claim 1, characterized in that, The method also includes: In response to the invalidation of the cache for the original file or soft copy file, the corresponding data block mapping table is cleared.
7. A method for accelerating soft copy lookup, characterized in that, include: The setting module is used to perform a soft copy of the original file to obtain a soft copy file, and record the data information of the original file into the data block mapping table; The traversal module is used to respond to receiving a read request for the soft copy file, and to traverse the data block mapping table according to the read request to determine whether there is a record corresponding to the read request in the data block mapping table; The reading module is used to determine the original file based on the read request in response to the existence of a record corresponding to the read request in the data block mapping table, so as to perform data reading operation. as well as The write module is used to update the data block mapping table of the original file corresponding to the soft copy file according to the write request in response to receiving a write request for the soft copy file; And the modules configured to implement the following functions: If no record corresponding to the read request exists in the data block mapping table, check if the data block corresponding to the read request exists in the current soft copy file; In response to the absence of the data block corresponding to the read request in the current soft copy file, all associated files of the current soft copy file are determined through the soft copy metadata concatenation information recorded in the current soft copy file; Traverse all associated files to check if the data block corresponding to the read request exists in any of the associated files; In response to the existence of a data block corresponding to the read request in the associated file, the data block mapping table of the corresponding associated file is updated according to the data block; as well as If the data block corresponding to the read request does not exist in the associated file, the data block mapping table of the current soft copy file is updated according to the data block.
8. An electronic device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Method and system for improving soft copy reading performance, terminal and storage medium
CN111858665A
Handling copy on first write data for snapshot purposes
US8874524B1