A method, device, and medium for storing verification data
By presetting the block area of the verification data in the SSD disk and determining the storage strategy based on the numbering information, the problem of parity data occupying user data space is solved, and the effect of increasing user data space and reducing DDR usage is achieved.
Patent Information
- Application Number
- CN202310365739.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2043-04-07
AI Technical Summary
In the prior art, parity data participates in the number of user data blocks, resulting in a decrease in user data space. How to save user data space so that parity data does not occupy the block area of user data is an urgent problem.
According to the RAID5 rule, the block area for storing the verification data is preset in the SSD disk, the current verification data and the number information of the corresponding super block are obtained, and the storage strategy is determined based on the relationship between the number information and the number of blocks stored in the user data, and the verification data is stored according to the policy to avoid occupying the block area of the user data.
By separately dividing the storage area of the verification data, the user data space is increased, and by optimizing the representation range of the L2P table, the use of DDR is reduced, and the block area is quickly positioned, so that the verification data is stored separately and the user data space is increased.
Smart Images

Figure CN116339641B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular, to a method, device, and medium for storing parity data. Background Art
[0002] A redundant arrays of independent disks (RAID) is a disk subsystem composed of multiple independent high-performance disk drives, thereby providing a storage performance higher than that of a single disk and a data redundancy technology. RAID5 is a data protection method commonly used in solid state drives (SSDs). RAID5 uses the method of N user data + 1 parity data to protect data, and its space utilization rate is N / (N + 1). The parity data is generated by performing an XOR operation on the previous N user data. When any one of the user data is damaged, it can be recovered by the parity and the remaining N - 1 user data.
[0003] Figure 1 The following is a schematic diagram of the block area of the existing super lun, as Figure 1 shown. There are multiple luns inside an SSD. Each lun has several planes, and each plane has multiple blocks. A virtual lun composed of N + 1 luns is called a super lun. One block is selected from each of all the planes of the super lun to form a super block. The introduction of an unaligned L2P table in the SSD can effectively reduce the usage of the DDR occupied by the L2P table and save costs. An L2P is represented by the actual occupied number of bits. In traditional use, since the parity data participates in the block numbering of the user data and shares the same block area, it occupies the addressing space of the user data, resulting in a reduction in the user data space.
[0004] Therefore, how to save the user data space so that the parity data does not occupy the block area of the user data is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, device, and medium for storing parity data. According to the corresponding relationship between the parity data and the super block, the block area can be quickly located, so that the parity data is stored separately, increasing the user data space.
[0006] To solve the above technical problems, the present invention provides a method for storing check data, including:
[0007] Pre-set a block area for storing check data in the SSD disk according to the RAID5 rule;
[0008] Obtain the current check data and the number information of the corresponding super block;
[0009] Determine the corresponding storage strategy according to the relationship between the number information and the number of blocks storing user data;
[0010] Store the current check data in the corresponding block area according to the corresponding storage strategy.
[0011] Preferably, the step of pre-setting a block area for storing check data in the SSD disk according to the RAID5 rule includes:
[0012] Select all planes under the super lun in the SSD disk;
[0013] Determine the number of blocks included in each super block among all planes;
[0014] Determine the block allocation quantity of the check data according to the number of blocks;
[0015] Select the corresponding area in each plane as the block area according to the block allocation quantity.
[0016] Preferably, the step of determining the corresponding storage strategy according to the relationship between the number information and the number of blocks storing user data includes:
[0017] Determine the number of blocks storing user data according to the block allocation quantity;
[0018] When the number information is less than or equal to the number of blocks storing user data, select the first storage strategy;
[0019] When the number signal is greater than the number of blocks storing user data, select the second storage strategy.
[0020] Preferably, the number information of the block of the super block corresponding to the first storage strategy is the same as the number information of the super block;
[0021] The number information of the blocks in different luns of the super block corresponding to the second storage strategy is different.
[0022] Preferably, storing the current check data in a corresponding block area according to the first storage policy includes:
[0023] Determining the number information of the current check data according to the number information of the super block;
[0024] Determining the number information of the LUN where the current check data is located according to the number information of the current check data;
[0025] Storing the current check data in the block area where the number information of the LUN where the current check data is located is located.
[0026] Preferably, storing the current check data in a corresponding block area according to the second storage policy includes:
[0027] Determining the original number information, actual number information, and layer number information of the LUN where the current check data is located according to the number information of the super block;
[0028] When the actual number information is greater than the original number information, storing the current check data in the block area corresponding to the layer number information and the actual number information;
[0029] When the actual number information is less than the original number information, storing the current check data in the block area corresponding to the next layer of the layer number information and the actual number information.
[0030] Preferably, when saving user data, it further includes:
[0031] Skipping the block area where the current check data is stored and storing in other block areas.
[0032] To solve the above technical problems, the present invention further provides a device for saving check data, including:
[0033] A setting module for presetting a block area for storing check data in an SSD disk according to RAID5 rules;
[0034] An obtaining module for obtaining the current check data and the number information of the corresponding super block;
[0035] A determining module for determining a corresponding storage policy according to the relationship between the number information and the number of blocks for storing user data;
[0036] A storage module for storing the current check data in a corresponding block area according to the corresponding storage policy.
[0037] Preferably, the setting module includes:
[0038] A selection module for selecting all planes under the super lun in the SSD disk;
[0039] A first determination module for determining the number of blocks included in each super block among all planes;
[0040] A second determination module for determining the block allocation quantity of the check data according to the number of blocks;
[0041] A selection module for selecting a corresponding area in each plane as the block area according to the block allocation quantity.
[0042] Preferably, the determination module includes:
[0043] A third determination module for determining the number of blocks for storing user data according to the block allocation quantity;
[0044] A first selection module for selecting a first storage policy when the number information is less than or equal to the number of blocks for storing user data;
[0045] A second selection module for selecting a second storage policy when the number signal is greater than the number of blocks for storing user data.
[0046] Preferably, the number information of the blocks in the super block corresponding to the first storage policy is the same as the number information of the super block;
[0047] The number information of the blocks in different luns in the super block corresponding to the second storage policy is different.
[0048] Preferably, the first storage module in the storage module includes:
[0049] A fourth determination module for determining the number information of the current check data according to the number information of the super block;
[0050] A fifth determination module for determining the number information of the lun where the current check data is located according to the number information of the current check data;
[0051] A third storage module, configured to store the current parity data according to the block area where the serial number information of the LUN where the current parity data is located is located.
[0052] Preferably, the second storage module in the storage module includes:
[0053] A sixth determination module, configured to determine the original serial number information, the actual serial number information, and the layer serial number information of the LUN where the current parity data is located according to the serial number information of the super block;
[0054] A first placement module, configured to, when the actual serial number information is greater than the original serial number information, place the current parity data in the block area corresponding to the layer serial number information and the actual serial number information for storage;
[0055] A second placement module, configured to, when the actual serial number information is less than the original serial number information, place the current parity data in the block area corresponding to the next layer of the layer serial number information and the actual serial number information for storage.
[0056] Preferably, when saving user data, a skip module is further included:
[0057] The skip module is configured to skip the block area where the current parity data is stored and store it in other block areas.
[0058] To solve the above technical problems, the present invention further provides a device for saving parity data, including:
[0059] A memory, configured to store a computer program;
[0060] A processor, configured to implement the steps of the method for saving parity data as described above when executing the computer program.
[0061] To solve the above technical problems, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for saving parity data as described above are implemented.
[0062] A method for storing parity data provided by the present invention includes: presetting a block area for storing parity data in an SSD disk according to RAID5 rules; obtaining current parity data and the number information of the corresponding super block; determining a corresponding storage strategy according to the relationship between the number information and the number of blocks storing user data; and storing the current parity data in the corresponding block area according to the corresponding storage strategy. This method separately divides a storage area for parity data, excludes the block area corresponding to the parity data when storing user data, increases the number of bits identifying the number of user data blocks when adding the same bit, thereby increasing the range represented by a fixed number of bits in L2P, reducing the usage of DDR, and being able to quickly locate the block area according to the corresponding relationship between the parity data and the super block, so as to store the parity data separately and increase the user's data space.
[0063] In addition, the present invention also provides a device and a medium for storing parity data, which have the same beneficial effects as the method for storing parity data described above. Description of the Drawings
[0064] In order to more clearly illustrate the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0065] Figure 1 It is a schematic diagram of the block area of an existing super lun;
[0066] Figure 2 It is a flowchart of a method for storing parity data provided by an embodiment of the present invention;
[0067] Figure 3 It is a schematic diagram of the distribution of a super lun provided by an embodiment of the present invention;
[0068] Figure 4 It is a schematic diagram of the numbering of parity blocks provided by an embodiment of the present invention;
[0069] Figure 5 It is a schematic diagram of a super lun corresponding to a second storage strategy provided by an embodiment of the present invention;
[0070] Figure 6 It is a flowchart of another method for storing parity data provided by an embodiment of the present invention;
[0071] Figure 7 It is a structural diagram of a device for storing parity data provided by an embodiment of the present invention;
[0072] Figure 8 This is a structural diagram of another apparatus for storing verification data provided by an embodiment of the present invention. Detailed implementation manners
[0073] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.
[0074] The core of the present invention is to provide a method, apparatus and medium for storing verification data. According to the correspondence between the verification data and the super block, the block area can be quickly located, so that the verification data is stored separately, increasing the user's data space.
[0075] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0076] It should be noted that in the method for storing verification data provided by the present invention, by separately dividing a block area for storing verification data (parity data) from the super lun, the parity block no longer occupies the number of the user data block, thereby increasing the capacity of the SSD disk represented by the same number of bits of L2P, achieving the purpose of reducing the DDR usage and saving costs.
[0077] When not using a separate parity block area, the SSD user space that can be represented by L2P with a length of m bits is:
[0078]
[0079] where m is the length of L2P, and N is the ratio of the number of blocks storing user data and parity blocks in the RAID5 stripe, that is, there are N user data blocks and 1 parity block.
[0080] When using a separate parity block area, the user space of the SSD that can be represented by L2P with a length of m bits is 2 m . Using a separate parity block area increases the user space that can be represented by the same length of L2P by 1 / (N + 1). If N = 31, the user space increases by 3.125%.
[0081] Figure 2The flowchart of a method for storing verification data provided by an embodiment of the present invention is as follows: Figure 2 As shown, the method includes:
[0082] S11: Preset a block area for storing verification data in the SSD disk according to the RAID5 rule;
[0083] S12: Obtain the current verification data and the number information of the corresponding super block;
[0084] S13: Determine the corresponding storage policy according to the relationship between the number information and the number of blocks storing user data;
[0085] S14: Store the current verification data in the corresponding block area according to the corresponding storage policy.
[0086] Specifically, preset a block area for storing verification data in the SSD disk according to the RAID5 rule. It is defined that there are N user data and 1 verification data in each RAID stripe in the SSD disk, and each super lun contains N + 1 luns. A lun is a logical unit, which is the smallest independent unit in the flash memory that can execute commands and report its own status. A lun can have 1 to multiple planes. Each plane is composed of hundreds or even thousands of blocks. Each block is composed of hundreds or even thousands of pages. The smallest erasure unit of NAND is a block. Each page is composed of a large number of cell units, and a page is the smallest unit in the flash memory that can be read and written.
[0087] A disk array is composed of many independent disks, combined into a disk group with a huge capacity. It uses the additive effect generated by individual disks providing data to improve the performance of the entire disk system. Using this technology, data is cut into many segments and stored on each hard disk respectively. A disk array can also use the concept of parity check. When any hard disk in the array fails, the data can still be read. When reconstructing the data, the data can be recalculated and then placed into the new hard disk. Due to the instability of NAND flash inside the SSD, RAID5 is usually introduced to recover data.
[0088] RAID 5 is a storage solution that takes into account storage performance, data security, and storage cost. RAID 5 can be understood as a compromise between RAID 0 and RAID 1. RAID 5 can provide data security for the system, but the degree of security is lower than that of Mirror while the disk space utilization rate is higher than that of Mirror. RAID 5 has a data reading speed similar to that of RAID 0, except that there is an additional parity check information, and the data writing speed is slightly slower than that of writing to a single disk. At the same time, since multiple data correspond to one parity check information, the disk space utilization rate of RAID 5 is higher than that of RAID 1, and the storage cost is relatively low. It is a solution that is currently used more frequently. When making a RAID 5 array, all disk capacities must be the same. When the capacities are different, the smallest capacity will be used as the standard. It is best that the hard disk rotation speeds are the same, otherwise it will affect performance, and the available space = the number of disks n - 1. RAID 5 does not have an independent parity check disk, and all parity check information is scattered on all disks, only occupying the capacity of one disk.
[0089] As an embodiment, pre-setting a block area for storing parity check data in the SSD disk according to the RAID5 rule in step S11 includes:
[0090] Select all planes under the super lun in the SSD disk;
[0091] Determine the number of blocks included in each super block among all planes;
[0092] Determine the block allocation quantity of the parity check data according to the number of blocks;
[0093] Select the corresponding area in each plane as the block area according to the block allocation quantity.
[0094] Specifically, a super lun contains N + 1 luns. Select one block from each of all planes of the super lun to form a super block, and the number of blocks included in each super block is:
[0095] (N + 1) × NumPlane
[0096] where NumPlane is the number of planes included in each lun.
[0097] If there are k blocks in each plane, then there are k super blocks in each super lun, and the number of parity blocks required for each super block is NumPlane. The number of parity blocks required for each super lun is k * NumPlane, and the number p of parity blocks allocated in each plane is as follows:
[0098]
[0099] Take the last block in each plane as the parity block area.
[0100] After selecting the parity block area, the number of blocks for storing user data in the plane is k - p. Figure 3 This is a schematic diagram of the distribution of a super lun provided by an embodiment of the present invention. As Figure 3 shown, taking 2 planes in each lun as an example, for user blocks and parity blocks, in addition to the block area for user data in the planes under each lun, a block area for storing check data is separately set.
[0101] In the existing actual use, the blocks with the same number in all planes of a lun are used as a whole, and user data or check data is written at the same time. In this application, the influence of the plane is no longer considered. Assuming that there is one plane in each lun, in this embodiment, the blocks of user data in each lun are numbered separately, and all parity blocks in the super lun are numbered uniformly. Figure 4 This is a schematic diagram of the numbering of parity blocks provided by an embodiment of the present invention. As Figure 4 shown, the parity blocks in a super lun have different numbers, and the blocks of user data have the same number.
[0102] Obtaining the current verification data and the corresponding super block number information in step S12. Since one super block corresponds to one parity block, the corresponding storage policy can be determined according to the super block number information. It can be understood that the storage policy is different due to the different relationships between the number information and the number of blocks storing user data. If the number information is less than the number of blocks storing user data, it means that the value of the current verification data is small. If the number information is greater than the number of blocks storing user data, it means that the current verification data is large, and different storage areas are required.
[0103] In addition, the same storage policy can also be set, or a more refined storage policy can be divided. This is not limited here, as long as the parity block area can be quickly located.
[0104] Store the current verification data in the corresponding block area according to the divided different storage policies. It should be noted that for the current verification data, only one storage policy is applicable.
[0105] A method for saving verification data provided by an embodiment of the present invention includes: presetting a block area for storing verification data in an SSD disk according to RAID5 rules; obtaining the current verification data and the corresponding super block number information; determining the corresponding storage policy according to the relationship between the number information and the number of blocks storing user data; storing the current verification data in the corresponding block area according to the corresponding storage policy. This method separately divides a storage area for verification data, excludes the block area corresponding to the verification data when saving user data, increases the number of user data block numbers when adding the same bit, thereby increasing the range represented by the fixed number of bits L2P, reducing the usage of DDR, and being able to quickly locate the block area according to the corresponding relationship between the verification data and the superblock, so as to store the verification data separately and increase the user's data space.
[0106] Based on the above embodiment, determining the corresponding storage policy according to the relationship between the number information and the number of blocks storing user data in step S13 includes:
[0107] Determine the number of blocks storing user data according to the block allocation quantity;
[0108] When the number information is less than or equal to the number of blocks storing user data, select the first storage policy;
[0109] When the number signal is greater than the number of blocks storing user data, select the second storage policy.
[0110] Specifically, the number of blocks for storing user data is determined according to the number of block allocations of the check data. For example, if the number of block allocations of the check data in one plane is p and there are k blocks in one plane, then the number of blocks for storing user data is k - p. As Figure 4 shown, the block areas for storing user data in one plane are Block0, Block1, Block2... Block(k - p), and the block areas for storing check data are Pblock0, Pblock(N + 1)... Pblock(p×(N + 1) - N - 1).
[0111] When the numbering information is less than or equal to the number of blocks for storing user data, it indicates that the currently stored data is less, and the first storage strategy is selected. When the numbering information is greater than the number of blocks for storing user data, it indicates that the currently stored data is more, and the second storage strategy is selected. It should be noted that the first storage strategy and the second storage strategy are only used to distinguish the differences between the two storage strategies. In fact, the actual second storage strategy can also be the first storage strategy, and the actual first storage strategy can also be the second storage strategy, which is not limited here.
[0112] As an embodiment, the numbering information of the blocks of the super block corresponding to the first storage strategy is the same as the numbering information of the superblock;
[0113] The numbering information of the blocks in different luns of the super block corresponding to the second storage strategy is different.
[0114] Specifically, when the numbering information is less than or equal to the number of blocks for storing user data, the super block is composed of blocks with the same numbering, that is, the blocks in the same layer of each lun. The numbering information of the super block is the same as the numerical value of the numbering information of the blocks, and each super block corresponds to a parity block.
[0115] When the numbering information is greater than the number of blocks for storing user data, the super block is composed of blocks with different numberings in different luns, Figure 5 which is a schematic diagram of a super lun corresponding to the second storage strategy provided by an embodiment of the present invention. As Figure 5 shown, the super block is composed of blocks with different numberings in different luns. It can be selected step by step in order or not in order, as long as the block numbers in each lun are different.
[0116] The composition methods of different super blocks corresponding to different storage policies provided by the embodiments of the present invention increase flexibility. According to the corresponding relationship between different super blocks and parity blocks, it is possible to conveniently find the corresponding parity block according to the number information of the super block.
[0117] Based on the above embodiments, storing the current check data in the corresponding block area according to the first storage policy includes:
[0118] Determining the number information of the current check data according to the number information of the super block;
[0119] Determining the number information of the LUN where the current check data is located according to the number information of the current check data;
[0120] Storing the current check data in the block area where the number information of the LUN where the current check data is located is located.
[0121] Specifically, in the first storage policy, the super block is composed of blocks with the same number, that is, the blocks in the same layer in each LUN. The number information of the super block is the same as the numerical value of the number information of the block, and each superblock corresponds to a parity block. According to the number information of the super block, the number information of the current check data can also be determined.
[0122] There is a mapping relationship between the number information of the current check data and the number information of the LUN where the current check data is located. The specific mapping relationship is as follows:
[0123] Index pl =MOD(Index pb , N + 1) where Index pl is the number information of the LUN where the parity block is located, and Index pb is the number information of the super block, that is, the number information of the current check data.
[0124] Index pl is the remainder of Index pb divided by N + 1, and Index pl ≤N.
[0125] According to the above mapping relationship, the number information of the LUN where the current verification data is located can be obtained. The block area where the number information is located is the block area of the verification data, that is, the current verification data is stored.
[0126] As an embodiment, storing the current verification data in the corresponding block area according to the second storage policy includes:
[0127] Determine the original number information, actual number information, and layer number information of the LUN where the current verification data is located according to the number information of the super block;
[0128] When the actual number information is greater than the original number information, place the current verification data in the block area corresponding to the layer number information and the actual number information for storage;
[0129] When the actual number information is less than the original number information, place the current verification data in the block area corresponding to the next layer of the layer number information and the actual number information for storage.
[0130] Specifically, when the number information is greater than the number of blocks storing user data, the super block is composed of blocks with different numbers in different LUNs. According to the number information Index of the super block sb Determine the actual number information Index of the LUN where the current verification data is located pl , and its specific mapping relationship is as follows:
[0131] Index pl = MOD((Index sb -(k - p)-1)×N, N + 1)
[0132] According to the number information Index of the super block sb The layer number information Index of the block area where the verification data is located can be obtained r And the original number information Index of the LUN where it is located c .
[0133] When the actual number information Index of the LUN where the current verification data is located calculated by the above formula pl Is greater than the original number information Index of the LUN where it is located c , then store the current verification data in the corresponding block area of the LUN corresponding to the layer number information and the actual number information.
[0134] When the actual number information Index of the LUN where the current verification data is located calculated by the above formula plGreater than the original serial number information Index of the corresponding LUN c When it is, it indicates the layer serial number information Index of the block area of the verification data r and the actual serial number information Index of the corresponding LUN pl If the block area of the corresponding LUN has been used, the current verification data will be stored in the block area of the next layer with the layer serial number information Index r and the LUN serial number is the actual serial number information Index pl of the corresponding LUN block area
[0135] The corresponding block area storage of the current verification data provided in this embodiment according to the first storage policy includes: determining the serial number information of the current verification data according to the serial number information of the super block; determining the serial number information of the LUN where the current verification data is located according to the serial number information of the current verification data; storing the current verification data according to the block area where the LUN serial number information of the current verification data is located. The corresponding block area storage of the current verification data according to the second storage policy includes: determining the original serial number information, actual serial number information and layer serial number information of the LUN where the current verification data is located according to the serial number information of the super block; when the actual serial number information is greater than the original serial number information, storing the current verification data in the block area corresponding to the layer serial number information and the actual serial number information; when the actual serial number information is less than the original serial number information, storing the current verification data in the block area of the next layer of the layer serial number information and the actual serial number information. To prevent the entire LUN from being damaged and resulting in data loss, according to the corresponding relationship between different super blocks and parity blocks, it is possible to easily find the corresponding parity block according to the serial number information of the super block
[0136] On the basis of the above embodiment, when saving user data, it further includes
[0137] Skipping the storage in the block area where the current verification data is stored and storing in other block areas
[0138] Specifically, the other block area storage is the area other than the block area where the verification data is stored, that is, the block area for storing user data. Blocks in the same super block should be distributed on different LUNs. When the super block number is less than or equal to k - p, from the serial number Index pb of the parity block, the LUN serial number Index pl, skip the blocks on this LUN when storing user data. When the super block number is greater than k - p, according to Index sb the layer Index where the parity block is located can be calculated r and the LUN number Index c , from the Index calculated in the above embodiments pl is greater than Index c then store the parity at Index r layer and the LUN numbered Index pl , if Index pl is less than Index c , it means that the blocks of the LUN at Index r layer and numbered Index pl have been used, then store the parity at Index r +1 layer and the LUN numbered Index pl .
[0139] As an embodiment, Figure 6 is a flowchart of another method for storing check data provided by the embodiment of the present invention, as Figure 6 shown, the method includes:
[0140] S21: Obtain the number information Index of the super block sb ;
[0141] S22: Judge whether Index sb is greater than k - p, if so, go to step S23, if not, go to step S24;
[0142] S23: Index pl = MOD(((Index sb -(k - p)-1)×N),N + 1), Index r = Index sb / (N + 1), Index c = MOD(Index sb ,N + 1);
[0143] S24: Index pb = Index sb ;
[0144] S25: Judge whether Index c is greater than Index pl , if so, go to step S26, if not, go to step S27;
[0145] S26: Index r Increment by 1;
[0146] S27: Index pb = Index r × N + Index pl ;
[0147] S28: Find the parity block according to Index pb Find the parity block.
[0148] Another method for storing check data provided by an embodiment of the present invention. This method separately divides a storage area for check data, excludes the block area corresponding to the check data when storing user data, increases the number of user data blocks identified when adding the same bit, thereby increasing the range represented by the fixed number of bits L2P, reducing the usage of DDR, and being able to quickly locate the block area according to the correspondence between the check data and the super block, so as to store the check data separately and increase the user's data space.
[0149] The above has described in detail each embodiment corresponding to the method for storing check data. On this basis, the present invention also discloses an apparatus for storing check data corresponding to the above method. Figure 7 It is a structural diagram of an apparatus for storing check data provided by an embodiment of the present invention. As Figure 7 shown, the apparatus for storing check data includes:
[0150] A setting module 11, configured to preset a block area for storing check data in the SSD disk according to the RAID5 rule;
[0151] An obtaining module 12, configured to obtain the current check data and the number information of the corresponding super block;
[0152] A determining module 13, configured to determine the corresponding storage strategy according to the relationship between the number information and the number of blocks storing user data;
[0153] A storage module 14, configured to store the current check data in the corresponding block area according to the corresponding storage strategy.
[0154] As an embodiment, the setting module includes:
[0155] A selection module, configured to select all planes under the super lun in the SSD disk;
[0156] The first determination module is used to determine the number of blocks included in each super block among all planes;
[0157] The second determination module is used to determine the block allocation quantity of the check data according to the number of blocks;
[0158] The selection module is used to select the corresponding area in each plane as the block area according to the block allocation quantity.
[0159] As an embodiment, the determination module includes:
[0160] The third determination module is used to determine the number of blocks for storing user data according to the block allocation quantity;
[0161] The first selection module is used to select the first storage strategy when the number information is less than or equal to the number of blocks for storing user data;
[0162] The second selection module is used to select the second storage strategy when the number signal is greater than the number of blocks for storing user data.
[0163] As an embodiment, the number information of the blocks in the super block corresponding to the first storage strategy is the same as the number information of the super block;
[0164] The number information of the blocks in different luns in the super block corresponding to the second storage strategy is different.
[0165] As an embodiment, the first storage module in the storage module includes:
[0166] The fourth determination module is used to determine the number information of the current check data according to the number information of the super block;
[0167] The fifth determination module is used to determine the number information of the lun where the current check data is located according to the number information of the current check data;
[0168] The third storage module is used to store the current check data according to the block area where the lun number information of the current check data is located.
[0169] As an embodiment, the second storage module in the storage module includes:
[0170] The sixth determination module is used to determine the original number information, actual number information and layer number information of the lun where the current check data is located according to the number information of the super block;
[0171] The first placement module is used to store the current verification data in the block area corresponding to the layer number information and the actual number information when the actual number information is greater than the original number information.
[0172] The second placement module is used to store the current verification data in the block area corresponding to the next layer of the layer number information and the actual number information when the actual number information is less than the original number information.
[0173] As an embodiment, when saving user data, it further includes a skip module:
[0174] The skip module is used to skip the block area where the current verification data is stored and store it in other block areas.
[0175] Since the embodiments of the device part correspond to the above embodiments, the embodiments of the device part are described with reference to the embodiments of the above method part and will not be elaborated here.
[0176] A device for saving verification data provided by an embodiment of the present invention includes: presetting a block area for storing verification data in an SSD disk according to RAID5 rules; obtaining the current verification data and the number information of the corresponding super block; determining a corresponding storage strategy according to the relationship between the number information and the number of blocks storing user data; and storing the current verification data in the corresponding block area according to the corresponding storage strategy. This device separately divides a storage area for verification data, excludes the block area corresponding to the verification data when saving user data, increases the number of user data blocks identified by the same bit, thereby increasing the range represented by the fixed number of bits L2P and reducing the usage of DDR. According to the corresponding relationship between the verification data and the superblock, the block area can be quickly located, enabling the separate storage of verification data and increasing the user's data space.
[0177] Figure 8 It is a structural diagram of another device for saving verification data provided by an embodiment of the present invention, as Figure 8 shown. This device includes:
[0178] A memory 21 for storing computer programs;
[0179] A processor 22 for implementing the steps of the method for saving verification data when executing the computer program.
[0180] The device for saving verification data provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer, etc.
[0181] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 may be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 22 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.
[0182] The memory 21 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 21 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 211. After the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the method for saving verification data disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 21 may further include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 212 may include Windows, Unix, Linux, etc. The data 213 may include, but is not limited to, the data involved in the method for saving verification data, etc.
[0183] In some embodiments, the device for saving verification data may further include a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27.
[0184] Those skilled in the art can understand that Figure 8 the structure shown in
[0185] The processor 22 implements the method for storing verification data provided in any of the above embodiments by calling the instructions stored in the memory 21.
[0186] An apparatus for storing verification data provided by an embodiment of the present invention includes: a block area for storing verification data is preset in the SSD disk according to the RAID5 rule; the current verification data and the number information of the corresponding super block are obtained; the corresponding storage policy is determined according to the relationship between the number information and the number of blocks storing user data; and the current verification data is stored in the corresponding block area according to the corresponding storage policy. The apparatus separately divides a storage area for the verification data, excludes the block area corresponding to the verification data when storing user data, increases the number of user data blocks identified when adding the same bit, thereby increasing the range represented by the fixed number of bits L2P and reducing the usage amount of the DDR. According to the corresponding relationship between the verification data and the superblock, the block area can be quickly located, so that the verification data is stored separately, increasing the user's data space.
[0187] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor 22, the steps of the method for storing verification data as described above are implemented.
[0188] It can be understood that if the method in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0189] A computer medium provided by an embodiment of the present invention includes: a block area for storing parity data is preset in an SSD disk according to RAID5 rules; current parity data and the number information of the corresponding super block are obtained; a corresponding storage policy is determined according to the relationship between the number information and the number of blocks storing user data; and the current parity data is stored in the corresponding block area according to the corresponding storage policy. This computer medium separately divides a storage area for parity data, excludes the block area corresponding to the parity data when storing user data, increases the number of user data blocks identified by the same bit, thereby increasing the range represented by the fixed number of bits L2P, reducing the usage of DDR, and being able to quickly locate the block area according to the corresponding relationship between the parity data and the superblock, so as to store the parity data separately and increase the user's data space.
[0190] The above has introduced in detail a method for storing parity data, a device for storing parity data, and a medium provided by the present invention. The embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0191] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
Claims
1. A method for storing verification data, characterized in that, Including: Pre-setting a block area for storing parity data in the SSD disk according to the RAID5 rule; Obtaining the current parity data and the number information of the corresponding super block; Determining a corresponding storage policy according to the relationship between the number information and the number of blocks storing user data; specifically including: determining the number of blocks storing user data according to the block allocation quantity; when the number information is less than or equal to the number of blocks storing user data, selecting a first storage policy; when the number signal is greater than the number of blocks storing user data, selecting a second storage policy; wherein, the number information of the block of the super block corresponding to the first storage policy is the same as the number information of the super block; the number information of the blocks in different luns of the super block corresponding to the second storage policy is different; Storing the current parity data in the corresponding block area according to the corresponding storage policy.
2. The method for storing verification data according to claim 1, wherein The pre-setting a block area for storing parity data in the SSD disk according to the RAID5 rule includes: Selecting all planes under the super lun in the SSD disk; Determining the number of blocks included in each super block among all planes; Determining the block allocation quantity of the parity data according to the number of blocks; Selecting a corresponding area in each plane as the block area according to the block allocation quantity.
3. The method for storing verification data according to claim 1, wherein Storing the current parity data in the corresponding block area according to the first storage policy includes: Determining the number information of the current parity data according to the number information of the super block; Determining the number information of the lun where the current parity data is located according to the number information of the current parity data; Storing the current parity data in the block area where the number information of the lun where the current parity data is located is located.
4. The method for storing verification data according to claim 1, characterized in that, Storing the current parity data in the corresponding block area according to the second storage policy includes: Determining the original number information, actual number information and layer number information of the lun where the current parity data is located according to the number information of the super block; When the actual number information is greater than the original number information, placing the current parity data in the block area corresponding to the layer number information and the actual number information for storage; When the actual number information is less than the original number information, placing the current parity data in the block area corresponding to the next layer of the layer number information and the actual number information for storage.
5. The method for storing verification data according to any one of claims 1 to 4, characterized in that When saving user data, it further includes: Skipping the block area where the current parity data is stored and storing in other block areas.
6. A device for storing verification data, characterized in that, Including: A setting module for pre-setting a block area for storing parity data in the SSD disk according to the RAID5 rule; An acquisition module, configured to acquire current verification data and the number information of the corresponding super block; A determination module, configured to determine a corresponding storage policy according to the relationship between the number information and the number of blocks storing user data; Specifically including: determining the number of blocks storing user data according to the block allocation quantity; when the number information is less than or equal to the number of blocks storing user data, selecting a first storage policy; when the number signal is greater than the number of blocks storing user data, selecting a second storage policy; wherein, the number information of the blocks of the super block corresponding to the first storage policy is the same as the number information of the super block; the number information of the blocks in different luns of the super block corresponding to the second storage policy is different; A storage module, configured to perform corresponding block area storage on the current verification data according to the corresponding storage policy.
7. A device for storing verification data, characterized in that, Including: A memory, configured to store a computer program; A processor, configured to implement the steps of the method for saving verification data according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for saving verification data according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Verification data generation method and solid state disk
CN109542671A
Solid state disk management method and solid state disk
CN113590038A