Method and system for efficiently storing data

By using one-stage mapping and data block segmentation technology on SSD, the problems of low storage efficiency and high cost caused by two-stage mapping are solved, achieving more efficient data storage and performance improvement.

CN111752479BActive Publication Date: 2024-10-18ALIBABA GROUP HOLDING LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202010231546.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-27
Publication Date
2024-10-18
Estimated Expiration
2040-03-27

AI Technical Summary

Technical Problem

When existing computer systems use solid-state drives (SSDs), the metadata overhead caused by two-stage mapping and the mismatch between logical and physical block sizes lead to inefficient storage utilization, increasing system costs and performance bottlenecks.

Method used

A one-stage mapping method is used to divide data packets into partial data blocks and complete data blocks. The collection cache is used to optimize the writing of data blocks and directly map between files and physical blocks to reduce the amount of metadata and improve storage efficiency.

Benefits of technology

Simplify the IO stack, reduce the amount of metadata, improve storage capacity utilization, reduce system costs and performance bottlenecks, and improve SSD storage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111752479B_ABST
    Figure CN111752479B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, system and non-transitory computer-readable medium for effectively storing data. The method includes dividing a data packet into one or more data blocks according to the physical block size of a secondary storage unit, wherein the one or more data blocks include a partial data block and zero or more complete data blocks. Each complete data block of the zero or more complete data blocks is sent to a second storage unit to be written into a selected physical block of the second storage unit; the current partial data block and at least another partial data block are collected in a collection buffer; the current partial data block and a combination of a subset of multiple other partial data blocks are sent to the secondary storage unit to be written into the selected physical block of the secondary storage unit, wherein the combination substantially fills all of a data block of a physical block size.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This disclosure claims priority to U.S. Provisional Patent Application No. 62 / 824,992, filed on March 27, 2019, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure relates generally to data storage and, more particularly, to methods, systems, and non-transitory computer-readable media for efficiently storing data. Background Art

[0004] All modern computers have some form of secondary storage for long-term storage of data. Traditionally, hard disk drives (HDDs) have been used for this purpose. However, computer systems are increasingly using solid-state drives (SSDs) as their secondary storage units. SSDs have many superior properties compared to HDDs, most notably very low latency and very high transfer speeds. However, to take full advantage of the lower latency and higher speeds, metadata that records the various mappings from logical block addresses (LBAs) to physical block addresses (PBAs) may be stored in random access memory (RAM) for fast access. This results in heavy use of the system's dynamic random access memory (DRAM) capacity, which reduces system performance and increases system cost. Summary of the invention

[0005] An embodiment of the present disclosure provides a method for storing data efficiently. The method includes dividing a data packet into one or more data blocks according to the physical block size of a secondary storage unit, wherein the one or more data blocks include a partial data block and zero or more complete data blocks. Each complete data in the zero or more complete data blocks is sent to the secondary storage unit to be written into a selected physical block of the secondary storage unit; a current partial data block and at least another partial data block are collected in a collection buffer; a combination of the current partial data block and a subset of multiple other partial data blocks is sent to the secondary storage unit to be written into a selected physical block of the secondary storage unit, wherein the combination substantially fills all of a data block of a physical block size.

[0006] Other purposes and advantages of the disclosed embodiments will be partially set forth in the following description, and in part will become apparent from the description, or may be learned through the implementation of the embodiments. The purposes and advantages of the disclosed embodiments may be realized and obtained through the elements and combinations set forth in the claims.

[0007] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Embodiments and various aspects of the present disclosure are illustrated in the following detailed description and accompanying drawings.The various features illustrated in the drawings are not drawn to scale.

[0009] Figure 1 A schematic diagram showing a two-stage mapping performed on a file by a traditional file system and a secondary storage unit is shown.

[0010] Figure 2 The logical mapping of files to logical blocks and the physical mapping of logical blocks to physical blocks are shown and compared.

[0011] Figure 3 A schematic diagram showing two-stage mapping performed on files by a traditional file system and a secondary storage unit when the secondary storage unit is an SSD.

[0012] Figure 4 It shows how two-phase mapping is less efficient in terms of storage utilization due to the additional metadata overhead caused by two-phase mapping.

[0013] Figure 5 is a schematic diagram of a simplified internal structure of an SSD according to some embodiments of the present disclosure.

[0014] Figure 6 is a schematic diagram of an internal NAND flash memory structure that can replace an SSD according to some embodiments of the present disclosure.

[0015] Figure 7 A schematic diagram illustrating an exemplary single-stage mapping of a file to a secondary storage unit (illustrated here as an SSD) according to some embodiments of the present disclosure.

[0016] Figure 8 It shows how the one-level mapping according to some embodiments of the present disclosure is more efficient in terms of storage utilization.

[0017] Fig. 9 is a schematic diagram illustrating an efficient metadata scheme utilizing a header and a footer according to some embodiments of the present disclosure.

[0018] Fig.10 is a flow chart illustrating processing abnormal events according to some embodiments of the present disclosure. Specific embodiments

[0019] Reference will now be made in detail to exemplary embodiments, examples of which are shown in the accompanying drawings. The following description refers to the accompanying drawings, wherein, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments set forth in the following description of exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with the aspects related to the present invention described in the appended claims. Specific aspects of the present disclosure are described in more detail below. In the event of a conflict with terms and / or definitions incorporated by reference, the terms and definitions provided herein shall prevail.

[0020] Modern computers are based on the von Neumann architecture. So, broadly speaking, the main components of a modern computer can be conceptualized as two components: a component for processing data, called a processing unit, and a component for storing data, called a main memory unit. The processing unit (e.g., CPU) fetches the instructions to be executed and the data to be used from the main memory unit (e.g., RAM), performs the requested calculations, and writes the data back to the main memory unit. So, in some cases, after each instruction cycle, data needs to be fetched from the main memory unit and written to the main memory unit. This means that the speed at which the processing unit can read and write the main memory unit is important for system performance. If the speed is insufficient, moving data back and forth will become a bottleneck for system performance. This bottleneck is called the von Neumann bottleneck.

[0021] Therefore, high speed and low latency are considerations for selecting the appropriate technology to be used in the main storage unit. Modern systems generally use DRAM. DRAM can transfer data at a speed of tens of GB / s with a latency of only a few nanoseconds. However, there may be a balance in maximizing speed and response time. DRAM has three disadvantages. In terms of absolute and relative measures, DRAM has a relatively low density in terms of the amount of data stored. Compared with other storage technologies, DRAM has a much lower data per unit size ratio and takes up a lot of space to meet current data storage needs. In terms of price per GB, DRAM is also much more expensive than other storage media. Finally, and most importantly, DRAM is volatile, which means that it does not retain data if power is removed. In summary, these three factors make DRAM unsuitable for long-term storage of data. Most other technologies that have the speed and latency required for main storage devices also have the same limitations as DRAM.

[0022] Therefore, modern computers have secondary storage units in addition to processing units and primary storage units. The difference between primary and secondary storage is that the processing unit can directly access data in the primary storage unit, but not in the secondary storage unit. Instead, in order to access data in the secondary storage unit, the data from the secondary storage unit is first transferred to the primary storage unit. This forms a storage hierarchy in which data is moved from the secondary storage unit (non-volatile, large capacity, high latency, low bandwidth) to the primary storage unit (volatile, small capacity, low latency, high bandwidth) to make the data processable. The data is then transferred from the primary storage unit to the processor, which may require several transfers before the data is finally transferred back to the secondary storage unit. Therefore, like the connection between the processing unit and the primary storage unit, the speed and response time of the connection between the primary storage unit and the secondary storage unit also contribute to system performance. If its speed and responsiveness are insufficient, moving data back and forth between the primary storage unit and the secondary storage unit can also become a bottleneck for system performance.

[0023] Traditionally, the secondary storage unit in computer systems has been the HDD. An HDD is an electromechanical device that stores data by manipulating the magnetic field of a small portion of a rapidly spinning disk composed of ferromagnetic material. But HDDs have several limitations that make them less popular in modern systems. In particular, the transfer speeds of HDDs have largely stagnated. The transfer speeds of HDDs are largely dependent on the speed of the spinning disk, which begins to face physical limitations above a certain number of revolutions per second (e.g., spinning disks face mechanical failure and fragmentation). The speeds of HDDs have largely reached the limits of the angular velocity that spinning disks can currently withstand and have essentially plateaued. However, CPUs do not have similar limitations. As the amount of data being accessed continues to increase, HDD speeds have increasingly become a bottleneck to system performance. This has led to the search for, and ultimately the introduction of, new memory storage technologies.

[0024] The storage technology ultimately chosen was flash memory. Flash memory consists of circuits, primarily logic gates made up of transistors. Because flash stores data via circuits, it is a solid-state storage technology, a storage technology that has no (mechanically) moving components. Solid-state based devices have advantages over electromechanical devices such as HDDs because solid-state devices do not face the physical limitations or increased chance of failure that typically results from the use of mechanical movement. Flash memory is faster, more reliable, and more resistant to physical shock. As the cost per gigabyte (GB) has fallen, flash memory has become increasingly popular and has become the underlying technology for flash drives, SD cards, non-volatile storage units in smartphones and tablets, and more. Over the past decade, flash memory has become increasingly prominent in PCs and servers in the form of SSDs.

[0025] SSDs are commonly used secondary storage units based on flash memory technology. Technically speaking, an SSD refers to any secondary storage unit that does not involve mechanical moving components and is manufactured using almost all flash memory technology. Therefore, SSDs do not face the mechanical limitations encountered by HDDs. Compared to HDDs, SSDs have many of the same advantages as flash memory, such as significantly higher speeds and lower latency. However, SSDs are not without disadvantages. One of the disadvantages of SSDs is their relatively low storage density and relatively high cost per gigabyte. In addition, the way data is processed and stored on many computer systems may involve extensive use of main memory (such as RAM) to fully utilize the advantages of SSDs. These two limitations make managing how data is stored on SSDs critical to both system performance and system cost.

[0026] As just suggested, modern computer systems do not simply store data onto secondary storage units. Rather, there is a complex hierarchy between how data is presented (logical representation) and how the data is physically stored (physical representation). While the exact details vary between computer systems, from a simplified perspective, there are two different mappings between the logical representation of data and its corresponding physical representation. Thus, there are three different layers: the logical representation of the data, the intermediate operating system (OS) representation, and the final physical representation.

[0027] Specifically, modern computer systems can be thought of as three main components: the physical components that make up the system (e.g., hardware), the programs that run on the system (e.g., applications), and specialized programs that manage the hardware and act as an intermediary for applications (e.g., OS). The benefit of an operating system (OS) is that it frees applications from having to know about each other or the details of the hardware on which the applications are running. Instead, the OS abstracts these details, simplifying the creation and complexity of applications. For example, one specific way that the OS acts as an intermediary between hardware and applications is by providing a file system.

[0028] The main function of a file system is to relieve applications from having to manage low-level structural details that are necessary to properly track data stored on a secondary storage unit. Instead, a file system enables applications to work with logical data groupings called files. In this way, the representation of data as files is a logical representation of data, where files are considered the basic unit of data. However, since files are not actually stored on a secondary storage unit, the logical representation of files is essentially an illusion. Instead, the file system converts each file into one or more data blocks of a generally fixed size, which are called logical blocks. This is an intermediate representation of the data. The mapping between files and logical blocks is broken down and maintained in the metadata of the file (stored). For the OS or the file system subcomponent of the OS, a logical block is the basic unit of data that acts on data and is stored on a secondary storage unit. Whenever an application requests to read data from or write data to a file, the file system uses the metadata associated with the file to map the read / write operation to the appropriate logical block. The file system then sends the data to the secondary storage unit and performs the reverse mapping (data block to file) on any data received in response, if necessary.

[0029] While using logical mappings to abstract files and the underlying mechanisms for how to access and manipulate data provides several advantages, such as allowing files to be of arbitrary size, the logical mapping performed by the file system also has disadvantages. The main disadvantage is the need to maintain metadata that records the mapping between files and their corresponding logical blocks. Non-essential metadata is stored with the actual data, thereby reducing the storage capacity of the secondary storage unit available to the application. In addition, for each input / output (IO) operation performed by the application, (e.g., reading data from the secondary storage unit or writing data to the secondary storage unit) a corresponding mapping operation is performed. This increases the latency of IO operations and actually requires that the metadata be stored in the primary storage unit (e.g., RAM) to minimize latency. This will inevitably reduce the RAM available to the application, thereby reducing system performance. Therefore, it is important to manage the details of the mapping performed by the file system to reduce these trade-offs.

[0030] However, there is typically a second mapping on many secondary storage units, especially SSDs. What happens on these secondary storage units is that once the unit receives a logical block, the unit performs a second internal mapping. Specifically, the storage controller or a subcomponent of the secondary storage unit (called the flash translation layer on SSDs) performs the same functions as described above for the file system. That is, the storage controller converts the input logical block into a block of data called a physical block, which is then stored on the actual physical hardware of the secondary storage unit. This is a physical representation of data, where a physical block is considered the basic unit of data. The secondary storage unit maintains metadata that records the mapping between logical blocks and their corresponding physical blocks, which is also stored on the physical hardware. Whenever the file system or OS requests a read or write of a data block, the secondary storage unit uses the metadata associated with the logical block to map the read / write operation to the appropriate physical block.

[0031] Figure 1 is a schematic diagram showing a basic overview of the mapping typically performed on a file. Figure 1 , file 101 is mapped to a logical representation 103 by a file system 102. Typically, the logical representation 103 of file 101 consists of two groups: a group of logical blocks containing file data 106 of file 101 and a group of logical blocks containing metadata 104, which records how a group of logical blocks 106 are mapped to file 101. As shown here, logical block 105 contains file metadata 104 for file 101, and logical blocks 107, 108, 109, and 110 contain file data 106 for file 101. Typically, file metadata 104 includes the logical block address (LBA) of each logical block storing file data 106, and may include an offset value in each logical block. Note that, typically, file metadata 104 and file data 106 may include one or more logical blocks, or even use the same logical blocks.

[0032] The file system 102 may write each logical block to a secondary storage unit 111, where a second mapping is performed by a flash translation layer 112 of the secondary storage unit. As shown in the logical block 105, the flash translation layer 112 maps the logical block 105 to a physical representation 113. Typically, the physical representation 113 consists of two groups: a group of physical blocks 116 containing the contents of the logical block 105 and a group of physical blocks 114 containing metadata, which records how the group of physical blocks 116 is mapped to the logical block 105. As shown here, the physical block 115 contains the logical block metadata 114 of the logical block 105, and the physical blocks 117, 118, 119, and 120 contain the data 116 of the logical block 105. Typically, the logical block metadata 114 includes the physical block address (PBA) of each logical block in the logical block group 116, and may include an offset value in each logical block. Note that typically, the logical block metadata 114 and the logical block data 116 may include one or more physical blocks, or even use the same physical blocks.

[0033] Figure 2 The similarities between the two-stage mapping of traditional computer systems are shown. Figure 2 It shows how file 201 is mapped to logical blocks (shown as 203, 204, 205 and 206) via logical file system 202, and similarly, how logical block 207 is mapped to physical blocks (shown as 209, 210, 211 and 212) via storage controller 208 of a secondary storage unit. Figure 2 It also shows how the mapping of the file 201 to the logical blocks and the mapping of the logical blocks 207 to the physical blocks are decomposed into data 220 and metadata 219 recording the mapping.

[0034] Figure 3 is a schematic diagram showing a basic overview of the two-stage mapping performed on a file when the secondary storage unit is an SSD. Figure 3 As shown, file 301 is mapped to logical representation 303 via file system 302. The logical representation is usually composed of multiple logical blocks. Here, logical representation 303 is composed of logical blocks 305, 307, 308, 309 and 310. The logical blocks are divided into two groups: group 306 containing file 301 data and group 304 containing metadata, which records how to map the logical blocks of group 306 to file 301. Figure 3 It also shows how each logical block 305, 307, 308, 309 and 310 is mapped to a physical page of a physical block of SSD 311. Taking logical block 305 as an example, Figure 3 It shows how logical block 305 is mapped to physical page 320 , which is part of physical block 317 .

[0035] Typically, the reason a secondary storage unit performs this second, internal mapping is to relieve the OS from having to understand the peculiarities and details of the internal structure and characteristics of the secondary storage unit. Regardless of the underlying technology or the features of the implementation, almost every secondary storage unit is designed to present a basic set of primitive operations (e.g., read (READ) or write (WRITE)). The OS can then use the secondary storage unit using the provided general purpose IO operations. The storage controller then handles the details of translating between the general purpose IO operations and the specific details of the internal physical hardware of the secondary storage unit, including the details of the underlying storage technology and any manufacturer-specific peculiarities.

[0036] However, it is inefficient to have two mappings, one mapped by the file system and the other mapped by the storage controller of the secondary storage unit. The two-stage mapping requires that each IO operation (such as READ or WRITE) to the secondary storage unit be mapped twice, once by the file system and another time by the storage controller, which increases the latency of the IO operation. The two-stage mapping also takes up resources of the host system and the connected secondary storage unit. The host uses RAM space to maintain metadata in the main storage and spends processing unit time to handle the necessary calculations. Similarly, the storage controller also maintains metadata for its mappings in some fast memory cache (usually DRAM) and uses its internal processing unit to handle the mapping. Adding DRAM and other components required for mapping increases the price of the secondary storage unit and reduces its speed and capacity to respond to IO requests.

[0037] Therefore, avoiding two-stage mapping helps avoid inefficiencies. Since it would be difficult for the OS and file system to outsource to the secondary storage unit, the mapping functions performed by the secondary storage unit (through its storage controller) should be merged into the functions of the file system. However, merging the mapping functions performed by the secondary storage unit into the file system is not an easy task because it then requires the file system / OS to manage the low-level details of the secondary storage unit (on which the OS stores data). Integrating the mapping performed by the secondary storage unit into the functions of the file system is a particularly complex task for SSDs, which have several features and functions that need to be managed to maintain the functionality of the SSD. Some of these important functions are wear leveling, block remapping, garbage collection, and efficient management of data allocation with read / write characteristics.

[0038] Incorporating the mapping that is typically performed by the storage controller of the secondary storage unit into the file system also has other additional advantages. The basic (smallest) storage unit in the secondary storage unit is traditionally called a physical block. Since a physical block is the smallest amount of data that can be stored, each READ operation and WRITE operation on the secondary storage unit is a read from some of the multiple physical blocks or a write to some of the multiple physical blocks. However, as described above, in traditional file systems, the basic (smallest) storage unit is a logical block. Therefore, traditional file systems read data from and write data to secondary storage units in the form of multiple logical blocks.

[0039] The size mismatch between logical and physical blocks leads to inefficiencies. Specifically, whenever the size of the logical block is different from the size of the physical block, storage capacity and data transfer speed are wasted. The inefficiencies caused by the size mismatch are particularly noticeable whenever the logical block is significantly smaller than the physical block size. A greater inefficiency caused by the logical block being smaller than the physical block size is caused by the fact that the secondary storage unit typically only reads and writes multiples of its physical block size. Therefore, when writing data, the secondary storage unit must either waste a portion of the physical block, which reduces storage capacity, or store multiple logical blocks on one physical block, which increases complexity. In addition, no matter which strategy is used, IO bandwidth is wasted. In the case where the logical block size is smaller than the physical block size, IO bandwidth is wasted because the secondary storage unit reads the entire physical block and then discards the additional data. When the logical block size is larger than the physical block size, the secondary storage unit must read the logical block again (usually at the end) whenever the logical block size is not an integer multiple of the physical block size, and the read again logical block contains the additional data that may be discarded. Since the data is read anyway, the secondary storage unit discards the additional data instead of using it, thereby wasting bandwidth and capacity.

[0040] Figure 4 The waste of storage capacity caused by having two-stage mapping is shown. Specifically, Figure 4 It is shown how when a file is mapped to logical blocks using a logical map 404, additional data in the form of metadata is required. Figure 4 It is also shown that when the physical mapping 415 is used to map the logical block to the physical block, more metadata is needed to record the physical mapping 415, including metadata for recording the mapping of the first metadata. Taking file 401 as an example, Figure 4It is shown that file 401 is first mapped to logical blocks 408 and 409 by logical mapping 404, metadata (M / D) 405 is shown corresponding to file 401, and logical mapping 404 of file data 401 to logical blocks 408 and 409 is recorded. Metadata 405 is then mapped to logical block 409. Similar steps are taken for files 402 and 403, where file 402 is mapped to logical block 410, and file 403 is mapped to logical blocks 412 and 413. Metadata 406 and 407 are created, recording the two file mappings, where metadata 406 is stored in logical blocks 410 and 411, and metadata 407 is stored in logical blocks 413 and 414.

[0041] After the file is mapped to the logical blocks in the logical map 404, physical mapping 415 may occur when the logical blocks are mapped to physical blocks. For example, Figure 4 It shows that the logical block 408 is mapped to the physical block 423, and metadata 416 corresponding to the logical block 408 is created, and the metadata 416 records the physical mapping 415 of the logical block 408 to the physical block 423, Figure 4 It is also shown that metadata 416 is then mapped to physical block 423. Similar steps are taken for logical blocks 408-414, which are also mapped to physical blocks 423-427. Metadata 417-422 recording these mappings are created and are also mapped to physical blocks 423-427. Figure 4 The possibility of size differences between logical blocks and physical blocks is also shown.

[0042] While the inefficiency of having a difference between logical block size and physical block size is prevalent in all secondary storage units, the inefficiency is particularly problematic for SSDs. The greater inefficiency is due to the fact that the size of the physical blocks in an SSD is typically much larger than the physical blocks (called sectors) of an HDD, and therefore also typically much larger than the logical blocks of the OS / file system. The large size of the physical blocks of an SSD is due to the limitations of the NAND flash memory architecture on which SSDs are based. As a basic overview, an SSD is made using floating gate transistors strung together. The strings are then placed side by side with each other to form a two-dimensional matrix of floating gate transistors, referred to herein as an SSD block. The strings that span the block laterally (thus hitting each string) are called SSD pages, which are the smallest unit that can be read and written on an SSD.

[0043] Figure 5 is a simplified schematic diagram showing the basic layout of an SSD. Specifically, Figure 5It is shown how an SSD is composed of an I / O interface 503, through which the SSD communicates with a host system. A storage controller 504, which includes a processor that controls the functions of the SSD, is connected to the I / O interface 503. The storage controller 504 is connected to a RAM 505, which includes multiple caches, of which caches 506, 507, 508, and 509 are shown here. The storage controller 504 is then connected to physical blocks 510, 515, 520, and 525 as shown. As shown in physical block 510, each physical block has a physical block address (PBA) that uniquely identifies the physical block. As shown in physical block 510, each physical block is composed of physical pages, such as physical block 510 is composed of physical pages 511, 512, 513, and 514. Each page also has its own physical page address (PPA), which is unique within its block. The Physical Block Address, together with the Physical Page Address, uniquely identifies a page - similar to combining a 7-digit phone number with its area code. Figure 5 The planes of blocks are omitted in the figure. In a real SSD, the storage controller is not connected to physical blocks, but to planes, each of which consists of physical blocks.

[0044] Figure 6 is an alternative diagram of the internal NAND flash memory structure of an SSD. As described above, the storage controller of the SSD (e.g., Figure 5 The storage controller 504 of the SSD is connected to one or more NAND flash integrated circuits (ICs), which ultimately store any data received by the SSD. Each NAND IC 602, 605, and 608 typically contains one or more planes. Taking NAND IC 602 as an example, NAND IC 602 is composed of planes 603 and 604. As described above, each plane is then composed of multiple physical blocks. For example, plane 603 is composed of physical blocks 611, 615, and 619. Then, each physical block is also composed of physical pages, and for physical block 611, the physical pages include physical pages 612, 613, and 614.

[0045] The reason that SSD blocks are sometimes considered physical blocks (the basic unit) rather than SSD pages is that to write to a previously written SSD page, the SSD page must first be erased (zeroed). However, it is not possible to erase a single SSD page; instead, the entire SSD block (meaning each SSD page in that block) must be erased. However, even a single SSD page is typically much larger than the logical block size used by the OS / file system. Therefore, whether you consider SSD blocks to be physical blocks or SSD pages to be physical blocks, the large size of both means inefficiency. More problematically, one of the ways that SSDs increase their storage capacity (and density) is by increasing the length of each SSD page (i.e., more strings per physical block) and by increasing the number of bits (number of bits) that can be stored in the transistors that make up one SSD page. Both result in larger SSD page (and SSD block) sizes, further exacerbating the size difference between physical and logical blocks.

[0046] To address these issues, the disclosed embodiments propose a method of mapping directly between files and the physical blocks on which the files are stored. By reducing the number of mappings to only one, the IO stack can be simplified, potentially halving the amount of metadata. This reduces the performance loss of using two-level mappings, reduces the storage capacity and bandwidth loss caused by the size mismatch between logical blocks and physical blocks, reduces the amount of DRAM used to access file mappings, and reduces the price of secondary storage units.

[0047] Figure 7 A schematic overview of the primary mapping performed by some disclosed embodiments is shown. Figure 7 As shown, file 701 is directly mapped to the physical page of SSD 703 by file system 702, and the step of mapping to logical blocks performed by the traditional file system is skipped. Specifically, file 701 is mapped to physical pages 705, 707, 708, 709 and 710. File data 706 of file 701 is stored on physical pages 707, 708, 709 and 710. Metadata recording how file 701 is mapped to physical pages 707, 708, 709 and 710 is stored on physical page 705. The physical pages are divided into two groups: data group 706 containing file 701 data and metadata group 704 containing metadata recording how physical blocks of data group 706 are mapped to file 701. Figure 7 It is also shown how each physical page is part of a physical block, where the physical page has a physical page address (PPA) inside the physical block. The physical block in turn has a physical block address (PBA). The physical page address and the physical block address together uniquely identify the page. Taking physical page 707 as an example, physical page 707 can be identified as physical page 0x00 of physical block 0x99804.

[0048] Figure 8 Shown with Figure 4 Compared with the two-stage mapping shown previously in , the one-stage file mapping has higher data efficiency. Because the one-stage mapping only uses metadata to record the mapping of files to physical blocks, more storage space can be used to store data instead of metadata. Taking file 801 as an example, Figure 8 It shows that the file 801 is mapped to the physical block 808, metadata (M / D) 805 recording the mapping is created, and then the metadata 805 is also mapped to the physical block 808. Figure 4 The higher efficiency of the first-level mapping 804 means that only 3 physical blocks instead of 5 are used to store files 801, 802 and 803.

[0049] To achieve this direct mapping, some embodiments of the present disclosure determine that a data packet is stored by the device. For example, this may involve a user of the device creating a new file, such as by downloading a new video, or a user modifying an already existing file, such as by editing a research paper. The decision may also be prompted without user intervention, such as an application or service on the device automatically executing a function to generate data or the device automatically downloading a system update. After the device decides to store certain specific data packets, the device can select which physical storage unit to store the specific data packets on. In some embodiments, selecting a physical storage unit may involve selecting from a plurality of secondary storage units, which may be an SSD, an HDD, a tape, or some other non-volatile storage medium.

[0050] After the device selects a secondary storage unit to store the data packet, the physical block size of the selected secondary storage unit is determined. This may involve directly analyzing the secondary storage unit, reading model information stored in the storage unit, consulting a local database that lists device types (or other identification information) and their corresponding physical block sizes, or accessing an Internet resource that lists the physical block size, serial number or other identification information of a specific model.

[0051] After determining the physical block size, the device may then segment the data packet into chunks of data. Each data chunk, except possibly one, has the same size as the physical block determined for the secondary storage unit. Therefore, unless the data packet (along with any metadata) is an exact integer multiple of the physical block size, there may be one data chunk that is not completely filled, called a partial data chunk. If the data packet is smaller than the physical block size, then the partial data chunk may be the only data chunk. Otherwise, if the data packet is larger than the physical block size, then in addition to the partial data chunk, there may be one or more filled data chunks, called complete data chunks.

[0052] After the data packets are segmented, each of the complete data blocks (if any) can then be written to the physical blocks of the secondary storage unit. The partial data blocks can be stored in the collection cache. The collection cache can hold the unwritten partial data blocks until the total partial data blocks collected substantially fill up all of the data blocks of one physical block size (for example, more than 90%). After the collected partial data blocks substantially fill up all of the data blocks of one physical block size, the collected partial data blocks are then written to the physical blocks of the secondary storage unit, which can maximize the use of storage capacity, and if the partial data blocks are not written with other partial data blocks, the amount of wasted space will be greatly reduced due to writing multiple partial data blocks to the physical block.

[0053] In some embodiments, the device may be any of a variety of types of electronic systems. For example, the device may be a server, a storage node in a data center, a desktop computer, a laptop computer, a tablet computer, a smartphone, a wearable device (such as a smart watch), an embedded device, an orbiting satellite, or any other von Neumann architecture computer with a secondary storage unit.

[0054] In some embodiments, the device may have only a single accessible secondary storage unit. In some other embodiments, the device may have multiple accessible secondary storage units. In either case, for some embodiments, the accessible secondary storage unit may be physically connected to the device, such as by USB, Thunderbolt, InfiniBand, Fibre Channel, SAS or SATA connection. In some embodiments, the accessible secondary storage unit may not be physically connected to the device, but is networked, which means that the secondary storage unit can be accessed through the network connection of the device. For example, SAN, NAS, cloud storage and using other devices as remote targets. Some embodiments may have two types of accessible secondary storage units, that is, some secondary storage units can be physically attached and some secondary storage units can be networked.

[0055] In some embodiments, the device may store data packets across multiple connected secondary storage units. An example of storing a data packet across multiple secondary storage units may be that the data packet is stored on a logical drive across multiple secondary storage units. In some embodiments, the storage of data packets across multiple secondary storage units may be achieved by first dividing the data packet between the secondary storage units to which the data packet is to be written, for then continuing to divide each divided portion of the data packet for each secondary storage unit (as appropriate). In some embodiments, when selecting which secondary storage units to select and how many secondary storage units to select, the device may make decisions based on various criteria, such as current or historical IO utilization of the secondary storage units, performance characteristics of the secondary storage units such as read (READ) or write (WRITE) speed, or capacity utilization of the secondary storage units. The criteria may also take into account the characteristics of the stored data, such as whether the data is frequently accessed or infrequently accessed. The basic principle is that for performance reasons, data that is accessed more frequently should be stored on faster, more powerful, and better secondary storage units, and vice versa.

[0056] In some embodiments, the selected groups of secondary storage units may have different physical block sizes, which may cause the data packets to be segmented differently depending on the secondary storage units to which the data packets are to be written. For example, if some of the secondary storage units are SSDs and some are HDDs, the selected groups of secondary storage units may have different physical block sizes. SSDs typically have larger physical blocks than HDDs, so if the data packet is stored in one of the SSD secondary storage units, the data blocks into which the data packet is segmented will be larger, while if the data packet is stored on one of the HDD secondary storage units, the data blocks into which the data packet is segmented will be smaller. Additionally, for some embodiments in which data packets are written across multiple secondary storage units, the various sub-portions of the data packet may be similarly segmented into data blocks of different sizes depending on the secondary storage unit to which each sub-portion is written.

[0057] In addition, in embodiments where data packets are divided across multiple secondary storage units, some embodiments may divide the data equally. Alternatively, some embodiments may divide the data unequally across the secondary storage units based on various criteria. The criteria used may be based on the characteristics of the selected secondary storage unit, such as the current or historical IO utilization of the secondary storage unit, the performance characteristics of the secondary storage unit such as READ or WRITE speed, or the capacity utilization of the secondary storage unit. The criteria may also take into account the characteristics of the stored data, such as whether the data is frequently accessed or infrequently accessed. The overall goal is to divide the data blocks between the secondary storage units in a manner that maximizes the performance of the device. The resources of the secondary storage unit (in terms of capacity and performance) and the efficiency obtained by controlling which secondary storage unit the data packet is stored in are maximized (for example, frequently read data is performed on the secondary storage unit with the best random read performance, frequently written data is performed on the secondary storage unit with a fast write speed, and rarely accessed data can be stored on the slower secondary storage unit) to seek maximized performance.

[0058] In some embodiments, complete data blocks or certain subsets of them may not be written immediately after being partitioned. Instead, the complete data blocks may be retained in a main storage unit (e.g., RAM), stored in a cache (e.g., a storage accelerator unit), or stored in a cache (e.g., a DRAM module in a secondary storage unit). One of the advantages of not writing the complete data blocks immediately is that it allows the device to delay writing the data in order to process other IO requests, such as READ requests from system applications. Allowing the device to delay writing complete data blocks to prioritize other IO requests increases the response time of the device and improves resource utilization because the WRITE operation can be postponed to a time when system resource utilization is low. Allowing this prioritization also allows the system to avoid writing data that may be re-edited soon, further improving system efficiency.

[0059] In some embodiments, the process of segmenting a data packet into data blocks may continue for a period of time, rather than occurring simultaneously. In other words, some (complete) data blocks may have been segmented out of a data packet while the device is still segmenting other parts of the data packet. When some complete data blocks have been segmented out of a data packet and other parts are still to be segmented, in some embodiments, writing of the complete data blocks that have been segmented can be started without waiting for the entire segmentation process to be completed. Complete data blocks can also be temporarily stored instead of being written immediately, rather than being written immediately. Being able to start writing immediately will further improve efficiency, because storing complete data blocks as they are segmented out of the data packet allows the available IO bandwidth to be used immediately and allows further WRITE operations to be carried out in a timely manner. Being able to store complete data blocks as they become available is particularly useful for larger data packets (such as large files), because for a fixed physical block size, the segmentation operation will take correspondingly longer.

[0060] In some embodiments, not all partial data blocks stored in the collection cache can be used to substantially fill the entirety of a data block of the size of a physical block. Therefore, in some embodiments, only certain partial data blocks may be used to substantially fill the entirety of a data block of the size of a physical block. What constitutes "substantially all" may vary from application to application, but is typically about 90%. Since the partial data blocks accommodated by the data cache exceed the capacity of a complete data block, only a subset of the partial data blocks can be used. For example, if the data cache currently holds three partial data blocks, which are 0.7, 0.8, and 0.15 of a complete data block, respectively, all of the three data blocks cannot be written to a single physical block. Since the size of the partial data blocks (in terms of the complete data block) may be in an arbitrary range (complete data block size 0.0, complete data block size 0.9), it may occur that more partial data blocks can be accommodated in a single physical block. Therefore, the data block may need to wait until the combination of enough small data blocks adds up to substantially fill the entire data block without exceeding the size of the complete data block before being stored.

[0061] Thus, a partial data block in a queue may wait until it can be paired with one or more data blocks whose combined size is ≥ 0.9 times the full data block size, but ≤ 1.0 times the full data block size. In some embodiments, the stored data blocks may be viewed as a queue, with those data blocks that have been stored the longest being given priority when combining data blocks to achieve the size criteria described above. In practice, the larger the size of the stored partial data blocks (in terms of full data blocks), the fewer other stored partial data blocks that can be combined with the first stored partial data block without exceeding the size of a full data block. Thus, larger stored partial data blocks may wait longer on average than smaller stored partial data blocks.

[0062] In order to track which partial data block belongs to which file when multiple partial data blocks are written to the same physical block (or the same physical page when referring to a solid state drive), metadata that records the length and offset can be retained in the physical block of the partial data block of a specific file in some embodiments. In addition, some embodiments can use a header and tail scheme to separate and track partial data blocks in a specific physical block (or physical page of an SSD). Using the header and tail scheme, each partial data block written to a physical block begins with a header and ends with a footer. In addition to error correction coding, the header and tail use a unique pattern for each partial data block (in a given block) to ensure that the header and tail and the partial data blocks to which they correspond can be identified. The header of each partial data block contains an index of the partial data block stored in the physical block. In the metadata used to map from a data packet to the appropriate physical block, the physical block address (or physical page address of an SSD) and the index of the data packet—for example, whether the packet is the first, second, third, or nth file stored in the physical block in sequence—are all recorded.

[0063] In the embodiment just described using the header and tail scheme, reading a partial data block corresponding to a data packet can be implemented as follows. First, the system looks up the metadata of the data packet to determine the physical block address of the partial data block and the index of the partial data block in the physical block. To find the entry for the partial data block in the metadata, its hash value can be used as the entry. The hash is strong enough to allow for extremely low probability of collisions, thereby achieving low-latency address mapping. The system can read the entire contents of the physical block, use the index and the header and tail to find the requested partial data block, and then delete the rest of the page read by the system.

[0064] Fig. 9 is a schematic diagram showing the head and tail scheme just described. Fig. 9As shown. Partial data chunks (PDC) 902, 903, 904 and 905 are collected in a collection cache 901. When the combined size of some subsets of the collected partial data chunks (considering the size of metadata, such as their headers and tails) substantially fills the physical block size 914 of a secondary storage unit (SSU) 906, the subsets of the partial data chunks are written to the physical block. Here, partial data chunks 902, 903 and 904 and their corresponding metadata (e.g., headers and tails) are selected to substantially fill the entirety of a physical block. Partial data chunks 902, 903 and 904 are then written to a physical block 907. When the partial data chunks are written to the physical block, the header is first written, then the corresponding partial data chunk is written immediately thereafter, and then the tail is written after the partial data chunk. Using the first partial data chunk to be written, partial data chunk 902 is taken as an example, a header 908 unique to partial data chunk 902 is first written, and then partial data chunk 902 is written immediately after the header 908. Then, a tail 909 unique to the partial data block 902 is written after the partial data block 902 .

[0065] Some embodiments may employ various, possibly complex, strategies for determining which partial data blocks should be combined and stored. Some embodiments may employ a strategy of not using combined stored partial data blocks, even if the combination of those partial data blocks would substantially fill all of a complete data block. The reason for doing so may be that it is more efficient to "reserve" one of the data blocks for later use (e.g., not using a very small partial data block, which may be combined with a very large partial data block, which is difficult to find a matching pair for).

[0066] In some embodiments, there may be an abnormal event when a partial data block in the collection cache is written to a physical block, even if the partial data block does not substantially fill the entirety of a data block. An example of such an abnormal event is a power outage, because the cache is almost certainly volatile, so if the cache loses power, any data will be lost. The contents of the data cache will therefore be protected by the normal power-off protection of the secondary storage unit, and in the event of a power outage in the secondary storage unit, the data in the cache can be written to the physical block using the remaining power, and any unused space will be written with random data. Another example of writing data in advance is if there is a timer that shows how long the data can be kept in the cache, and the timer times out. Another example is a request to write data as early as possible in response to an OS command to refresh the cache.

[0067] Fig.10 is a flowchart of an exemplary method for how a host system performs a primary mapping consistent with some embodiments of the present disclosure. In particular, Fig.10 It is shown how a data packet such as a file is divided into a plurality of data blocks and how these data blocks are written to physical blocks in normal operation and in the case of an abnormal event. A data packet can be divided into complete data blocks, which are the size of the physical block size of the secondary storage unit to be written and can be written immediately. The remainder of the partial data block that is smaller than the physical block size (referred to as the remaining data block) can be stored in the collection cache with other partial data blocks. After the remaining data block and some subset of other remaining data blocks fill substantially all of a physical block, the remaining data block and subset of other data blocks can be written to the physical block of the secondary storage unit. Alternatively, the partial data blocks can be written to the physical block in response to an abnormal event.

[0068] like Fig.10 As shown, in step 1002, a data packet is first queued to be written to the secondary storage unit. In step 1003, it is determined whether the data packet is larger than the physical block size of the secondary storage unit. If the data packet is larger than the physical block size, the data packet is divided into one or more complete data blocks in step 1004, and the remaining part is a partial data block (which must be less than or equal to the physical block size). Then, in step 1005, the complete data block is written to a physical block. In step 1006, the partial data block is stored in a cache, and the method proceeds to step 1007. On the other hand, if in step 1003, if the data packet is smaller than the size of the physical block, then in step 1006, the data packet is stored in the cache as a partial data block. Then, the method proceeds to step 1007.

[0069] In step 1007, it is determined whether the partial data block and a subset of other partial data blocks stored in the same cache together fill up substantially all of the size of a physical block. If the partial data block and some subset of other partial data blocks do fill up substantially all of the size of a physical block, then in step 1011, the partial data block is written into a physical block of the secondary storage unit, and the method proceeds to step 1012.

[0070] If the partial data block and some subset of other partial data blocks do not fill up substantially all of the size of a physical block, it is determined in step 1008 whether there is a timeout, and in step 1009 whether there is a power outage. If neither of the determinations in steps 1008 and 1009 is positive, the flowchart repeats step 1002. If one of the determinations in steps 1008 and 1009 is positive, the partial data block and any other partial data blocks are immediately written to the physical block in step 1010, and any unused space is filled with random data, and the method then proceeds to step 1012. Finally, in step 1012, metadata recording the mapping between the data packet and its corresponding data block is updated.

[0071] Some embodiments may employ a timer to limit how long a partial data block can remain in the cache before it is written to a physical block. For example, the length of time a partial data block remains in the cache may be limited by storing each partial data block with metadata that records when the partial data block was stored in the cache. The system may then periodically review the metadata that records when the partial data block was stored to ensure that the partial data block has not exceeded the time limit. Another example is to set a specific value in the metadata, then decrement it periodically, and write the partial data block (if it has not yet been written) if the value reaches zero. Still other embodiments may not be based on elapsed time, but on other metrics, such as the amount of data written or the amount of partial data blocks stored. Limiting the time that a partial data block remains in the cache can ensure that the system does not exhibit uncontrollable behavior and allow partial data blocks to continue to accumulate in the cache, thereby degrading system performance.

[0072] In some embodiments, there may be multiple buffers used to store partial data blocks. In some embodiments, there may be multiple buffers used for each secondary storage unit. Using multiple caches can improve system performance by reducing bottlenecks that may be caused by concurrent processes competing to access the cache. In embodiments that utilize multiple buffers, the system can select which buffer to store a particular partial data block based on a variety of factors. These factors include the current number of partial data blocks stored in each cache, the current size of the total number of partial data blocks in each cache, the average size of the partial data blocks in each cache, the current or historical usage of each cache, and the current or historical wait time of the partial data blocks in each cache.

[0073] Additionally, in some embodiments, the cache may be part of the system, such as a dedicated high-speed cache or a designated portion of the system's main memory (e.g., RAM). In other embodiments, the cache may be part of a secondary storage unit. In embodiments utilizing multiple data caches, the system may use a mix of caches, with some caches being part of the system and some caches being part of (one or more of) the secondary storage unit.

[0074] In some embodiments, a non-transitory computer-readable storage medium including instructions is also provided, and the instructions can be executed by a device (e.g., a host system) to perform the above method. Common forms of non-transitory media include, for example, floppy disks, disks, hard disks, solid-state drives, tapes or any other magnetic data storage media, CD-ROMs, any other optical data storage media, any physical media with hole patterns, RAM, PROM and EPROM, FLASH-EPROM or any other flash memory, NVRAM, cache, registers, any other storage chip or cassette and network versions thereof. The device may include one or more processors (CPU), input / output interfaces, network interfaces and / or memory.

[0075] It should be noted that relational terms such as "first" and "second" herein are used only to distinguish one entity or operation from another entity or operation, and do not require or imply any actual relationship or order between these entities or operations. In addition, the words "comprise", "have", "include" and "includes" and other similar forms are equivalent in meaning and open in an unrestricted manner, because one or more items following any of these words do not represent an exhaustive list of these items, or are limited to the listed items.

[0076] As used herein, unless expressly stated otherwise, the term "or" encompasses all possible combinations unless not feasible. For example, if it is stated that a component may include A or B, then, unless expressly stated otherwise or not feasible, the component may include A, or B, or A and B. As a second example, if it is stated that a component may include A, B, or C, then, unless expressly stated otherwise or not feasible, the component may include A, or B, or C, or A and B, or A and C, or B and C, or A and B and C.

[0077] It should be understood that the above embodiments can be implemented by hardware or software (program code) or a combination of hardware and software. If implemented by software, it can be stored in the above-mentioned computer readable medium. The software can execute the disclosed method when executed by a processor. The host system, operating system, file system and other functional units described in this disclosure can be implemented by hardware or software or a combination of hardware and software. It will also be understood by those of ordinary skill in the art that multiple of the above functional units can be combined into one functional unit, and each of the above functional units can be further divided into multiple functional subunits.

[0078] In the foregoing description, embodiments have been described with reference to many specific details that may vary from implementation to implementation. Certain changes and modifications may be made to the described embodiments. Other embodiments will be apparent to those skilled in the art by considering the description and practice of the invention disclosed herein. It should be understood that the description and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the appended claims. The order of steps shown in the accompanying drawings is for illustrative purposes only and is not intended to be limited to any particular order of steps. Thus, it will be appreciated by those skilled in the art that these steps may be performed in different orders when implementing the same method.

[0079] In the drawings and the specification, exemplary embodiments have been disclosed. However, many variations and modifications may be made to these embodiments. Therefore, although specific terms are employed, they are used only in a general and descriptive sense and not for the purpose of limitation.

Claims

1. A method for storing data in a secondary storage unit, the method include: According to the physical block size of the secondary storage unit, a data packet is divided into one or more data blocks, wherein the one or more data blocks include a portion of a data block and zero or more complete data blocks; the complete data block is a data block that fills up a physical block; sending each of the zero or more complete data blocks to the secondary storage unit to be written into a selected physical block of the secondary storage unit; collecting the current partial data block and at least another partial data block in a collection buffer; and sending a combination of the current partial data block and a subset of a plurality of other partial data blocks to the secondary storage unit to be written to a selected physical block of the secondary storage unit, wherein the combination substantially fills all of a data block of a physical block size; For the data packet, metadata for mapping the data packet to the physical block in which the data block is written is recorded, and the data packet is not mapped to a logical block.

2. The method according to claim 1, further comprising: include: Splitting the data packet into two or more sub-data packets; and Two or more secondary storage units are selected to store the sub-data packets.

3. The method according to claim 1, in, The secondary storage unit is selected based on: the current or historical IO utilization of the secondary storage unit, the current or historical capacity utilization of the secondary storage unit, performance characteristics of the secondary storage unit's read or write speed, or Characteristics of the data packet.

4. The method according to claim 3, in, The metadata includes a physical block address of the physical block and an index of a data block of the data packet in each of the physical blocks, wherein the data block of the data packet is written into the physical block.

5. The method according to claim 4, in: Each data block written begins with a header and ends with a trailer; The header and trailer are unique within their respective data blocks; and The header marks the index of the data block.

6. The method according to claim 1, further comprising: include: In response to an abnormal event, the partial data blocks collected in the collection buffer are sent to the secondary storage unit to be written into the selected physical blocks of the secondary storage unit.

7. The method according to claim 6, in, The abnormal event is one of a power failure, a timer timeout, or a command to refresh the collection buffer.

8. A non-transitory computer readable medium storing a set of instructions executable by at least one processor of a computer system to cause the computer system to perform a method of storing data in a secondary storage unit, the method include: According to the physical block size of the secondary storage unit, a data packet is divided into one or more data blocks, wherein the one or more data blocks include a portion of a data block and zero or more complete data blocks; the complete data block is a data block that fills up a physical block; sending each of the zero or more complete data blocks to the secondary storage unit to be written into a selected physical block of the secondary storage unit; collecting the current partial data block and at least another partial data block in a collection buffer; and sending a combination of the current partial data block and a subset of a plurality of other partial data blocks to the secondary storage unit to be written to a selected physical block of the secondary storage unit, wherein the combination substantially fills all of a data block of a physical block size; The set of instructions is executable by the at least one processor of the computer system to cause the computer system to further perform: Metadata for the data packet that maps the data packet to a physical block in which the data block is written is recorded; the data packet is not mapped to a logical block.

9. The non-transitory computer readable medium of claim 8, in, The secondary storage unit is selected based on: the current or historical IO utilization of the secondary storage unit, the current or historical capacity utilization of the secondary storage unit, performance characteristics of the secondary storage unit's read or write speed, or Characteristics of the data packet.

10. The non-transitory computer readable medium of claim 8, in, The metadata includes a physical block address of the physical block and an index of a data block of the data packet in each of the physical blocks, wherein the data block of the data packet is written into the physical block.

11. The non-transitory computer readable medium of claim 10, in: Each data block written begins with a header and ends with a trailer; The header and trailer are unique within their respective data blocks; and The header marks the index of the data block.

12. The non-transitory computer readable medium of claim 8, wherein the set of instructions is executable by the at least one processor of the computer system to cause the computer system to further perform: In response to an abnormal event, the partial data blocks collected in the collection buffer are sent to the secondary storage unit to be written to a selected physical block of the secondary storage unit.

13. A system for storing data in a secondary storage unit, include: A memory that stores a set of instructions; and one or more processors configured to execute the set of instructions to cause the system to perform: According to the physical block size of the secondary storage unit, a data packet is divided into one or more data blocks, wherein the one or more data blocks include a portion of a data block and zero or more complete data blocks; the complete data block is a data block that fills up a physical block; sending each of the zero or more complete data blocks to the secondary storage unit to be written into a selected physical block of the secondary storage unit; collecting the current partial data block and at least another partial data block in a collection buffer; and sending a combination of the current partial data block and a subset of a plurality of other partial data blocks to the secondary storage unit to be written to a selected physical block of the secondary storage unit, wherein the combination substantially fills all of a data block of a physical block size; The one or more processors are configured to execute the instruction set so that the system further performs: For the data packet, metadata for mapping the data packet to the physical block in which the data block is written is recorded, and the data packet is not mapped to a logical block.

14. The system according to claim 13, in, The secondary storage unit is selected based on: the current or historical IO utilization of the secondary storage unit, the current or historical capacity utilization of the secondary storage unit, performance characteristics of the secondary storage unit's read or write speed, or Characteristics of the data packet.

15. The system according to claim 13, in, The metadata includes a physical block address of the physical block and an index of a data block of the data packet in each of the physical blocks, wherein the data block of the data packet is written into the physical block.

16. The system according to claim 15, in: Each data block written begins with a header and ends with a trailer; The header and trailer are unique within their respective data blocks; and The header marks the index of the data block.

17. The system according to claim 13, in, The one or more processors are configured to execute the instruction set so that the system further performs In response to an abnormal event, the partial data blocks collected in the collection buffer are sent to the secondary storage unit to be written into the selected physical blocks of the secondary storage unit.

18. A system for storing data in a secondary storage unit, include: Host device; and A secondary storage unit, the secondary storage unit is communicatively connected to the host device, wherein: The host device is configured to: According to the physical block size of the secondary storage unit, a data packet is divided into one or more data blocks, wherein the one or more data blocks include a portion of a data block and zero or more complete data blocks, and the complete data block is a data block that fills up a physical block; sending each of the zero or more complete data blocks to the secondary storage unit to be written into a selected physical block of the secondary storage unit; collecting the current partial data block and at least another partial data block in a collection buffer; and sending a combination of the current partial data block and a subset of a plurality of other partial data blocks to a secondary storage unit to be written into a selected physical block of the secondary storage unit, wherein the combination substantially fills the entirety of a data block of a physical block size; recording metadata mapping the data packet to the physical block into which the data block is written, the data packet not being mapped to a logical block; and The secondary storage unit is configured as follows: writing each of the received zero or more complete data blocks into a selected physical block of the secondary storage unit, A combination of the current partial data block and a subset of a plurality of other partial data blocks is written to a selected physical block of the secondary storage unit.

Citation Information

Patent Citations

  • Method for implementing mixed hierarchical array, the hierarchical array and storage system

    CN101458613A

  • Data storage system comprising a mapping bridge for aligning host block size with physical block size of a data storage device

    CN102063267A

  • Non-volatile memory device and programming method

    CN103578551A

  • Method of partitioning physical block and memory system thereof

    CN104077235A

  • Hybrid storage aggregate block tracking

    CN104285214A