Disk array system and data processing method

A disk array system and a data processing method are provided. The data processing method is applied to the disk array system. The disk array system includes a first disk and a second disk. The data processing method includes: receiving a reading command, wherein the reading, command includes a data starting address; determining to assign the reading command to the first disk or the second disk according to the data starting address of the reading command and a stripe size; and reading corresponding data according to the reading command from the first disk or the second disk which receives the reading command.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan application serial No. 1021118072, filed on May 22, 2013. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of specification.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The disclosure relates to a disk array system and a data processing method thereof.

2. Description of the Related Art

As the electronic technology develops, a disk array system stored data is widely used in electronic devices, such as a personal computer (PC) and a network server.

The disk array system may be a redundancy array of independent disks 1 (RAID 1) system. The RAID 1 system includes a plurality of disks. When operating the writing data process in RAID 1 system, the data is written to different disks at the same time (which means the RAID 1 system backups the data in a main disk via at least one image disk) to improve the data reliability. When operating the reading data process in RAID 1 system, the data is read from one single disk (such as the main disk) and then send the data back to the host. Thus, the reading speed of the RAID 1 system is limited by the reading speed of the disk, which causes the efficiency of read to be difficultly improved.

BRIEF SUMMARY OF THE INVENTION

A disk array system is provided. In an embodiment, the disk array system is electrically connected to a host and receives a reading command of the host. The reading command includes a data starting address. The disk array system includes a first disk, a second disk and a control device. The control device receives the reading command and assigns the reading command to the first disk or the second disk according to the data starting address and a stripe size of the reading command. The first disk or the second disk which receives the reading command reads corresponding data according to the reading command.

A data processing method is also provided. In an embodiment, the data processing method is applied to a disk array system. The disk array system is electrically connected to a host. The disk array system includes a first disk and a second disk. The data processing method includes: receiving a reading command, wherein the reading command includes a data starting address; determining to assign the reading command to the first disk or the second disk according to the data starting address and a stripe size of the reading command; and reading corresponding data according to the reading command via the first disk or the second disk which receives the reading command.

These and other features, aspects and advantages of the present disclosure will become better understood with regard to the following description, appended claims, and accompanying drawings.

DETAILED DESCRIPTION OF THE EMBODIMENTS

FIG. 1is a schematic diagram showing a disk array system100in an embodiment. The disk array system100includes a control device130and a plurality of disks, such as a first disk110and a second disk120. The control device130is electrically connected to the first disk110, the second disk120and the host10, respectively.

In an embodiment, the control device130may be achieved via a logic circuit, an integrated circuit, a programmable logic device (PLD) or a complex programmable logic device (CPLD). Furthermore, the control device130may include a decoder132and a controller134, which is not limited herein.

In the embodiment, the first disk110and the second disk120includes a plurality of stripes, respectively. Each of the stripes includes a plurality of storage spaces (the number of the storage spaces of each of the stripes is called a stripe size, which can be set by the user). A plurality of logic block addresses (LAB) of the disk array system100correspond to the storage space of the first disk110or the storage space of the second disk120, and data stored in the first disk110and the second disk120are the same, which forms a disk configuration of the RAID 1 system. In the embodiment, the number of the disks is two, which is not limited herein.

FIG. 2is a flow chart showing a data processing method200in an embodiment. The data processing method200is applied to the disk array system100inFIG. 1, which is not limited herein.

The steps of the data processing method200illustrated hereinafter does not need to be executed in a specific sequence unless expressly stated. Moreover, the steps can be executed at the same time.

First, after the disk array system100starts operation, the control device130receives the reading command from the host10(step S1). The reading command includes a data starting address LAB_S and a data length Seccnt. The data starting address LAB_S means a start logic, block address of the corresponding data in the disk array system100. The data length Seccnt means the corresponding data size.

Then, the control device130analyzes the data starting address LAB_S of the reading command via the decoder132(step S2). The control device130determines to assign the reading command to the first disk110or the second disk120via the controller134according to the data starting address and the stripe size of the reading command (step S3).

After the first disk110or the second disk120receives the reading command, the first disk110or the second disk120which receives the reading command reads the corresponding data stored in the first disk110or the second disk120according to the data starting address LAB_S and the data length Seccnt of the reading command (step S4). The first disk110or the second disk120which receives the reading command sends the corresponding data and a corresponding state to the host10via the control device130(step S5). The corresponding state may be a reading normal state or a reading error state.

When the disk array system100continuously receives multiple reading commands from the host10, the control device130assigns the reading commands to the first disk110and the second disk120, respectively, so as to make the first disk110and the second disk120read data according to the received reading command at the same time and increase the data reading speed.

In an embodiment, the disk array system100may also use a disk access technology, such as a native command queuing (NCQ) technology, to continuously read the data stored in the first disk110or the second disk120, which can efficiently increase the data reading speed and extend the service life of the disk.

The data processing method200can be applied to various transmission interfaces, such as a serial advanced technology attachment (SATA) interface, a small computer system interface (SCSI) interface or a universal serial bus (USB) interface, which is not limited herein.

Operations of assigning the reading command is illustrated hereinafter, which is not limited, herein.

In an embodiment, the stripe size can be set as 16, which means each of the stripes includes storage spaces directed by 16 LBAs. The LBAs of the disk array system100are 0x0000 to 0x000F, 0x0010 to 0x001F, 0x0020 to 0002F and so on, which can direct the storage spaces of the first disk110or the second disk120.

In the embodiment, the disk array system100continuously receives the reading commands R_a to R_c. The data starting address LAB_S_a of the reading command R_a is 0x0001. The data starting address LAB_S_b of the reading command R_b is 0x0010. The data starting address LAB_S_c of the reading command R_c is 0x0100.

The control device130can assign the reading command Ra to the first disk110, assign the reading command R_b to the second disk120, and assign the reading command R_c to the first disk110, respectively, according to the stripe size and the data starting addresses LAB_S_a to LAB_S_c.

For example, the control device130can set a first operating parameter S_size_1 via the controller134according to the stripe size. The first operating parameter S_size_1 may be a binary expression of the stripe size. For example, it the stripe size is 16, the first operating parameter S_size_1 is 8′b0001_0000. Then, the control device130logically adds lowest bytes of the first operating parameter S_size_1 and the data starting addresses LAB_S_a to LAB_S_c via the controller134to get a first operating value, and the control device130determines to assign the reading commands R_a to R_c to the first disk110or the second disk120according to whether the first operating value has the number “1”.

For example, the control device130executes AND logic operation between the lowest byte (8′b0001_0000) of the first operating parameter S_size_1 and the lowest byte (8′b0000_0001) of the data starting address LBA_S_a (0x0001) of the reading command R_a via the controller134to get the first operating value 8′b0000_0000. The first operating value does not have the number “1”, and thus the reading command R_a is assigned to the first disk110.

Additionally, the control device130may execute AND logic operation between the lowest byte (8′b0001_0000) of the first operating parameter S_size_1 and the lowest byte (8′b0001_0000) of the data starting address LBA_S_b (0x0010) of the reading command R_b via the controller134to get the first operating value 8′b0001_0000. The first operating value has the number 1, and thus the reading command R_b is assigned to the second disk120.

The control device130executes AND logic operation between the lowest byte (8′b0001_0000) of the first operating parameter S_size_1 and the lowest byte (8′b0000_0000) of the data starting address LBA_S_c (0x0100) of the reading command R_c via the controller134to get the first operating value 8′b0000_0000. The first operating value does not have the number “1”, and thus the reading command R_c is assigned to the first disk110.

The first disk110and the second disk120can read the data stored therein at the same time according to the reading commands R_a to R_c to increase the data reading speed.

In an embodiment, the control device130can determine to assign the reading commands R_a to R_c by a different way.

For example, the control device130can also set a second operating parameter S_size_2 via the controller134according to the stripe size. The second operating parameter S_size_2 may be a base 2 log of the stripe size. For example, if the stripe size is 16, the second operating parameter S_size_2 is 0x04. Then, the control device130shifts the data starting address LAB_S to the right via the controller134according to the second operating parameter S_size_2 to get a second operating value. The control device130determines to assign the reading commands R_a to R_c to the first disk110or the second disk120via the controller134according to the lowest hit of the second operating value.

For example, when the second operating parameter S_size_2 is 0x04, the control device130shifts the data starting address LAB_S_a (0x0001) of the reading command R_a to the right by four bits via the controller134to get the second operating value 0x0000. The lowest bit of the second operating value is 0, and thus the reading command R_a is assigned to the first disk110. The control device130shifts the data starting, address LAB_S_a (0x0010) of the reading command R_b to the right by four bits via the controller134to get the second operating value 0x0001. The lowest bit of the second operating value is 1, and thus the reading command R_b is assigned to the second disk120.

The control device130shifts the data starting address LAB_S_c (0x0100) of the reading command R_c to the right by four bits via the controller134to get the second operating value 0x0010. The lowest bit of the second operating value is 0, and thus the reading command R_c is assigned to the first disk110.