A disk data processing method and apparatus

By dividing the disk into inner and outer regions and adjusting the number of concurrent processes, the problem of low disk data erasure efficiency in existing technologies is solved, and a more efficient data writing and erasure process is achieved.

CN115167772BActive Publication Date: 2026-05-26ALIBABA (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2022-07-08
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In existing technologies, erasing old data by writing data to disk is inefficient, mainly because a fixed number of concurrent disk writes fail to fully utilize hardware bandwidth resources.

Method used

The disk's storage area is divided into inner and outer zones. The outer zone initially writes data with a larger number of concurrent processes, while the inner zone writes data with an even larger number of concurrent processes after the data has been fully written. By utilizing the difference in write bandwidth between the inner and outer zones of the disk, the number of concurrent processes can be adjusted to fully utilize the hardware bandwidth.

Benefits of technology

It improves data writing efficiency, reduces overall erase time, and fully utilizes hardware performance, especially significantly improving data erase efficiency in high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115167772B_ABST
    Figure CN115167772B_ABST
Patent Text Reader

Abstract

This application discloses a disk data processing method and apparatus. The method includes: simultaneously writing data to be written to the outer regions of a first number of disks; after the outer regions of the first number of disks have all been written with data, simultaneously writing the data to be written to the inner regions of a second number of disks, wherein the second number is greater than the first number. The storage area of ​​the disk is pre-divided into the inner region and the outer region. The outer region is a storage area from the starting point of the stored data to a predetermined capacity, and the inner region is a storage area from the predetermined capacity to when the disk is full of data. This application solves the problem of low efficiency in the prior art when erasing old data by writing data to the disk. By utilizing the properties of the inner and outer regions of the disk, different numbers of disks are used to simultaneously write data to the inner and outer regions of the disk, thereby improving the efficiency of data writing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of disk data processing, and more specifically, to a disk data processing method and apparatus. Background Technology

[0002] In cloud environments, data erasure is required in many situations, such as server relocation and decommissioning.

[0003] In order to enable hard drives (or disks) to be reused, the method of erasing data on the disks in a server during server relocation and scrapping is generally to rewrite data on the disk. This rewritten data will overwrite the original data on the disk, thereby preventing the original data on the disk from being leaked.

[0004] Conventional data erasure methods involve writing to the disk multiple times from beginning to end using random numbers; the effective bandwidth for data erasure determines the erasure efficiency. When writing to a disk, data to be erased can be written in batches, meaning multiple disks can be written to simultaneously at a time. Performing data writing requires a host computer, and the I / O (interface) path between the host and the disks includes multiple intermediary devices. The write bandwidth of these intermediary devices, as well as the write bandwidth of the disk itself, affects the disk data writing speed.

[0005] In existing technologies, the number of disk erasure batches is determined based on experience. The number of disks that are simultaneously writing data in each batch is constant. The next batch of erasure is performed only after the previous batch is completed. The inventors found that this erasure method has the problem of low erasure efficiency. Summary of the Invention

[0006] This application provides a disk data processing method and apparatus to at least solve the problem of low efficiency in the prior art when erasing old data by writing data to the disk.

[0007] According to one aspect of this application, a disk data processing method is provided, comprising: simultaneously writing data to be written to the outer regions of a first number of disks; after the outer regions of the first number of disks have all been written with data, simultaneously writing the data to be written to the inner regions of a second number of disks, wherein the second number is greater than the first number, the storage area of ​​the disk is pre-divided into the inner region and the outer region, the outer region being a storage area from the starting point of data storage to a predetermined capacity, and the inner region being a storage area from the predetermined capacity to the point where the disk is full of data.

[0008] According to another aspect of this application, a disk data processing apparatus is also provided, comprising: a first writing module for simultaneously writing data to be written to the outer regions of a first number of disks; and a second writing module for simultaneously writing the data to be written to the inner regions of a second number of disks after the outer regions of the first number of disks have all been written with data, wherein the second number is greater than the first number, and the storage area of ​​the disk is pre-divided into the inner region and the outer region, wherein the outer region is a storage area from the starting point of data storage to a predetermined capacity, and the inner region is a storage area from the predetermined capacity to the point where the disk is full of data.

[0009] According to another aspect of this application, an electronic device is also provided, including a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the above-described method steps.

[0010] According to another aspect of this application, a readable storage medium is also provided, on which computer instructions are stored, wherein the computer instructions, when executed by a processor, implement the above-described method steps.

[0011] In this embodiment, the data to be written is simultaneously written to the outer regions of a first number of disks. After the outer regions of the first number of disks have all been written, the data to be written is simultaneously written to the inner regions of a second number of disks, wherein the second number is greater than the first number. The storage area of ​​the disk is pre-divided into the inner region and the outer region. The outer region is the storage area from the starting point of the stored data to a predetermined capacity, and the inner region is the storage area from the predetermined capacity to when the disk is full of data. This application solves the problem of low efficiency in the prior art when erasing old data by writing data to the disk. By utilizing the properties of the inner and outer regions of the disk, different numbers of disks are used to simultaneously write data to the inner and outer regions of the disk, thereby improving the efficiency of data writing. Attached Figure Description

[0012] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0013] Figure 1 This is a schematic diagram illustrating the relationship between ideal disk write bandwidth and disk capacity according to an embodiment of this application;

[0014] Figure 2 This is a flowchart of a disk data processing method according to an embodiment of this application;

[0015] Figure 3This is a schematic diagram illustrating the connection between a host and a disk according to an embodiment of this application;

[0016] Figure 4 This is a schematic diagram illustrating the actual disk write bandwidth in different batches according to embodiments of this application;

[0017] Figure 5 This is a schematic diagram illustrating the improvement of concurrency in the inner region according to an embodiment of this application;

[0018] Figure 6 This is a schematic diagram illustrating the relationship between actual disk write bandwidth and disk capacity according to an embodiment of this application;

[0019] Figure 7 This is a schematic diagram comparing the inner and outer regions before and after partitioning according to an embodiment of this application;

[0020] Figure 8 This is a schematic diagram illustrating the disk data writing process based on a disk expansion card according to an embodiment of this application; and,

[0021] Figure 9 This is a schematic diagram of a disk data processing apparatus according to an embodiment of this application. Detailed Implementation

[0022] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0023] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0024] In the following embodiments, old data on the disk is overwritten by writing data to the disk to achieve the purpose of data erasure. Therefore, in the following embodiments, data erasure and data writing have the same meaning. Data writing requires the use of a host. To improve data writing efficiency, the host will write data to multiple disks simultaneously. The disks in the following embodiments can be various types of disks, such as disks previously used on a server.

[0025] Factors limiting the host's disk write speed include the disk's own write bandwidth and the connection between the host and the disk. This connection creates a maximum bandwidth that the host can use when writing to the disk. This maximum bandwidth is related to the hardware connection between the host and the disk, and is usually a fixed value that does not change with data writing. Furthermore, the disk's write bandwidth varies depending on the capacity region being written to. Figure 1 This is a schematic diagram illustrating the relationship between ideal disk write bandwidth and disk capacity according to an embodiment of this application. Figure 1 The term "ideal write bandwidth" (or "ideal erase bandwidth") is used here. "Ideal" here refers to the write bandwidth obtained by considering only the disk's write performance without any other limitations. Figure 1 The disk capacity is 20TB (where B is an abbreviation for Byte, 1000B equals 1KB, 1024KB equals 1MB, 1024MB equals 1GB, 1024GB equals 1TB. In the following text, MB will be abbreviated as M and TB as T). Figure 1 The horizontal axis represents different disk capacities. Figure 1 The vertical axis represents the ideal write bandwidth, such as... Figure 1 As shown, when the disk capacity is 0, the ideal write bandwidth is the largest, greater than 250M per second. As the capacity increases, the ideal write bandwidth decreases continuously.

[0026] Figure 1 Although the ideal write bandwidth curve for a 20TB disk is shown, based on the operating principles of disks, it is known that disks of any capacity or brand exhibit varying performance. Figure 1 The characteristic shown is that the ideal write bandwidth of a disk decreases as its capacity increases.

[0027] The following embodiments utilize this characteristic of the disk. Since the maximum bandwidth available for writing to the disk by the computer is limited, in order to make full use of the advantage of this maximum bandwidth, the number of disks that can write data simultaneously can be determined based on the maximum bandwidth (for ease of description, it is assumed that the number is 20). As data is written, the disk capacity is constantly changing, and the ideal write bandwidth of the disk is also gradually decreasing. At this time, the ideal write bandwidth of 20 disks will be less than the maximum bandwidth, which leads to a surplus of maximum bandwidth, resulting in waste. In order to utilize the surplus maximum bandwidth, the number of disks that write data simultaneously can be increased.

[0028] Based on the principle that the ideal write bandwidth of a disk changes with its capacity, this embodiment provides a disk data processing method. Figure 2 This is a flowchart of a disk data processing method according to an embodiment of this application. The following describes... Figure 2The steps are explained below.

[0029] Step S202: Simultaneously write the data to be written to the outer area of ​​the first number of disks;

[0030] Step S204: After data has been written to the outer areas of the first number of disks, the data to be written is simultaneously written to the inner areas of the second number of disks, wherein the second number is greater than the first number. The storage area of ​​the disk is pre-divided into the inner area and the outer area. The outer area is the storage area from the starting point of data storage to a predetermined capacity, and the inner area is the storage area from the predetermined capacity to when the disk is full of data.

[0031] The above steps involve simultaneously writing data to multiple disks. When writing data to the outer regions of multiple disks simultaneously, the ideal write bandwidth of the disks is relatively large. To fully utilize the ideal write bandwidth, a first number of disks can be written to simultaneously. When writing data to the inner regions of multiple disks simultaneously, the ideal write bandwidth of the inner regions is smaller than that of the outer regions. The maximum bandwidth available for the computer to write to the disks is not fully utilized. In this case, the number of disks written to simultaneously can be increased, i.e., the first number is adjusted to a second number, to fully utilize the maximum bandwidth available for the computer to write to the disks. The difference between the above steps and existing technologies is that in existing technologies, the number of disks written to simultaneously remains unchanged. For example, data is written to 20 disks in a batch, and the next batch of disk writing begins only after all 20 disks have been written. In the above steps, when writing data to 20 disks, the number of disks written to simultaneously (i.e., the second number) is increased when writing to the inner regions, resulting in more than 20 disks being written to simultaneously. Therefore, the above steps solve the problem of low efficiency in erasing old data by writing data to the disk in the existing technology. Furthermore, by utilizing the properties of the inner and outer areas of the disk, different numbers of disks are used to write data to the inner and outer areas of the disk simultaneously, thereby improving the efficiency of data writing.

[0032] In the above steps, the disk is divided into inner and outer regions based on a predetermined capacity. This predetermined capacity can be determined in advance, and in the following description, it will be referred to as the capacity partitioning point. That is, before simultaneously writing the data to be written to the outer region of a first number of disks, the capacity partitioning point of the disk can be determined. The capacity partitioning point is used to identify the value of the predetermined capacity. Based on the capacity partitioning point, the disk is divided into the inner region and the outer region. The outer region is the storage area from the starting point of data storage to the capacity partitioning point, and the inner region is the storage area from the capacity partitioning point to when the disk is full of data.

[0033] In the above description, writing data to the disk requires the host to perform the write operation. This means there is a maximum bandwidth involved when the host writes data to the disk. This is because when the host connects to multiple disks, other devices are used to connect the host and the multiple disks. In the following embodiments, the device connecting the host and the multiple disks is referred to as an intermediate device. It is precisely because of the existence of the intermediate device that the aforementioned maximum bandwidth exists when the host writes data to the disk. Therefore, for ease of description, this maximum bandwidth will also be referred to as the maximum bandwidth of the intermediate device in the following embodiments.

[0034] There are many types of intermediate devices. Figure 3 This is a schematic diagram illustrating the connection between a host and a disk according to an embodiment of this application. Figure 3 An example is given of the intermediate devices used when connecting a host and a disk, through which the host can write data to multiple disks simultaneously. Figure 3 This is just one example of a connection between a host and a disk; other types of intermediate devices can also be used to connect the host and the disk, which will not be described in detail here.

[0035] exist Figure 3 The system uses a simple bundle of disks (JBOD) to increase the number of disks. JBOD is a disk storage technology; of course, other technologies can also be used to write data to the disk from the host, which will not be elaborated on here. Figure 3 As shown, the I / O path between the disk and the host (not shown in the diagram) involves multiple intermediate devices such as Host Bus Adapter (HBA) cards and disk expansion cards. An HBA card is a circuit board or integrated circuit adapter that provides input / output (I / O) processing and physical connectivity between the host and the disk. Disk expansion cards can expand the number of Serial Attached SCSI (SAS) links, connecting more disks.

[0036] In concurrent data writing scenarios, the capacity constraints of intermediate devices will affect disk write efficiency. Figure 3 In the given I / O path from the host to the JBOD, at any given time, the disk and the host first establish a physical connection through the physical link (PHY) between the SAS devices on the port to exchange data, and then data transfer occurs. When performing a 1MB write operation, the HBA card will establish multiple connections with the disk through the disk expansion card, transferring the write data in batches until the 1MB of data has been sent. Figure 3In this context, the maximum bandwidth for the host to write data to the disk is limited by the maximum bandwidth of the disk expansion card (i.e., the maximum bandwidth of the intermediate device), which can be determined through testing. Actual testing has shown that... Figure 3 The maximum bandwidth of the expander in the system is approximately 3000MB / s, and all disks share the 3000MB / s bandwidth equally.

[0037] by Figure 3 For example, assuming the initial number is 20 disks, limited by the maximum bandwidth of the disk expansion card, the write bandwidth of each disk is 3000 divided by 20, which equals 150MB / s. Initially, the ideal write bandwidth of the disks is greater than 150MB / s, so data is written to all 20 disks simultaneously at 150MB / s. As the disk's write capacity changes, the ideal write bandwidth will decrease to less than 150MB / s. In this case, data is written to the disks according to the ideal write bandwidth, resulting in a total write bandwidth of less than 3000MB / s for the 20 disks, failing to fully utilize the maximum bandwidth of the intermediate devices. To fully utilize the maximum bandwidth of the intermediate devices, the initial number (20) can be increased to a second number.

[0038] The above description mentions a first quantity, which can be determined empirically, for example, by the user based on the existing hardware configuration. In an alternative approach, when the number of disks requiring data writing is large, all disks can be divided into different batches for writing. In this alternative approach, the first quantity can be determined based on the batches. The step of determining the first quantity may include: obtaining the total number M of disks to be written and the batches n for performing data writing, wherein the M disks are divided into n batches for data writing, with each batch of disks being written to simultaneously; and dividing the total number M by the batches n to obtain the first quantity.

[0039] The value of batch n can be obtained by the user in advance; or it can be obtained with a time limit. For example, for writing data to M disks, all disk writes need to be completed within h1 hours, and / or, for a single disk, the time for writing data to each disk cannot exceed h2 hours. In this case, the batch n can be determined according to the following steps: for each possible value of the batch n, calculate the time to complete the data write after dividing the M disks into batches according to that possible value, wherein the time includes a first time and / or a second time, the first time is the time to complete the data write of a single batch of disks, and the second time is the time to complete the data write of all batches of disks; select the possible value that meets the requirements as the value of the batch n according to the data write completion time corresponding to each possible value. In this optional method, the first time and the second time can be estimated based on the disk capacity, the total number of disks, the maximum bandwidth of the intermediate device, and the ideal write bandwidth of the disk. The following is an example. Figure 1 The ideal write bandwidth of the disk shown in the figure and Figure 3 The maximum bandwidth of the disk expansion card shown in the figure will be used as an example for explanation.

[0040] In this example, the erasure process divides the disk into multiple batches for erasure, ensuring that each disk is erased three times. Each batch erasure process typically has a time constraint (e.g., it must not exceed a predetermined duration of 72 hours). If a batch erasure exceeds the time constraint, an alarm is triggered. Ideally, the overall erasure time should be as short as possible. Figure 4 This is a schematic diagram illustrating the actual disk write bandwidth in different batches according to embodiments of this application. The following is in conjunction with... Figure 4 Please provide an explanation.

[0041] Figure 4 The text shows the actual erase bandwidth variation of the disk under different erase batches n. The actual write bandwidth of the disk is different for different batches.

[0042] The first scenario, n=2, involves erasing in two batches. Each batch contains m1 disks. Since there are only two batches, each batch has a large number of disks, meaning a large number of disks are writing data concurrently. This scenario with n=2 is called a high-concurrency scenario. The m1 disks share a bandwidth of 3000MB / s, resulting in a single-disk erase bandwidth of 111MB / s. Throughout the process, the expander bandwidth (the actual bandwidth used by the intermediate devices) is always fully utilized, but the disks' inherent capabilities are not fully leveraged, and there is a risk that a single-disk erase time will exceed 72 hours. Although this method results in the lowest overall time (the ideal time), it is not recommended due to the excessively long single-disk erase time.

[0043] The second scenario, n=4. When erasing in four batches, each batch contains m² disks. Because it's divided into four batches, each batch has a smaller number of disks, meaning fewer disks are writing data concurrently. This n=4 scenario is called a low-concurrency scenario. In this scenario, m² disks share 3000MB / s, and each disk can use 214MB / s of bandwidth from the expansion card. However, as the disk write capacity changes, the ideal write bandwidth will drop below 214MB / s. At this point, the maximum bandwidth of the expansion card still has some margin. In this case, the single-disk capacity is fully utilized, but the expander bandwidth is not fully utilized for a considerable period. The overall erase time is longer.

[0044] The third scenario is n=3. In this case, the number of disks in each batch is m³. These M³ disks share 3000MB / s, each disk can use a disk expansion card with a bandwidth of 155MB / s, and the ideal write bandwidth for each disk only drops below 155MB / s after a considerable period of data writing has begun. Therefore, in this scenario, both disk capacity and expander capacity are utilized to a certain extent, achieving a balance between the two.

[0045] Considering the actual write bandwidth and time constraints of the above three scenarios, n=3 can be selected, that is, the disk is divided into three batches for writing. Even if the disk is divided into three batches for writing, the expander capability is still not fully utilized at the end of the erasure process (about 5 hours). The above solution in this embodiment increases the number of disks writing data concurrently at the end of the erasure process, thereby making fuller use of the maximum bandwidth of the intermediate device and improving the data writing efficiency. Figure 5 This is a schematic diagram illustrating the improvement of concurrency in the inner region according to an embodiment of this application, as shown below. Figure 5 As shown, when writing to the outer region, the concurrency level of n=3 is used to write data to the disk simultaneously. When writing to the inner region, the concurrency level needs to be increased, and the concurrency level of n=2 is used to write data to the disk simultaneously.

[0046] The above implementation divides the disk into two regions for erasure: an inner region and an outer region. In the outer region, write concurrency is reduced while maintaining high erase bandwidth per disk, thus reducing single-disk erase latency. In the inner region, write concurrency is increased without affecting the actual disk bandwidth, reducing the number of erase batches. Throughout the erasure process in both regions, the expander bandwidth remains at its maximum, ensuring the overall erase time is close to optimal. This maximizes hardware performance, improves data erasure efficiency, and reduces erase time.

[0047] The above method relies on dividing the disk into inner and outer regions. When writing data to the inner region, the number of disks concurrently writing is greater than that to the outer region. This leverages the fact that the write bandwidth of the inner region is lower than that of the outer region. Since the write bandwidth of the inner region is less than that of the outer region, increasing the number of disks concurrently writing is justifiable in improving erase efficiency. Considering the difference in write bandwidth between the inner and outer disks, in one implementation, the disk capacity partitioning point can be determined based on the correspondence between the change in the actual write bandwidth of the disk and the data already written to the disk. In this method, determining the disk capacity partitioning point includes: determining the actual write bandwidth of the disk, wherein the actual write bandwidth of the disk varies with the capacity; determining the disk capacity partitioning point based on the relationship between the actual write bandwidth and the capacity, and data erase constraints; wherein, when the decrease in the actual write bandwidth of the disk meets the data erase constraints (or simply predetermined conditions), the amount of data already written to the disk is obtained; and the disk capacity partitioning point is determined based on the amount of data already written to the disk.

[0048] exist Figure 1 The diagram illustrates the relationship between ideal disk write bandwidth and capacity. Under normal circumstances, the actual disk write bandwidth should generally follow the trend of the ideal disk write bandwidth; that is, the actual disk write bandwidth decreases as the amount of data written decreases. In this case, when writing data to multiple disks simultaneously, if the actual write bandwidth of a single disk decreases, from an efficiency perspective, the number of disks writing concurrently can be increased. The predetermined condition for the actual write bandwidth to decrease can be determined based on data obtained from disk testing or through other methods. Regardless of how the predetermined condition is determined, once the actual write bandwidth decreases to a certain level, it is advisable to consider increasing the number of disks writing data simultaneously from a first number to a second number.

[0049] In practical applications, disks typically connect to the host via an intermediate device for data writing, for example, in Figure 3 In this system, the host connects to disks via a disk expansion card for data writing; the disk expansion card is a type of intermediate device. Intermediate devices also have a maximum write bandwidth. When an intermediate device is connected to multiple disks, its bandwidth is shared by all the disks connected to it. The maximum bandwidth is the maximum bandwidth when the intermediate device simultaneously writes data to all the disks it is connected to. In this case, the actual write bandwidth of each disk is determined by both the maximum write bandwidth of the intermediate device and the ideal write bandwidth of that disk.

[0050] In the case where data to be written is simultaneously written to multiple disks through an intermediate device, determining the actual write bandwidth of the disk includes: obtaining the maximum bandwidth of the intermediate device, wherein the maximum bandwidth is divided by the first number to obtain the first bandwidth of the disk; obtaining the second bandwidth for writing data to the disk, wherein the second bandwidth is the maximum bandwidth when writing data directly to the disk without going through the intermediate device, and the second bandwidth is the ideal write bandwidth; and taking the minimum value between the first bandwidth and the second bandwidth as the actual write bandwidth of the disk.

[0051] Figure 6 This is a schematic diagram illustrating the relationship between actual disk write bandwidth and disk capacity according to an embodiment of this application. Figure 1 different, Figure 6 The maximum bandwidth limitation of intermediate devices was taken into account. Figure 6 In this example, n=3 was used. In this case, each batch contains m³ disks, which share a bandwidth of 3000MB / s. Each disk can utilize a disk expansion card with a bandwidth of 155MB / s. For example... Figure 6 As shown, before the disk capacity reaches 16.6T, i.e., within the area from 0T to 16.6T, the ideal write bandwidth of the disk is greater than the bandwidth shared by the disk from the intermediate device (i.e., the first bandwidth). In this area, data writing is limited by the first bandwidth, and its upper limit remains at 155MB / s. In the area after 16.6T, i.e., from 16.6T to 20T, the ideal write bandwidth of the disk is less than the first bandwidth. At this point, the actual write bandwidth of the disk is limited by the ideal write bandwidth; that is, the actual write bandwidth of the disk is the same as the ideal write bandwidth, but less than the first bandwidth.

[0052] from Figure 6 As can be seen, the actual disk write bandwidth starts to decrease at 16.6T. Therefore, 16.6T is used as the capacity division point to distinguish between the inner and outer regions.

[0053] Figure 6 The diagram illustrates a principle: if the actual write bandwidth of the disk is limited by the bandwidth of the intermediate device, it means that the maximum bandwidth of the intermediate device has been fully utilized; if the actual write bandwidth of the disk is limited by the ideal write bandwidth of the disk, it means that the maximum bandwidth of the intermediate device has not been fully utilized. In order to fully utilize the maximum bandwidth of the intermediate device, increasing the number of disk data being written simultaneously from the first number to the second number becomes a better choice.

[0054] The above analysis shows that the disk capacity allocation point can be determined based on the relationship between the actual write bandwidth and the maximum bandwidth of the intermediate device. This embodiment provides the following two determination methods.

[0055] Method 1: Obtain the actual write bandwidth of a single disk when writing data to be written to multiple disks simultaneously; calculate the total write bandwidth occupied when writing to multiple disks simultaneously based on the actual write bandwidth of a single disk; when the total write bandwidth is less than the maximum bandwidth of the intermediate device, obtain the amount of data already written to the disk. Use the obtained amount of data already written to the disk as the capacity partitioning point.

[0056] Method 2: When the actual write bandwidth of a single disk is less than the first bandwidth, obtain the amount of data that has been written to the single disk, and use the obtained amount of data written to the disk as the capacity division point.

[0057] Of the two methods mentioned above, one is based on the relationship between the total write bandwidth occupied by multiple disks and the maximum bandwidth of the intermediate device, while the other is based on the relationship between the write bandwidth of a single disk and the shared bandwidth of the intermediate device. Both methods assume that the maximum bandwidth of the intermediate device has a margin of safety and is not fully utilized. This is considered an opportunity to increase concurrent disk writes, and then the amount of data already written at that point is determined, which serves as the capacity allocation point.

[0058] When determining the second quantity, a relatively simple method can be used: the first quantity is the quantity in each batch when the disks are divided into n1 batches, and the second quantity is the quantity when the disks are divided into n1-1 batches. For example, ... Figure 5 As shown, when writing to the outer region, a concurrency level of n=3 is used to simultaneously write data to the disk. When writing to the inner region, the concurrency level needs to be increased; in this case, a concurrency level of n=2 is used to simultaneously write data to the disk. That is, in Figure 5 In the process, the disks are first divided into 3 batches, and the first quantity is the total number of disks divided by 3. Then, when writing data to the inner area, it can be considered that the disks are divided into 2 batches, and the second quantity is the total number of disks divided by 2. The second quantity obtained is greater than the first quantity, which increases the number of disks that can be written to concurrently.

[0059] Figure 7 This is a schematic diagram comparing the inner and outer regions before and after partitioning according to an embodiment of this application, as shown below. Figure 7 As shown, without internal and external partitioning, the second batch of disk data is written only after the first batch of disk data has been completely written. However, by adopting the scheme described above, while writing data to the internal area of ​​the first batch of disks, the internal areas of the second batch of disks can be written in parallel, either partially or entirely, thus saving overall time and improving writing efficiency.

[0060] When determining the second quantity, it can also be determined based on the maximum bandwidth of the intermediate device and the actual write bandwidth of the disk when writing data in the inner region. This method of determining the second quantity based on the maximum bandwidth of the intermediate device and the actual write bandwidth of the disk is more accurate than determining the second quantity based on batches. In one implementation, an optional example of calculating the second quantity is provided: when writing data in the inner region, obtain the sum of the actual write bandwidth of all the disks in the first quantity, subtract the sum of the actual write bandwidth from the maximum bandwidth of the intermediate device to obtain the bandwidth difference, which is the bandwidth of the intermediate device that is not occupied, calculate the number of disks that can be added under this bandwidth difference, and then the second quantity can be obtained.

[0061] In the above implementation, the efficiency of disk data writing is improved by introducing the division of inner and outer regions. When writing data to the disk, the host needs to perform the write operation. In this case, the topology between the host and the disk becomes a factor limiting the write bandwidth. The disk topology includes the connection method between the HBA or expander and the disk, the number of disks, the disk capacity, etc. Although the topology varies slightly from model to model, in the above implementation, the impact of these topologies on write bandwidth is summarized as the maximum bandwidth of the intermediate device. Both the maximum bandwidth of the intermediate device and the ideal write bandwidth of the disk can be factors that limit the efficiency of data writing. The maximum bandwidth of the intermediate device and the ideal write bandwidth of the disk can be obtained in advance. Based on these write bandwidth limitations, the capacity division point of the inner and outer regions and the write batch can be calculated.

[0062] In the actual topology between disks and hosts, disk expansion cards are the most common intermediate devices. The following describes an optional implementation method using a disk expansion card as an example.

[0063] Figure 8 This is a schematic diagram of the disk data writing process based on a disk expansion card according to an embodiment of this application. Figure 8 In this context, the bottleneck of the topology is the number of available PHYs and the transfer capacity of the disk. The number of PHYs and the transfer capacity are ultimately reflected by the expander limit bandwidth (i.e., the maximum bandwidth of the disk expansion card).

[0064] exist Figure 8In this process, the bandwidth that each disk can share with the disk expansion card (i.e., the erase bandwidth of the PHY contention, which is the first bandwidth mentioned above) is calculated based on the number of disks and the expander's maximum bandwidth. Then, the actual erase bandwidth of the disk can be obtained based on the ideal disk bandwidth and the erase bandwidth of the PHY contention. The actual erase bandwidth of the disk is limited by the erase bandwidth of the PHY contention and the ideal disk bandwidth. This involves the number of disks, which is determined based on the batch. When determining the erase batch, the erase batch can be determined based on the erase constraints (such as the overall erase time requirement, the erase time requirement of a single disk, etc.). After determining the erase batch, the number of disks can be obtained. Then, the corresponding capacity already written to the disk is calculated based on the change in the actual erase bandwidth of the disk, and the inner and outer regions are divided according to the capacity already written to the disk. It should be noted that although the term erase bandwidth is used here, as described in the above implementation method, the erase purpose is achieved by writing data. Therefore, the erase bandwidth has the same technical meaning as the write bandwidth mentioned above.

[0065] exist Figure 8 In the illustrated process, let n be the number of erase batches, and obtain the maximum bandwidth of expander. This maximum bandwidth can be obtained through testing, for example, by simultaneously writing data to all disks to be erased to obtain the maximum expander bandwidth. Calculate the erase bandwidth that the disk expansion card can share when the number of erase batches is n (at this time, there is PHY resource contention); that is, expander's built-in scheduling algorithm ensures fairness, and all disks share the write bandwidth, i.e., the erase bandwidth of each disk's PHY contention = (expander maximum bandwidth / (total number of disks / n)). Combining the ideal bandwidth performance of the disk (no PHY resource contention), calculate the actual disk bandwidth during the erase process: actual disk bandwidth = min(ideal bandwidth, erase bandwidth under contention). The actual disk bandwidth is a piecewise function that varies with capacity, as shown in the figure. Figure 4 As shown. In Figure 4 In the case of a two-batch erase operation, the single-disk erase bandwidth is 111 MB / s. With a four-batch erase operation, each disk can utilize 214 MB / s of bandwidth from the disk expansion card; however, the ideal write bandwidth drops below 214 MB / s as the disk write capacity changes. With a three-batch erase operation, each disk can utilize 155 MB / s of bandwidth from the disk expansion card, and the ideal write bandwidth for each disk only falls below 155 MB / s after a considerable period of data writing has begun. Figure 4 The decision was made to erase the image in three batches. This has already been discussed above. Figure 4 The details have been explained in detail, so I will not repeat them here.

[0066] After determining the actual disk bandwidth for each erase batch, the relationship between write volume and bandwidth is calculated, and then the capacity partitioning points for the erase batches and inner / outer regions are determined. For example, in Figure 6 In this context, for a 20TB disk, the capacity partitioning point is 16.6TB. Figure 6 The above has already provided a detailed explanation, so it will not be repeated here.

[0067] In the above text, the value of n was selected based on calculation, or the user can directly provide an expected value of n, and the inner and outer regions can also be calculated based on the expected value of n provided by the user.

[0068] Finally, based on the calculated erase batches and the division of inner and outer regions, the erase process is executed.

[0069] In the above embodiments, considering the significant difference in disk write bandwidth between the inner and outer regions, using a fixed number of disks for erasing cannot fully utilize hardware performance. The solution described in the above embodiments divides the disk into inner and outer regions, with each region employing a different level of concurrency (i.e., erase batches). The outer region, with its larger capacity and higher performance, uses larger erase batches to reduce concurrency and ensure bandwidth per disk. The inner region, with its smaller capacity and lower performance, uses more erase batches to fully utilize the expander bandwidth. It should be noted that although increasing concurrency in the inner region slightly affects disk bandwidth, the inherently lower performance of the inner region means it will not significantly increase erase time. Instead, it can reduce the number of erase batches in the inner region, maximizing expander performance and improving overall erase efficiency.

[0070] In one test, an 864*20T disk was erased with an expander bandwidth limit of 3000MB / s, three erases per disk, and a single disk erase time not exceeding 72 hours. Under these conditions, using the above embodiment to divide the 16.6T capacity into inner and outer regions before erasing resulted in an overall erase time close to the optimal 300 hours, achieving good erase efficiency. The solution in the above embodiment can fully utilize the hardware performance of high-density models (i.e., models with a large number of connected disks) to achieve higher disk erase efficiency and optimal overall erase time and single disk erase time.

[0071] In this embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the methods described in the above embodiments.

[0072] The aforementioned program can run on a processor or be stored in memory (or computer-readable medium). Computer-readable medium includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable medium does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0073] These computer programs may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes can be implemented using different modules, and different steps can be implemented using different modules.

[0074] This embodiment provides such an apparatus or system. The apparatus is referred to as a disk data processing apparatus. Figure 9 This is a schematic diagram of a disk data processing apparatus according to an embodiment of this application, such as... Figure 9 As shown, the device includes a disk data processing device, comprising: a first writing module 92, configured to simultaneously write data to be written to the outer regions of a first number of disks; and a second writing module 94, configured to simultaneously write data to be written to the inner regions of a second number of disks after the outer regions of the first number of disks have been written with data, wherein the second number is greater than the first number, and the storage area of ​​the disk is pre-divided into the inner region and the outer region, wherein the outer region is the storage area from the starting point of data storage to a predetermined capacity, and the inner region is the storage area from the predetermined capacity to the point where the disk is full of data.

[0075] The system or apparatus is used to implement the functions of the methods in the above embodiments. Each module in the system or apparatus corresponds to each step in the method, as has been described in the method and will not be repeated here.

[0076] Optionally, it further includes: a determining module, used to determine the capacity partitioning point of the disk, wherein the capacity partitioning point is used to identify the value of the predetermined capacity; and a partitioning module, used to divide the disk into the inner region and the outer region according to the capacity partitioning point, wherein the outer region is the storage area from the starting point of data storage to the capacity partitioning point, and the inner region is the storage area from the capacity partitioning point to the point where the disk is full of data.

[0077] Optionally, the determining module is used to determine the actual write bandwidth of the disk, wherein the actual write bandwidth of the disk varies with the capacity; determine the capacity partitioning point of the disk based on the relationship between the actual write bandwidth and the capacity and the data erasure constraint; wherein, when the decrease in the actual write bandwidth of the disk meets the data erasure constraint, the amount of data already written to the disk is obtained; and the capacity partitioning point of the disk is determined based on the amount of data already written to the disk.

[0078] Optionally, when writing data to be written simultaneously through an intermediate device, the determining module is configured to: obtain the maximum bandwidth of the intermediate device, wherein the intermediate device is connected to multiple disks, the bandwidth of the intermediate device is shared by the multiple disks connected to the intermediate device, and the maximum bandwidth is the maximum bandwidth when writing data simultaneously to all disks connected to the intermediate device; divide the maximum bandwidth by the first number to obtain the first bandwidth of the disk; obtain the second bandwidth for writing data to the disk, wherein the second bandwidth is the maximum bandwidth when writing data directly to the disk without going through the intermediate device; and take the minimum value between the first bandwidth and the second bandwidth as the actual write bandwidth of the disk.

[0079] Optionally, the determining module is configured to obtain the actual write bandwidth of a single disk when writing data to be written to multiple disks simultaneously; calculate the total write bandwidth occupied when writing to multiple disks simultaneously based on the actual write bandwidth of the single disk; and obtain the amount of data already written to the disk when the total write bandwidth is less than the maximum bandwidth of the intermediate device; or, the determining module is configured to obtain the amount of data already written to the single disk when the actual write bandwidth of a single disk is less than the first bandwidth.

[0080] Optionally, it further includes: a second determining module, configured to determine the second quantity based on the maximum bandwidth of the intermediate device and the actual write bandwidth of the disk.

[0081] Optionally, it further includes: a calculation module, used to obtain the total number M of disks to be written and the batch n of data writing, wherein the M disks are divided into n batches for data writing respectively, and each batch of disks is written to simultaneously; the first number is obtained by dividing the total number by the batch.

[0082] Optionally, the value of batch n is pre-input; or, the batch n is determined according to the following steps: for each of the multiple possible values ​​of the batch n, calculate the time to complete the data writing after dividing the M disks into batches according to the possible value, wherein the time includes a first time and / or a second time, the first time being the time to complete the data writing of a single batch of disks, and the second time being the time to complete the data writing of all batches of disks; select the possible value that meets the requirements as the value of the batch n according to the data writing completion time corresponding to each possible value.

[0083] The above embodiments solve the problem of low efficiency in erasing old data by writing data to the disk in the prior art. Furthermore, by utilizing the properties of the inner and outer areas of the disk, different numbers of disks are used to write data to the inner and outer areas of the disk simultaneously, thereby improving the efficiency of data writing.

[0084] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A disk data processing method, comprising: Write the data to be written to the outer area of ​​the first number of disks simultaneously; After data has been written to the outer areas of the first number of disks, the data to be written is simultaneously written to the inner areas of the second number of disks, wherein the second number is greater than the first number. The storage area of ​​the disk is pre-divided into the inner area and the outer area. The outer area is the storage area from the starting point of data storage to a predetermined capacity, and the inner area is the storage area from the predetermined capacity to the point where the disk is full of data. The predetermined capacity is represented by a capacity division point. The capacity division point is the amount of data that has been written to the disk when the total write bandwidth occupied when writing to multiple disks simultaneously is less than the maximum bandwidth of the intermediate device. The maximum bandwidth is the maximum bandwidth when the intermediate device writes data to all disks connected to it simultaneously.

2. The method of claim 1, wherein, Before simultaneously writing the data to be written to the outer regions of the first number of disks, the method further includes: Determine the disk capacity partitioning points; The disk is divided into the inner region and the outer region according to the capacity division point.

3. The method of claim 2, wherein, Determining disk capacity partitioning points includes: Determine the actual write bandwidth of the disk, wherein the actual write bandwidth of the disk varies with its capacity; Based on the relationship between the actual write bandwidth and capacity and the data erasure constraint, the capacity partitioning point of the disk is determined; wherein, when the decrease in the actual write bandwidth of the disk meets the data erasure constraint, the amount of data already written to the disk is obtained; the capacity partitioning point of the disk is determined based on the amount of data already written to the disk.

4. The method of claim 3, wherein, When writing data to be written simultaneously through an intermediate device, determining the actual write bandwidth of the disk includes: Obtain the maximum bandwidth of the intermediate device, wherein the intermediate device is connected to multiple disks, and the bandwidth of the intermediate device is shared by the multiple disks connected to the intermediate device; The first bandwidth of the disk is obtained by dividing the maximum bandwidth by the first quantity. Obtain a second bandwidth for writing data to the disk, wherein the second bandwidth is the maximum bandwidth when writing data directly to the disk without going through the intermediate device; The minimum value between the first bandwidth and the second bandwidth is taken as the actual write bandwidth of the disk.

5. The method of claim 4, wherein, The method further includes: The actual write bandwidth of a single disk is obtained when data to be written is written to multiple disks simultaneously.

6. The method according to claim 4, wherein, When the decrease in the actual write bandwidth of the disk meets the data erase constraint, obtaining the amount of data already written to the disk includes: When the actual write bandwidth of a single disk is less than the first bandwidth, the amount of data that has been written to the single disk is obtained.

7. The method according to any one of claims 4 to 6, wherein, Also includes: The second quantity is determined based on the maximum bandwidth of the intermediate device and the actual write bandwidth of the disk.

8. The method according to any one of claims 1 to 6, wherein, Before simultaneously writing the data to be written to the outer regions of the first number of disks, the method further includes: The total number M of disks to be written and the batch n of data writing are obtained, wherein the M disks are divided into n batches for data writing, and each batch of disks is written to simultaneously. The first quantity is obtained by dividing the total quantity by the batch.

9. The method according to claim 8, wherein, The value of batch n is pre-input; or, The batch n is determined according to the following steps: For each possible value of the batch n, calculate the time to complete the data writing after dividing the M disks into batches according to the possible value, wherein the time includes a first time and / or a second time, the first time is the time to complete the data writing of a single batch of disks, and the second time is the time to complete the data writing of all batches of disks; select the possible value that meets the requirements as the value of the batch n according to the data writing completion time corresponding to each possible value.

10. The method according to any one of claims 1 to 6, wherein, The disk in question is a disk that has been used on the server.

11. A disk data processing apparatus, comprising: The first write module is used to simultaneously write the data to be written to the outer area of ​​a first number of disks; The second writing module is used to simultaneously write the data to be written to the inner area of ​​the second number of disks after the outer areas of the first number of disks have been written with data, wherein the second number is greater than the first number, and the storage area of ​​the disk is pre-divided into the inner area and the outer area, wherein the outer area is the storage area from the starting point of the data storage to a predetermined capacity, and the inner area is the storage area from the predetermined capacity to the point where the data fills the disk. The predetermined capacity is represented by a capacity division point, which is the amount of data that has been written to a disk when the total write bandwidth occupied when writing to multiple disks simultaneously is less than the maximum bandwidth of the intermediate device. The maximum bandwidth is the maximum bandwidth when the intermediate device writes data to all disks connected to it simultaneously.

12. The apparatus according to claim 11, wherein, It also includes: a determining module for determining the capacity partitioning point of the disk; and a partitioning module for dividing the disk into the inner region and the outer region according to the capacity partitioning point. The determining module is used to determine the actual write bandwidth of the disk, wherein the actual write bandwidth of the disk varies with its capacity; determine the capacity partitioning point of the disk based on the relationship between the actual write bandwidth and its capacity and data erasure constraints; wherein, when the decrease in the actual write bandwidth of the disk meets the data erasure constraints, the amount of data already written to the disk is obtained; and the capacity partitioning point of the disk is determined based on the amount of data already written to the disk. When writing data to be written simultaneously through an intermediate device, the determining module is configured to: obtain the maximum bandwidth of the intermediate device, wherein the intermediate device is connected to multiple disks, and the bandwidth of the intermediate device is shared by the multiple disks connected to the intermediate device; divide the maximum bandwidth by the first number to obtain the first bandwidth of the disk; obtain the second bandwidth for writing data to the disk, wherein the second bandwidth is the maximum bandwidth when writing data directly to the disk without going through the intermediate device; and take the minimum value between the first bandwidth and the second bandwidth as the actual write bandwidth of the disk. The determining module is used to obtain the actual write bandwidth of a single disk when writing data to be written to multiple disks simultaneously, or the determining module is used to obtain the amount of data already written to a single disk when the actual write bandwidth of a single disk is less than the first bandwidth; It also includes: a second determining module, used to determine the second quantity based on the maximum bandwidth of the intermediate device and the actual write bandwidth of the disk; It also includes: a calculation module, used to obtain the total number M of disks to be written and the batch n of data writing, wherein the M disks are divided into n batches for data writing respectively, and the disks in each batch are written to simultaneously; the first number is obtained by dividing the total number by the batches. The value of batch n is pre-input; or, batch n is determined according to the following steps: for each of the multiple possible values ​​of batch n, calculate the time to complete the data writing after dividing the M disks into batches according to the possible value, wherein the time includes a first time and / or a second time, the first time being the time to complete the data writing of a single batch of disks, and the second time being the time to complete the data writing of all batches of disks; select the possible value that meets the requirements as the value of batch n according to the data writing completion time corresponding to each possible value.

13. An electronic device comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the steps of the method according to any one of claims 1 to 10.

14. A readable storage medium having computer instructions stored thereon, wherein, When executed by a processor, the computer instructions implement the steps of the method described in any one of claims 1 to 10.