Partition configuration method, data storage management method and device
By configuring the storage partitions of the solid-state drive (SSD) according to the category identifier of the files to be stored, the problem that existing technologies cannot meet diverse security requirements is solved. Custom partition configuration and independent storage are realized, improving the data storage efficiency and security of the SSD.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YEESTOR MICROELECTRONICS CO LTD
- Filing Date
- 2022-08-31
- Publication Date
- 2026-04-17
AI Technical Summary
Existing solid-state drives (SSDs) cannot be customized with partition configurations based on different data security requirements, making it difficult to meet diverse security needs. Furthermore, data resource sharing between different partitions affects stability and security.
By obtaining the category identifier of the file to be stored, the corresponding storage partition is determined, and the partition mode is adjusted according to the needs. Storage partitions with different security and performance are configured to ensure that each partition is stored independently and to avoid resource sharing.
It enables customized partition configuration based on data security requirements, improving the flexibility and security of data storage, reducing the impact of low-stability partitions on high-security partitions, and improving storage efficiency and stability.
Smart Images

Figure CN115599293B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of solid-state drives, and in particular to a partition configuration method, a data storage management method, and an apparatus. Background Technology
[0002] Solid-state drives (SSDs) are hard drives made using arrays of solid-state electronic storage chips. They typically consist of a control unit and storage units (such as FLASH chips and DRAM chips). The advantages of SSDs include fast boot and read times, short read times, and strong shock resistance. Their storage space is made of flash memory chips using various media, providing data loss prevention capabilities. They are currently widely used in many fields, including military, automotive, industrial control, video surveillance, network monitoring, network terminals, power, medical, aviation, and navigation equipment.
[0003] Currently, all solid-state drives (SSDs) sold on the market are mass-produced and have a fixed type of flash memory. However, different types of data have different security requirements. For example, some data has high requirements for security and storage stability, while other data has lower requirements. The SSDs mentioned above can only use a fixed type of flash memory to store data, which makes it difficult to meet different security requirements. Summary of the Invention
[0004] Firstly, this application provides a data storage management method.
[0005] A data storage management method, comprising:
[0006] Get the file to be saved;
[0007] Based on the storage category identifier of the file to be stored, the storage partition of the file to be stored is determined, and one storage partition corresponds to one partition mode;
[0008] The file to be stored is stored based on the storage partition.
[0009] Optionally, the step of storing the file to be stored based on the storage partition includes:
[0010] Obtain the remaining capacity based on the storage partition;
[0011] Determine the required capacity corresponding to the file to be stored;
[0012] Based on the comparison between the remaining capacity and the required capacity, and based on the comparison result, an adjustment storage step is performed;
[0013] Adjust the storage, adjust the storage partition, and store the file to be stored.
[0014] Optionally, the storage partition includes a shared area, and the shared areas can exchange data. The physical blocks of the shared areas are intermediate physical blocks.
[0015] The adjustment storage step includes:
[0016] Based on the remaining capacity and the demand capacity, determine the demand difference;
[0017] Based on the partitioning pattern of the storage partition and the demand difference, the intermediate physical blocks are allocated to determine the intermediate partition;
[0018] Add the intermediate partition to the storage partition to update the storage partition;
[0019] The file to be stored is stored based on the storage partition.
[0020] Optionally, the step of storing the file to be stored based on the storage partition includes:
[0021] Based on the file to be stored and the remaining capacity, primary storage data and secondary storage data are determined, wherein the size of the primary storage data corresponds to the remaining capacity;
[0022] Based on the storage partition before adjustment, store the primary storage data;
[0023] The secondary storage data is stored based on the intermediate partition.
[0024] Optional, also includes:
[0025] Obtain the free capacity of each of the aforementioned storage partitions;
[0026] Determine the capacity threshold for each of the aforementioned storage partitions;
[0027] Based on the comparison between each of the free capacities and the corresponding capacity thresholds, each of the storage partitions is adjusted.
[0028] Optionally, the capacity threshold includes a congestion threshold;
[0029] The step of comparing each of the free capacities with the corresponding capacity thresholds, and adjusting each of the storage partitions based on the comparison results, includes:
[0030] Determine whether the free capacity is less than or equal to the corresponding congestion threshold; if so, determine that the storage partition corresponding to the free capacity is a congested partition.
[0031] The idle difference is determined based on the idle capacity and the congestion threshold;
[0032] Based on the partitioning pattern of the congested partition and the free space difference, intermediate physical blocks are allocated to determine supplementary partitions;
[0033] Add the supplementary partition to the storage partition of the partition pattern;
[0034] The congestion threshold includes a reset threshold;
[0035] The step of comparing each of the free capacities with the corresponding capacity thresholds, and adjusting each of the storage partitions based on the comparison results, includes:
[0036] Determine whether the free capacity is greater than or equal to the corresponding reset threshold. If so, determine that the storage partition corresponding to the free capacity is a reset partition.
[0037] The reset difference is determined based on the free capacity and the reset threshold;
[0038] Based on the partitioning pattern of the congested partition and the reset difference, the intermediate physical blocks of the partitioning pattern are allocated to determine the free partitions.
[0039] Remove the free partition from the storage partition of the partition pattern.
[0040] This application provides a data storage management method that, based on the storage category identifier of the file to be stored, determines the file type of the file, obtains the data security or storage stability requirements of the file to be stored, then determines a suitable partitioning mode based on the file type, and stores the file to be stored in the corresponding storage partition. This technical solution can identify the storage stability requirements of the file to be stored, differentiate the stored data, and store data of different importance levels in storage partitions with different security levels, thus meeting diverse security needs.
[0041] By obtaining the free capacity of each storage partition and comparing it with the corresponding capacity threshold, it is possible to determine whether the capacity of each storage partition is too low. For storage partitions with low capacity, timely adjustments and supplementation can be made to reduce the risk that the storage partition cannot provide data storage space in time due to low capacity, thereby improving the efficiency of data storage.
[0042] Secondly, this application provides a partition configuration method.
[0043] A partition configuration method, comprising:
[0044] Obtain the partition configuration information and the configuration capacity corresponding to the partition configuration information;
[0045] Based on the configured capacity and the partition configuration information, physical blocks are allocated to determine each storage partition corresponding to each of the partition configuration information, wherein the partition configuration information includes the type of the storage partition, and the type of the storage partition is associated with the data security of the storage partition.
[0046] Optionally, the storage partition includes a fixed partition and a shared partition. The fixed partitions are independent of each other, while the shared partitions can exchange data.
[0047] This application provides a partition configuration method that allows for the configuration of different storage partitions on a solid-state drive (SSD), including the capacity of each partition, thus enabling custom partition configuration of the SSD. Different storage partitions offer varying levels of data security and performance. Since SSDs are used in different scenarios, their requirements for data security and performance also differ. Therefore, this custom partition configuration method allows the SSD to include multiple storage partitions with different data security and performance levels, providing greater flexibility.
[0048] On the other hand, once each storage partition is configured, the physical resources occupied by each partition are locked, and the partitions are independent of each other, with no data exchange between them. Currently, mainstream partitioning methods operate at the operating system level, logically separating multiple partitions, but sharing data resources. Data garbage and fragmentation across partitions are common and require unified cleanup. In the technical solution of this application, because each storage partition is independent, a single storage partition can only perform garbage collection and recycling within its own space, without affecting the data stability of other storage partitions. This reduces the impact of less stable storage partitions on high-security partitions, resulting in greater security.
[0049] Thirdly, this application provides a data storage management device.
[0050] A data storage management device, comprising:
[0051] The data acquisition module is used to acquire files to be stored.
[0052] The category identification module is used to determine the storage partition of the file to be stored based on the storage category identifier of the file to be stored, wherein one storage partition corresponds to one partition mode;
[0053] A partitioned storage module is used to store the file to be stored based on the storage partition.
[0054] Fourthly, this application provides a partition configuration device.
[0055] A partition configuration device, comprising:
[0056] The partition setting module is used to obtain partition configuration information and the configuration capacity corresponding to the partition configuration information;
[0057] The partition configuration module is used to allocate physical blocks based on the configured capacity and the partition configuration information, and determine each storage partition corresponding to each of the partition configuration information, wherein the partition configuration information includes the type of the storage partition, and the type of the storage partition is associated with the data security of the storage partition. Attached Figure Description
[0058] Figure 1 A flowchart illustrating an embodiment of the partition configuration method of this application is shown.
[0059] Figure 2 A schematic diagram of the partition capacity of a solid-state drive illustrating an embodiment of the partition configuration method of this application is shown.
[0060] Figure 3 A schematic diagram of the partition capacity of a solid-state drive illustrating Embodiment 2 of the partition configuration method of this application is shown.
[0061] Figure 4 A flowchart illustrating the data storage management method of this application is provided.
[0062] Figure 5 Draw a diagram illustrating the storage process of the file to be stored.
[0063] Figure 6 A schematic diagram of the sub-process of step S3 in the data storage management method of this application is shown.
[0064] Figure 7 A schematic diagram of the sub-process of step S35 in the data storage management method of this application is shown.
[0065] Figure 8 A schematic diagram of the sub-process of step S6 in the data storage management method of this application is shown.
[0066] Figure 9 A schematic diagram of the partition configuration device of this application is shown.
[0067] Figure 10 A schematic diagram of the data storage management device of this application is shown.
[0068] In the diagram, 1 is the data acquisition module; 2 is the category recognition module; 3 is the partitioned storage module; 4 is the partition setting module; and 5 is the partition configuration module. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In addition, the reference numerals for each step in this embodiment are only for convenience of explanation and do not represent a limitation on the order of movement of each step. In practical applications, the order of movement of each step can be adjusted or performed simultaneously as needed, and such adjustments or substitutions are all within the scope of protection of this invention.
[0070] The following describes some of the concepts involved in the embodiments of this application.
[0071] 1. Solid State Drive (SSD): Also known as a solid-state drive, it is a hard drive made of solid-state electronic storage chip arrays. An SSD mainly consists of a main controller, storage units, cache (optional), and a host interface (such as SATA, SAS, PCIe, etc.).
[0072] 2. SSD Access: The Host interface accesses the SSD via Logical Block Address (LBA). Each logical address represents a sector (typically 512 bytes in size). The operating system typically accesses the SSD in 4KB units. The basic unit of access to the SSD by the Host interface is called a Host Page. The SSD internally maintains a mapping table. Each time the Host interface writes a User Page, a new mapping relationship is created. This mapping relationship is added to (on the first write) or modified (overwritten) in the mapping table. When reading a User Page, the SSD first looks up the physical page corresponding to that User Page in the mapping table, and then accesses the Flash to read the corresponding Host data.
[0073] 3. Storage Cell Structure: Also known as a physical page (Flash Page), it consists of two or more logical units (also called dies or LUNs). A logical unit is the smallest independent unit within flash memory that can execute commands and report its own status. A logical unit can have one or more planes, and each plane contains multiple physical blocks. A physical block is the smallest unit to be erased, and each physical block consists of hundreds or even thousands of pages. The page is of great significance; it is the smallest unit that can be read and written in flash memory. Currently, a flash memory page is typically 16KB. If 512 bytes of data need to be read, then at the flash memory level, the entire page containing those 512 bytes of data must be read (the actual read operation is 16KB).
[0074] 4. Classification of storage units: These include SLC (Single Level Cell), MLC (Multi-Level Cell), and TLC (Triple Level Cell). Different classifications offer varying levels of data security and performance.
[0075] SLC storage cells store 1 bit of data in each cell. Whether the stored data is 0 or 1 is determined based on a voltage threshold. For writing to NAND Flash, the control gate is controlled to charge, so that the floating gate stores enough charge, exceeding 4V, and the storage cell represents 0 (programmed); if there is no charge or the voltage threshold is lower than 4V, it represents 1 (erased).
[0076] MLC (Multi-Level Cell) memory cells store 2 bits of data in each cell, designated as "10", "11", "10", and "11" based on voltage thresholds. A charge below 3.5V represents "11"; between 3.5V and 4.0V, "10"; between 4V and 5.5V, "11"; and above 5.5V, "10". While MLC uses the same voltage as SLC (Single-Level Cell) memory cells, the voltage thresholds are divided into four parts, directly impacting performance and stability.
[0077] TLC storage cells store 3 bits of data in each cell, resulting in more precise voltage thresholds and consequently lower reliability per cell. In summary, for storing the same amount of data, TLC, MLC, and SLC storage cells require an increasing number of storage cells, with corresponding increases in data stability and security.
[0078] The following is in conjunction with the instruction manual appendix. Figures 1-10 The embodiments of this application will be described in further detail.
[0079] This application provides a partition configuration method.
[0080] Example 1:
[0081] Reference Figure 1 and Figure 2 The main process of the partition configuration method is described below.
[0082] S01. Obtain partition configuration information and the configuration capacity corresponding to the partition configuration information.
[0083] The partition configuration information indicates the attributes of the storage partitions that the solid-state drive (SSD) has after partition configuration, specifically including the number of storage partitions, the type of storage partitions, and whether the storage partitions are encrypted. The configuration capacity indicates the capacity space of the storage partitions.
[0084] The type of storage partition determines its data security and performance. In this embodiment, the types of storage partitions include TLC partitions, MLC partitions, and SLC partitions. When storing the same amount of data, TLC partitions, MLC partitions, and SLC partitions require an increasing number of storage units, and their data stability and security also increase accordingly.
[0085] For example, if all partition configuration information is configured as SLC mass production mode and no encryption is required, and the standard capacity is 128G, then the write command is within the entire logical range of 0~128G, and all data is written to the physical blocks of the SLC partition.
[0086] For example, if the partition configuration information is partly configured for SLC mass production mode and partly for TLC mass production mode, then the size of each storage partition is determined based on the configured capacity. For instance, the SLC partition might be 32GB, consuming a total of 96GB of physical blocks, and the TLC partition might be 96GB, also consuming a total of 96GB of physical blocks. The physical block ranges for both SLC and TLC partitions are then set and recorded in the system partition table. The system partition table also records whether each storage partition is encrypted. When the SSD receives a file to be stored, it writes the entire file to the SLC partition if the file's logical address falls within the logical range of the SLC partition; otherwise, it writes it to other partitions. Similarly, the address range of the command determines whether encryption or decryption is needed.
[0087] If the configuration capacity includes 32GB for SLC configuration mode and 96GB for TLC configuration mode, then the SLC partition size is 32GB and the TLC partition size is 96GB. For example, if the partition configuration information includes both SLC and TLC configuration modes, the solid-state drive will be divided into two storage partitions: an SLC partition and a TLC partition.
[0088] In a preferred embodiment, the partition configuration information further includes physical configuration information, which indicates the number of fixed physical blocks in all physical blocks, the partitioning mode of the fixed physical blocks, and the number of intermediate physical blocks.
[0089] S02. Based on the configuration capacity and partition configuration information, allocate physical blocks and determine each storage partition corresponding to each partition configuration information.
[0090] Each storage partition offers varying levels of data stability, making them suitable for different working environments. Depending on the storage requirements of the files to be stored or the application environment, fixed hard drives with different partition types and sizes can be configured. For example, SLC partitions can store system data or other important data, while TLC partitions can store regular log data.
[0091] For example, in environments with high requirements for system disk data stability, high requirements for personal data privacy, and large temperature differences in the working environment, solid-state drives can be used entirely or mostly as SLC partitions, so that most of the data is stored in highly stable SLC partitions.
[0092] For example, in environments where the stability of system disk data is not critical and the temperature difference in the working environment is small, solid-state drives can be used entirely or mostly as TLC partitions to obtain more storage space and meet a larger number of storage needs.
[0093] The implementation principle of the partition configuration method provided in this application is as follows: partition configuration information can be used to configure different storage partitions in a solid-state drive (SSD), and the capacity of the storage partitions can be configured, thus realizing custom partition configuration of the SSD. Different storage partitions have different data security and performance requirements. Due to the different application scenarios of SSDs, their requirements for data security and performance also differ. Therefore, the custom partition configuration method allows the SSD to include multiple storage partitions with different data security and performance requirements, making it more flexible.
[0094] On the other hand, once each storage partition is configured, the physical resources occupied by each partition are locked, and the partitions are independent of each other, with no data exchange between them. Currently, mainstream partitioning methods operate at the operating system level, logically separating multiple partitions, but sharing data resources. Data garbage and fragmentation across partitions are common and require unified cleanup. In the technical solution of this application, because each storage partition is independent, a single storage partition can only perform garbage collection and recycling within its own space, without affecting the data stability of other storage partitions. This reduces the impact of less stable storage partitions on high-security partitions, resulting in greater security.
[0095] Example 2:
[0096] Reference Figure 3The main difference between this embodiment and the partition configuration method in Embodiment 21 is that the storage partition includes a fixed area and a shared area, and the configured capacity includes a fixed capacity corresponding to the fixed area and a shared capacity corresponding to the shared area. The fixed area and the shared area together constitute the storage partition, and the fixed capacity and the shared capacity together constitute the total capacity of the storage partition. The physical resources of the fixed area are fixed, and garbage collection and recycling of data in the fixed area do not affect any other areas. The shared areas are logically distinguished, and data exchange can be achieved between different shared areas, thereby alleviating the capacity constraints of some overcrowded storage partitions.
[0097] In this implementation, each storage partition can be configured with a fixed area and a shared partition. The fixed capacity of the fixed area and the shared capacity of the shared area are configured through partition configuration information and configuration capacity. For high-security storage partitions, the fixed capacity of the internal fixed area can be set to a higher value, and the shared capacity of the shared area can be set to a lower value, so that most of the data in this storage partition is not affected by other storage partitions. For low-security storage partitions, the fixed capacity of the internal fixed area can be set to a higher value, and the shared capacity of the shared area can be set to a lower value, so that most of the data in this storage partition can alleviate the performance impact on other storage partitions.
[0098] This application provides a data storage management method, the main process of which is described below.
[0099] Reference Figure 4 and Figure 5 S1, Get the file to be saved.
[0100] The files to be stored refer to the files that need to be stored on the solid-state drive.
[0101] S2. Determine the storage partition for the file to be stored based on the storage category identifier of the file to be stored.
[0102] In this context, a storage partition refers to a portion of the storage units within a solid-state drive (SSD), composed of multiple physical blocks. SSDs have various storage partition types, each with different storage stability and data security characteristics. In this embodiment, storage partitions include SLC partitions and TLC partitions. Each storage partition corresponds to a partitioning mode, which indicates the storage capacity of a single storage unit within the partition. Partitioning modes include the SLC mode for SLC partitions and the TLC mode for TLC partitions.
[0103] Different storage partitions will differ in terms of storage stability, data security, and performance. In this embodiment, the stability and performance of the SLC partition are better than those of the TLC partition. However, to store the same amount of data, the SLC partition consumes more physical blocks than the TLC partition. For example, a 32G SLC partition requires 96G of physical blocks, while a 32G TLC partition requires 32G of physical blocks.
[0104] In this embodiment, the device disk for storing files has attribute markers in multiple specific logical address ranges. These attribute-marked logical address ranges are called operational logical address ranges, which include SLC operational logical address ranges, SLC encryption logical address ranges, TLC operational logical address ranges, and TLC encryption logical address ranges. The attribute markers include the SLC storage category corresponding to the SLC operational logical address range, the SLC encryption category corresponding to the SLC encryption logical address range, the TLC storage category corresponding to the TLC operational logical address range, and the TLC encryption category corresponding to the TLC encryption logical address range.
[0105] The storage category identifier refers to the attribute marker of the logical address range corresponding to the file to be stored. Specifically, by parsing the file to be stored, the logical address corresponding to the file can be obtained. Based on the operational logical address range where the logical address is located, and the attribute marker corresponding to this operational logical address range, the storage category identifier can be obtained. When the storage category identifier of the file to be stored is determined to be SLC storage category or SLC encrypted category, the storage partition corresponding to the file to be stored is an SLC partition. When the storage category identifier of the file to be stored is determined to be TLC storage category or TLC encrypted category, the storage partition corresponding to the file to be stored is a TLC partition.
[0106] S3. Based on storage partitions, store files to be stored.
[0107] Specifically, if the storage category of the file to be stored is identified as SLC storage category, the file to be stored will be written to the SLC partition; if the storage category of the file to be stored is identified as SLC encryption category, the file to be stored will be encrypted and written to the SLC partition; if the storage category of the file to be stored is identified as TLC storage category, the file to be stored will be written to the TLC partition; if the storage category of the file to be stored is identified as TLC encryption category, the file to be stored will be encrypted and written to the TLC partition.
[0108] S4. Obtain the free capacity of each storage partition.
[0109] Free capacity refers to the remaining capacity space in a storage partition. Each storage partition has one free capacity. For example, if the total capacity of an SLC partition is 32GB and 16GB of data has already been stored, then the current free capacity of the SLC partition is 16GB.
[0110] S5. Determine the capacity threshold for each storage partition.
[0111] Each storage partition has a corresponding capacity threshold.
[0112] S6. Based on the comparison of each free capacity and its corresponding capacity threshold, adjust the sharing area of each storage partition based on the comparison results.
[0113] By comparing the capacity threshold and free capacity of storage partitions, it is possible to assess whether the storage partitions are in a state of insufficient capacity or overcrowding, and make corresponding adjustments in a timely manner so that each storage partition can provide a certain amount of capacity space relatively quickly when performing storage tasks.
[0114] In this embodiment, step S4 is executed once every monitoring cycle to perform periodic monitoring tests on each storage partition. The monitoring cycle is a system preset value.
[0115] The implementation principle of the data storage management method provided in this application is as follows: Based on the storage category identifier of the file to be stored, the file type of the file to be stored can be determined, and the data security or storage stability requirements of the file to be stored can be obtained. Then, based on the file type of the file to be stored, a suitable partitioning mode is determined, and the file to be stored is stored in the corresponding storage partition. The technical solution of this application can identify the storage stability requirements of the file to be stored, distinguish the stored data, and store data of different importance levels in storage partitions with different security levels, thus meeting diverse security needs.
[0116] By obtaining the free capacity of each storage partition and comparing it with the corresponding capacity threshold, it is possible to determine whether the capacity of each storage partition is too low. For storage partitions with low capacity, timely adjustments and supplementation can be made to reduce the risk that the storage partition cannot provide data storage space in time due to low capacity, thereby improving the efficiency of data storage.
[0117] Reference Figure 6 In a preferred embodiment, step S3 includes the following sub-steps:
[0118] S31. Obtain the remaining capacity based on the storage partition.
[0119] The remaining capacity refers to the available storage space in a storage partition. Each storage partition has a corresponding remaining capacity. For example, if the total capacity of an SLC partition is 32GB and 16GB of data has already been stored, then the remaining capacity of the SLC partition is 16GB.
[0120] S32. Determine the required capacity of the file to be stored.
[0121] The required capacity refers to the space required after the file to be stored is written to the storage partition.
[0122] S33. Determine if the remaining capacity is greater than or equal to the required capacity. If yes, execute S34; otherwise, execute S35.
[0123] This involves comparing the remaining capacity with the required capacity, and then performing storage adjustment steps based on the comparison results.
[0124] S34. Write the file to be saved to the current storage partition.
[0125] If the remaining capacity is greater than or equal to the required capacity, it means that the current storage partition can complete the storage of the file to be stored using only its remaining capacity space. Therefore, the file to be stored can be directly written to the current storage partition.
[0126] S35. Adjust storage, adjust storage partitions, and save the files to be saved.
[0127] The purpose of adjusting the storage process is to increase the capacity of the current storage partition so that it can meet the needs of the files to be stored before storing them. Specifically, this is achieved by allocating intermediate physical blocks from the solid-state drive to the current storage partition, thereby increasing the remaining capacity of the partition to be stored.
[0128] In this embodiment, the storage partition includes a fixed area and a shared area. Correspondingly, each physical block in the solid-state drive can be divided into fixed physical blocks and intermediate physical blocks. A fixed physical block is a physical block within a fixed area. The partition mode of a fixed physical block remains unchanged. Once a fixed physical block is assigned to a certain partition mode, it remains part of the storage partition corresponding to that partition mode. Throughout its lifecycle, the fixed physical block is used only for the same storage partition, resulting in stronger data stability. For example, if a fixed physical block is assigned to SLC mode, it will remain a fixed part of the SLC partition.
[0129] The intermediate physical block is a logistics block within the shared area. The partitioning mode of the intermediate physical block can be changed. When the intermediate physical block is assigned to SLC mode, it becomes part of an SLC partition; when assigned to TLC mode, it becomes part of a TLC partition. During its lifespan, the intermediate physical block can be used as either an SLC or TLC partition, offering greater flexibility, better wear leveling across the entire device, and extending the overall lifespan of the device with greater capacity.
[0130] In this embodiment, whenever the storage adjustment step is triggered, the required capacity corresponding to the storage adjustment step will be stored.
[0131] Reference Figure 7 Specifically, the sub-steps of step S35 include:
[0132] S351. Determine the demand difference based on the remaining capacity and the demand capacity.
[0133] The demand difference is the absolute value of the difference between the remaining capacity and the required capacity. The demand difference reflects the space required by the current storage partition to fully store the files to be stored.
[0134] S352. Based on the partitioning pattern and demand difference of the storage partition, allocate intermediate physical blocks to determine intermediate partitions.
[0135] The capacity of the intermediate partition corresponds to the difference in demand, and the partitioning pattern of the intermediate partition is consistent with that of the storage partition.
[0136] By utilizing the demand difference, the number of intermediate physical blocks needed to be added to the corresponding storage partition is determined. Then, the storage mode for these intermediate physical blocks is determined using the partition mode. By assigning the corresponding number of intermediate physical blocks to the corresponding storage mode, an intermediate partition with the capacity to satisfy the demand difference is obtained. Because of the increased capacity of the intermediate partition, the original storage partition is effectively updated; the new storage partition is a combination of the intermediate partition and the old one. Intermediate physical blocks can be added to different storage partitions by adjusting the storage steps, resulting in better overall wear leveling and extending the overall lifespan of the solid-state drive (SSD) even with larger usage capacities.
[0137] S353. Add the intermediate partition to the storage partition to update the storage partition.
[0138] Compared to the storage partition before the update, the updated storage partition has increased capacity to meet the demand difference, which can fully store the files to be stored.
[0139] S354. Based on the storage partition, store the file to be stored.
[0140] This involves writing the file to be stored to the updated storage partition.
[0141] Specifically, the sub-steps of step S354 include:
[0142] S3541. Based on the files to be stored and the remaining capacity, determine the primary storage data and the secondary storage data.
[0143] The file to be stored is split into primary storage data and secondary storage data, with the size of the primary storage data corresponding to the remaining capacity.
[0144] S3542. Store primary storage data based on the storage partition before adjustment.
[0145] This involves writing primary storage data into the storage partition before the update, thus allowing some data to be stored before the storage partition update is complete, thereby improving efficiency.
[0146] S3543, Based on the intermediate partition, store secondary storage data.
[0147] In this process, secondary storage data is first written to the intermediate partition, so that the file to be stored is completely stored in the updated storage partition.
[0148] The file to be stored is split into primary storage data and secondary storage data. First, the primary storage data is written to the storage partition corresponding to the remaining capacity. After the intermediate partition is determined, the secondary storage data is written to the intermediate partition. This segmented storage method allows the file to be stored to begin storage while the intermediate partition is being formed, thus improving storage efficiency.
[0149] Reference Figure 8 In a preferred embodiment, step S6 includes the following sub-steps:
[0150] S61. Determine whether the free capacity is less than or equal to the corresponding congestion threshold. If yes, determine that the storage partition corresponding to the free capacity is a congested partition; otherwise, execute S65.
[0151] The capacity threshold includes a congestion threshold, with each storage partition having its own congestion threshold. When the free capacity of a storage partition is less than or equal to the corresponding congestion threshold, it indicates that the remaining capacity of this storage partition is too small, and this storage partition is classified as a congested partition.
[0152] S62. Determine the idle difference based on the idle capacity and the congestion threshold.
[0153] The idle difference is the absolute value of the difference between the idle capacity and the congestion threshold.
[0154] S63. Based on the partitioning pattern of the congested partition and the free space difference, allocate intermediate physical blocks to determine the supplementary partition.
[0155] In this embodiment, the capacity of the supplementary partition corresponds to the free space difference, and the partitioning mode of the supplementary partition is consistent with the partitioning mode of the congested partition. In this embodiment, the physical blocks used to determine the reset partition are all intermediate physical blocks that have not yet been written with stored data.
[0156] S64. Add the supplementary partition to the storage partition of the partition mode corresponding to the congested partition.
[0157] Specifically, the number of intermediate physical blocks that need to be added to the corresponding congested partition is determined by using the free space difference. The storage mode of the intermediate physical blocks that need to be added to the corresponding congested partition is determined by using the partition mode. By allocating the corresponding number of intermediate physical blocks to the corresponding storage mode, a supplementary partition with capacity space that meets the free space difference can be obtained. Since there is an additional capacity in the supplementary partition, the original storage partition is essentially updated, and the capacity space is expanded in a timely manner so that the storage partition can efficiently complete subsequent storage tasks.
[0158] S65. Determine whether the free capacity is greater than or equal to the corresponding reset threshold. If yes, determine that the storage partition corresponding to the free capacity is the reset partition; otherwise, end.
[0159] The capacity threshold also includes a reset threshold. Each storage partition has a corresponding reset threshold, which is a system preset value. The reset threshold of a storage partition is greater than its congestion threshold. When the free capacity of a storage partition is greater than or equal to the corresponding reset threshold, it indicates that the remaining capacity of this storage partition is too large, and this storage partition is designated as a reset partition.
[0160] S66. Determine the reset difference based on the idle capacity and the reset threshold.
[0161] The reset difference is the absolute value of the difference between the free capacity and the reset threshold.
[0162] S67. Based on the partitioning mode and reset difference of the reset partition, allocate intermediate physical blocks of the partitioning mode to determine the free partition.
[0163] In this embodiment, the capacity of the free partition corresponds to the reset difference, and the partitioning mode of the free partition is consistent with that of the reset partition. The physical blocks that determine the reset partition are all intermediate physical blocks that have not been written with stored data. If the number of intermediate physical blocks without stored data is insufficient, the stored data written in the intermediate physical blocks is transferred to idle fixed physical blocks, and then the intermediate physical blocks are reallocated.
[0164] S68. Remove the free partition from the storage partition of the partition mode corresponding to the reset partition.
[0165] When a free partition is removed from a storage partition, it exists as an intermediate physical block. By removing a free partition from a storage partition, the number of intermediate physical blocks can be increased, facilitating subsequent adjustments to the storage partition.
[0166] In a preferred embodiment, step S5 includes the following sub-steps:
[0167] S51. Obtain historical adjustment data.
[0168] The historical adjustment data is based on the data used in historical adjustment storage steps, and includes at least one required capacity from the storage partitions that have participated in the adjustment. In this embodiment, the historical adjustment data preferably captures the required capacity corresponding to the five most recent adjustment storage steps.
[0169] S52. Based on historical adjustment data, determine the congestion threshold in the capacity threshold.
[0170] Historical adjustment data can reflect the demand for remaining capacity of storage partitions only in the most recent adjustment storage steps. By using historical adjustment data to update the congestion thresholds corresponding to each storage partition, the free capacity can change according to the demand of the most recent adjustment storage steps, making it more flexible.
[0171] In a preferred embodiment, step S52 includes the following sub-steps:
[0172] S521. Determine the threshold base.
[0173] The threshold base is a system preset value.
[0174] S522. Determine the additional base number based on the impact coefficient and the average of each demand capacity in the historical adjustment data.
[0175] The additional base is obtained by multiplying the impact coefficient by the average of the demand capacity in the historical adjustment data.
[0176] S523. Determine the crowding threshold based on the threshold base and the additional base.
[0177] The crowding threshold is the sum of the threshold base and the additional base.
[0178] For example, if the threshold base is 5G, the average demand capacity in the historical adjustment data is 1G, and the influence coefficient is 0.2, then the additional base is 0.2G, and the congestion threshold is 5.2G.
[0179] Historical adjustment data reflects the demand for remaining capacity in storage partitions in historical data. A larger demand indicates that recent storage tasks require a large amount of storage, necessitating more free capacity to meet the demand and adjust the corresponding storage partition to a state with more remaining capacity. Conversely, a smaller demand indicates that recent storage tasks require a smaller amount of storage, and less free capacity is needed to meet the demand. This reduces the number of intermediate physical blocks required by the storage partition, allowing more physical blocks to be allocated to storage partitions with larger demands.
[0180] This application also provides a partition configuration apparatus, which applies the partition configuration method described above.
[0181] Reference Figure 9 The partition configuration includes:
[0182] Partition setting module 4 is used to obtain partition configuration information and the configuration capacity corresponding to the partition configuration information;
[0183] The partition configuration module 5 is used to allocate physical blocks based on the configured capacity and partition configuration information, and to determine each storage partition corresponding to each partition configuration information. The partition configuration information includes the type of storage partition, and the type of storage partition is related to the data security of the storage partition.
[0184] The partition configuration device provided in this embodiment can realize each step of the partition configuration method in the aforementioned embodiment due to the functions of each module and the logical connection between them. Therefore, it can achieve the same technical effect as the aforementioned partition configuration method. For the principle analysis, please refer to the relevant description of the steps of the aforementioned partition configuration method, which will not be repeated here.
[0185] This application also provides a data storage management device, which applies the data storage management method described above.
[0186] Reference Figure 10 The data storage management device includes:
[0187] Data acquisition module 1 is used to acquire the file to be stored;
[0188] Category identification module 2 is used to determine the storage partition of the file to be stored based on the storage category identifier of the file to be stored. One storage partition corresponds to one partition mode.
[0189] Partition storage module 3 is used to store files to be stored based on storage partitions.
[0190] The data storage management device provided in this embodiment can realize each step of the data storage management method in the aforementioned embodiment due to the functions of each module and the logical connection between them. Therefore, it can achieve the same technical effect as the aforementioned data storage management method. For the principle analysis, please refer to the relevant description of the steps of the aforementioned data storage management method, which will not be repeated here.
[0191] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data storage management method characterized by comprising: include: Get the file to be saved; Based on the storage category identifier of the file to be stored, the storage partition of the file to be stored is determined, and one storage partition corresponds to one partition mode; The file to be stored is stored based on the storage partition; The data storage management method further includes: Obtain the free capacity of each of the aforementioned storage partitions; Determine the capacity threshold for each of the aforementioned storage partitions; Based on the comparison between each of the free capacities and the corresponding capacity thresholds, the storage partitions are adjusted accordingly. The capacity threshold includes a congestion threshold; the step of comparing each free capacity with its corresponding capacity threshold and adjusting each storage partition based on the comparison result includes: Determine whether the free capacity is less than or equal to the corresponding congestion threshold; if so, determine that the storage partition corresponding to the free capacity is a congested partition. The idle difference is determined based on the idle capacity and the congestion threshold; Based on the partitioning pattern of the congested partition and the free space difference, intermediate physical blocks are allocated to determine supplementary partitions; Add the supplementary partition to the storage partition of the partition pattern; The congestion threshold includes a reset threshold; The step of comparing each of the free capacities with the corresponding capacity thresholds, and adjusting each of the storage partitions based on the comparison results, includes: Determine whether the free capacity is greater than or equal to the corresponding reset threshold. If so, determine that the storage partition corresponding to the free capacity is a reset partition. The reset difference is determined based on the free capacity and the reset threshold; Based on the partitioning pattern of the congested partition and the reset difference, the intermediate physical blocks of the partitioning pattern are allocated to determine the free partitions. Remove the free partition from the storage partition of the partition pattern.
2. The data storage management method of claim 1, wherein, The step of storing the file to be stored based on the storage partition includes: Obtain the remaining capacity based on the storage partition; Determine the required capacity corresponding to the file to be stored; Based on the comparison between the remaining capacity and the required capacity, and based on the comparison result, an adjustment storage step is performed; Adjust the storage, adjust the storage partition, and store the file to be stored.
3. The data storage management method of claim 2, wherein, The storage partition includes a shared area, and data can be exchanged between the shared areas. The physical block of the shared area is an intermediate physical block. The storage adjustment step includes: Based on the remaining capacity and the demand capacity, determine the demand difference; Based on the partitioning pattern of the storage partition and the demand difference, the intermediate physical blocks are allocated to determine the intermediate partition; Add the intermediate partition to the storage partition to update the storage partition; The file to be stored is stored based on the storage partition.
4. The data storage management method of claim 3, wherein, The step of storing the file to be stored based on the storage partition includes: Based on the file to be stored and the remaining capacity, primary storage data and secondary storage data are determined, wherein the size of the primary storage data corresponds to the remaining capacity; Based on the storage partition before adjustment, store the primary storage data; The secondary storage data is stored based on the intermediate partition.
5. A partition configuration method, characterized in that, include: Obtain the partition configuration information and the configuration capacity corresponding to the partition configuration information; Based on the configured capacity and the partition configuration information, physical blocks are allocated to determine each storage partition corresponding to each of the partition configuration information. The partition configuration information includes the type of storage partition, which is associated with the data security of the storage partition. The storage partition includes fixed partitions and shared partitions. Each fixed partition is independent of the others, while each shared partition can exchange data. Get the file to be saved; Based on the storage category identifier of the file to be stored, the storage partition of the file to be stored is determined, and one storage partition corresponds to one partition mode; The file to be stored is stored based on the storage partition; The step of storing the file to be stored based on the storage partition includes: Obtain the remaining capacity based on the storage partition; Determine the required capacity corresponding to the file to be stored; Based on the comparison between the remaining capacity and the required capacity, and based on the comparison result, an adjustment storage step is performed; Adjust storage, adjust the storage partition, and store the file to be stored; whenever the storage adjustment step is triggered, the required storage capacity corresponding to the storage adjustment step will be reserved. The storage partition includes a shared area, and data can be exchanged between the shared areas. The physical block of the shared area is an intermediate physical block. The storage adjustment step includes: Based on the remaining capacity and the demand capacity, determine the demand difference; Based on the partitioning pattern of the storage partition and the demand difference, the intermediate physical blocks are allocated to determine the intermediate partition; Add the intermediate partition to the storage partition to update the storage partition; The file to be stored is stored based on the storage partition.
6. A data storage and management device, characterized in that, For implementing the data storage management method as described in claim 1, the data storage management device includes: The data acquisition module (1) is used to acquire the file to be stored; Category identification module (2) is used to determine the storage partition of the file to be stored based on the storage category identifier of the file to be stored, wherein one storage partition corresponds to one partition mode; The partition storage module (3) is used to store the file to be stored based on the storage partition.
7. A partition configuration device, characterized in that, For implementing the partition configuration method as described in claim 5, the partition configuration apparatus includes: The partition setting module (4) is used to obtain partition configuration information and the configuration capacity corresponding to the partition configuration information; The partition configuration module (5) is used to allocate physical blocks based on the configured capacity and the partition configuration information, and determine each storage partition corresponding to each of the partition configuration information, wherein the partition configuration information includes the type of the storage partition, and the type of the storage partition is related to the data security of the storage partition.
Citation Information
Patent Citations
Intelligent write allocation method and device based on ZNS solid state disk
CN114546295A