Wear leveling method, apparatus and product
By transferring data and write tasks between RAID groups, the problem of uneven wear in RAID groups is solved, wear leveling is achieved, the lifespan of storage devices is extended, and system reliability is improved.
Patent Information
- Application Number
- CN202410517037.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2025-10-28
AI Technical Summary
In existing RAID technologies, the wear and tear on each RAID group is uneven, which affects the reliability and lifespan of storage devices, and there is a lack of effective wear leveling solutions.
By determining the write loss and wear status of each RAID group, data and write tasks are transferred from heavily worn RAID groups to lightly worn RAID groups based on this information, thus achieving a balanced distribution of wear among RAID groups.
It achieves a balance of wear and tear among RAID groups, extends the lifespan of storage devices, and improves the reliability and efficiency of the storage system.
Smart Images

Figure CN120849080A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data storage, and more specifically, to wear leveling methods, apparatus, and computer program products. Background Technology
[0002] Redundant Arrays of Independent Disks (RAID) is a technology that combines multiple physical disk drives into one or more logical units. It aims to improve data access speed, enhance data security, and increase fault tolerance through data redundancy and parallel processing.
[0003] Depending on the different combinations of disk arrays, RAID technology can be divided into several levels, such as RAID 0, RAID 1, and RAID 5. Each level has its specific data distribution and redundancy methods, suitable for different application scenarios and needs. For example, RAID 0 distributes data across multiple disks using striping technology to provide the highest storage performance. RAID 1 provides data redundancy through data mirroring to ensure data reliability. RAID 5 combines striping and distributed parity, improving both performance and fault tolerance. RAID technology is favored for its excellent data redundancy and I / O performance enhancement capabilities. However, as storage devices are used continuously, their physical wear and tear gradually becomes apparent, directly affecting the reliability and lifespan of the storage devices. Summary of the Invention
[0004] This disclosure provides embodiments of a wear leveling method, apparatus, and computer program product. In a first aspect of the embodiments of this disclosure, a wear leveling method is provided. The method includes determining the write loss of each RAID group based at least on type information of each of a plurality of independent disk redundant array RAID groups. The method further includes determining the wear state of each RAID group based on status information and write loss of each RAID group. The method also includes transferring at least a portion of data and / or write tasks from a first RAID group to a second RAID group based on the write loss and wear state of each RAID group.
[0005] In a second aspect of the embodiments of this disclosure, an electronic device is provided. The electronic device includes one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to perform actions, including determining the write wear of each RAID group based at least on type information of each of a plurality of independent disk redundant array RAID groups. These actions also include determining the wear state of each RAID group based on status information and write wear of each RAID group. Furthermore, these actions include transferring at least a portion of data and / or write tasks from a first RAID group to a second RAID group based on the write wear and wear state of each RAID group.
[0006] In a third aspect of the embodiments of this disclosure, a computer program product is provided, tangibly stored on a non-volatile computer-readable medium and including machine-executable instructions that, when executed, cause a machine to perform actions, including determining the write loss of each RAID group based at least on type information of each of a plurality of independent disk redundant array RAID groups. These actions also include determining the wear state of each RAID group based on status information and write loss of each RAID group. Furthermore, these actions include transferring at least a portion of data and / or write tasks from a first RAID group to a second RAID group based on the write loss and wear state of each RAID group.
[0007] It should be understood that the description in the Summary of the Invention section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0008] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0009] Figure 1 This is a schematic diagram of an example environment in which embodiments of the present disclosure may be implemented;
[0010] Figure 2 This is a flowchart of a wear leveling method according to some embodiments of the present disclosure;
[0011] Figure 3 This is a diagram illustrating the effect of wear equalization according to an embodiment of the present disclosure;
[0012] Figure 4 This is a schematic diagram of wear equalization according to an embodiment of the present disclosure;
[0013] Figure 5 This is a schematic block diagram of an example device that can be used to implement embodiments of the present disclosure. Detailed Implementation
[0014] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0015] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0016] RAID technology combines multiple storage devices into a single unit, known as a RAID array. During write operations, in addition to the actual data writing, extra computation and verification operations are performed to provide redundancy. These additional operations increase the overhead of write operations, leading to write penalties. Because these write penalties are difficult to quantify, it's often assumed that the overhead of write operations is the same across RAID arrays with different attributes. This results in the wear and tear on each RAID array being considered uniform, lacking a cross-RAID wear leveling solution. Consequently, technicians cannot distribute wear evenly across the storage devices during use, necessitating frequent replacements of individual storage devices.
[0017] To address this, this disclosure proposes a wear leveling method. An embodiment of this disclosure includes determining the write loss of each RAID group based at least on the type information of each RAID group in a plurality of independent disk redundant array (RAID) groups. The method further includes determining the wear state of each RAID group based on its status information and write loss. The method also includes transferring at least a portion of data and / or write tasks from a first RAID group to a second RAID group based on the write loss and wear state of each RAID group. This wear leveling method can accurately estimate the true wear of RAID groups by utilizing the write loss caused by different RAID types, and evenly distribute the wear caused by write tasks among the RAID groups based on this true wear, resulting in a more balanced wear level among the RAID groups.
[0018] Figure 1 This is a schematic diagram of an example environment 100 that can be implemented according to embodiments of the present disclosure. Figure 1 As shown, environment 100 may include a management system 101, a network 102, and multiple RAID groups 103. The management system 101 is communicatively coupled to the multiple RAID groups 103 via the network 102. The multiple RAID groups 103 include RAID groups 1031-103N. The network 102 may be, for example, a wide area network (WAN), a local area network (LAN), a wireless network, a public telephone network, an intranet, or any other type of network well known to those skilled in the art.
[0019] In this embodiment, the wear leveling method is executed by the management system 101. The management system 101 may include a processor and storage area for executing embodiments of this disclosure. In this embodiment, the method executed by the management system 101 includes the following steps: The management system 101 determines the write wear of each RAID group 1031-103N based at least on the type information of each RAID group 1031-103N of the multiple independent disk redundant array RAID groups 103. This operation can be performed separately from other operations, for example, it can be performed during idle periods to save computing resources during peak periods. The management system 101 may pre-store the type information of multiple RAID groups 103, or the type information may be provided in real time by the multiple RAID groups 103. In some embodiments, after the write loss of RAID groups 1031-103N is calculated for the first time, the management system 101 can organize it into a table data and store it locally. In this way, each time an embodiment of the present disclosure is executed, if the type information of RAID groups 1031-103N has not changed, the table data can be directly called to determine the write loss of each RAID group 1031-103N, which can improve efficiency and save computing resources.
[0020] The management system 101 determines the wear status of each RAID group 1031-103N based on its status information and write wear. This status information reflects the utilization level of the RAID group 1031-103N. Similarly, the management system 101 can request status information from each RAID group 1031-103N and make a preliminary estimate to determine the wear status of the RAID group 1031-103N before performing other steps.
[0021] The management system 101, based on the write wear and tear status of each RAID group 1031-103N, transfers at least a portion of the data and / or write tasks from the first RAID group to the second RAID group. For example, the first RAID group can be 1031, and the second RAID group can be 1032. After the transfer, a portion of the write tasks for the first RAID group will be handled by the second RAID group, thereby distributing wear and tear between the first and second RAID groups. Each RAID group in the multiple RAID groups 103 is associated with multiple storage devices. These storage devices include, but are not limited to, hard disks (including hard disk drives (HDDs) and solid-state drives (SSDs)), disk arrays of storage systems consisting of multiple disks, and external storage devices such as external hard drives and storage arrays.
[0022] like Figure 1 As shown, in environment 100, network 102 can be used to transfer data between multiple RAID groups 103 and management system 101. Network 102 has a theoretical bandwidth, which refers to the maximum transmission speed supported by network 102. It represents the maximum amount of data that network 102 can transmit under ideal conditions, usually measured in bits per second (bps). For example, if the theoretical bandwidth of network 102 is 100Mbps, it means that under ideal conditions it can transmit 100 megabits of data per second. However, in reality, due to other factors that may exist in the network (e.g., signal interference, bandwidth sharing, transmission delay, etc.), the actual transmission speed may not reach 100Mbps.
[0023] As understood by those skilled in the art, an instance of the management system 101 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Servers can be connected directly or indirectly via wired or wireless communication, and this application does not impose any limitations on this.
[0024] Figure 2 This is a flowchart of a wear leveling method according to some embodiments of the present disclosure. Figure 2As shown, flowchart 200 includes blocks 202-206. In block 202, the write overhead of each RAID group is determined based on the type information of each RAID group in a multi-disk redundant array RAID group. Write overhead (also known as "write penalty") refers to the actual number of write operations that occur after writing one piece of data. As mentioned above, due to the existence of parity operations, calculation operations, etc., more than one write operation actually occurs. To accurately balance wear, it is necessary to first determine the write overhead caused by the write operations. The RAID group type information can include RAID 0, RAID 1, RAID 5, RAID 6, RAID 10, etc., because different RAID types have different write overheads. For example, RAID 5 requires additional read and write operations for each write due to the presence of its parity bit, so its write overhead is relatively high. Typically, each RAID group is associated with multiple storage devices, such as multiple solid-state drives (SSDs).
[0025] In box 204, the wear status of each RAID group is determined based on its status information and write losses. This status information may include, but is not limited to, the number of read / write operations, capacity, and temperature of the storage devices, thereby determining the wear status of each RAID group. Based on write losses, the wear status can be determined relatively accurately from the status information. This status information reflects the historical usage of the storage devices associated with the RAID group.
[0026] In box 206, based on the write wear and tear status of each RAID group, at least a portion of the data and / or write tasks from the first RAID group are transferred to the second RAID group. Write tasks are often associated with the stored data, so to make the write tasks meaningful, the stored data needs to be transferred to the second RAID group first. For example, a data transfer guide can be developed first, instructing which data and / or related write tasks from the first RAID group to be transferred to the second RAID group. The data transfer guide is then executed, for example, transferring data and / or write tasks from a heavily worn RAID group to a less worn RAID group. This operation may include updating the data distribution within the RAID group using data replication, deletion, etc., while ensuring data consistency and integrity. The wear leveling method disclosed herein can accurately estimate the true wear of RAID groups by utilizing the write wear caused by different RAID types, and based on this true wear, distribute the wear caused by write tasks evenly among the RAID groups, resulting in a more balanced wear level among the RAID groups.
[0027] Table 1 shows the distribution of wear levels across multiple RAID groups.
[0028]
[0029]
[0030] As shown in Table 1, the RAID group consisting of storage devices 1-3, with type information indicating RAID 2, has over 1900 write cycles remaining on each storage device. The RAID group consisting of storage devices 4-6, with type information indicating RAID 6, has over 1700 write cycles remaining on each storage device. Therefore, the wear and tear on the different RAID groups is uneven. In box 206, a portion of the data and / or write tasks from the RAID 5 group can be transferred to the RAID 2 group, ensuring that future write operations occur within the RAID 2 group, thus further balancing the wear and tear.
[0031] This disclosure is aimed at Figure 2 The various boxes within the document provide several embodiments. For box 202, the embodiment includes determining a type weight based on type information, where the type weight indicates the actual number of write operations that occur when each piece of data is written. This embodiment also includes determining write overhead at least based on the type weight. As mentioned above, due to the presence of verification operations, computation operations, etc. (which are closely related to attribute information), more than one write operation actually occurs. Quantifying write overhead based on type information in this embodiment allows for an accurate determination of the actual number of write operations, providing a basis for wear leveling.
[0032] In some embodiments, determining type weights includes recording the actual number of times test data is written to a RAID group of the type indicated by type information, wherein the test data includes multiple data sets. Determining type weights also includes determining the type weight of the RAID group based on the number of test data sets and the actual number of writes. For example, the actual number of writes can be determined according to formula (1).
[0033]
[0034] Where j represents the RAID group type information, WP j The write loss is determined based on the type information, where a1 represents the total number of actual writes to the RAID group, and a2 represents the amount of test data. The write loss of each type of RAID group can be calculated relatively accurately using formula (1).
[0035] Table 2 shows the correspondence between type information and write loss calculated according to formula (1).
[0036] Type information Write loss RAID 5 2 RAID 6 3 RAID 10 2
[0037] In some embodiments, Table 2 can be stored locally and called when calculating write loss. Formula (1) only considers type information, and can also be combined with the unit size of the written data to calculate write loss. The unit size of the written data refers to the unit size that needs to be written for each write operation set by the upstream control entity for the RAID group. In some embodiments, the unit size of the written data is divided by the size of the data block as the block weight. This embodiment also includes rounding the block weight as a range weight, which indicates the number of data blocks involved in each write operation. This embodiment also includes determining write loss based on the type weight and the range weight. For example, the number of data blocks involved in each write operation can be determined according to Formula (2).
[0038]
[0039] Where WP represents the number of data blocks involved, s b Indicates the size of the data block, s w This indicates the unit size of the data being written. If WP≤1, then let WP=1. If WP>1, then let WP=int(WP)+1, where int is the integer part. When calculating the write loss, formula (1) and formula (2) can be combined, and the calculation can be performed according to formula (3).
[0040]
[0041] Among them W r This represents write loss. Write loss can be calculated relatively accurately using formula (3).
[0042] For box 204, in some embodiments, the wear status is calculated separately for each RAID. This embodiment includes determining the lifespan of the RAID group based on write losses, according to the cumulative and total number of writes to the multiple storage devices associated with the RAID group. This embodiment also includes determining the utilization rate of the RAID group based on the write capacity and total capacity of the multiple storage devices. This embodiment also includes determining the wear status of the RAID group based on lifespan and utilization rate. The cumulative write count indicates the number of write operations completed by the storage device, but does not indicate the actual number of write operations. By introducing write losses, the actual number of write operations can be accurately determined. Each storage device usually has a predetermined total number of writes. For example, a solid-state drive can usually be written 100,000 times. By calculating the ratio of the cumulative write count to the total number of writes, the wear status of the storage device can be determined in terms of the number of writes. The more capacity is occupied, the more writes are performed. Therefore, the wear status of the storage device can also be determined in terms of capacity occupancy. For example, the lifespan can be calculated according to formula (4).
[0043]
[0044] Among them W i dn represents the lifetime of the i-th RAID group, where i is the ordinal number of the RAID group, k is the ordinal number of the storage device in the i-th RAID group, and the i-th RAID group is associated with a total of K storage devices. i,k wn represents the cumulative number of writes to the k-th storage device in the i-th RAID group. i,k W represents the total number of writes to the k-th storage device in the i-th RAID group. r This represents write loss. In another example, utilization is calculated according to formula (5).
[0045]
[0046] Where i represents the ordinal number of the RAID group, C i This represents the utilization rate of the i-th RAID group, k represents the ordinal number of the storage device in the i-th RAID group, and the i-th RAID group is associated with a total of K storage devices. dc i,k tc represents the write capacity of the k-th storage device in the i-th RAID group. i,k This represents the total capacity of the k-th storage device in the i-th RAID group. Furthermore, formulas (4)-(5) can be combined and the wear status calculated using formula (6).
[0047] WS i =ω w ·W i +ω c ·C i Formula (6)
[0048] Among them WS i ω represents the wear status of the i-th RAID group. w ω represents the first weight. c This represents the second weight. Formula (6) provides a scheme for accurately quantifying the wear status of a RAID group.
[0049] In some embodiments, wear leveling is achieved based on the wear status of the global RAID groups. This embodiment includes determining a global wear status based on each wear status. This embodiment also includes detecting whether the global wear status meets a leveling condition. This embodiment further includes, in response to the global wear status meeting the leveling condition, transferring at least a portion of data and / or write tasks from a first RAID group to a second RAID group based on the write loss and wear status of each RAID group. In this embodiment, a leveling condition is used as a trigger to automatically initiate a wear leveling operation when all wear is uneven. Regarding the global wear status, in some embodiments, an average wear status is determined based on the wear status of each RAID group. This embodiment also includes determining a wear standard deviation based on the wear status of each RAID group and the average wear status. This embodiment also includes determining global wear leveling based on the wear standard deviation and the average wear status. The global wear status indicates an overall estimate of the wear status including multiple RAID groups. For example, the average wear status can be calculated according to formula (7).
[0050]
[0051] Among them WS average WSi represents the average wear status, N represents the number of RAID groups, and WSi represents the wear status of the i-th RAID group. In one example, the wear standard deviation can be calculated according to formula (8).
[0052]
[0053] Where σ represents the wear standard deviation, N represents the number of RAID groups, and WS i WS represents the wear status of the i-th RAID group. average This represents the average wear condition. In one example, the global wear condition can be calculated using formula (9).
[0054]
[0055] Where λ represents the global wear state, σ represents the wear standard deviation, and WS average Indicates the average wear condition, WS i Let N represent the wear state of the i-th RAID group, and N represent the number of RAID groups. The global wear state, which indicates the overall wear deviation, can be accurately determined according to formula (9). In some alternative embodiments, the global wear state is determined as the difference between the wear states of the first RAID group and the second RAID group. This can reduce the polarization of individual RAID groups.
[0056] In some embodiments, each RAID group includes multiple relocation units, each relocation unit is associated with a set of data blocks, each relocation unit records the number of writes, and the operation of transferring a portion of the data based on the write loss and wear status of each RAID group includes determining the write heat of each relocation unit in the first RAID group based on the write loss of the first RAID group and the historical write count of each relocation unit. The operation of transferring a portion of the data also includes determining the relocation unit with the highest write heat as the source relocation unit. The operation of transferring a portion of the data also includes determining the write heat of each relocation unit in the second RAID group based on the write loss of the second RAID group and the write count of each relocation unit. The operation of transferring a portion of the data also includes determining the relocation unit with the lowest write heat as the destination relocation unit. The operation of transferring a portion of the data also includes transferring the data and / or write tasks of the source relocation unit to the destination relocation unit. In some embodiments, the product of the write loss of the first RAID group and the write count of each relocation unit is used as the write heat of each relocation unit. For example, the write heat of each relocation unit can be calculated according to formula (10).
[0057]
[0058] where t i,m W represents the write hotness of the m-th relocation unit in the i-th RAID group. r W represents write loss. i,m Indicates the number of writes, WP j This indicates the write overhead determined based on the type information; int represents the rounding operation; s b Indicates the size of the data block, s w This indicates the unit size of the data being written. According to formula (10), data and / or write tasks written to the most frequently used relocation unit can be transferred to the relocation units of other RAID groups with less wear, thus enabling very precise wear leveling between RAID groups.
[0059] Figure 3 This is a diagram illustrating the effect of wear equalization according to an embodiment of this disclosure. Figure 3As shown, the relocation units of each RAID group are placed in a storage pool 302. Before the transfer, the write operation 306 for the relocation unit 304 should write data to the RAID group 308 that includes the relocation unit 304. The type information of the RAID group 308 indicates RAID 5, and the unit size of the written data is 8KB. The write operation 306 is ultimately written to the data block of the storage device 310 of the RAID group 308. The data block size of the storage device associated with the RAID group 308 is 2KB, so one write to the storage device will involve 4 data blocks. As shown in Table 2, the write loss caused by the RAID 5 type is 2, so it can be determined that the actual wear caused to the RAID group 308 by the write operation 306 is equivalent to the wear caused by 2 × 4 = 8 write operations. After the transfer, the write operation 306 will write to the RAID group 312, as indicated by the dashed arrow. The wear of the write operation 306 will be transferred to the RAID group 312.
[0060] Figure 4 This is a wear leveling diagram based on a disclosed embodiment. It begins at 402. At 404, the write loss of each RAID group is calculated based on the type information of each RAID group in a multi-disk redundant array RAID group. In this embodiment, the write loss can be calculated according to formulas (1)-(3). First, the type weight, i.e., the number of actual write operations that occur when each data is written, is determined according to formula (1). Then, the write loss based on the type information is determined according to the type weight. Alternatively, the write loss based on the type information can be obtained directly from Table 2. Furthermore, the write loss can also be calculated by combining the unit size of the written data. According to formula (2), the unit size of the written data is divided by the size of the data block as the block weight, and the block weight is rounded down as the range weight. The write loss based on the unit size of the written data is determined according to the type weight and the range weight. Finally, the first two are combined according to formula (3) to obtain the write loss.
[0061] At position 406, the wear status of each RAID group is calculated, and the global wear status is also calculated at position 406. The wear status of each RAID group can be calculated using formulas (4)-(6). On one hand, according to formula (4), based on write loss, the lifespan of the RAID group is determined according to the cumulative and total write counts of the multiple storage devices associated with the RAID group. On the other hand, according to formula (5), the utilization rate of the RAID group is determined according to the write capacity and total capacity of the multiple storage devices. Finally, according to formula (6), the wear status of the RAID group is determined based on its lifespan and utilization rate. For the global wear status, the wear standard deviation is determined using formula (7) based on the wear status of each RAID group and the average wear status. Then, the global wear balance is determined according to formula (8) based on the wear standard deviation and the average wear status. The global wear status can also be calculated using formula (9).
[0062] At point 408, it is determined whether the global wear state meets the equilibrium condition, which in this embodiment is the relationship between the global wear state λ and the wear threshold θ. If λ ≥ θ, the transfer operation begins at point 410; otherwise, the wear state is updated at point 406. At point 410, the RAID group with the most severe wear is selected as the first RAID group, and the RAID group with the least wear is selected as the second RAID group. Further, at point 410, the write heat of multiple relocation units in the first RAID group with more severe wear is calculated. For example, the write heat of each relocation unit can be calculated according to formula (10). At point 412, one or more relocation units with higher write heat are selected from the many relocation units in the first RAID group and added to the transfer guide to generate the transfer guide.
[0063] At point 414, it is determined whether the wear status of the first RAID group is less than or equal to that of the second RAID group if the transfer operation is performed according to the transfer guide. If so, the transfer operation is valid, and the transfer is executed at point 416 according to the transfer guide. Otherwise, it is necessary to return to point 412 to update the transfer guide. The method for updating the transfer guide is to continue selecting relocation units with higher write activity from the relocation units of the first RAID group and add them to the transfer guide. At point 414, it is also possible to determine whether λ is less than or equal to θ. If λ < θ, the transfer operation is valid, and the transfer is executed at point 416 according to the transfer guide. Otherwise, it is necessary to return to point 412 to update the transfer guide in the aforementioned manner. After determining that the transfer operation based on the transfer guide is valid at point 414, the process proceeds to point 416 to execute the transfer, that is, to transfer the data and / or write tasks of one or more relocation units to another RAID group according to the transfer guide. Finally, the process ends at point 418.
[0064] Figure 5This is a schematic block diagram of an example device 500 that can be used to implement embodiments of the present disclosure. As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 502 or loaded from storage unit 508 into random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.
[0065] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0066] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as method 200. For example, in some embodiments, method 200 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform method 200 by any other suitable means (e.g., by means of firmware).
[0067] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.
[0068] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0069] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Furthermore, although operations are depicted in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0070] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to computer-readable storage media within the respective computing / processing device.
[0071] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0072] Various aspects of this disclosure have been described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0073] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0074] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operations or steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0075] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0076] Various embodiments of the present disclosure have been described above. The description is exemplary and exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market of the various embodiments, or to enable others skilled in the art to understand the various embodiments disclosed herein.
Claims
1. A wear leveling method, comprising: The write loss of each RAID group is determined at least based on the type information of each RAID group in a multi-disk redundant array RAID group; The wear status of each RAID group is determined based on the status information of each RAID group and the write loss. as well as Based on the write loss and wear status of each RAID group, at least a portion of the data and / or write tasks of the first RAID group are transferred to the second RAID group.
2. The method of claim 1, wherein determining the write loss of each RAID group based at least on the type information of each RAID group of a plurality of independent disk redundant array RAID groups comprises: A type weight is determined based on the type information, wherein the type weight indicates the number of actual write operations that occur when each piece of data is written; as well as The write loss is determined at least based on the type weight.
3. The method according to claim 2, wherein determining the type weight based on the type information includes: Record the actual number of times test data is written to the RAID group of the type indicated by the type information, wherein the test data includes multiple data; as well as The type weight of the RAID group is determined based on the amount of test data and the actual number of writes.
4. The method of claim 2, wherein determining the write loss based at least on the type weight comprises: Divide the unit size of the written data by the size of the data block to obtain the block weight; The block weights are rounded down to obtain range weights, which indicate the number of data blocks involved in each write operation. as well as The write loss is determined based on the type weight and the range weight.
5. The method of claim 1, wherein each RAID group is associated with multiple storage devices, and determining the wear state of each RAID group based on the status information of each RAID group and the write loss comprises: Perform the following operations for each RAID group: Based on the write loss, the lifespan of the RAID group is determined according to the cumulative and total number of writes to the multiple storage devices associated with the RAID group; The utilization rate of the RAID group is determined based on the write capacity and total capacity of the multiple storage devices; as well as The wear status of the RAID group is determined based on the lifespan and the usage rate.
6. The method of claim 1, wherein transferring at least a portion of the data and / or write tasks from the first RAID group to the second RAID group comprises: Determine the global wear status based on each wear state; Detect whether the global wear state meets the equilibrium condition; as well as In response to the global wear state satisfying the balancing condition, based on the write loss of each RAID group and the wear state, at least a portion of the data and / or write tasks of the first RAID group are transferred to the second RAID group.
7. The method of claim 6, wherein determining the global wear state based on each wear state comprises: The average wear status is determined based on the wear status of each RAID group; The wear standard deviation is determined based on the wear status of each RAID group and the average wear status; as well as The global wear balance is determined based on the wear standard deviation and the average wear state.
8. The method of claim 6, wherein determining the global wear state based on each wear state comprises: The difference between the wear state of the first RAID group and the wear state of the second RAID group is determined as the global wear state.
9. The method of claim 6, wherein each RAID group includes a plurality of relocation units, each relocation unit is associated with a set of data blocks, each relocation unit records a write count, and transferring at least a portion of the data and / or write tasks of the first RAID group to the second RAID group based on the write loss of each RAID group and the wear state comprises: The write heat of each relocation unit in the first RAID group is determined based on the write loss of the first RAID group and the historical write count of each relocation unit. The relocation cell with the highest writing frequency is identified as the source relocation cell; The write heat of each relocation unit in the second RAID group is determined based on the write loss of the second RAID group and the number of writes to each relocation unit. The target relocation cell will be determined by writing to the relocation cell with the lowest heat. as well as The data and / or write task of the source relocation unit is transferred to the destination relocation unit.
10. The method of claim 9, wherein determining the write heat of each relocation unit of the first RAID group based on the write loss of the first RAID group and the number of writes per relocation unit comprises: The write heat of each relocation unit is calculated by multiplying the write loss of the first RAID group by the number of writes in each relocation unit.
11. An electronic device, comprising: At least one processor; as well as Coupled to the at least one processor and having instructions stored thereon, the instructions, when executed by the at least one processor, cause the electronic device to perform actions, the actions including: The write loss of each RAID group is determined at least based on the type information of each RAID group in a multi-disk redundant array RAID group; The wear status of each RAID group is determined based on the status information of each RAID group and the write loss; and Based on the write loss and wear status of each RAID group, at least a portion of the data and / or write tasks of the first RAID group are transferred to the second RAID group.
12. The electronic device of claim 11, wherein determining the write loss of each RAID group based at least on the type information of each RAID group of a plurality of independent disk redundant array RAID groups comprises: A type weight is determined based on the type information, wherein the type weight indicates the number of actual write operations that occur when each piece of data is written; as well as The write loss is determined at least based on the type weight.
13. The electronic device of claim 12, wherein determining the type weight based on the type information includes: Record the actual number of times test data is written to the RAID group of the type indicated by the type information, wherein the test data includes multiple data; as well as The type weight of the RAID group is determined based on the amount of test data and the actual number of writes.
14. The electronic device of claim 12, wherein determining the write loss based at least on the type weight comprises: Divide the unit size of the written data by the size of the data block to obtain the block weight; The block weights are rounded down to obtain range weights, which indicate the number of data blocks involved in each write operation. as well as The write loss is determined based on the type weight and the range weight.
15. The electronic device of claim 11, wherein each RAID group is associated with multiple storage devices, and determining the wear state of each RAID group based on the status information of each RAID group and the write loss comprises: Perform the following operations for each RAID group: Based on the write loss, the lifespan of the RAID group is determined according to the cumulative and total number of writes to the multiple storage devices associated with the RAID group; The utilization rate of the RAID group is determined based on the write capacity and total capacity of the multiple storage devices; as well as The wear status of the RAID group is determined based on the lifespan and the usage rate.
16. The electronic device of claim 11, wherein transferring at least a portion of the data and / or write tasks from the first RAID group to the second RAID group comprises: Determine the global wear status based on each wear state; Detect whether the global wear state meets the equilibrium condition; as well as In response to the global wear state satisfying the balancing condition, based on the write loss of each RAID group and the wear state, at least a portion of the data and / or write tasks of the first RAID group are transferred to the second RAID group.
17. The electronic device of claim 16, wherein determining the global wear state based on each wear state comprises: The average wear status is determined based on the wear status of each RAID group; The wear standard deviation is determined based on the wear status of each RAID group and the average wear status; as well as The global wear balance is determined based on the wear standard deviation and the average wear state.
18. The electronic device of claim 16, wherein determining the global wear state based on each wear state comprises: The difference between the wear state of the first RAID group and the wear state of the second RAID group is determined as the global wear state.
19. The electronic device of claim 16, wherein each RAID group includes a plurality of relocation units, each relocation unit is associated with a set of data blocks, each relocation unit records a write count, and transferring at least a portion of the data and / or write tasks of the first RAID group to the second RAID group based on the write loss of each RAID group and the wear state comprises: The write heat of each relocation unit in the first RAID group is determined based on the write loss of the first RAID group and the historical write count of each relocation unit. The relocation cell with the highest writing frequency is identified as the source relocation cell; The write heat of each relocation unit in the second RAID group is determined based on the write loss of the second RAID group and the number of writes to each relocation unit. The target relocation cell will be determined by writing to the relocation cell with the lowest heat. as well as The data and / or write task of the source relocation unit is transferred to the destination relocation unit.
20. A computer program product tangibly stored on a non-volatile computer-readable medium and comprising machine-executable instructions that, when executed, cause a machine to: The write loss of each RAID group is determined at least based on the type information of each RAID group in a multi-disk redundant array RAID group; The wear status of each RAID group is determined based on the status information of each RAID group and the write loss; and Based on the write loss and wear status of each RAID group, at least a portion of the data and / or write tasks of the first RAID group are transferred to the second RAID group.