Data storage method, device and equipment
By dividing the disks in the storage pool into free space and energy-saving space, and converting the disk state according to the state, the problem of high energy consumption of the storage pool is solved, and energy consumption is reduced and efficiency is improved without affecting the storage function.
Patent Information
- Application Number
- CN202310813455.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-01-07
AI Technical Summary
When processing data, the existing storage pools consume a lot of energy, which increases energy costs.
By dividing the disks in the storage pool into free space and energy-saving space, using the management device to obtain the disk state, and convert the disk from the working state to the sleep state according to preset conditions, thereby optimizing the disk usage state and reducing energy consumption.
While not affecting the function of the storage pool, the energy consumption of the storage pool is reduced, and the available space is expanded to ensure efficiency when the business is busy, and the available space is reduced to reduce unnecessary energy consumption when it is idle, and the energy saving effect is improved.
Smart Images

Figure CN119271111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data storage method, device and equipment. Background Art
[0002] The development of computer technology and its wide application in various fields have generated a large demand for data storage. Disk storage is a common way to store data. Disk storage consumes a lot of energy, making energy costs (such as electricity costs, etc.) the focus of data center operation and maintenance.
[0003] Storage pools mostly use redundant arrays of independent disks (RAID) architecture. Currently, when a storage pool is working, the data to be stored is evenly scattered and stored in each disk in the storage pool. In other words, the probability of each disk in the storage pool being in input and output (IO) request is the same. This causes all disks in the storage pool to be in working state, which makes the storage pool consume more energy. Summary of the invention
[0004] The present application provides a data storage method, apparatus and device, which can reduce the energy consumption of a storage pool.
[0005] In a first aspect, a data storage method is provided, which is applied to a management device, which is used to manage a storage pool, and the storage pool includes a first disk group and a second disk group; wherein the disks in the first disk group are in a working state and are used to process input and output (IO) requests; and the disks in the second disk group are in a dormant state; the method includes: obtaining the state of the disks in the first disk group, the state of the disks including one or any combination of the degree of wear of the disks, the port bandwidth utilization of the disks, and the space utilization of the disks; when the state of the disks in the first disk group meets a preset first condition, controlling the first disk in the second disk group to enter a working state from a dormant state, and dividing the first disk in a working state into the first disk group to update the first disk group.
[0006] The method divides the disks in the same storage pool into available space and energy-saving space. The disks in the energy-saving space are in a dormant state, which can save the energy consumption of the storage pool. The disks in the available space are in a working state, which can ensure the normal operation of the storage pool and realize the data storage function. In this way, the energy consumption of the storage pool is reduced without affecting the storage function of the storage pool.
[0007] Furthermore, the method expands the available space when the storage service of the storage pool is busy, thereby ensuring the efficiency of storing data in the storage pool.
[0008] In a possible implementation, the state of the disk includes the wear of the disk; the method also includes: determining that the wear of the second disk in the first disk group is the smallest; when a write request is obtained, writing the data requested by the write request to the second disk.
[0009] In this implementation, data that needs to be stored is written preferentially to disks with less wear, thereby ensuring balanced wear of the disks in the storage pool and increasing the overall life of the storage pool.
[0010] In one possible implementation, the wear degree of the third disk in the first disk group is less than the wear degree of other disks in the first disk group except the second disk and the third disk, and the write request includes two write requests; writing the data requested by the write request to the second disk includes: writing the data requested by one of the two write requests to the second disk, and writing the data requested by the other write request to the third disk.
[0011] In this implementation, when there are multiple write requests to be processed, data is preferentially written to the disk with less wear and tear while two write requests are executed concurrently, thereby improving the execution efficiency of write requests while ensuring the balance of wear on the disks in the storage pool.
[0012] In one possible implementation, the physical address mapped by the address of the logical block LB used to carry the data requested by the IO request belongs to a disk in the second disk group; the method also includes: modifying the physical address mapped by the address of the LB to the physical address of the disk in the first disk group to forward the IO request to the disk in the first disk group.
[0013] In this implementation, by modifying the LBA, the write request originally sent to the dormant disk is forwarded to the working disk, thereby avoiding the dormant disk from being awakened and ensuring energy saving.
[0014] In a possible implementation, the method further includes: when the state of the disk in the first disk group meets a preset second condition, controlling the fifth disk in the first disk group to enter a sleep state from a working state, and assigning the fifth disk in the sleep state to the second disk group.
[0015] This implementation method can reduce the available space and expand the energy-saving space when the storage pool is idle, thereby reducing unnecessary energy consumption of the storage pool and improving energy-saving effects.
[0016] In a possible implementation, before controlling the fifth disk in the first disk group to enter the dormant state from the working state, the method further includes: migrating data in the fifth disk to other disks in the first disk group.
[0017] In this implementation, before a disk enters a dormant state, data on the disk is migrated to a disk in a working state, so that the data on the disk can be accessed during the dormant state of the disk.
[0018] In a second aspect, a management device is provided, which is used to manage a storage pool, which includes a first disk group and a second disk group; wherein the disks in the first disk group are in a working state, and are used to process input and output (IO) requests; and the disks in the second disk group are in a dormant state; the management device includes: an acquisition unit, used to acquire the state of the disks in the first disk group, the state of the disks including one or any combination of the degree of wear of the disks, the port bandwidth utilization of the disks, and the space utilization of the disks; a control unit, used to control the first disk in the second disk group to enter a working state from a dormant state when the state of the disks in the first disk group meets a preset first condition, and to divide the first disk in a working state into the first disk group to update the first disk group.
[0019] In one possible implementation, the state of the disk includes the degree of wear of the disk; the management device also includes: a determination unit, used to determine that the second disk in the first disk group has the smallest degree of wear; and a writing unit, used to write the data requested by the write request to the second disk when a write request is obtained.
[0020] In one possible implementation, the wear degree of the third disk in the first disk group is less than the wear degree of other disks in the first disk group except the second disk and the third disk, and the write request includes two write requests; the write unit is used to: write the data requested to be written by one of the two write requests to the second disk, and write the data requested to be written by the other write request to the third disk.
[0021] In one possible implementation, the physical address mapped to the address of the logical block LB used to carry the data requested by the IO request belongs to a disk in the second disk group; the management device also includes: a modification unit, used to modify the physical address mapped to the address of the LB to the physical address of the disk in the first disk group, so as to forward the IO request to the disk in the first disk group.
[0022] In one possible implementation, the control unit is further used to: when the state of the disk in the first disk group meets a preset second condition, control the fifth disk in the first disk group to enter a sleep state from a working state, and assign the fifth disk in the sleep state to the second disk group.
[0023] In a possible implementation manner, the control unit is further configured to: before controlling the fifth disk in the first disk group to enter the sleep state from the working state, migrate data in the fifth disk to other disks in the first disk group.
[0024] In a third aspect, a computing device is provided, comprising a processor and a memory; wherein the memory stores computer instructions, and the processor is used to execute the computer instructions to implement the method provided in the first aspect.
[0025] In a fourth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method provided in the first aspect.
[0026] According to a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computer device, the computer device executes the method provided in the first aspect.
[0027] According to a third aspect, a computing device is provided, comprising a processor and a memory; wherein the memory stores computer instructions, and the processor is used to execute the computer instructions to implement the method provided in the first aspect.
[0028] According to a fourth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method provided in the first aspect.
[0029] According to a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computer device, the computer device executes the method provided in the first aspect.
[0030] The beneficial effects of the second to fifth aspects can be referred to the above introduction to the beneficial effects of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a storage system provided in an embodiment of the present application;
[0032] Figure 2 A flowchart of a data storage solution provided in an embodiment of the present application;
[0033] Figure 3 A functional schematic diagram of a decision maker provided in an embodiment of the present application;
[0034] Figure 4 A functional schematic diagram of an IO controller provided in an embodiment of the present application;
[0035] Figure 5 A flowchart of a data storage method provided in an embodiment of the present application;
[0036] Figure 6 A schematic diagram of the structure of a management device provided in an embodiment of the present application;
[0037] Figure 7 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings, wherein "multiple" refers to two or more.
[0039] Energy conservation of storage systems has become a focus of the industry due to factors such as energy conservation and emission reduction as well as operation and maintenance costs. Generally speaking, in a storage system, multiple disks form a storage pool. Among them, a storage pool is a logical storage instance composed of multiple disks, providing data read and write functions.
[0040] An embodiment of the present application provides a data storage solution, which can divide a part of the disks in the same storage pool into available space and another part of the disks into energy-saving space. The disks in the available space are in normal working state, and the disks in the energy-saving space are in a dormant state. When an IO request is received, the disks in the available space are used to process the IO request. In this way, while ensuring that the IO request is processed normally, the energy consumption of the storage pool is reduced. In the embodiment of the present application, the available space may also be referred to as the first disk group, and the energy-saving space may also be referred to as the second disk group.
[0041] Next, the data storage solution provided in the embodiment of the present application is introduced in detail.
[0042] The normal working state of the disk may be referred to as the working state, which refers to the state in which the disk can be read and written normally. The dormant state of the disk refers to the power-off state or the low power consumption state. In other words, a disk in the normal working state can be read and written normally, so that IO requests can be processed normally. A disk in the dormant state is in the power-off state or the low power consumption state, with no energy consumption or low energy consumption.
[0043] The low power consumption state is a power saving state of the disk, which refers to a state in which the energy consumption of the disk is reduced by reducing the frequency, shutting down the power of some modules (such as cache, processor) in the disk, and the like.
[0044] IO request is a general term for read request and write request. In other words, IO request can be a read request, a write request, or both.
[0045] Figure 1 A storage system 100 provided by an embodiment of the present application is shown. As shown in the figure, the storage system 100 includes a storage pool 110 and a management module 120.
[0046] Among them, the storage pool 110 may be composed of multiple disks such as disk 111, disk 112, disk 113, disk 114, disk 115, and disk 116. In some embodiments, the disks constituting the storage pool 110 may be homogeneous. That is, the disks in the storage pool 110 are disks of the same type, for example, all are solid state disks (SSDs) or all are hard disk drives (HDDs). In some embodiments, the disks constituting the storage pool 110 may be heterogeneous. That is, the storage pool 110 includes disks of different types. Specifically, some of the disks in the storage pool 110 are SSDs, and other disks are HDDs.
[0047] The management module 120 is a module, chip, circuit, device, equipment or platform with data processing capabilities. The management module 120 may also be referred to as an energy-saving management module, which is used to execute the data storage solution provided in the embodiment of the present application. For example, a disk in a dormant state in the storage pool 110 (i.e., a disk in the energy-saving space) may be controlled to enter a working state (i.e., enter an available space), or a disk in a working state (i.e., a disk in the available space) may be controlled to enter a dormant state (i.e., enter an energy-saving space). Among them, a disk in a dormant state entering a working state may be referred to as capacity expansion, i.e., the capacity for storing data is increased. A disk in a working state entering a dormant state may be referred to as capacity reduction, i.e., the capacity for storing data is reduced.
[0048] In some embodiments, the management module 120 includes a sensor 121, a decision maker 122, and an IO controller 123. The sensor 121 is used to obtain the status of the disks in the storage pool 110, and transmit the obtained status to the decision maker 122. Exemplarily, the status obtained by the sensor 121 is the status of the disks in the available space. The decision maker 122 can make decisions based on the status of the disks, for example, to expand the capacity (i.e., to divide one or more disks from the energy-saving space to the available space), or to reduce the capacity (i.e., to divide one or more disks from the energy-saving space to the available space), or neither to expand the capacity nor to reduce the capacity. The IO controller 123 is used to forward IO requests to the disks in the available space, so that the disks in the available space process the IO requests, thereby avoiding waking up the disks in the energy-saving space.
[0049] In some embodiments, Figure 1As shown, the management module 120 also includes an energy-saving switch 124. The energy-saving switch 124 is used to receive a control instruction, and in response to the control instruction, start or shut down the sensor 121, the decision maker 122, and the IO controller 123. Among them, when the control instruction is an instruction to turn on the energy-saving mode, the energy-saving switch 124 starts the sensor 121, the decision maker 122, and the IO controller 123, so that the management module 120 can execute the data storage solution provided in the embodiment of the present application. When the control instruction is an instruction to turn off the energy-saving mode, the energy-saving switch 124 shuts down the sensor 121, the decision maker 122, and the IO controller 123.
[0050] like Figure 1 As shown, the storage system 100 also includes a control module 130. The control module 130 can receive user operations, generate control instructions based on the user operations, and send the control instructions to the energy-saving switch 124. Thus, through the control module 130, the user can freely choose whether to store data according to the data storage solution provided in the embodiment of the present application. Exemplarily, the control module 130 can be implemented by software, for example, it can be an application (application) or a process (process).
[0051] In some embodiments, Figure 1 As shown, the control module 130 may be disposed outside the storage pool 110 , for example, disposed on a host for utilizing the storage pool 110 for data storage.
[0052] In some embodiments, Figure 1 As shown, the management module 120 may be disposed in the storage pool 110 .
[0053] The above example introduces the storage system 100 provided in the embodiment of the present application. Next, in conjunction with the storage system 100, the process of the data storage solution provided in the embodiment of the present application is introduced.
[0054] See also Figure 2 In some embodiments, before implementing the data storage solution provided by the embodiment of the present application, the management module 120 may first execute 201 to determine whether the storage pool 110 is in the energy-saving mode. If the storage pool is in the energy-saving mode, the subsequent process may be started. Exemplarily, if the sensor 121, the decision maker 122, and the IO controller 123 in the management module 120 are in an on state or a working state, it can be confirmed that the storage pool 110 is in the energy-saving mode. Otherwise, it can be confirmed that the storage pool 110 is not in the energy-saving mode.
[0055] In some embodiments, the storage pool 110 may be in the energy-saving mode by default. That is, without step 201, it may be confirmed that the storage pool 110 is in the energy-saving mode.
[0056] When the storage pool 110 is in the energy-saving mode, the management module 120 may execute step 202 to obtain the status of the disk and make a decision based on the status of the disk. The details are as follows.
[0057] In step 202, the status of the disk in the available space is specifically obtained, that is, the status of the disk in the storage pool 110 in working state is obtained. In some embodiments, the sensor 121 can obtain the status of the disk. For example, the sensor 121 can monitor the status of the disk to obtain the status of the disk. For another example, the disk can report the status of the disk to the sensor 121 in real time or periodically.
[0058] In some embodiments, the state of the disk may refer to the wear of the disk. The wear refers to the ratio of the number of times the disk has been erased to the maximum number of times the disk can be erased. The maximum number of times the disk can be erased refers to the life of the disk, which is set when the disk is shipped from the factory or designed. The number of times the disk has been erased can be obtained by the amount of data written to the disk. The amount of data written to the disk is the amount of data written to the disk. The data written to the disk includes the data currently stored in the disk and the data that was historically stored on the disk but has been erased.
[0059] In some embodiments, the state of the disk may refer to the port bandwidth utilization of the disk. In one example, the port bandwidth utilization may be the ratio of the actual rate through the port to the maximum rate of the port. In one example, the port bandwidth utilization may be the ratio of the input / output operations per second (IOPS) of the disk to the maximum IOPS of the disk.
[0060] In some embodiments, the state of the disk may refer to the space utilization of the disk, wherein the space utilization refers to the ratio of the used storage space of the disk to the total storage space of the disk.
[0061] In some embodiments, the state of the disk may include any two of the wear degree of the disk, the port bandwidth utilization of the disk, and the space utilization of the disk. In some embodiments, the state of the disk may include the wear degree of the disk, the port bandwidth utilization of the disk, and the space utilization of the disk.
[0062] In step 202, a decision may be made based on the state of the disk. Specifically, the decision may be made based on the state of all disks in the available space. When the state of the disks in the available space meets the first condition, a decision to expand the capacity is obtained. When the state of the disks in the available space meets the second condition, a decision to reduce the capacity is obtained. The details are as follows.
[0063] In some embodiments, when the state of the disk refers to the wear of the disk, the first condition may be a preset wear threshold A1, and the second condition may be a preset wear threshold A2. The wear threshold A1 is greater than the wear threshold A2. In one example, the wear threshold A1 may be 50%-80%. In one example, the wear threshold A1 may be 50%. In one example, the wear threshold A1 may be 60%. In one example, the wear threshold A1 may be 70%. In one example, the wear threshold A1 may be 80%. In one example, the wear threshold A2 may be 30%-40%. In one example, the wear threshold A2 may be 30%. In one example, the wear threshold A2 may be 40%.
[0064] The average wear value of all disks in the available space can be calculated. If the average wear value is greater than the wear threshold A1, it is confirmed that the state of the disk meets the first condition. If the average wear value is less than the wear threshold A2, it is confirmed that the state of the disk meets the second condition.
[0065] In some embodiments, when the state of the disk refers to the port bandwidth utilization of the disk, the first condition may be a preset bandwidth utilization threshold B1, and the second condition may be a preset bandwidth utilization threshold B2. The bandwidth utilization threshold B1 is greater than the bandwidth utilization threshold B2. In one example, the bandwidth utilization threshold B1 may be 50%-80%. In one example, the bandwidth utilization threshold B1 may be 50%. In one example, the bandwidth utilization threshold B1 may be 60%. In one example, the bandwidth utilization threshold B1 may be 70%. In one example, the bandwidth utilization threshold B1 may be 80%. In one example, the bandwidth utilization threshold B2 may be 10%-40%. In one example, the bandwidth utilization threshold B2 may be 10%. In one example, the bandwidth utilization threshold B2 may be 20%. In one example, the bandwidth utilization threshold B2 may be 30%. In one example, the bandwidth utilization threshold B2 may be 40%.
[0066] The average port bandwidth utilization of all disks in the available space can be calculated. If the average port bandwidth utilization is greater than the bandwidth utilization threshold B1, it is confirmed that the state of the disk meets the first condition. If the average port bandwidth utilization is less than the bandwidth utilization threshold B2, it is confirmed that the state of the disk meets the second condition. In one example, if the average port bandwidth utilization is less than the bandwidth utilization threshold B2, and the IO queue of the disk is less than 1, that is, the storage pool 110 has no IO requests waiting to be processed, it is confirmed that the disk in the available space is idle, and it is confirmed that the state of the disk meets the second condition.
[0067] In some embodiments, when the state of the disk refers to the space utilization of the disk, the first condition may be a preset space utilization threshold C1, and the second condition may be a preset space utilization threshold C2. Wherein, the space utilization threshold C1 is greater than the space utilization threshold C2. In one example, the space utilization threshold C1 may be 50%-80%. In one example, the space utilization threshold C1 may be 50%. In one example, the space utilization threshold C1 may be 60%. In one example, the space utilization threshold C1 may be 70%. In one example, the space utilization threshold C1 may be 80%. In one example, the space utilization threshold C2 may be 10%-40%. In one example, the space utilization threshold C2 may be 10%. In one example, the space utilization threshold C2 may be 20%. In one example, the space utilization threshold C2 may be 30%. In one example, the space utilization threshold C2 may be 40%.
[0068] The average space utilization of all disks in the available space may be calculated. If the average space utilization is greater than the space utilization threshold C1, it is confirmed that the state of the disk meets the first condition. If the average space utilization is less than the space utilization threshold C2, it is confirmed that the state of the disk meets the second condition.
[0069] In some embodiments, when the state of the disk is the wear of the disk and the port bandwidth utilization of the disk, if the average wear of all disks in the available space is greater than the wear threshold A1, or the average port bandwidth utilization of all disks in the available space is greater than the port bandwidth utilization threshold B1, then it is confirmed that the state of the disk meets the first condition. If the average wear of all disks in the available space is less than the wear threshold A2, and the average port bandwidth utilization of all disks in the available space is less than the port bandwidth utilization threshold B2, then it is confirmed that the state of the disk meets the second condition.
[0070] In some embodiments, when the state of the disk is the wear of the disk and the space utilization of the disk, if the average wear of all disks in the available space is greater than the wear threshold A1, or the average space utilization of all disks in the available space is greater than the space utilization threshold C1, then it is confirmed that the state of the disk meets the first condition. If the average wear of all disks in the available space is less than the wear threshold A2, and the average space utilization of all disks in the available space is less than the space utilization threshold C2, then it is confirmed that the state of the disk meets the second condition.
[0071] In some embodiments, when the state of the disk is the port bandwidth utilization of the disk and the space utilization of the disk, if the average value of the port bandwidth utilization of all disks in the available space is greater than the port bandwidth utilization threshold B1, or the average value of the space utilization of all disks in the available space is greater than the space utilization threshold C1, then it is confirmed that the state of the disk meets the first condition. If the average value of the port bandwidth utilization of all disks in the available space is less than the wear threshold B2, and the average value of the space utilization of all disks in the available space is less than the space utilization threshold C2, then it is confirmed that the state of the disk meets the second condition.
[0072] In some embodiments, the status of the disk may include the wear of the disk, the port bandwidth utilization of the disk, and the space utilization of the disk. The comprehensive score of the available space can be calculated based on the wear of the disk, the port bandwidth utilization of the disk, and the space utilization of the disk using the following formula.
[0073] First, the score of each disk in the available space can be calculated by equations (1) and (2).
[0074]
[0075] w1+w2=1 (2)
[0076] Among them, p disk is the disk score, v current is the actual port rate of the disk, v port The maximum port rate of the disk, P / E current The number of times the disk has been erased, P / E space The maximum number of times the disk can be erased.
[0077] Then, the comprehensive score of the available space can be calculated using equations (3) and (4).
[0078]
[0079] w3+w4=1 (4)
[0080] Among them, p all is the comprehensive score of available space, C current is the sum of the used storage space of all disks in the available space, C space The sum of all storage spaces of all disks in the available space. The average of all disks' scores for free space.
[0081] In addition, parameters w1~w4 are determined according to the service level agreement (SLA) required by the device and the user. It is found through experiments that the storage performance of the storage pool 110 is positively correlated with the size of w1 and w4; the service life of the storage pool 110 is positively correlated with the size of w2, and the energy consumption of the storage pool 110 is positively correlated with the size of w3.
[0082] A threshold D1 and a threshold D2 may be set, wherein the threshold D1 is greater than the threshold D2. If the comprehensive score of the available space is greater than the threshold D1, it is considered that the disk status meets the first condition. If the comprehensive score of the available space is less than the threshold D2, it is considered that the disk status meets the second condition.
[0083] When the disk status meets the first condition, the decision result is to expand the capacity. When the disk status meets the second condition, the decision result is to reduce the capacity. When the disk status does not meet the first condition or the second condition, the decision result is to maintain the status quo, that is, neither expand nor reduce the capacity.
[0084] In some embodiments, Figure 3 As shown, the operation of making a decision based on the state of the disk in step 202 may be performed by the decision maker 122 .
[0085] In some embodiments, when the decision result is to expand or shrink, the decision maker 122 may also determine the target disk for expansion or shrink and the number of target disks. The target disk refers to the disk whose state is to be changed by expansion or shrink. The target disk for expansion is different from the target disk for shrink. Specifically, for expansion, the target disk refers to the disk that enters the working state from the dormant state, that is, the disk that is divided from the energy-saving space to the available space. For shrink, the target disk refers to the disk that enters the dormant state from the working state, that is, the disk that is divided from the available space to the energy-saving space.
[0086] In addition, the greater the difference between the average value of the disk status and the corresponding threshold value, the greater the number of target disks. The specific device can be adjusted according to needs, which will not be described here.
[0087] In some embodiments, the target disk for shrinking can be the disk with the greatest wear in the available space. In this way, the disk with the greatest wear can be put into hibernation first to avoid writing data to the disk, thereby preventing the wear of the disk from further increasing and thus preventing the disk from affecting the storage function of the entire storage pool after reaching the end of its life.
[0088] Continue reading Figure 2 , the management module 120 may determine in step 203 whether the decision result of step 202 is capacity expansion.
[0089] If the judgment result of step 203 is yes, the management module 120 executes step 204 to divide the target disk from the energy-saving space into the available space. Specifically, before step 204, the target disk is in a dormant state and is located in the energy-saving space. In step 204, the target disk is controlled to enter a working state from the dormant state, such as controlling the target disk to power on, or waking up the target disk. The target disk that enters the working state is divided into the available space.
[0090] If the determination result of step 203 is no, the management module 120 executes step 205 to determine whether the determination result of step 202 is to reduce the capacity.
[0091] If the judgment result of step 205 is yes, the management module 120 executes step 206 to divide the target disk from the available space into the energy-saving space. Specifically, before step 204, the target disk is in the working state and is located in the available space. In step 204, the target disk is controlled to enter the dormant state from the working state, for example, the target disk is controlled to be powered off, or the target disk is controlled to enter the low power consumption state. The target disk that enters the dormant state is divided into the energy-saving space.
[0092] Before controlling the target disk to enter the dormant state from the working state, the data in the target disk is migrated to other disks in the available space so that subsequent IO requests can access the data.
[0093] If the determination result of step 205 is no, the status of the disks in the storage pool 110 is not changed.
[0094] As described above, in some embodiments, it is determined whether the storage pool 110 is in the energy-saving mode through step 201. If the determination result of step 201 is no, that is, the storage pool 110 is not in the energy-saving mode, the management module 120 can execute step 207 to determine whether the energy-saving mode is turned on. Specifically, it can be determined whether the energy-saving switch 124 receives an instruction to turn on the energy-saving mode. If received, then in step 207, it is confirmed to turn on the energy-saving mode.
[0095] In step 207, if it is confirmed that the energy saving mode is turned on, the management module 120 may execute step 208 to obtain the information of the disks in the storage pool 110. The information of the disks may include the identification of the disks. In some embodiments, the information of the disks in the storage pool 110 may also include the wear degree of each disk in the storage pool 110.
[0096] Next, the management module 120 may execute step 209 to divide available space and energy-saving space based on the information of the disks in the storage pool 110. In step 209, a portion of the disks in the storage pool 110 may be divided into available space, and another portion of the disks may be divided into energy-saving space. The disks divided into available space are in working state, or the disks divided into available space are controlled to enter working state. The disks divided into energy-saving space are in sleep state, or the disks divided into energy-saving space are controlled to enter sleep state. As described above, the identifier of the disk obtained in step 208 may be used to control the disk identified by the identifier to enter working state or sleep state, so as to divide the disk into available space or sleep state.
[0097] In some embodiments, available space and energy-saving space can be divided based on the wear degree of the disk. Disks with large wear degree are divided into energy-saving space, and disks with small wear degree are divided into available space. In one example, it can be set that the storage pool 110 has a total of N disks, and the N disks can be sorted in order from small to large in terms of wear degree to obtain a disk queue. The first to Mth disks in the disk queue are divided into available space, and the remaining disks are divided into energy-saving space. Wherein, N is an integer greater than 1, M is an integer greater than or equal to 1, and M is less than N.
[0098] The above describes the implementation schemes of capacity expansion and capacity reduction as well as the implementation schemes of available space and energy-saving space. Next, the processing scheme of IO requests is described when the disks of the storage pool 110 are divided into available space and energy-saving space.
[0099] Continue reading Figure 2 When the storage pool 110 is in energy-saving mode, that is, when the disks of the storage pool 110 are divided into available space and energy-saving space, the management module 120 executes step 210 to send the IO request to the disks in the available space, so as to use the disks in the available space to process the IO request. For example, when the IO request is specifically a write request, the management module 210 sends the write request to the disks in the available space, so as to write the data requested to be written by the write request to the disks in the available space. When the IO request is a read request, the management module 210 sends the read request to the disks in the available space, so as to read data from the disks in the available space.
[0100] In some embodiments, the management module 120 may select a disk from available space to process a write request. This operation may be referred to as disk selection.
[0101] The management module 120 may obtain the wear degree of the disk in the available space, and upon receiving an IO request for a write request, preferentially send the write request to the disk with less wear degree, so as to write the data requested by the write request to the disk with less wear degree.
[0102] In one example, whenever the management module 120 receives a write request, it forwards the write request to the disk with the least wear in the available space. Exemplarily, the disks in the available space can be sorted in order of wear from small to large to obtain a disk queue. Whenever the management module 120 receives a write request, it forwards the write request to the first disk in the disk queue (i.e., the disk at the head of the queue) to write the data requested by the write request to the disk.
[0103] After the data requested by the write request is written to the disk, the wear degree of the disk is updated. Then, based on the disk with the updated wear degree, the disk queue is updated. That is, after the wear degree of the disk is updated, the disks in the available space are reordered in order of wear degree from small to large to obtain an updated disk queue. When a write request is received again, the write request is forwarded to the first disk in the updated disk queue to write the data requested by the write request to the disk.
[0104] In this way, data can be written to disks with less wear first, thereby ensuring balanced wear of the disks in the storage pool 110 and avoiding damage to one or some disks due to excessive wear, which in turn affects the performance and life of the storage pool 110.
[0105] In some embodiments, when the management module 120 receives at least two write requests at the same time, the management module 120 may send different write requests among the at least two write requests to different disks in the available space, so that the at least two write requests are processed in parallel, or in other words, the data requested to be written by the at least two write requests are stored in parallel in the disks. This improves the efficiency of data storage. In one example, the at least two write requests are sent to at least two disks with the smallest wear in the available space, and the at least two write requests correspond to the at least two disks one by one. That is, the wear of each disk in the at least two disks is less than the wear of other disks in the available space. More specifically, as described above, the disks in the available space are sorted in order of wear from small to large to obtain a disk queue. The at least two write requests are sent to at least two disks in the disk queue, and the positions of the at least two disks in the sorted queue are located before the positions of other disks. Other disks refer to disks in the available space other than the at least two disks.
[0106] In some embodiments, whenever a disk enters the available space from the energy-saving space through capacity expansion, the management module 120 preferentially sends a write request to the disk, so as to preferentially use the newly added disk in the available space to store data. Generally speaking, the disk in the energy-saving space is not used to process IO requests, and its wear degree is likely to be less than that of the disk in the available space. Therefore, when a disk is added from the energy-saving space to the available space, the disk is preferentially used to process write requests and store data. This ensures the balance of wear degree of the disks in the storage pool 110.
[0107] In some embodiments, if the disk to which the IO request is originally intended is a disk with energy-saving space, the management module 120 may forward the IO request to a disk with available space. This operation may be referred to as IO forwarding.
[0108] In some embodiments, formula (5) can be used to implement IO forwarding by modifying the physical address mapped by the address of the logical block (LB) carrying the data requested by the IO request (i.e., the logical block address (LBA)), as follows.
[0109] LBA logic →New LBA logic (5)
[0110] Among them, BLA logic NewLBA is the logical block address before modification. logic is the modified logical block address.
[0111] When the physical address mapped by the address of the logical block carrying the data requested by the IO request does not belong to the destination disk, the physical address mapped by the address of the logical block can be modified to a physical address in the destination disk, so that the logical block is sent to the destination disk. The destination disk refers to a disk used to process IO requests, that is, a disk used to store or store the data requested by the IO request. More specifically, the destination disk refers to a disk obtained according to the scheme described above and used to process IO requests. The destination disk belongs to the disk in the available space. In one example, when the IO request is a write request, the destination disk is the disk with the least wear in the available space.
[0112] More specifically, in one example, when the physical address mapped to the address of the logical block carrying the data requested by the IO request is a disk in the energy-saving space, the physical address mapped to the address of the logical block can be modified to the physical address of the disk in the available space. Thus, the IO request originally intended to be sent to the disk in the energy-saving space can be sent to the disk in the available space, thus avoiding the disk in the energy-saving space from being woken up, thereby ensuring the energy-saving effect.
[0113] When the IO request is a read request, the data requested by the IO request is the data requested to be read by the read request. When the IO request is a write request, the data requested by the IO request is the data requested to be written by the write request.
[0114] In some embodiments, Figure 4 As shown, the above disk selection operation and IO forwarding operation can be performed by the IO controller 123 in the management module 120.
[0115] In some embodiments, the disks in the energy-saving space can be shielded by means of a whitelist to avoid sending IO requests to the disks in the energy-saving space. Specifically, only the disks in the available space are included in the whitelist. When providing external data storage services, the storage pool 110 only provides logical blocks whose addresses are mapped to the physical addresses of the disks in the whitelist. This ensures that the physical addresses mapped to the addresses of the logical blocks carrying the data requested by the IO requests are the physical addresses of the disks in the available space, rather than the physical addresses of the disks in the energy-saving space, thereby achieving the purpose of shielding the disks in the energy-saving space.
[0116] In summary, the data storage solution provided by the embodiment of the present application divides the disks in the same storage pool into available space and energy-saving space, wherein the disks in the energy-saving space are in a dormant state, which can save the energy consumption of the storage pool. The disks in the available space are in a working state, which can ensure the normal operation of the storage pool and realize the data storage function. In addition, the data storage solution provided by the embodiment of the present application can expand the available space when the storage business of the storage pool is busy, thereby ensuring the efficiency of the storage pool in storing data; when the storage pool is idle, the available space can be reduced and the energy-saving space can be expanded, thereby reducing unnecessary energy consumption of the storage pool and improving energy-saving effects.
[0117] In addition, the data storage solution provided in the embodiment of the present application takes into account the wear of the disk, capacity utilization, port bandwidth utilization, etc. when expanding or reducing the available space, and can ensure that the expansion or reduction of the available space does not affect the performance of the storage pool, thereby ensuring that the energy-saving mode of the storage pool does not affect the user's use.
[0118] In addition, the data storage solution provided in the embodiment of the present application forwards the IO request of the disk that is originally intended to fall into the energy-saving space to the disk in the available space, thereby avoiding the disk in the dormant state from being awakened and ensuring the energy-saving effect.
[0119] Based on the data storage solution described above, an embodiment of the present application provides a data storage method executed by a management device. The management device is used to manage a storage pool, and the storage pool includes a first disk group and a second disk group; wherein the disks in the first disk group are in a working state and are used to process input and output IO requests; and the disks in the second disk group are in a dormant state. Figure 5 As shown, the method includes the following steps.
[0120] Step 501, obtaining the status of the disks in the first disk group, wherein the status of the disks includes one or any combination of the wear degree of the disks, the port bandwidth utilization of the disks, and the space utilization of the disks;
[0121] Step 502, when the state of the disk in the first disk group meets the preset first condition, control the first disk in the second disk group to enter the working state from the sleep state, and divide the first disk in the working state into the first disk group to update the first disk group.
[0122] In some embodiments, the state of the disk includes the wear of the disk; the method also includes: determining that the wear of the second disk in the first disk group is the smallest; when a write request is obtained, writing the data requested by the write request to the second disk.
[0123] In an example of this embodiment, the wear degree of the third disk in the first disk group is less than the wear degree of other disks in the first disk group except the second disk and the third disk, and the write request includes two write requests; writing the data requested by the write request to the second disk includes: writing the data requested by one of the two write requests to the second disk, and writing the data requested by the other write request to the third disk.
[0124] In some embodiments, the physical address mapped by the address of the logical block LB used to carry the data requested by the IO request belongs to a disk in the second disk group; the method also includes: modifying the physical address mapped by the address of the LB to the physical address of the disk in the first disk group to forward the IO request to the disk in the first disk group.
[0125] In some embodiments, the method further comprises:
[0126] When the state of the disks in the first disk group meets the preset second condition, the fifth disk in the first disk group is controlled to enter the sleep state from the working state, and the fifth disk in the sleep state is divided into the second disk group.
[0127] In an example of this embodiment, before controlling the fifth disk in the first disk group to enter the sleep state from the working state, the method further includes: migrating data in the fifth disk to other disks in the first disk group.
[0128] The method can divide the disks in the same storage pool into available space and energy-saving space, wherein the disks in the energy-saving space are in a dormant state, which can save the energy consumption of the storage pool. The disks in the available space are in a working state, which can ensure the normal operation of the storage pool and realize the data storage function. In addition, the data storage solution provided by the embodiment of the present application can expand the available space when the storage business of the storage pool is busy, thereby ensuring the efficiency of the storage pool in storing data; when the storage pool is idle, the available space can be reduced and the energy-saving space can be expanded, thereby reducing unnecessary energy consumption of the storage pool and improving the energy-saving effect.
[0129] See also Figure 6 The present application also provides a management device 600. The management device 600 is used to manage a storage pool, wherein the storage pool includes a first disk group and a second disk group; wherein the disks in the first disk group are in a working state and are used to process input and output IO requests; and the disks in the second disk group are in a dormant state. Figure 6 As shown, the management device 600 includes:
[0130] An acquisition unit 610 is used to acquire the status of the disk in the first disk group, where the status of the disk includes one or any combination of the wear degree of the disk, the port bandwidth utilization of the disk, and the space utilization of the disk;
[0131] The control unit 620 is used to control the first disk in the second disk group to enter the working state from the sleep state when the state of the disk in the first disk group meets the preset first condition, and to divide the first disk in the working state into the first disk group to update the first disk group.
[0132] The functions of the functional units of the management device 600 can be referred to above. Figure 5 or Figure 2 The introduction and implementation of the various method embodiments shown will not be repeated here.
[0133] This embodiment of the application provides a computing device 700. Figure 7 As shown, the computing device 700 includes a processor 710 and a memory 720. The memory 720 stores computer instructions. The processor 710 is used to execute the computer instructions stored in the memory 720, so that the processor 710 can execute the above Figure 2 The scheme shown or Figure 5 The method shown.
[0134] The present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on a computing device, the computing device Figure 2 The scheme shown or Figure 5 The method shown.
[0135] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute Figure 2 The scheme shown or Figure 5 The method shown.
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data storage method, characterized in that: The method is applied to a management device, the management device is used to manage a storage pool, the storage pool includes a first disk group and a second disk group; wherein the disks in the first disk group are in a working state and are used to process input and output IO requests; the disks in the second disk group are in a dormant state; the method includes: Acquire the status of the disk in the first disk group, where the status of the disk includes one or any combination of the wear degree of the disk, the port bandwidth utilization of the disk, and the space utilization of the disk; When the state of the disk in the first disk group meets the preset first condition, the first disk in the second disk group is controlled to enter the working state from the sleep state, and the first disk in the working state is divided into the first disk group to update the first disk group.
2. The method according to claim 1, characterized in that The state of the disk includes the wear degree of the disk; the method further includes: determining that the second disk in the first disk group has the smallest wear; When a write request is obtained, the data requested by the write request is written to the second disk.
3. The method according to claim 2, characterized in that The wear degree of the third disk in the first disk group is less than the wear degree of other disks in the first disk group except the second disk and the third disk, and the write request includes two write requests; Writing the data requested by the write request to the second disk comprises: The data requested to be written by one of the two write requests is written to the second disk, and the data requested to be written by the other write request is written to the third disk.
4. The method according to any one of claims 1 to 3, characterized in that The physical address mapped by the address of the logic block LB for carrying the data requested by the IO request belongs to a disk in the second disk group; the method further includes: The physical address mapped by the address of the LB is modified to the physical address of the disk in the first disk group, so as to forward the IO request to the disk in the first disk group.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: When the state of the disks in the first disk group meets the preset second condition, the fifth disk in the first disk group is controlled to enter the sleep state from the working state, and the fifth disk in the sleep state is divided into the second disk group.
6. The method according to claim 5, characterized in that Before controlling the fifth disk in the first disk group to enter the dormant state from the working state, the method further includes: migrating data in the fifth disk to other disks in the first disk group.
7. A management device, characterized in that: The management device is used to manage a storage pool, the storage pool includes a first disk group and a second disk group; wherein the disks in the first disk group are in a working state and are used to process input and output IO requests; the disks in the second disk group are in a dormant state; the management device includes: an acquisition unit, configured to acquire the status of a disk in the first disk group, wherein the status of the disk includes one or any combination of the wear degree of the disk, the port bandwidth utilization of the disk, and the space utilization of the disk; A control unit is used to control the first disk in the second disk group to enter a working state from a sleep state when the state of the disk in the first disk group meets a preset first condition, and to divide the first disk in the working state into the first disk group to update the first disk group.
8. The management device according to claim 7, characterized in that: The state of the disk includes the wear degree of the disk; the management device further includes: a determination unit, configured to determine that the second disk in the first disk group has the smallest wear degree; The writing unit is used to write the data requested by the writing request to the second disk when a writing request is obtained.
9. The management device according to claim 8, characterized in that: The wear degree of the third disk in the first disk group is less than the wear degree of other disks in the first disk group except the second disk and the third disk, and the write request includes two write requests; The writing unit is used for writing the data requested to be written by one of the two writing requests to the second disk, and writing the data requested to be written by the other writing request to the third disk.
10. The management device according to any one of claims 7 to 9, characterized in that: The physical address mapped by the address of the logic block LB for carrying the data requested by the IO request belongs to a disk in the second disk group; the management device further includes: A modification unit is used to modify the physical address mapped by the address of the LB to the physical address of the disk in the first disk group, so as to forward the IO request to the disk in the first disk group.
11. The management device according to any one of claims 7 to 10, characterized in that: The control unit is also used to: when the state of the disk in the first disk group meets the preset second condition, control the fifth disk in the first disk group to enter the sleep state from the working state, and divide the fifth disk in the sleep state into the second disk group.
12. The management device according to claim 11, characterized in that: The control unit is further configured to: before controlling the fifth disk in the first disk group to enter a dormant state from a working state, migrate data in the fifth disk to other disks in the first disk group.
13. A computing device, characterized in that: The method comprises a processor and a memory; wherein the memory stores computer instructions, and the processor is used to execute the computer instructions to implement the method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device, the computing device performs the method according to any one of claims 1 to 6.
15. A computer program product comprising instructions, characterized in that When the instructions are executed by a computer device, the computer device is caused to perform the method according to any one of claims 1 to 6.