Abstract:
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 is a redundancy array of independent disk 0 (RAID 0) system The disk array system includes a plurality of disks. The data processing method includes: receiving a reading command; determining whether to divide the reading command to a plurality of reading command segments according to the reading command; and assigning the reading command to a corresponding disk of the disks to read data stored in the corresponding disk accordingly when it is determined that the reading command is not divided.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    This application claims the priority benefit of Taiwan application serial No. 102118070, 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 
       [0002]    1. Field of the Invention 
         [0003]    The disclosure relates to a disk array system and a data processing method. 
         [0004]    2. Description of the Related Art 
         [0005]    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. 
         [0006]    The disk array system may be a redundancy array of independent disks 0 (RAID 0) system which includes a plurality of disks. When operating the writing process in RAID 0 system, the data are divided to a plurality of data segments, and then the data segments are written to different disks, respectively. When operating the reads data in RAID 0 system, the data segments are taken out from different disks and reassembled, and then are sent back to a host. 
         [0007]    However, since the RAID 0 system should reassemble the data segments according to each of the reading commands, the RAID 0 system cannot apply a disk access technology, such as a native command queuing (NCQ) technology, to continuously read the data stored in the disk and improve a data access speed. 
       BRIEF SUMMARY OF THE INVENTION 
       [0008]    A disk array system includes a plurality of disks and a control device. The control device receives a reading command and determines whether to divide the reading command to a plurality of reading command segments according to the reading command. When the control device determines not to divide the reading command, the control device assigns the reading command to a corresponding disk of the disks to read data stored in the corresponding disk according to the reading command. 
         [0009]    When the control device determines to divide the reading command, the control device divides the reading command to the reading command segments, and the reading command segments are assigned to the disks, respectively, to make the disks read the data according to the reading command segments. 
         [0010]    A data processing method is applied to a disk array system. The disk array system is a RAID 0 system and includes a plurality of disks. The data processing method includes following steps: receiving a reading command, determining whether to divide the reading command to a plurality of reading command segments according to the reading command; and assigning the reading command to a corresponding disk of the disks to read data stored in the corresponding disk accordingly when the reading command is not divided. 
         [0011]    In sum, when the disk array system continuously receives a plurality of reading commands which do not need to he divided, the reading commands are assigned to corresponding disks, respectively, to improve a data reading speed and extend a service life of the disks. 
         [0012]    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. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0013]      FIG. 1 . is a schematic diagram showing a disk array system in an embodiment; 
           [0014]      FIG. 2  is a flow chart showing a data processing method in an embodiment; and 
           [0015]      FIG. 3  is a flow chart showing a specific step of the data processing method in  FIG. 2 . 
       
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
       [0016]      FIG. 1 . is a schematic diagram showing a disk array system  100  in an embodiment. The disk array system  100  includes a control device  130  and a plurality of disks, such as a first disk  110  and a second disk  120 . The control device  130  is electrically connected to the first disk  110 , the second disk  120  and a host  10 , respectively. 
         [0017]    In the embodiment, the control device  130  may be achieved via a logic circuit, an integrated circuit, a programmable logic device (PLD) or a complex programmable logic device (CPLD). Furthermore, the control device  130  may include a decoder  132  and a controller  134 , which is not limited herein. 
         [0018]    In the embodiment, the first disk  110  and the second disk  120  includes 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). Each of the storage spaces corresponds to one of multiple logic block addresses (LBA) of the disk array system  100 , respectively. That means, each of the multiple LBAs of the disk array system  100  directs one storage space of the first disk  110  or the second disk  120 , respectively. The storage space directed by the LBA of the disk array system  100  are configured alternately in the first disk  110  and the second disk  120 , in which the data stored in the first disk  110  are different from the second disk  120 , to form a disk configuration of the RAID 0 system. In the embodiment, the number of the disks is two which is not limited herein. 
         [0019]      FIG. 2  is a flow chart showing a data processing method  200  in an embodiment. The data processing method  200  can be applied to the disk array system  100  in  FIG. 1 , which is not limited herein. 
         [0020]    The steps of the data processing method  200  illustrated hereinafter do riot need to be executed in a specific sequence unless expressly stated. Moreover, the steps can be executed at the same time. 
         [0021]    First, after the disk array system  100  starts operation, the control device  130  receives a reading command from the host  10  (step S 1 ). The reading command includes a data starting address LBA_S and a data length Seccnt. The data starting address LBA_S is a start LBA of the data corresponding to the reading command in the disk array system  100 , and the data length Seccnt is the data size corresponding reading command. 
         [0022]    Then, the control device  130  determines whether to divide the reading command to a plurality of reading command segments, such as a first reading command segment and a second reading command segment, accordingly (step S 2 ). The first reading command segment only corresponds to the data stored in the first disk  110 , and the second reading command segment only corresponds to the data stored in the second disk  120 . 
         [0023]    When the control device  130  determines not to divide the reading command, the control device  130  assigns the reading command to the first disk  110  or the second disk  120  according to the data starting address LBA_S of the reading command, so as to read the data stored in the first disk  110  or the second disk  120  according to the reading command (step S 3 ). The control device  130  sends the data back to the host  10  (step S 4 ). 
         [0024]    On the other hand, when the control device  130  determines that the reading command needs to be divided into the first reading command segment and the second reading command segment, the control device  130  divides the reading command to the first reading command segment and the second reading command segment (step S 5 ). The control device  130  assigns the first reading command segment and the second reading command segment to the first disk  110  and the second disk  120 , respectively, so as to make the first disk  110  read the data segments stored in the first disk  110  according to the first reading command segment, and make the second disk  120  read the data segments stored in the second disk  120  according to the second reading command segment (step S 6 ). The control device  130  reassembles the data segments from the first disk  110  and the second disk  120 , and the reassembled data segments are taken as the data read by the disk array system  100  according to the reading command (step S 7 ). The control device  130  sends the data back to the host  10  (step S 4 ). 
         [0025]    As stated above, when the disk array system  100  continuously receives multiple reading commands which do not need to be divided from the host  10 , the control device  130  assigns the reading, commands to the first disk  110  and the second disk  120 , respectively, so as to read the data stored in the first disk  110  and the second disk  120  at the same time according to the reading commands to increase the data reading speed. 
         [0026]    Furthermore, when the disk array system  100  continuously receives multiple reading commands which do not need to he divided from the host  10 , the disk array system  100  can also apply a disk access technology, such as a native command queuing (NCQ) technology, to continuously read the data stored in the first disk  110  or the second disk  120  to effectively improve the data reading speed and extend the service life of the disks. The data processing method  200  can he 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. 
         [0027]    Operations relating to determining whether to divide the reading, command segments to the first reading command segment and the second reading command segment are illustrated hereinafter, which is not limited herein. 
         [0028]      FIG. 3  is a flow chart showing a specific step of the data processing method  200  in  FIG. 2 . The steps illustrated hereinafter do not need to he executed in a specific sequence unless expressly stated. Moreover, the steps can be executed at the same time. 
         [0029]    First, the control device  130  analyzes the data starting address LBA_S and the data length Seccnt of the reading command via the decoder  132  (step S 21 ). Then the control device  130  finds out a start disk number DS via the controller  134  according to the data starting address LBA_S and the strip size (step S 22 ). The start disk number DS is the number of the disk directed by the data starting address LBA_S. On the other hand, the control device  130  adds the data starting address LBA_S and the data length Seccnt to obtain a data end address LBA_E via the controller  134  (step S 23 ). The data end address LBA_E is the end IL BA of the data corresponding to the reading command in the disk array system  100 . 
         [0030]    The control device  130  finds out an end disk number DE via the controller  134  according to the data end address LBA_E and the strip size (step S 24 ). The end disk number DE is the number of the disk directed by the data end address LBA_E. The control device  130  compares the start disk number DS and the end disk number DE via the controller  134  to determine whether to divide the reading command (step S 25 ). 
         [0031]    If the start disk number DS and the end disk number DE corresponding to the reading command are different, it means that the data corresponding to the reading command are stored in the first disk  110  and the second disk  120 , respectively. The controller  134  determines the reading command needs to be divided, and executes the step S 5 . 
         [0032]    If the start disk number DS and the end disk number DE corresponding to the reading command are the same, the control device  130  further determines whether the data length of the reading command is larger than the strip size via the controller  134  (step S 26 ). If yes, it means that the data corresponding to the reading command are stored in the first disk  110  and the second disk  120 , respectively. Thus, the controller  134  determines the reading command needs to he divided, and executes the step S 5 . 
         [0033]    If no, it means that the data corresponding to the reading command are stored in the first disk  110  or the second disk  120 . The controller  134  determines the reading command does not need to be divided, and executes the step S 3 . 
         [0034]    In other words, the control device  130  can determine whether the data corresponding to each reading command are stored in both of the first disk  110  and the second disk  120  or stored in one of the first disk  110  and the second disk  120  via the controller  134 , so as to determine whether to divide the reading command 
         [0035]    In an embodiment, the strip size may include  16  storage spaces directed by the LBAs. Thus, the storage spaces directed by the LBAs, such as 0x0000 to 0x0001; 0x0020 to 0x002F and 0x0040 to 0x004F, of the disk array system  100  are in the first disk  110 . The storage spaces directed by the LBAs, such as 0x0010 to 0x001F, 0x0030 to 0x003F and 0x0050 to 0x005F, of the disk array system  100  are in the second disk  120 . 
         [0036]    In the embodiment, the disk array system  100  continuously receives the reading commands R_a to R_c. 
         [0037]    If the data starting address LBA_S_a of the reading command R_a is 0x0001 and the data length Seccnt a is 0x0F, the start disk number DS_a corresponding to the reading command Ra is 0, which refers to the first disk  110 . The data end address LBA_E_a of the reading command R_a is LBA_S_a+Seccnt_a−1=0x000F and thus the end disk number DE_a corresponding to the reading command Ra is 0, which refers to the first disk  110 . 
         [0038]    Since the start disk number DS_a and the end disk number DE_a are the same, and the data. length Seccnt_a is not larger than the strip size, the control device  130  determines the reading command R_a does not need to be divided via the controller  134 , and assigns the reading command R_a to the first disk  110  to read the data according to the start disk number corresponding to the reading command R_a. 
         [0039]    If the data starting address LBA_S_b of the reading command R_b is 0x0010 and the data length Seccnt_b is 0x0F the start disk number DS_b corresponding, to the reading command R_b is 1, which refers to the second disk  120 . The data end address LBA_E_b of the reading command R_b is LBA_S_b+Seccnt_b−1=0x001E, and thus the end disk number DE_b corresponding to the reading command R_b is 1, which refers to the second disk  120 . 
         [0040]    Since the start disk number DS b and the end disk number DE_b are the same, the control device  130  determines that the reading command R_b does not need to be divided via the controller  134 , and assigns the reading command R_b to the second disk  120  to read the data according to the start disk number corresponding to the reading command R_b. 
         [0041]    if the data starting address LBA_S_c of the reading command R_c is 0x0101 and the data length Seccnt_c is 0x10, the start disk number DS_c corresponding to the reading command R_c is 0, which refers to the first disk  110 . The data end address LBA_E_c of the reading command R_c LBA_S_c Seccnt_c−1=0x0110, and thus the end disk number DE_c corresponding to the reading command R_c is 1, which refers to the second disk  120 . 
         [0042]    Since the start disk number DS_c and the end disk number DE_c are different, the control device  130  determines the reading command R_c needs to be divided via the controller  134 , and divides the reading command R_c to the first reading command segment and the second reading command segment. 
         [0043]    As stated above, the control device  130  can determines whether to divide the reading command segments to the first reading command segment and the second reading command segment. 
         [0044]    Methods of calculating the start disk number DS or the end disk number DE of the reading command are illustrated hereinafter, which is not limited herein. 
         [0045]    In the embodiments stated above, the method of calculating the start disk number DS or the end disk number DE corresponding to the reading command may be setting a first operating parameter S_size — 1 according to the strip size. The first operating parameter S_size — 1 may be a binary expression of the stripe size. For example, if the stripe size is 16, the first operating parameter S_size — 1 is 8′b0001 — 0000. Then, the control device  130  logically adds a lowest byte of the first operating parameter S_size — 1 and a lowest byte of the data starting address LBA_S or the data end address LBA_E via the controller  134  to get a first operating value. The control device  130  calculates the start disk number DS or the end disk number DE corresponding to the reading command according to whether the first operating value has the number “1”. 
         [0046]    For example, the control device  130  logically adds 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 Ra via the controller  134  to get the first operating value 8′b0000 — 0000. The first operating value does not have the number “1”, and thus the start disk number DS_a is 0. 
         [0047]    The control device  130  logically adds the lowest byte (8′b0001 — 0000) of the first operating parameter S_size — 1 and the lowest byte (8′b0001 — 1111) of the data end address LBA_E_a (0x000F) of the reading command R_a to get the first operating value 8′b0001 — 0000. The first operating value does not have the number 1, and thus the end disk number DE_a is 0. 
         [0048]    The control device  130  logically adds 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 controller  134  to get the first operating value 8′b0001 — 0000. The first operating value has the number “1”, and thus the start disk number DS_b is 1. 
         [0049]    The control device  130  logically adds the lowest byte (8′b0001 — 0000) of the first operating parameter S_size — 1 and the Slowest byte (8′b0001 — 1110) of the data end address LBA_E_b (0x001E) of the reading command R_b to get the first operating value 8′b0001 — 0000. The first operating value has the number 1, and thus the end disk number DE_b is 1. 
         [0050]    The control device  130  logically adds 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 (0x0101) of the reading command Re via the controller  134  to get the first operating value 8′b0000 — 0000. The first operating value does not have the number “1”, and thus the start disk number DS_c is 0. 
         [0051]    The control device  130  logically adds the lowest byte (8′b0001 — 0000) of the first operating parameter S_size — 1 and the lowest byte (8′b0001 — 0000) of the data end address LB_E_c (0x0110) of the reading command Re to get the first operating value 8′b0001 — 0000. The first operating value has the number 1, and thus the end disk number DE_c is 1. 
         [0052]    In another embodiment, the method of calculating the start disk number DS or the end disk number DE corresponding to the reading command may also be that the control device  130  sets a second operating parameter S_size — 2 via the controller  134  according to the strip 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 device  130  shifts the data starting address LBA_S or the data end address LBA_E to the right via the controller  134  according to the second operating parameter S_size — 2 to get a second operating value. The control device  130  takes a lowest bit of the second operating value as the start disk number DS or the end disk number DE via the controller  134 . 
         [0053]    For example, when the second operating parameter S_size — 2 is 0x04, the control device  130  shifts the data starting address LBA_S_a (0x0001) of the read command R_a to the right by four bits via the controller  134  to get the second operating value 0x0000. The lowest bit of the second operating value is 0, and thus the start disk number DS_a is 0. On the other hand, the control device  130  shifts the data starting address LBA_E_a (0x000F) of the read command Ra to the right by four bits via the controller  134  to get the second operating value 0x0000. The lowest bit of the second operating value is 0, and thus the end disk number DE_a is 0. 
         [0054]    The control device  130  shifts the data starting address LBA_S_b (0x0010) of the read command R_b to the right by four bits via the controller  134  to get the second operating value 0x0001, The lowest bit of the second operating value is 1, and thus the start disk number DS_b is 1. On the other hand, the control device  130  shifts the data starting address LBA_E_b (0x001E) of the read command R_b to the right by four bits via the controller  134  to get the second operating value 0x000F. The lowest bit of the second operating value is 1, and thus the end disk number DE_b is 1. 
         [0055]    The control device  130  shifts the data starting address LBA_S_c (0x0101) of the read command R_c to the right by four bits via the controller  134  to get the second operating value 0x0010. The lowest bit of the second operating value is 0, and thus the start disk number DS_c is 0. On the other hand, the control device  130  shifts the data starting address LBA_E_c (0x0110) of the read command R_c to the right by four bits via the controller  134  to get the second operating value 0x0011. The lowest bit of the second operating value is 1, and thus the end disk number DE_c is 1. 
         [0056]    As stated. above the control device  130  can calculate the start disk number DS or the end disk number DE corresponding to the reading command. 
         [0057]    Although the present disclosure has been described in considerable detail with reference to certain preferred embodiments thereof, the disclosure is not for limiting the scope. Persons having ordinary skill in the art may make various modifications and changes without departing from the scope. Therefore, the scope of the appended claims should not be limited to the description of the preferred embodiments described above.