A data storage method, storage medium, and system based on RAID technology
By optimizing the distribution of data blocks and parity blocks in flash memory chips through RAID technology, the problem of uneven wear in storage devices is solved, thereby improving device performance and lifespan.
Patent Information
- Application Number
- CN202510347565.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-03-24
AI Technical Summary
Uneven wear between flash memory chips in storage devices leads to performance degradation and shortened lifespan.
By employing RAID technology, the distribution of data blocks and parity data blocks is optimized, the amount of parity data is allocated reasonably, and the amount of data blocks and parity data is swapped appropriately. This optimizes the wear distribution of the parity data storage device and the distribution method of parity blocks and data blocks, ensuring that the wear of the storage device is minimized and the wear of each flash memory chip is evenly distributed.
To improve the performance and lifespan of storage devices, optimize the distribution of data blocks and parity blocks, balance the wear and tear on each flash memory chip, and extend the device's lifespan.
Smart Images

Figure CN120295567B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage technology, and specifically to a data storage method, storage medium, and system based on RAID technology. Background Technology
[0002] Flash memory-based storage devices are widely used in various electronic devices due to their superior read / write performance, large storage capacity, and extremely low power consumption.
[0003] Storage devices consist of data blocks for storing user data and parity blocks for storing parity data. These data blocks and parity blocks are stored in stripes. When the user data stored in the storage device needs frequent updates, updating any data block requires modifying the parity block of the stripe containing that data block. This results in a much higher update frequency for the parity blocks compared to other data blocks. Consequently, the flash memory chips containing the parity blocks experience greater wear than other flash memory chips, leading to uneven wear among the flash memory chips within the storage device. Ultimately, this affects the performance and lifespan of the storage device. Summary of the Invention
[0004] To address the technical problem of uneven wear among flash memory chips within storage devices, the present invention aims to provide a data storage method, storage medium, and system based on RAID technology. The specific technical solution adopted is as follows:
[0005] On one hand, this application provides a data storage method based on RAID technology, applied to a storage device. The storage device includes n flash memory chips, each flash memory chip including several data blocks and several parity blocks, where n is an integer greater than or equal to 2. The method includes: obtaining operation information of each data block and parity block in each flash memory chip; determining a target swapping method based on the operation information; and swapping the parity blocks and data blocks in the first stripe according to the target swapping method to obtain swapped data blocks and swapped parity blocks in the storage device.
[0006] The target swapping method is the one with the smallest wear level of the storage device among r swapping methods. The wear level of the storage device represents the wear level of the storage device. The swapping method represents the swapping of any data block and parity block in the first stripe. Each first stripe includes (n-1) data blocks and one parity block. r is the product of (n-1) and x, where x is the number of first stripes and x is an integer greater than or equal to 1.
[0007] The swapped data block is used to store user data, and the swapped check block is used to store check data.
[0008] In another possible example, the data storage method based on RAID technology further includes: determining the degree of association between a first data block and a second data block based on the operation information of the data blocks, wherein the first data block and the second data block are two different data blocks in the storage device; and determining a first stripe based on the first data block and the second data block if the degree of association between the first data block and the second data block is greater than or equal to a first threshold.
[0009] In another possible example, the degree of association between the first data block and the second data block is related to a first parameter and / or a second parameter, where the first parameter represents the difference in the number of operations between the first data block and the second data block within a first time period, and the second parameter represents the sum of the time intervals between the respective operation times of the first data block and the corresponding operation times of the second data block within the first time period.
[0010] In another possible example, the data storage method based on RAID technology also includes: for any given flash memory chip, determining the historical wear level of the flash memory chip based on the operation information of the data block; and determining the number of parity blocks for each flash memory chip based on the total number of parity blocks of the storage device and the historical wear level of each flash memory chip.
[0011] In another possible example, for any given flash memory chip, the historical wear level of the flash memory chip is the sum of the number of writes and erases of the full data block and / or full parity block of the flash memory chip.
[0012] In another possible example, determining the number of parity blocks for each flash memory chip based on the total number of parity blocks in the storage device and the historical wear level of each flash memory chip includes: for any given flash memory chip, determining the number of parity blocks for the flash memory chip based on the historical wear level of the flash memory chip; and determining the number of parity blocks for each flash memory chip based on the total number of parity blocks in the storage device and the parity block value parameter for each flash memory chip.
[0013] The number of check blocks parameter is related to the third parameter and / or the fourth parameter. The third parameter is the sum of the differences between the historical wear level of any flash memory chip and the historical wear level of other flash memory chips; the fourth parameter is the maximum value among the n third parameters.
[0014] In another possible example, the wear and tear of the storage device is related to a fifth parameter and / or a sixth parameter, where the fifth parameter is the sum of the differences between the predicted wear and tear of each flash memory chip and the mean of the predicted wear and tear of the n flash memory chips, and the sixth parameter is the maximum value among the predicted wear and tear of the n flash memory chips.
[0015] In another possible example, for any flash memory chip, the predicted wear level of the flash memory chip is related to the seventh parameter and the eighth parameter. The seventh parameter is the sum of the number of writes and erases of the full data block and / or the full parity block of the flash memory chip before the data block and parity block are swapped. The eighth parameter is at least one of the number of writes, erases and modifications of the flash memory chip in a second time period after the data block and parity block are swapped.
[0016] On the one hand, this application provides a computer-readable storage medium, including a computer program or instructions, which, when executed on a computer, cause the computer to perform the above-described data storage method based on RAID technology.
[0017] On the one hand, this application provides a data storage system based on RAID technology, applied to a storage device, the storage device including n flash memory chips, and the system including: a module for executing the above-described data storage method based on RAID technology.
[0018] In summary, the data storage method, storage medium, and system based on RAID technology of this application optimize the distribution of parity blocks and data blocks by placing highly correlated data blocks in the same first stripe, rationally allocating the number of parity blocks to each flash memory chip, and rationally swapping data blocks and parity blocks, using the wear level of the storage device as a constraint. This ensures that the wear level of the storage device is minimized and the wear of each flash memory chip is balanced, thereby improving the performance and lifespan of the storage device. Attached Figure Description
[0019] To more clearly illustrate the technical solutions and advantages in the embodiments of this application 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A schematic diagram of a storage device provided in one embodiment of this application;
[0021] Figure 2 A flowchart illustrating a data storage method based on RAID technology provided in one embodiment of this application;
[0022] Figure 3 This is a block diagram of a data storage system based on RAID technology provided in one embodiment of this application. Detailed Implementation
[0023] To further illustrate the technical means and effects adopted by this application to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a data storage method, storage medium, and system based on RAID technology proposed in this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0025] The following description, in conjunction with the accompanying drawings, details a specific solution for a data storage method, storage medium, and system based on RAID technology provided in this application.
[0026] This application provides a data storage method based on RAID technology, which is applied to a storage device.
[0027] Please see Figure 1 The diagram shows a schematic of the storage device of this application.
[0028] like Figure 1 As shown, storage device 100 includes n flash memory chips. n is an integer greater than or equal to 2.
[0029] Storage devices may include, for example, solid-state drives (SSDs).
[0030] A flash memory chip can also be understood as a channel. Each flash memory chip consists of multiple basic storage units, namely flash memory cells.
[0031] The data stored in the storage device is actually stored in flash memory cells. This data includes user data and verification data.
[0032] User data refers to various information stored by users on storage devices, including documents, images, audio, programs, etc.
[0033] Validation data refers to additional data generated to ensure the accuracy and integrity of user data. Validation data is calculated from user data using specific algorithms.
[0034] Figure 1 The storage device shown can utilize Redundant Array of Independent Disks (RAID) technology. RAID technology combines individual flash memory chips to form a single storage device.
[0035] Specifically, storage devices can utilize RAID5 technology.
[0036] RAID5 is a striped storage method with distributed parity. With RAID5 technology, user data and parity data can be distributed across multiple flash memory chips.
[0037] exist Figure 1 In the example, n is 5, meaning storage device 100 includes flash memory chips 11-1 to 11-5. Each flash memory chip includes several data blocks and one parity block. Figure 1 In the example, D i P represents a data block. j This represents a check block. Both i and j are integers greater than or equal to 0.
[0038] A data block is the basic unit for storing user data in a storage device. One data block can occupy multiple flash memory cells.
[0039] A check block is a basic unit in a storage device that stores check data; one check block can occupy multiple flash memory cells.
[0040] In RAID 5 technology, data blocks or parity blocks at the same location within each flash memory chip form a stripe, and each stripe contains one parity block. Therefore, each flash memory chip includes several data blocks and several parity blocks.
[0041] exist Figure 1 In the example, in the storage device, the data block or parity block at the front of the five flash memory chips forms a stripe 12. This striped distribution can distribute data across multiple flash memory chips, thereby improving data read and write speeds and reducing the frequent read and write operations on some flash memory chips, which can create read / write hotspots and affect the uniform distribution of data.
[0042] In one possible embodiment, the storage device 100 may also include a controller 13.
[0043] The controller 13 can be used to control the flash memory chips of the storage device.
[0044] For example, controller 13 can be used to swap data blocks and check blocks according to the method of embodiments of this application.
[0045] The following will describe in detail a data storage method based on RAID technology provided in one embodiment of this application.
[0046] Please see Figure 2 The flowchart of a data storage method based on RAID technology provided in one embodiment of this application is shown.
[0047] like Figure 2As shown, the data storage method based on RAID technology according to the embodiments of this application includes operations S210 to S230.
[0048] In operation S210, the operation information of each data block and parity block in each flash memory chip is obtained.
[0049] For example, the operation information may include at least one of the following: the number of write operations, the number of erase operations, and the number of modification operations.
[0050] A write operation refers to writing data to a flash memory cell. An erase operation refers to resetting the data stored in a flash memory cell. A modify operation refers to reading the original data from a flash memory cell and writing new data to another flash memory cell. Each modify operation consists of a consecutive read operation and a write operation.
[0051] In one possible embodiment, the self-monitoring analysis and reporting technology (SMART) information of the storage device may include operational information of each data block and check block in each flash memory chip.
[0052] In operation S220, the target swapping method is determined based on the operation information.
[0053] In this embodiment, the distribution of check blocks and data blocks in a stripe is optimized by swapping check blocks and data blocks within the stripe. Here, a stripe can be any stripe in the storage device, or it can be understood as the first stripe.
[0054] In a storage device, each first stripe includes (n-1) data blocks and one parity block. Within each first stripe, the parity block and data blocks can be interchanged, resulting in (n-1) interchange possibilities for a first stripe. x flash memory chips provide a total of r interchange possibilities, where r is the product of (n-1) and x. x is an integer greater than or equal to 1.
[0055] Each swapping method corresponds to a wear level of the storage device. To reduce the wear level of the storage device, the target swapping method with the lowest wear level can be selected from r swapping methods.
[0056] In operation S230, according to the target swapping method, the check block and data block in the first strip are swapped to obtain the swapped data block and the swapped check block.
[0057] Swapping the parity block and the data block can be understood as swapping the physical addresses of the data block and the parity block in the first stripe, and updating the mapping table between logical addresses and physical addresses.
[0058] The target swapping method results in the least wear and tear on the storage device among the r swapping methods. Therefore, swapping the parity block and data block in the first strip according to the target swapping method can reduce the wear and tear on the storage device and improve its performance and lifespan.
[0059] In some implementations, the wear of a flash memory chip is reduced by decreasing the number of parity blocks in the flash memory chip. However, this approach reduces the data reliability of data blocks in the same band and still results in excessive wear of the flash memory chip containing the parity blocks and uneven wear among the various flash memory chips in the storage device.
[0060] In this embodiment, there is no need to reduce the number of parity blocks in the flash memory chip, thus ensuring the accuracy of data blocks within the same band. Furthermore, this embodiment uses the wear level of the storage device as a reference and swaps the parity blocks and data blocks in the first band with the goal of minimizing wear. This optimizes the distribution of parity blocks and data blocks, ensuring minimal wear on the storage device and thereby improving its performance and lifespan.
[0061] When there is a large amount of user data stored in the storage device and the user data is related to each other, the user data may be stored in multiple stripes, and the operations between the related user data are also related.
[0062] Therefore, in one embodiment of this application, related data blocks in the storage device can be copied to a new stripe (here, the new stripe is the first stripe). What would have required multiple operations for each related data block can be replaced by operations on the entire first stripe, thereby reducing the operational overhead of data blocks (including data block addressing, parity block updates, etc.) and the wear and tear on the storage device.
[0063] Specifically, the data storage method based on RAID technology in this application embodiment may further include: determining the degree of association between a first data block and a second data block based on the operation information of the data blocks; and determining a first stripe based on the first data block and the second data block if the degree of association between the first data block and the second data block is greater than or equal to a first threshold.
[0064] The first data block and the second data block are two different data blocks in the storage device.
[0065] In one possible embodiment, the degree of association between the first data block and the second data block is related to the first parameter and / or the second parameter.
[0066] The first parameter represents the difference in the number of operations between the first data block and the second data block within the first time period.
[0067] The second parameter represents the sum of the time intervals between the operation times of the first data block and the corresponding operation times of the second data block within the first time period.
[0068] The first time period can be a set time period preceding the current time. For example, the first time period could be 48 hours preceding the current time.
[0069] When the degree of association between the first data block and the second data block is related to the first parameter, the following formula (1) can be used to determine the degree of association Q between the first data block and the second data block. i,j .
[0070]
[0071] d i d j , representing the number of operations performed on the first and second data blocks respectively within the first time period, where i represents the i-th data block and j represents the j-th data block. |d i -d j |d represents the absolute value of the difference between the number of operations performed on the first and second data blocks within the first time period. i -d j The smaller the value of |, the more similar the operation frequency of the first data block and the second data block are in the first time period, and the higher the correlation between the first data block and the second data block. The first data block and the second data block should be in the same first stripe.
[0072] When the degree of association between the first data block and the second data block is related to the second parameter, the following formula (2) can be used to determine the degree of association Q between the first data block and the second data block. i,j .
[0073]
[0074] t i,m,j This is the time interval between the m-th operation time of the first data block and the corresponding operation time of the second data block within the first time period. Here, "corresponding" can be understood as the operation time of the m-th operation of the first data block being closest to the operation time of a certain operation of the second data block within the first time period. This is the sum of the time intervals between each operation time of the first data block and the corresponding operation time of the second data block within the first time period. The smaller the value, the more similar the operation times of the first data block and the second data block are within the first time period, and the higher the correlation between the first data block and the second data block. The first data block and the second data block should be in the same first stripe.
[0075] When the degree of correlation between the first data block and the second data block is related to both the first parameter and the second parameter, the following formula (3) can be used to determine the degree of correlation Q between the first data block and the second data block. i,j .
[0076]
[0077] In one possible embodiment, the correlation degree Q calculated by formulas (1) to (3) above can also be applied. i,j After normalization, we get q. i,j q i,j It can be compared with a first threshold to determine whether the first data block and the second data block are two data blocks of the first strip.
[0078] For example, the sigmoid function can be used to measure the correlation Q between the first data block and the second data block. i,j After normalization, we get q. i,j .
[0079] q i,j The range of values is (0, 1). The first threshold can take values greater than 0 and less than 1.
[0080] For example, the first threshold can be 0.8.
[0081] In summary, the embodiments of this application can copy and place the first data block and the second data block with a high degree of correlation into the first stripe, thereby increasing the possibility of operating on the entire stripe, reducing the number of operations on the storage device, and extending the service life of the storage device.
[0082] A storage device consists of n flash memory chips, and the wear and tear on each chip affects the lifespan of the storage device. To improve the lifespan of the storage device, the wear and tear on each flash memory chip needs to be more evenly distributed.
[0083] The parity block is updated most frequently in the first stripe, and it is also a factor affecting the wear and tear of the flash memory chip.
[0084] Therefore, in one embodiment of this application, the number of parity blocks is reasonably allocated to each flash memory chip to prevent some flash memory chips containing parity blocks with higher update frequencies from reaching their lifespan faster, thus affecting the lifespan of the storage device. In other words, this embodiment of the application can make the wear and tear among the various flash memory chips more even, improving the performance and lifespan of the solid-state drive.
[0085] Specifically, the data storage method based on RAID technology in this application embodiment may further include: determining the historical wear level of any flash memory chip based on the operation information of data blocks; and determining the number of parity blocks for each flash memory chip based on the total number of parity blocks in the storage device and the historical wear level of each flash memory chip.
[0086] Therefore, among the n flash memory chips in a storage device, those with lower historical wear levels can be allocated more parity blocks, while those with higher historical wear levels can be allocated fewer parity blocks. This results in a more even distribution of wear across the flash memory chips, extending the lifespan of the storage device.
[0087] Flash memory chips are used to store and update user data and verification data. Therefore, the number of operations performed on the flash memory chip to measure its wear and tear is a more accurate indicator. This number of operations can include write cycles and erase cycles.
[0088] Therefore, in one possible embodiment, for any flash memory chip, the historical wear level of the flash memory chip is the sum of the number of writes and erases of the full data block and / or full parity block of the flash memory chip.
[0089] A storage device comprises n flash memory chips, where one flash memory chip n i Taking e1 data blocks and e2 check blocks as an example, for n i The historical wear level of the flash memory chip is the sum of the number of writes and erases for e1 data blocks, or the historical wear level of the flash memory chip is the sum of the number of writes and erases for e2 parity blocks, or the predicted wear level of the flash memory chip is the sum of the number of writes and erases for both e1 data blocks and e2 parity blocks.
[0090] In one possible implementation, for example, the following embodiment can be used to determine the number of check blocks for each flash memory chip based on the total number of check blocks in the storage device and the historical wear level of each flash memory chip:
[0091] For any given flash memory chip, the number of parity blocks for that chip is determined based on its historical wear level. Furthermore, the number of parity blocks for each flash memory chip is determined based on the total number of parity blocks in the storage device and the parity block value for each chip.
[0092] The number of check blocks parameter is related to the third parameter and / or the fourth parameter.
[0093] The third parameter is the sum of the differences between the historical wear levels of any one flash memory chip and the historical wear levels of all other flash memory chips. In the case of a storage device comprising n flash memory chips, the storage device corresponds to n third parameters.
[0094] The fourth parameter is the maximum value among the n third parameters.
[0095] When the number of parity blocks is related to the third parameter, the following formula (4) can be used to determine the number of parity blocks W of the k-th flash memory chip. k .
[0096]
[0097] s p s k These represent the historical wear levels of the p-th and k-th flash memory chips, respectively. n is the number of flash memory chips in the storage device. It is the sum of the differences between the historical wear level of the p-th flash memory chip and the historical wear level of other flash memory chips.
[0098] When the number of parity blocks is related to the fourth parameter, the following formula (5) can be used to determine the number of parity blocks W of the k-th flash memory chip. k .
[0099]
[0100] Understandably, the third parameter, that is... This is the sum of the differences between the historical wear levels of the p-th flash memory chip and the historical wear levels of other flash memory chips. The storage device consists of n flash memory chips, each corresponding to a third parameter. Therefore, n flash memory chips correspond to n third parameters, which can also be understood as p taking values from 1 to n, thus generating n third parameters. The fourth parameter, i.e. It is the maximum value among the n third parameters.
[0101] When the number of parity blocks is related to both the third and fourth parameters, the following formula (6) can be used to determine the number of parity blocks W for the k-th flash memory chip. k .
[0102]
[0103] The larger the value, the smaller the historical wear of the k-th flash memory chip in the storage device compared to the historical wear of other flash memory chips, and the more parity blocks it can receive.
[0104] In this embodiment, the parity block value parameters of each flash memory chip can be used as the ratio for allocating the number of parity blocks to the flash memory chips. Therefore, the number of parity blocks for each flash memory chip is determined based on the parity block value parameters and the total number of parity blocks in the storage device.
[0105] In summary, the embodiments of this application can reasonably allocate the number of check blocks to each flash memory chip to ensure that the historical wear degree of the flash memory chips among the n flash memory chips of the storage device is more balanced, thereby improving the service life of the storage device.
[0106] In one possible embodiment, the degree of wear and tear on the storage device is related to a fifth parameter and / or a sixth parameter.
[0107] In one possible embodiment, the target substitution method can be determined from r substitution methods by changing parameters. For any given substitution method, the substitution parameters characterize the reasonableness of that substitution method.
[0108] For example, sizing parameters are negatively correlated with the wear and tear of the storage device. Alternatively, sizing parameters may be inversely proportional to the wear and tear of the storage device.
[0109] The fifth parameter is the sum of the differences between the predicted wear level of each flash memory chip and the average predicted wear level of the n flash memory chips.
[0110] The sixth parameter is the maximum value among the predicted wear levels of the n flash memory chips.
[0111] When the interchange parameter is related to the fifth parameter, the following formula (7) can be used to determine the fifth parameter f of the c-th interchange method. c Formula (8) can be used to determine the transposition parameter G for the c-th transposition method. c .
[0112]
[0113] b a Let a be the predicted wear level of the a-th flash memory chip. This represents the average predicted wear level of n flash memory chips in a storage device. n is the number of flash memory chips in the storage device.
[0114] Characterizes the uniformity of predicted wear levels among n flash memory chips in a storage device. The smaller the value, the more uniform the predicted wear of the n flash memory chips, which is more conducive to extending the lifespan of the storage device.
[0115] When the number of check blocks is related to the sixth parameter, the following formula (9) can be used to determine the sixth parameter f of the c-th swapping method. cFormula (10) can be used to determine the transposition parameter G for the c-th transposition method. c .
[0116] f c =max{b a} (9)
[0117]
[0118] The above max{b a} represents the maximum value among the predicted wear levels of n flash memory chips.
[0119] Because the entire storage device becomes obsolete when the wear of a single flash memory chip reaches its maximum, max{b a This is related to the overall wear and tear of the storage device. a The smaller the value of}, the less wear and tear the storage device experiences, and the longer its lifespan.
[0120] When the interchange parameter is related to the fifth and sixth parameters, the following formula (11) can be used to determine the sixth parameter f of the c-th interchange method. c Formula (12) can be used to determine the transposition parameter G for the c-th transposition method. c .
[0121]
[0122] In one possible embodiment, for any given flash memory chip, the predicted wear level of the flash memory chip can be the same as the historical wear level of the flash memory chip.
[0123] In one possible embodiment, for any given flash memory chip, the predicted wear level can be correlated with a seventh parameter and an eighth parameter. For example, the predicted wear level of the flash memory chip can be the sum of the seventh parameter and the eighth parameter.
[0124] The seventh parameter is the sum of the number of writes and erases of the full data block and / or full parity block of the flash memory chip before the data block and parity block are swapped.
[0125] The seventh parameter can be understood as follows: for any swapping method, this swapping method indicates that in any of the first stripes, the parity block is swapped with one of the data blocks. According to this swapping method, before the swapping, the sum of the write and erase counts of the full data block and / or full parity block of any flash memory chip.
[0126] The eighth parameter is at least one of the number of writes, erases, and modifications of the flash memory chip during the second time period after the data block and parity block are swapped.
[0127] The eighth parameter can be understood as follows: for any swapping method, the swapping method indicates that in any of the first stripes, the check block is swapped with one of the data blocks. According to this swapping method, after the swapping, any flash memory chip will have at least one of the following in the second time period: write count, erase count, and modification count.
[0128] The second time period can be the same as or different from the first time period.
[0129] When the storage device needs to frequently write user data, the eighth parameter can be the number of times the flash memory chip is written in the second time period after the data block and parity block are swapped.
[0130] When the storage device needs to frequently write and delete user data, the eighth parameter can be the sum of the number of writes and erases of the flash memory chip in the second time period after the data block and parity block are swapped.
[0131] The other cases for the eighth parameter are similar to those described above and will not be repeated here.
[0132] In this embodiment, the seventh parameter can be understood as a parameter for evaluating the historical operation of the flash memory chip before replacement, or it can be used to evaluate the historical wear and tear of the flash memory chip. The eighth parameter can be understood as the wear and tear of the flash memory chip after replacement within a relatively recent period. Therefore, combining the seventh and eighth parameters to determine the third wear parameter and then the replacement parameter would be more accurate.
[0133] In summary, the above embodiments of this application can determine the target swapping method. For example, an instruction instructing the target swapping method can be sent to the controller of the storage device, so that data blocks and parity blocks in the storage device can be swapped according to the target swapping method. The swapped data blocks can be used to store user data, and the swapped parity blocks can be used to store parity data. As a result, the wear and tear of each flash memory chip in the storage device is more even, which can improve the performance and lifespan of the storage device.
[0134] like Figure 3 As shown in the figure, this application embodiment also provides a block diagram of a data storage system based on RAID technology.
[0135] Data storage systems based on RAID technology can be applied to storage devices. A storage device consists of n flash memory chips, and each flash memory chip includes several data blocks and several parity blocks.
[0136] A data storage system based on RAID technology may include: a first module 310, a second module 320, and a third module 330.
[0137] The first module is used to obtain the operation information of each data block and check block in each flash memory chip.
[0138] The second module is used to determine the target swapping method based on the operation information.
[0139] The target swapping method is the one with the smallest wear level of the storage device among r swapping methods. The wear level of the storage device represents the wear level of the storage device. The swapping method represents the swapping of any data block and parity block in the first stripe. Each first stripe includes (n-1) data blocks and one parity block. r is the product of (n-1) and x, where x is the number of first stripes and x is an integer greater than or equal to 1.
[0140] The third module is used to swap the check block and the data block in the first strip according to the target swapping method, so as to obtain the swapped data block and the swapped check block in the storage device.
[0141] The swapped data block is used to store user data, and the swapped check block is used to store check data.
[0142] This application also provides an electronic device, including a storage device and a processor. The storage device is used to store executable program code, and the processor can be used to call and run the executable program code from the storage device, so that the electronic device executes the data storage method based on RAID technology described above.
[0143] The processor can send instructions to the controller of the storage device to indicate the target swapping method, so that the storage device can swap data blocks and parity blocks according to the target swapping method.
[0144] In other embodiments, a computer program product is also provided. When the computer program product is run on an electronic device such as a computer, the electronic device performs the above-mentioned related steps to realize the visual recognition method for water supply and drainage pipeline maintenance provided in the above embodiments.
[0145] In other embodiments, a computer-readable storage medium is also provided, which stores computer program code. When the computer program code is run on a computer, it causes the computer to execute the above-described related method steps to implement the data storage method based on RAID technology provided in the above embodiments.
[0146] The provided system, device, computer program product, and computer-readable storage medium are all used to execute the data storage method based on RAID technology provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the data storage method based on RAID technology provided above, and will not be repeated here.
[0147] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0148] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A data storage method based on RAID technology, characterized in that, Applied to a storage device, the storage device comprising n flash memory chips, each flash memory chip comprising several data blocks and several parity blocks, where n is an integer greater than or equal to 2, the method comprising: Obtain the operation information of each data block and check block in each of the aforementioned flash memory chips; Based on the operation information of the data block, the degree of association between the first data block and the second data block is determined, wherein the first data block and the second data block are two different data blocks in the storage device; If the correlation between the first data block and the second data block is greater than or equal to a first threshold, a first stripe is determined based on the first data block and the second data block; Based on the operation information, a target swapping method is determined. The target swapping method is the one with the smallest wear level of the storage device among r swapping methods. The wear level of the storage device represents the wear level of the storage device. The swapping method represents the swapping of the data block and the parity block of any first stripe. Each first stripe includes (n-1) data blocks and one parity block. r is the product of (n-1) and x, where x is the number of first stripes and x is an integer greater than or equal to 1. According to the target swapping method, the check block and the data block in the first stripe are swapped to obtain the swapped data block and the swapped check block in the storage device. The swapped data block is used to store user data, and the swapped check block is used to store check data.
2. The data storage method based on RAID technology according to claim 1, characterized in that, The degree of correlation between the first data block and the second data block is related to the first parameter and / or the second parameter. The first parameter represents the difference in the number of operations between the first data block and the second data block within a first time period. The second parameter represents the sum of the time intervals between each operation time of the first data block and the corresponding operation time of the second data block within the first time period.
3. The data storage method based on RAID technology according to claim 1, characterized in that, The method further includes: For any one of the flash memory chips, the historical wear level of the flash memory chip is determined based on the operation information of the data block; The number of check blocks for each flash memory chip is determined based on the total number of check blocks in the storage device and the historical wear level of each flash memory chip.
4. The data storage method based on RAID technology according to claim 3, characterized in that, For any one of the flash memory chips, the historical wear level of the flash memory chip is the sum of the number of writes and erases of the full data block and / or full parity block of the flash memory chip.
5. The data storage method based on RAID technology according to claim 4, characterized in that, The step of determining the number of check blocks for each flash memory chip based on the total number of check blocks in the storage device and the historical wear level of each flash memory chip includes: For any one of the flash memory chips, the number of check blocks for the flash memory chip is determined based on the historical wear level of the flash memory chip. The number of check blocks is related to a third parameter and / or a fourth parameter. The third parameter is the sum of the differences between the historical wear level of any one of the flash memory chips and the historical wear level of other flash memory chips. The fourth parameter is the maximum value among the n third parameters. The number of check blocks for each flash memory chip is determined based on the total number of check blocks in the storage device and the check block value parameters of each flash memory chip.
6. The data storage method based on RAID technology according to claim 1, characterized in that, The wear level of the storage device is related to a fifth parameter and / or a sixth parameter, wherein the fifth parameter is the sum of the differences between the predicted wear level of each of the flash memory chips and the average predicted wear level of the n flash memory chips, and the sixth parameter is the maximum value among the predicted wear levels of the n flash memory chips.
7. The data storage method based on RAID technology according to claim 6, characterized in that, For any flash memory chip, the predicted wear level of the flash memory chip is related to the seventh parameter and the eighth parameter. The seventh parameter is the sum of the number of writes and erases of the full data block and / or the full parity block of the flash memory chip before the data block and the parity block are swapped. The eighth parameter is at least one of the number of writes, erases and modifications of the flash memory chip in a second time period after the data block and the parity block are swapped.
8. A computer-readable storage medium, characterized in that, It includes a computer program or instructions that, when run on a computer, cause the computer to perform the data storage method based on RAID technology as described in any one of claims 1-7.
9. A data storage system based on RAID technology, characterized in that, The system is applied to a storage device, the storage device comprising n flash memory chips, and the system comprising: a module for performing a data storage method based on RAID technology as described in any one of claims 1-7.
Citation Information
Patent Citations
Data management method, data verification method and related device
CN117519582A
Data storage method and related device
CN119271113A