A hard disk abnormal power-down optimization method, system, device and readable storage medium
By dividing the data to be stored in a QLC NAND flash SSD into two parts and using QLC and SLC storage methods respectively, the problems of data loss and high cost when QLC NAND flash SSDs are powered off are solved, achieving fast and efficient data storage.
Patent Information
- Application Number
- CN202310275412.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-03-17
AI Technical Summary
QLC NAND flash SSDs suffer from data loss due to the need for two write operations upon power-off. Existing technologies either fill the data with dummy data or transfer it to SLC, resulting in high costs or performance degradation.
The data to be stored is divided into first predetermined data and second predetermined data. The first predetermined data is stored using QLC cross-storage, and the second predetermined data is stored using SLC. The fast storage characteristic of SLC is used to quickly save the data when the hard drive loses power.
It effectively solves the problem of data loss when QLC NAND flash SSDs are powered off, reduces the number of write cycles, lowers costs, and meets the requirement of data retention within 50ms.
Smart Images

Figure CN116185304B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer storage, and specifically relates to a method, system, device, and readable storage medium for optimizing abnormal power-down of a hard disk. Background Technology
[0002] QLC SSDs require user data to be written in a strictly specified order and through a two-step program (essentially writing data twice to the same storage space) before it can be truly saved to the NAND flash memory. Specifically, within a block, after completing the first step of the program for the first four WordLines (WLs) (which cannot be read), the first step of the program for the fifth WL is written. Then, the process returns to write the second step of the program for the first WL (WordLine), followed by the first step of the program for the sixth WL, and so on (see diagram below). This results in a large accumulation of user data (at least 4+1 WLs) in memory. Upon power-down, this data must be written to the NAND flash memory before the power-down operation can be completed. As mentioned earlier, because QLC storage requires writing the same WL twice, and when the SSD is powered off and there is a large amount of data in memory (either the DDR cache in the SSD or the computer's RAM), the two QLC writes cannot be completed, leading to data loss. Summary of the Invention
[0003] To address the above problems, this invention proposes a hard disk power-down optimization method, comprising:
[0004] In response to the hard drive power-off, the data to be stored is divided into first predetermined data and second predetermined data based on a predetermined strategy;
[0005] The first predetermined data is stored in the first predetermined space using a first predetermined storage method, and the second predetermined data is stored in the second predetermined space using a second predetermined storage method.
[0006] In some embodiments of the present invention, storing the first predetermined data in a first predetermined space using a first predetermined storage method, and storing the second predetermined data in a second predetermined space using a second predetermined storage method, includes:
[0007] Based on the storage group where the first predetermined data is located, calculate the available execution distance between the storage group and other storage groups, and use the predetermined storage space corresponding to the storage group with the largest available execution distance as the second predetermined space for storing the second predetermined data.
[0008] In some embodiments of the present invention, the method further includes:
[0009] Based on the predetermined strategy, the first predetermined space of predetermined size is initialized as the second predetermined space.
[0010] In some embodiments of the present invention, the method further includes:
[0011] In response to power-on of the hard disk, the second predetermined data is retrieved from the second predetermined space and appended to the first predetermined space based on the first predetermined method.
[0012] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0013] The ratio of the first predetermined data to the second predetermined data is determined based on the speed ratio of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0014] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0015] The ratio of the first predetermined data and the second predetermined data is determined based on the time consumed by storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0016] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0017] The ratio of the first predetermined data and the second predetermined data is determined based on the power consumption of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0018] Another aspect of the present invention provides a hard disk power-down optimization system, comprising:
[0019] A data allocation module is configured to, in response to power-off of the hard disk, divide the data to be stored into a first predetermined data and a second predetermined data based on a predetermined strategy.
[0020] A data writing execution module is configured to store the first predetermined data into a first predetermined space using a first predetermined storage method, and to store the second predetermined data into a second predetermined space using a second predetermined storage method.
[0021] Another aspect of the present invention provides a computer device comprising:
[0022] At least one processor; and
[0023] A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of any of the methods described in the above embodiments.
[0024] Another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described in the above embodiments.
[0025] The optimization method proposed in this invention uses SLC to assist in saving data that QLC cannot save in a timely manner through hybrid storage, which can effectively solve the problems of high cost and failure to meet time limits in traditional implementation methods. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic flowchart of a hard disk power-down optimization method provided in an embodiment of the present invention;
[0028] Figure 2 This is a schematic diagram of a hard disk power-down optimization system provided in an embodiment of the present invention;
[0029] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention;
[0030] Figure 4 This is a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention.
[0031] Figure 5 This is a schematic diagram illustrating the steps of QLC secondary cross-connect storage provided in an embodiment of the present invention;
[0032] Figure 6 This is a schematic diagram illustrating the improved QLC data storage process during abnormal power-down, as provided in an embodiment of the present invention.
[0033] Figure 7 This is a schematic diagram illustrating the data storage process during abnormal power-down of the improved QLC provided in an embodiment of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0035] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.
[0036] This invention aims to solve the data storage problem of traditional QLC solid-state drives during abnormal power-down. Traditional QLC power-down solutions include the following two:
[0037] Option 1 involves filling the remaining user data with a large number of dummy data until all user data falls into the NAND. However, for QLCs with a large amount of cache and requiring 2-step writes, this option increases the power-down time and cannot meet the requirements of abnormal power-down.
[0038] Option two is to transfer the user data that has not been written to SLC. This option will consume a large number of SLC blocks, which will increase costs or reduce performance.
[0039] Current computer standards require SSDs to withstand power failures within 50ms. This means that data received by the SSD must be permanently saved (power-off retention) within 50 milliseconds. However, QLC (Quick Low Voltage) storage requires writing the data twice to achieve reliable storage (due to the electrical characteristics of QLC, there is a high probability of data loss after a single write in some cases). Therefore, of the two solutions mentioned above, Solution 1 cannot guarantee data retention on the SSD. Solution 2, on the one hand, divides a large portion of the SSD space into SLC (Single-Leg Capacitor), resulting in significant space usage. Furthermore, SLC storage consumes more power (writing data can be understood as filling the corresponding storage space with charge), and the limited capacitance of QLC SSDs cannot meet the power supply requirements of the entire SLC space.
[0040] like Figure 1 As shown, to solve the above problems, this invention proposes a hard disk power-down optimization method, including:
[0041] Step S1: In response to the power failure of the hard disk, the data to be stored is divided into first predetermined data and second predetermined data based on a predetermined strategy;
[0042] Step S2: Store the first predetermined data in the first predetermined space using the first predetermined storage method, and store the second predetermined data in the second predetermined space using the second predetermined storage method.
[0043] In this invention, the proposed hard disk power-down optimization primarily addresses abnormal power-down of QLC (Quick Low Voltage) storage. In the QLC power-down mechanism, data storage involves two steps: firstly, data is stored twice in the storage unit; secondly, the storage order may involve overlapping storage. Specifically, as follows... Figure 5 As shown, Figure 5 The diagram illustrates the storage order of QLC data. Taking the eight word lines WL0-7 as an example, when storing data on the four word lines WL0-3, the data is stored sequentially, completing the first write operation on WL0-3. The third column in the diagram represents the first storage operation, and the numbers indicate the execution order. Therefore, data is written to WL4 on the fifth write operation, and the sixth write operation jumps back to WL1 to complete the second data write operation on WL1. At this point, the data in WL1 can be stably preserved even after the hard drive loses power. The seventh write operation is the first data write operation on WL5, and the eighth write operation jumps back to WL2 to perform the second data storage operation on WL2. In other words, assuming the data to be stored requires four write spaces (WL0-3), then to complete two writes to WL0-3, it is necessary to write data to WL4 (5th), WL5 (7th), WL6 (9th), and WL7 (11th). Traditionally, the 5th, 7th, 9th, and 11th writes are implemented by filling dummy data. Figure 5 The example shown only illustrates data writing within a single block, while QLC's parallel-based design incorporates numerous other features such as... Figure 5 As shown in the diagram, there is a large amount of blank padding that consumes the power time of the QLC hard drive and the capacitance of the QLC.
[0044] Therefore, this invention proposes an improved method. Specifically, in step S1, when the hard disk controller senses that the hard disk power supply has been abnormally disconnected and no external power supply device is providing power to the hard disk, the data in the solid-state drive that has not yet been stored in the QLC storage space is divided into two parts according to a certain algorithm, such as a binary search algorithm. The data can be divided equally or according to a certain weighted proportion. This results in first data and second data.
[0045] Furthermore, in step S2, the first predetermined data retains the original QLC storage method, i.e., the interleaved storage method described above where data is written twice. The second predetermined data, however, uses SLC storage, which only requires storing the data sequentially once. This allows for rapid data saving even when the hard drive loses power.
[0046] In some embodiments of the present invention, when storing the second predetermined data in an SLC manner, it is stored in reverse chronological order, for example... Figure 5In the data storage process shown, assuming the data to be stored is data to be written to WL0-7, WL0-3 is divided into the first predetermined data, and WL4-7 is divided into the second predetermined data. When storing the second predetermined data, the data corresponding to WL7 is stored first, and then the data corresponding to WL6-4 is stored in reverse order. Furthermore, the data of these four WLs (WL0-3) are stored according to the QLC method. The execution can stop after the 12th data write is completed, that is, all the data in WL0-3 is written to the QLC. The remaining data to be written to WL4-7 according to the traditional implementation only needs to be executed up to the 12th time. If the traditional implementation is used, it is necessary to execute 20 times to complete the data writing of WL0-7, which also includes 4 invalid writes to fill WL8-11 with dummy data, and the second write to WL4-7.
[0047] Compared to traditional implementations, this reduces the number of data writes by 8 for a total of 8 write volumes (WL). This optimization is only within a single block. However, SSDs often involve multiple partitioning schemes.
[0048] In an embodiment of the present invention, the first predetermined space refers to the storage space of QLC, and the second predetermined space refers to the storage space of SLC which is a portion of the storage space of the solid-state drive divided into SLC, so as to write the second predetermined data into the SLC in the manner of SLC.
[0049] In some embodiments of the present invention, storing the first predetermined data in a first predetermined space using a first predetermined storage method, and storing the second predetermined data in a second predetermined space using a second predetermined storage method, includes:
[0050] Based on the storage group where the first predetermined data is located, calculate the available execution distance between the storage group and other storage groups, and use the predetermined storage space corresponding to the storage group with the largest available execution distance as the second predetermined space for storing the second predetermined data.
[0051] In this embodiment, the solid-state drive (SSD) contains many LUNs (Logical Unit Numbers, a grouping method for storage units in an SSD). Multiple LUNs form a Target, and multiple Targets further form a Super LUN. The SSD achieves high-parallel data read and write through LUNs and Super LUNs, enabling simultaneous access and storage of multiple LUNs. In this embodiment, a portion of the storage space corresponding to each LUN is divided into SLC storage space.
[0052] Furthermore, a storage group refers to a Target or Super LUN, where each Target or Super LUN corresponds to multiple different physical NAND execution units, enabling highly parallel data read and write operations. Therefore, in this embodiment, when selecting a corresponding storage group to store the first and second predetermined data in each Target or Super LUN, the available execution distance must first be calculated. The available execution distance is determined by the storage group numbers and the number of tasks currently executing in each storage group. The controller uses load balancing to allocate tasks to corresponding processes or threads one by one when issuing tasks. Therefore, it's more likely that the closest adjacent storage groups will be assigned tasks simultaneously or in the same batch, meaning adjacent storage groups are generally busy. Storage groups with "farther" numbers are less likely to be assigned tasks simultaneously or in the same batch, unless saturated. Therefore, when selecting a storage group to store the second predetermined data, the "farther" number distance should be prioritized. Secondly, the number of tasks waiting to be executed in the queue of threads or processes within each storage group must also be considered. The calculation method for the available execution distance is as follows:
[0053] `choose_slc_lun[i] = max(weight1 * dist[i][j], weight2 * super_lun_busy_cnt[j])`; where `dist[i][j]` represents the distance between storage groups, i.e., the distance between storage group numbered [i] and storage group numbered [j]. `super_lun_busy_cnt[j]` refers to the number of tasks to be executed on storage group numbered j. `weight1` and `weight2` represent the corresponding weights. Specifically, `dist[i][j] = (j - i + TOTAL_SUPER_LUN) % TOTAL_SUPER_LUN`, where TOTAL_SUPER_LUN represents the total number of all storage groups.
[0054] Furthermore, after selecting the corresponding storage group to store the second predetermined data, a second predetermined data storage table needs to be established to store the specific addresses of the second predetermined data in each storage group that are stored in other storage groups. In some embodiments of the present invention, the method further includes:
[0055] Based on the predetermined strategy, a storage space of a predetermined size is initialized as a second predetermined space.
[0056] In this embodiment, a portion of the QLC solid-state drive is divided into SLC space based on the actual performance of the QLC solid-state drive and the hardware conditions.
[0057] In some embodiments of the present invention, the method further includes:
[0058] In response to power-on of the hard disk, the second predetermined data is retrieved from the second predetermined space and appended to the first predetermined space based on the first predetermined method.
[0059] In this embodiment, when the hard disk is powered on again, the data stored in the SLC is read out and appended, and the second predetermined data is rewritten into the QLC according to the QLC writing method.
[0060] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0061] The ratio of the first predetermined data to the second predetermined data is determined based on the speed ratio of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0062] In this embodiment, when deciding which data to store in SLC and QLC, the proportion of data to be written is determined based on the speed of the specific QLC solid-state drive when performing QLC write mode and QLC write mode. For example, assuming that the ratio of SLC write speed to QLC write speed is 2:1, then 2 / 3 of the data to be stored is divided into second predetermined data, and the remaining 1 / 3 of the data is used as first predetermined data.
[0063] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0064] The ratio of the first predetermined data and the second predetermined data is determined based on the time consumed by storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0065] In this embodiment, based on the amount of data to be stored, the time required for the QLC to write one unit of data, and the time required for the SLC to write one unit of data, the total amount of data to be stored and the predetermined power-off time are used as known results. Equations for the corresponding data in the QLC and SLC are then constructed to solve for the corresponding results. The calculation formula is as follows:
[0066] slc_save*SLC_time+qlc_sace&QLC_time<=time;
[0067] slc_save+qlc_save=data;
[0068] `slc_save` represents the second predetermined data size, i.e., the size of the data saved using the SLC method. `SLC_time` represents the time consumed to store one unit of data using SLC. One unit of data can be considered as the data size of one WL mentioned above, or the time consumed by the corresponding unit of data can be determined according to specific sampling conditions. Similarly, `qlc_save` represents the first predetermined data size, and `QLC_time` represents the time consumed to store one unit of data using the QLC method. `data` represents the total amount of data to be stored. The specific values of `slc_save` and `qlc_save` can be solved using the above formulas for application. In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0069] The ratio of the first predetermined data and the second predetermined data is determined based on the power consumption of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0070] In this embodiment, when determining whether to divide the data to be stored into first predetermined data and second predetermined data, the corresponding allocation ratio can also be determined by the power consumption of QLC storage and SLC storage methods. Similarly, the calculation is performed with the power consumption of storing one unit of data as the granularity, and the calculation formula is as follows:
[0071] slc_save*SLC_consume+qlc_sace&QLC_consume<=total_consume;
[0072] slc_save+qlc_save=data;
[0073] SLC_consume and QLC_consume represent the power consumed to store one unit of data in SLC and QLC modes, respectively, while total_consume represents the available capacity of the capacitors provided to save data when the solid-state drive experiences an abnormal power failure.
[0074] In some embodiments of the present invention, the three methods for determining the first predetermined data and the second predetermined data can coexist, and the intersection of the three allocation methods is selected as the result of the first predetermined data and the second predetermined data.
[0075] Example:
[0076] QLC is saved by traversing the super lun; when saving SLC data, the slc_page to which the super_lun with the farthest distance from the current and the fewest waiting commands belongs is selected first. choose_slc_lun[i]=max(weight1*dist[i][j],weight2*super_lun_busy_cnt[j]); here weight1 and weight2 are weight values, which can be determined according to the actual test situation.
[0077] Define several concepts:
[0078] Dist: How long until other super_luns can be processed. The distance between the current super_lun_i and other super_lun_j, dist[i][j] = (j-i+TOTAL_SUPER_LUN)%TOTAL_SUPER_LUN;
[0079] super_lun_busy_cnt: The number of commands that the Super lun is currently processing for writing;
[0080] slc_save: Points to the user data in the current super_lun that needs to be saved to slc storage, ordered from largest to smallest by superpage number;
[0081] qlc_save: Points to the user data in the current super_lun that needs to be saved to the slc storage, ordered from largest to smallest by superpage number;
[0082] slc_save_table: Saves storage information for slc_super_page, such as data type, page number, super_lun number, etc., for use in restoring user data upon system boot.
[0083] Specifically, in some embodiments, such as Figure 7 As shown, assume there are 4 super LUNs in the current firmware, and each super LUN contains 4 physical LUNs. At power-down, the `cur_super_page` is being processed, and the NAND flash memory configuration is as follows. Figure 7 As shown.
[0084] When power is off:
[0085] 1. When power is off, the slc_save of super_lun_0 to super_lun_3 all point to super_page_4, and the qlc_save all point to super_page_0;
[0086] 2. After receiving the power-down command, WM iterates through all super_luns from 0 to 3:
[0087] First, save the user data super_page_4 (with zero write attempts) to QLC;
[0088] Perform a second write to super_page_0. At this point, the user data in super_page_0 has been written to the NAND. Update qlc_save to point to super_page_1.
[0089] Save the super_page_4 pointed to by slc_save to slc_super_page in (choose_slc_lun[i]). Update slc_save to point to super_page_3;
[0090] Update the slc_save_table information;
[0091] 3. Continue iterating through all super_luns from 0 to 3, repeating step 2;
[0092] 4. Continue until all super_luns have been processed, i.e., slc_save <= qlc_save;
[0093] 5. Persist the slc_save_table (using existing technology);
[0094] 6. Complete other power-down procedures.
[0095] The proposed power-off optimization method for hard drives, which uses SLC to assist in saving data that QLC cannot save in a timely manner, can effectively solve the problems of high cost and failure to meet time limits in traditional implementation methods.
[0096] like Figure 2 As shown, another aspect of the present invention provides a hard disk power-down optimization system, comprising:
[0097] Data allocation module 1 is configured to divide the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy in response to power failure of the hard disk.
[0098] The data writing execution module 2 is configured to store the first predetermined data into a first predetermined space using a first predetermined storage method, and to store the second predetermined data into a second predetermined space using a second predetermined storage method.
[0099] like Figure 3 As shown, another aspect of the present invention also provides a computer device comprising:
[0100] At least one processor 21; and
[0101] Memory 22, storing computer instructions 23 executable on processor 21, wherein the instructions 23, when executed by processor 21, implement a hard disk power-down optimization method, including:
[0102] In response to the hard drive power-off, the data to be stored is divided into first predetermined data and second predetermined data based on a predetermined strategy;
[0103] The first predetermined data is stored in the first predetermined space using a first predetermined storage method, and the second predetermined data is stored in the second predetermined space using a second predetermined storage method.
[0104] In some embodiments of the present invention, storing the first predetermined data in a first predetermined space using a first predetermined storage method, and storing the second predetermined data in a second predetermined space using a second predetermined storage method, includes:
[0105] Based on the storage group where the first predetermined data is located, calculate the available execution distance between the storage group and other storage groups, and use the predetermined storage space corresponding to the storage group with the largest available execution distance as the second predetermined space for storing the second predetermined data.
[0106] In some embodiments of the present invention, the method further includes:
[0107] Based on the predetermined strategy, a storage space of a predetermined size is initialized as a second predetermined space.
[0108] In some embodiments of the present invention, the method further includes:
[0109] In response to power-on of the hard disk, the second predetermined data is retrieved from the second predetermined space and appended to the first predetermined space based on the first predetermined method.
[0110] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0111] The ratio of the first predetermined data to the second predetermined data is determined based on the speed ratio of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0112] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0113] The ratio of the first predetermined data and the second predetermined data is determined based on the time consumed by storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0114] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0115] The ratio of the first predetermined data to the second predetermined data is determined based on the power consumption of storing data using the first and second predetermined storage methods and a predetermined power consumption value, and the data to be stored is allocated according to the ratio.
[0116] like Figure 4 As shown, another aspect of the present invention provides a computer-readable storage medium 401, which stores a computer program 402. When executed by a processor, the computer program 402 implements a hard disk power-down optimization method, including:
[0117] In response to the hard drive power-off, the data to be stored is divided into first predetermined data and second predetermined data based on a predetermined strategy;
[0118] The first predetermined data is stored in the first predetermined space using a first predetermined storage method, and the second predetermined data is stored in the second predetermined space using a second predetermined storage method.
[0119] In some embodiments of the present invention, storing the first predetermined data in a first predetermined space using a first predetermined storage method, and storing the second predetermined data in a second predetermined space using a second predetermined storage method, includes:
[0120] Based on the storage group where the first predetermined data is located, calculate the available execution distance between the storage group and other storage groups, and use the predetermined storage space corresponding to the storage group with the largest available execution distance as the second predetermined space for storing the second predetermined data.
[0121] In some embodiments of the present invention, the method further includes:
[0122] Based on the predetermined strategy, a storage space of a predetermined size is initialized as a second predetermined space.
[0123] In some embodiments of the present invention, the method further includes:
[0124] In response to power-on of the hard disk, the second predetermined data is retrieved from the second predetermined space and appended to the first predetermined space based on the first predetermined method.
[0125] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0126] The ratio of the first predetermined data to the second predetermined data is determined based on the speed ratio of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0127] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0128] The ratio of the first predetermined data and the second predetermined data is determined based on the time consumed by storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0129] In some embodiments of the present invention, dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes:
[0130] The ratio of the first predetermined data and the second predetermined data is determined based on the power consumption of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
[0131] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0132] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0133] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0134] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0135] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of the different aspects of the invention as described above exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for optimizing abnormal power-down of a hard drive, characterized in that, include: In response to the hard drive power-off, the data to be stored is divided into first predetermined data and second predetermined data based on a predetermined strategy; The first predetermined data is stored in the first predetermined space using a first predetermined storage method, and the second predetermined data is stored in the second predetermined space using a second predetermined storage method; The process of dividing the data to be stored into first predetermined data and second predetermined data based on a predetermined strategy includes: The ratio of the first predetermined data to the second predetermined data is determined based on the speed ratio of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio. The ratio of the first predetermined data and the second predetermined data is determined based on the time consumed by storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio. The ratio of the first predetermined data and the second predetermined data is determined based on the power consumption of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
2. The method according to claim 1, characterized in that, The steps of storing the first predetermined data in the first predetermined space using a first predetermined storage method and storing the second predetermined data in the second predetermined space using a second predetermined storage method include: Based on the storage group where the first predetermined data is located, calculate the available execution distance between the storage group and other storage groups, and use the predetermined storage space corresponding to the storage group with the largest available execution distance as the second predetermined space for storing the second predetermined data.
3. The method according to claim 1, characterized in that, Also includes: Based on the predetermined strategy, a storage space of a predetermined size is initialized as a second predetermined space.
4. The method according to claim 1, characterized in that, Also includes: In response to power-on of the hard disk, the second predetermined data is retrieved from the second predetermined space and appended to the first predetermined space based on the first predetermined storage method.
5. A hard disk power-down optimization system, characterized in that, include: A data allocation module is configured to, in response to power-off of the hard disk, divide the data to be stored into a first predetermined data and a second predetermined data based on a predetermined strategy. A data writing execution module is configured to store the first predetermined data into a first predetermined space using a first predetermined storage method, and to store the second predetermined data into a second predetermined space using a second predetermined storage method. The data allocation module is further configured to: determine the ratio of the first predetermined data and the second predetermined data based on the speed ratio of storing data in the first predetermined storage method and the second predetermined storage method, and allocate the data to be stored according to the ratio; The ratio of the first predetermined data and the second predetermined data is determined based on the time consumed by storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio. The ratio of the first predetermined data and the second predetermined data is determined based on the power consumption of storing data using the first predetermined storage method and the second predetermined storage method, and the data to be stored is allocated according to the ratio.
6. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-4.
7. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-4.
Citation Information
Patent Citations
Mixed reading / writing method for flash memory, and mixed reading / writing flash memory
CN107527655A