Data writing method and device

By suspending some locked areas to concurrently process read and write requests and splitting and merging write requests, the problem of low concurrency caused by locking in the storage system is solved, and the overall response speed and efficiency are improved.

CN114020482BActive Publication Date: 2025-09-19EMC IP HLDG CO LLC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111313918.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-06-02
Publication Date
2025-09-19
Estimated Expiration
2037-06-02

AI Technical Summary

Technical Problem

When processing multiple read and write requests, existing storage systems suffer from low concurrency and slow overall response speed due to the locking mechanism, especially when the logical data unit does not match the write request unit.

Method used

By suspending read and write requests for some locked areas, non-conflicting areas can be processed concurrently, and write requests can be split into sub-requests for merged execution. Combined with the priority mechanism and granularity adjustment, the concurrency of read and write requests can be improved.

Benefits of technology

This improves the concurrency of read and write requests for the storage system, enhances overall response speed and efficiency, and resolves performance bottlenecks caused by locking unused areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020482B_ABST
    Figure CN114020482B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a method and device for reading and writing data, which is used to improve the concurrency between multiple read and write requests of a storage system while ensuring that no read and write request conflicts occur. The method includes: splitting a first write request into a first group of sub-requests; splitting a second write request into a second group of sub-requests; and in response to detecting that a first sub-request in the first group of sub-requests and a second sub-request in the second group of sub-requests are consecutive in a storage area of ​​a file system, merging the first sub-request and the second sub-request for writing, wherein splitting the first write request into the first group of sub-requests is performed at: (i) a first boundary between a first logical data unit and a second logical data unit, and (ii) a second boundary between the second logical data unit and a third logical data unit.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application date of June 2, 2017, application number 201710409905.8, and invention name “Method and device for writing data”. Technical Field

[0002] Embodiments of the present disclosure relate to the field of data writing, and more particularly, to a method, device, and computer-readable storage medium for data writing. Background Art

[0003] In existing storage systems, multiple read and write requests are typically received. To prevent conflicts between these requests, the target area of ​​the executed read or write request is locked. Simultaneously, all target areas of pending read or write requests due to partially locked target areas are also locked. This can cause some storage space that is not actually being read or written to to be locked and thus hinder the overall responsiveness of the storage system.

[0004] Therefore, how to improve the concurrency between multiple read and write requests of the storage system while ensuring that no read and write request conflicts occur has become a focus of attention. Summary of the Invention

[0005] Embodiments of the present disclosure provide a solution for reading and writing data.

[0006] According to a first aspect of the present disclosure, a method for reading and writing data is provided. The method includes: in response to receiving a first read / write request for a first target area, determining whether there is a second read / write request in progress that conflicts with the first read / write request, wherein the second read / write request is directed to a second target area that at least partially overlaps with the first target area, and at least one of the first read / write request and the second read / write request is a read / write request; and in response to determining that the second read / write request conflicts, suspending the first read / write request while maintaining a sub-area of ​​the first target area that does not overlap with the second target area in an unlocked state.

[0007] According to a second aspect of the present disclosure, a data writing method is provided. The method includes: in response to receiving a first write request for a file system, splitting the first write request into at least one sub-request based on a logical data unit of the file system; determining whether there is a first sub-request among the at least one sub-requests for a data block smaller than the logical data unit; in response to determining the presence of the first sub-request, determining whether there is a currently pending second write request that can be merged with the first sub-request; and in response to determining the presence of the second write request, merging the first sub-request with the second write request for execution.

[0008] According to a third aspect of the present disclosure, an electronic device is provided. The device includes: at least one processing unit; at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, wherein the instructions, when executed by the at least one processing unit, cause the device to perform an action, the action comprising: in response to receiving a first read / write request for a first target area, determining whether there is a second read / write request being executed that conflicts with the first read / write request, the second read / write request being directed to a second target area that at least partially overlaps with the first target area, and at least one of the first read / write request and the second read / write request is a read / write request; and in response to determining that the second read / write request conflicts, suspending the first read / write request while maintaining a sub-area of ​​the first target area that does not overlap with the second target area in an unlocked state.

[0009] According to a fourth aspect of the present disclosure, an electronic device is provided. The device includes: at least one processing unit; at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, wherein the instructions, when executed by the at least one processing unit, cause the device to perform an action, the action comprising: in response to receiving a first write request for a file system, splitting the first write request into at least one sub-request based on a logical data unit of the file system; determining whether there is a first sub-request in the at least one sub-request for a data block size smaller than the logical data unit; in response to determining that the first sub-request exists, determining whether there is a second write request that can be merged with the first sub-request and is currently suspended; and in response to determining that the second write request exists, merging the first sub-request with the second write request for execution.

[0010] In a fifth aspect of the present disclosure, a computer program is provided, which, when executed by a processing unit, enables the processing unit to implement any step of the method described in the first and second aspects of the present disclosure.

[0011] This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.

[0013] Figure 1A schematic diagram showing data reading and writing in a traditional solution is shown;

[0014] Figure 2 A schematic diagram of non-aligned data writing in a traditional solution is shown;

[0015] Figure 3 A flow chart showing a method for reading and writing data according to an embodiment of the present disclosure is shown;

[0016] Figure 4 A schematic diagram illustrating data reading and writing according to an embodiment of the present disclosure is shown;

[0017] Figure 5 A schematic diagram illustrating priority-based data reading and writing according to an embodiment of the present disclosure is shown;

[0018] Figure 6 A flowchart of a priority-based data reading and writing method according to an embodiment of the present disclosure is shown;

[0019] Figure 7 A flow chart of a method for writing unaligned data according to an embodiment of the present disclosure is shown;

[0020] Figure 8 A schematic diagram illustrating non-aligned data writing according to an embodiment of the present disclosure; and

[0021] Figure 9 A schematic block diagram of an example device that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0022] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0023] As used herein, the term "including" and its variations represent open inclusion, i.e., "including but not limited to." Unless otherwise stated, the term "or" means "and / or." The term "based on" means "based at least in part on." The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment." The term "another embodiment" means "at least one additional embodiment." The terms "first," "second," etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0024] For the convenience of description, the embodiments of the present disclosure will use multiple concurrent write requests to describe the conflicts between multiple read and write requests. Those skilled in the art should understand that multiple read requests can be executed concurrently without conflict, and conflicting multiple read requests and write requests are also applicable to the method described herein.

[0025] As described above, traditional storage systems have a low degree of concurrency in processing multiple read and write requests. Figure 1 A schematic diagram 100 of data reading and writing in a conventional solution is shown. Figure 1 As shown, the storage area includes a plurality of consecutive logical data units 102 - 108 . The system receives a plurality of write requests from a user, namely a first write request 120 , a second write request 140 , and a third write request 160 .

[0026] The target areas of first write request 120 are logical data units 102 and 104. Since these are not locked, first write request 120 is executed, and its target areas (logical data units 102 and 104) are locked. Second write request 140 targets logical data units 104 and 106. Since first write request 120 locked logical data unit 104, the target area of ​​second write request 140 is pending due to a locked area. At the same time, the target areas of second write request 140 (logical data units 104 and 106) are also locked. Third write request 160 targets logical data units 106 and 108. Since second write request 140 locked logical data unit 106, the target area of ​​third write request 160 is pending due to a locked area. At the same time, the target areas of third write request 160 (logical data units 106 and 108) are also locked. However, when the first write request 102 is executed, the logical data units 106 and 108 are not actually written, that is, there is concurrency between the first write request 120 and the third write request 160. However, this concurrency cannot be implemented because the second write request 140 locks all its target areas, thereby affecting the overall response speed of the storage system.

[0027] In addition, existing file-level storage often uses 8KB as the logical data unit. However, in some operating systems such as Linux, there are 4KB-aligned write requests. When the storage system processes multiple 4KB-aligned write requests, the performance of the storage system will be severely degraded.

[0028] Figure 2 A schematic diagram 200 of non-aligned data writing in a conventional solution is shown. Figure 2As shown, the storage area includes a plurality of consecutive logical data units 202-210. In some embodiments, a single logical data unit may be 8KB in size. The system receives a plurality of write requests from a user, namely a first write request 220, a second write request 240, a third write request 260, and a fourth write request 280.

[0029] The target area of ​​the first write request 220 is the first target area 222, which is smaller than the size of a single logical data unit. In some embodiments, for example, the first target area 222 may be 4 KB in size. Since the first target area 222 is not locked, the first write request 220 is executed. However, since the minimum lock unit of the storage system is a single logical data unit, the logical data unit 202 is locked.

[0030] The target area of ​​the second write request 240 is the second target area 242. Figure 2 As can be seen, second target area 242 includes portions of logical data unit 202, logical data unit 204, and logical data unit 206. Because first write request 220 locked logical data unit 202, a locked region exists in second target area 242. Therefore, second write request 240 is suspended, and all logical data units 202, 204, and 206 corresponding to second target area 242 are locked. Similarly, third write request 260 has a locked region in third target area 262. Therefore, third write request 260 is suspended, and all logical data units 206, 208, and 210 corresponding to third target area 262 are locked.

[0031] The fourth target area 282 of the fourth write request 280 is smaller than the size of a single logical data unit. In some embodiments, for example, the fourth target area 282 may be 4 KB in size. Since the third write request 260 locked the logical data unit 210, the fourth target area 282 is also locked, and the fourth write request 280 is thus suspended. Simultaneously, the logical data unit 210 corresponding to the fourth target area 282 is also locked.

[0032] exist Figure 2 In the illustrated example, since the unit size of the write request does not match the logical data unit size, the concurrency that originally existed in multiple requests (such as the first write request 220 and the third write request 260 and the first write request 220 and the fourth write request 280, etc.) cannot be implemented, thereby affecting the overall response speed of the storage system.

[0033] In order to at least partially solve the above-mentioned problems and other potential problems, the embodiments of the present disclosure provide a data reading and writing solution. According to various example embodiments of the present disclosure, for multiple read and write requests, when the target area of ​​the read and write request is locked, the read and write request is suspended and all of its target areas are no longer locked, so that other write requests that do not conflict with the target area of ​​the read and write request being executed can be supported, and the write efficiency is improved by concurrently processing the non-conflicting read and write requests. In addition, multiple write requests whose unit size does not match the logical data unit size are split into at least one sub-request, and the sub-requests are merged, which can improve the efficiency of a single write and improve the concurrency of multiple write requests in the storage system, thereby speeding up the overall response speed of the storage system.

[0034] Based on this write mechanism, the problems in the existing technology of locking the space that is not actually read or written and the inefficiency of the file system in processing write requests with a unit size different from the logical data unit size are solved. It can greatly improve the concurrency between read and write requests and improve the efficiency of the storage system.

[0035] The following will refer to Figure 3-Figure 4 The data reading and writing method according to the present disclosure is described in detail. Figure 3 FIG. 3 is a flow chart showing a method 300 for reading and writing data according to an embodiment of the present disclosure; Figure 4 A schematic diagram 400 of data reading and writing according to an embodiment of the present disclosure is shown.

[0036] In block 302, the system receives a first read / write request. In some embodiments, the first read / write request may be a read / write request for a file system, including but not limited to a disk-based file system, a virtual file system, and a network file system. In some embodiments, the first read / write request may also be a read / write request for a storage device, including but not limited to an electromagnetic hard disk drive (HDD), a solid-state drive (SSD), flash memory, random access memory (RAM), and the like.

[0037] In block 302, the system determines whether there is a second read / write request in progress that conflicts with the first read / write request. Specifically, the system determines whether a first target area of ​​the first read / write request at least partially overlaps with a second target area of ​​the second read / write request and whether at least one of the first read / write request and the second read / write request is a write request.

[0038] For example, see Figure 4 , Figure 4The data reading and writing process is described using multiple concurrent write requests as an example. Write request 420 targets logical data units 102 and 104, write request 440 targets logical data units 104 and 106, and write request 460 targets logical data units 106 and 108. That is, the target areas of write requests 420 and 440 overlap, and the target areas of write requests 440 and 460 overlap, so write requests 420 and 440 conflict, and write request 440 and 460 also conflict, but write request 420 and 460 do not conflict.

[0039] If there is a second read / write request in progress that conflicts with the first read / write request, the method proceeds to block 306, where the system suspends the first read / write request without locking the portion of the area where the first read / write request does not conflict with the second read / write request. Figure 4 , request 440 conflicts with the currently executing write request 420 , so the system suspends the write request 440 without locking the target area (logical data unit 104 ) of the write request 420 that does not conflict with the write request 440 .

[0040] If there is no second read / write request in progress that conflicts with the first read / write request, the method proceeds to block 308, where the system executes the first read / write request regardless of whether the first read / write request conflicts with other currently pending read / write requests. Figure 4 , request 460 does not conflict with the currently executing write request 420, so the system executes write request 460 regardless of the conflict between write request 460 and the suspended write request 440, and locks its target area (logical data units 106 and 108).

[0041] In addition, after the first read / write request is executed, the system can notify the currently suspended read / write request to determine whether it can be executed. In some embodiments, the system can only notify the read / write request that conflicts with the first read / write request to determine whether it can be executed, thereby improving system efficiency.

[0042] Based on this read-write mechanism, the concurrency between multiple read-write requests in the system is improved. However, there may also be the following situation: a read-write request cannot be executed because its target area is always locked. To solve this problem, the present disclosure also proposes a priority-based mechanism to prevent read-write requests from being not executed for a long time. Figure 5-Figure 6 The method of reading and writing data based on priority according to the present disclosure is described. Specifically, Figure 5 A schematic diagram of priority-based data reading and writing according to an embodiment of the present disclosure is shown.

[0043] The system may set an associated counter for each pending read / write request, and when a subsequent third read / write request that conflicts with the pending first read / write request is executed, the counter associated with the first write request is incremented. Figure 5 , Figure 5 , using multiple write requests as an example to describe priority-based data reading and writing, after write request 530 completes, the system receives a new write request 540. The target area of ​​write request 540 is the same as that of request 530 (logical data units 106 and 108). At this point, write request 510 is still in progress, so the target area of ​​request 520 is still locked and cannot be executed. However, the target area of ​​write request 540 has become available due to the completion of write request 530. Therefore, the system will execute the subsequent write request 540 and increment the counter for request 520. Assume that write request 510 is still in progress and a new write request is received with the target areas being logical data units 106 and 108, or that write request 510 has completed while write request 540 is still in progress. In this case, logical data unit 106 is locked. If the system receives a new write request with the target areas being logical data units 102 and 104, the system will execute it before write request 520. In this case, the counter for write request 520 will be incremented.

[0044] Furthermore, to prevent read / write requests from being unable to execute for a long time due to the target area being locked, when the value of the counter reaches a threshold, the system can increase the priority of the first read / write request, wherein the initial priority of all read / write requests can be set to 0. For example, when the counter of write request 520 reaches a threshold (e.g., 5 times), the priority of write request 520 will be increased by 1.

[0045] Figure 6 FIG. 6 is a flow chart of a priority-based data read and write method 600 according to an embodiment of the present disclosure. In block 602, the system receives a fourth read and write request. For example, Figure 5 As shown, the system receives a new write request 550. In block 604, the system determines whether the fourth read / write request conflicts with the currently executing read / write request. When the system determines that the fourth read / write request conflicts with the currently executing read / write request, the method proceeds to block 606, where the system suspends the fourth read / write request. When the system determines that the fourth read / write request does not conflict with the currently executing read / write request, the method proceeds to block 608, where, for example, Figure 5 The write request 550 shown in does not conflict with the currently executing write request 510.

[0046] In block 608, the system determines whether the fourth read / write request conflicts with the currently pending first read / write request. Figure 5, write request 550 conflicts with the currently pending write request 520. If the system determines that the fourth read / write request does not conflict with the first read / write request, the method proceeds to block 610, where the system executes the fourth read / write request. If the system determines that the fourth read / write request conflicts with the first read / write request, the method proceeds to block 612.

[0047] In block 612, the system determines whether the priority of the fourth read / write request is lower than the priority of the first read / write request. When the system determines that the priority of the fourth read / write request is lower than the priority of the first read / write request, the method proceeds to block 614, where the system suspends the fourth read / write request. When the system determines that the priority of the fourth read / write request is not lower than the priority of the first read / write request, the method proceeds to block 612, where the system executes the fourth read / write request. Specifically, Figure 5 In the example, write request 550 has a priority of 0. As mentioned above, the priority of write request 520 depends on whether its counter has reached a threshold. If the counter of write request 520 has reached the threshold, the priority of write request 520 is 1, and the system suspends write request 550. This allows write request 520 to be executed immediately after write request 510 completes, avoiding excessive waiting times. If the counter of write request 520 has not yet reached the threshold, the threshold for write request 520 is also 0, and the system executes write request 550 and increments the counter for write request 520.

[0048] Based on this approach, the system can effectively avoid situations where certain write requests that are not expected by users are not executed for a long time.

[0049] In addition, the present disclosure further proposes a solution to further improve the concurrency between write requests by adjusting the granularity of write requests. Figure 7-Figure 8 The method for splitting and merging write requests according to an embodiment of the present disclosure is specifically described, wherein Figure 7 FIG. 7 is a flow chart showing a method 700 for writing unaligned data according to an embodiment of the present disclosure; Figure 8 A schematic diagram 800 is shown illustrating unaligned data writing according to an embodiment of the present disclosure.

[0050] In block 702, the system receives a first write request. In block 704, the system divides the first write request into at least one sub-request. Figure 8For write request 820, since its target area is smaller than a single logical data unit, its sub-request 822 is the original write request 820 itself; for write request 840, its target area is larger than a single logical data unit, and it can be split into 3 sub-requests: sub-request 842 smaller than the size of a single logical data unit, sub-request 844 corresponding to logical data unit 104, and sub-request 846 smaller than the size of a single logical data unit; similarly, write request 860 can be split into sub-request 862, sub-request 864, and sub-request 866, and sub-request 882 of write request 880 is itself.

[0051] In some embodiments, write requests can be split based on the offset of the logical data unit. For example, see Figure 8 The offset of logical data unit 202 may be 0KB-8KB, the offset of logical data unit 204 may be 8KB-16KB, the offset of logical data unit 206 may be 16KB-24KB, the offset of logical data unit 208 may be 24KB-32KB, and the offset of logical data unit 210 may be 32KB-40KB. Therefore, for a write request 840 with a target area of ​​4KB-20KB, the system may split the target area of ​​write request 840 into three target areas of 4KB-8KB, 8KB-16KB, and 16KB-20KB based on the offsets of logical data units 202, 204, and 206. These three target areas will correspond to the three sub-requests 842, 844, and 846 of write request 840, respectively.

[0052] In block 706, the system determines whether there is a first sub-request whose target area is smaller than the size of a single logical unit of data. If the system determines that there is a first sub-request, the method proceeds to block 710, where the system determines whether there is a currently pending second write request that can be merged with the first sub-request. Otherwise, the method proceeds to block 708, where the system may execute the write request according to method 300.

[0053] In some embodiments, the system may determine whether there is a second write request that can be merged by the following steps: obtaining the first target area of ​​the first sub-request; obtaining the second target area of ​​the second write request; determining whether the first target area and the second target area are adjacent; if the first target area and the second target area are adjacent, determining whether the merger of the first target area and the second target area falls within a single logical data unit; if the merger falls within a single logical data unit, determining that the first sub-request and the second write request can be merged. For example, see Figure 8For sub-request 842, its target area is 4KB-8KB, while the target area of ​​the currently pending sub-request 822 is 0KB-4KB. The two sub-request target areas are adjacent, and their merged target area is 0KB-8KB, which falls within the logical data unit 202. Therefore, sub-request 822 can be merged with sub-request 842.

[0054] In some embodiments, the system further determines the ratio of the target areas of the two sub-requests that can be merged to a single logical unit to further determine whether to merge the two sub-requests. In some embodiments, the system can compare the ratio with a preset ratio threshold, and merge the two sub-requests when the ratio is greater than the preset threshold. For example, see Figure 8 Assume that subrequest 822 targets a region between 1KB and 4KB, while subrequest 842 targets a region between 4KB and 8KB. These two subrequests' target regions are adjacent, resulting in a combined target region of 1KB to 8KB, which accounts for 7 / 8 of a single logical data unit. If the system's preset threshold is no greater than 7 / 8, the system can merge subrequests 822 and 842. If the system's preset threshold is greater than 7 / 8, the system will not merge subrequests 822 and 842.

[0055] If the system determines that there is no mergeable second write request, the method proceeds to block 712, where the system suspends the first sub-write request. Otherwise, the method proceeds to block 714, where the system merges the first sub-request and the second write request based on the above determination to form a new write request for execution. For example, see Figure 8 , sub-request 822 can be merged with sub-request 842 to form a new write request 848, sub-request 846 can be merged with sub-request 862 to form a new write request 868, and sub-request 866 can be merged with sub-request 882 to form a new write request 884.

[0056] Based on the multiple new write requests formed after splitting and merging, according to the concurrency method described above, the system can concurrently execute write requests 844, 848, 864, 868 and 884. Figure 2 The multiple write requests that need to be executed serially in the prior art can all be executed in parallel, which greatly improves the response speed of the system.

[0057] Figure 9A schematic block diagram of an example device 900 that can be used to implement an embodiment of the present disclosure is shown. As shown, device 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 902 or loaded from a storage unit 908 into a random access memory (RAM) 903. In RAM 903, various programs and data required for device 800 and / or device 900 operation can also be stored. CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to bus 904.

[0058] Various components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0059] The various processes and processing described above, such as method 300 and / or method 700, may be performed by the processing unit 901. For example, in some embodiments, method 300 and / or method 700 may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed onto the device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by CPU 901, one or more actions of method 300 and / or method 700 described above may be performed.

[0060] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0061] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0062] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0063] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0064] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0065] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0066] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0067] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the prescribed function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0068] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for managing write requests, comprising: In response to receiving a first write request for a file system, splitting the first write request into a first group of sub-requests; In response to receiving a second write request for the file system, splitting the second write request into a second group of sub-requests; as well as In response to detecting that a first sub-request in the first group of sub-requests and a second sub-request in the second group of sub-requests are consecutive in a storage area of ​​the file system, merging the first sub-request and the second sub-request for writing, wherein the first write request and the second write request point to corresponding ranges of the storage area of ​​the file system, the storage area includes logical data units with a uniform size, and Wherein splitting the first write request into the first group of sub-requests is performed at: (i) a first boundary between a first logical data unit and a second logical data unit, and (ii) a second boundary between the second logical data unit and a third logical data unit. 2 . The method according to claim 1 , wherein merging the first sub-request and the second sub-request forms an area in the storage area that does not cross any boundary between adjacent logical data units.

3. The method according to claim 1, further comprising: In response to receiving a third write request occupying the entire logical data unit, executing the third write request without splitting the third write request or merging the third write request with any other write requests or sub-requests. 4 . The method of claim 1 , wherein splitting the first write request into the first set of sub-requests is performed in response to the first write request specifying data extending across a boundary between adjacent logical data units.

5. The method of claim 4 , wherein merging the first sub-request and the second sub-request comprises: The first sub-request and the second sub-request are combined in a region that does not cross any boundary between adjacent logical data units. 6 . The method of claim 1 , wherein the first logical data unit, the second logical data unit, and the third logical data unit each include a corresponding data region specified by the first write request.

7. The method according to claim 6, further comprising: In response to receiving a third write request for the file system, splitting the third write request into a third group of sub-requests; as well as In response to detecting that a third sub-request in the third group of sub-requests and a fourth sub-request in the first group of sub-requests are consecutive in the storage area, the third sub-request and the fourth sub-request are merged for writing.

8. A computerized system comprising control circuitry comprising a set of processing units coupled to a memory, the control circuitry being constructed and arranged to: In response to receiving a first write request for a file system, splitting the first write request into a first group of sub-requests; In response to receiving a second write request for the file system, splitting the second write request into a second group of sub-requests; as well as In response to detecting that a first sub-request in the first group of sub-requests and a second sub-request in the second group of sub-requests are consecutive in a storage area of ​​the file system, merging the first sub-request and the second sub-request for writing, wherein the first write request and the second write request point to corresponding ranges of the storage area of ​​the file system, the storage area includes logical data units with a uniform size, and Wherein splitting the first write request into the first group of sub-requests is performed at: (i) a first boundary between a first logical data unit and a second logical data unit, and (ii) a second boundary between the second logical data unit and a third logical data unit.

9. The computerized system of claim 8, the control circuitry further constructed and arranged to merge the first sub-request and the second sub-request to form a region of the storage region that does not cross any boundary between adjacent logical data units.

10. The computerized system of claim 8, wherein the control circuit is further constructed and arranged to: In response to receiving a third write request occupying the entire logical data unit, executing the third write request without splitting the third write request or merging the third write request with any other write requests or sub-requests.

11. The computerized system of claim 8, wherein the control circuit is further constructed and arranged to: Splitting the first write request into the first set of sub-requests is performed in response to the first write request specifying data extending across a boundary between adjacent logical data units.

12. A computer program product comprising a set of non-transitory computer-readable media having instructions that, when executed by control circuitry of a computerized system, cause the control circuitry to perform a method of managing write requests, the method comprising: In response to receiving a first write request for a file system, splitting the first write request into a first group of sub-requests; In response to receiving a second write request for the file system, splitting the second write request into a second group of sub-requests; as well as In response to detecting that a first sub-request in the first group of sub-requests and a second sub-request in the second group of sub-requests are consecutive in a storage area of ​​the file system, merging the first sub-request and the second sub-request for writing, wherein the first write request and the second write request point to corresponding ranges of the storage area of ​​the file system, the storage area includes logical data units with a uniform size, and Wherein splitting the first write request into the first group of sub-requests is performed at: (i) a first boundary between a first logical data unit and a second logical data unit, and (ii) a second boundary between the second logical data unit and a third logical data unit.

13. The computer program product of claim 12, wherein merging the first sub-request and the second sub-request forms a region in the storage region that does not cross any boundary between adjacent logical data units.

14. The computer program product of claim 12, wherein the method further comprises: In response to receiving a third write request, the third write request occupying the entire logical data unit of the logical data unit, executing the third write request without splitting the third write request or merging the third write request with any other write requests or sub-requests.

15. The computer program product of claim 12, wherein splitting the first write request into the first set of sub-requests is performed in response to the first write request specifying data extending across a boundary between adjacent logical data units.

16. The computer program product of claim 12, wherein the first logical data unit, the second logical data unit, and the third logical data unit each include a respective data region specified by the first write request.

17. The computer program product of claim 12, wherein the method further comprises: In response to receiving a third write request for the file system, splitting the third write request into a third group of sub-requests; as well as In response to detecting that a third sub-request in the third group of sub-requests and a fourth sub-request in the first group of sub-requests are consecutive in the storage area, the third sub-request and the fourth sub-request are merged for writing.

Citation Information

Patent Citations

  • Method and apparatus for reading and writing data

    CN108984312A