Abstract:
A storage device uses an inventive alternate processing method for accommodating defective sectors of the storage device. The storage device includes a host interface, an alternate process controller which controls the storage and transfer of user data in and among the components of the apparatus, a memory which has a user sector area, an alternate information area, and a spare sector area, and a buffer memory which may be a part of the controller. User data addressed to normal sectors of memory are stored directly in the user sector area. When user data is addressed to a defective sector, the controller performs alternate processing and temporarily stores the data in the buffer memory. A plurality of user data sectors stored in the buffer memory are then written by the controller at one time to the spare sector area of memory using address data in the alternate information area.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention generally relates to a storage device and an alternate processing method for defective sectors of the storage device, and more particularly, the present invention relates to a non-volatile semiconductor memory with block unit erase only for performing erasure of data at the block unit level, and an alternate processing method for defective sectors of the non-volatile semiconductor memory. 
     This application is a counterpart of Japanese application Serial Number 145714/1998, filed May 27, 1998, the subject matter of which is incorporated herein by reference. 
     2. Description of the Related Art 
     In general, an external memory serves as an auxiliary memory for information processing equipment. The external memory has a buffer memory and a cache controller which temporarily stores data supplied from the information processing equipment, for example a host computer, for improving access speed, or which temporarily stores data during the reading of data from a memory that is being transferred to the host computer. The external memory is made up of a disk memory and a controller which controls the disk memory, and is integrated as a peripheral apparatus that is provided a peripheral controlling function by using an internal bus. Recently, a non-volatile semiconductor memory is being used for the memory. The non-volatile semiconductor memory is for example an EPROM (erasable programmable ROM) or an EEPROM (electrically erasable programmable ROM). 
     Further, the external memory recognizes that a sector is defective when a normal write and read to the sector can not be performed, and it writes the result to a defective sector map. For example, a magnetic disk with a capacity of 2 Gbytes may have a memory including a write area with 2000 error sectors in the defective sector map. This is a conventional alternate processing method for defective sectors. Detection of a defect is performed when the disk memory is formed or low level formatting is performed. A LBA (logical block address) is assigned for normal sectors when logical formatting is performed. Defective sectors occur when the disk memory is operated. At this time, the LBA is assigned by the logical formatting, and as a result the defective sectors are written to the defective sector map. Further, an alternate sector is provided. 
     It is desirable to use the sectors effectively by decreasing the number of data writing operations for an alternate processing. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to provide a storage device that can use the sectors effectively by decreasing the number of data writing operations for alternate processing. 
     According to one aspect of the present invention, for achieving the above object, there is provided a storage device comprising: a memory which has a user sector area, an alternate information area, and a spare sector area, the user sector area stores user data, the alternate information area stores information identifying a defective sector and an alternate sector which is alternated for the defective sector, and the spare sector area stores user data written to the defective sector; an alternate processing controller which reserves a sector of the spare sector area instead of the defective sector when the defective sector is present in the user sector area and which controls the writing of user data to all normal sectors of the user sector area; and a data storing unit which temporarily stores, when performing alternate processing, the data which is written to the defective sector; wherein the alternate processing controller stores data to the data storing unit when performing an alternate processing on data which is written to the defective sector, and transfers at one time a plurality of sector data from the data storing unit to the spare sector area. 
     According to another aspect of the present invention, for achieving the above object, there is provided a storage device comprising: a memory which has a user sector area, an alternate information area, and a spare sector area, the user sector area stores user data, the alternate information area stores information identifying a defective sector and an alternate sector which is alternated for the defective sector, and the spare sector area stores user data written to the defective sector; an alternate processing controller which reserves a sector of the spare sector area instead of the defective sector when the defective sector is present in the user sector area and which controls the writing of user data to all normal sectors of the user sector area; and the memory also has a temporary area for temporarily storing a block including a defective sector; wherein the alternate processing controller temporarily stores the block including the defective sector to the temporary area and stores at one time data for a plurality of defective sectors to the spare sector area. 
     An object of the present invention is to provide an alternate processing method for defective sectors of a storage device that can use the sectors effectively by decreasing the number of data writing operations for alternate processing. 
     According to one aspect of the present invention, for achieving the above object, there is provided an alternate processing method for defective sectors of a storage device comprising: providing a memory which has a user sector area, an alternate information area, and a spare sector area, the user sector area stores user data, the alternate information area stores information identifying a defective sector and an alternate sector which is alternated for the defective sector, and the spare sector area stores [an alternate] user data written to the defective sector; providing an alternate processing controller which reserves a sector of the spare sector area instead of the defective sector when the defective sector is present in the user sector area and which controls the writing of user data to all normal [all] sectors of the user sector area; temporarily storing data to a data storing unit when performing alternate processing on data which is written to the defective sector; and storing at one time a plurality of sector data from the alternate processing to the spare sector area by reading from the data storing unit. 
     According to another aspect of the present invention, for achieving the above object, there is provided an alternate processing method for defective sectors of a storage device comprising: providing a memory which has a user sector area, an alternate information area, and a spare sector area, the user sector area stores user data, the alternate information area stores information identifying a defective sector and an alternate sector which is alternated for the defective sector, and the spare sector stores user data written to the defective sector; providing an alternate processing controller which reserves a sector of the spare sector area instead of the defective sector when the defective sector is present in the user sector area and which controls the writing of data to all normal sectors of the user sector area; providing the memory with a temporary area for temporarily storing a block including a defective sector; temporarily storing in the temporary area the block including the defective sector; and storing at one time the data of the plurality of the defective sectors stored in the temporary area to the spare sector area. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     While the specification concludes with claims particularly pointing out and distinctly claiming the subject matter that is regarded as the invention, the invention, along with the objects, features, and advantages thereof, will be better understood from the following description taken in connection with the accompanying drawings, in which: 
     FIG. 1 is a schematic diagram showing a storage device and an alternate processing method for defective sectors of a storage device according to a first preferred embodiment of [a] the present invention. 
     FIG. 2 is a schematic diagram showing a memory layout of the external memory according to the first preferred embodiment. 
     FIG. 3 is a schematic diagram showing a storage device and an alternate processing method for defective sectors of a storage device according to a second preferred embodiment of [a] the present invention. 
     FIG.4 is a schematic diagram showing a memory layout of the external memory according to the second preferred embodiment. 
     FIG. 5 is a schematic diagram showing the data alternate processing in the temporary area according to the second preferred embodiment. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     A storage device and an alternate processing method for defective sectors of a storage device according to first and second preferred embodiments of the present invention will hereinafter be described in detail with reference to the accompanying drawings. 
     FIG. 1 is a schematic diagram showing a storage device and an alternate processing method for defective sectors of the storage device according to a first preferred embodiment of a present invention. 
     As shown in FIG. 1, an external memory  30  is preferably made up of a host interface  11  for connecting to an external host computer, a memory  15 , a micro controller  12  for controlling data read and write operations to a memory  15 , a buffer memory  13  for storing supplied write data, and an alternate processing controller  31  for performing alternate processing and defective sector checking, and which provides a buffer memory  32  (a data storing unit). 
     The memory  15  is a non-volatile semiconductor memory with block unit erase only, and is made up of] an EEPROM. 
     FIG.2 is a schematic diagram showing a memory layout of the external memory. 
     As shown in FIG.2, the memory  15  is preferably made up of a user sector area  21  for storing user data, an alternate information area  22  having address information for a defective sector and an alternate sector which is alternated for the defective sector, and a spare sector area  23  for storing data written to the defective sector in the user sector area  21 . 
     The micro controller  12  is a microprocessor for executing a control program, which has a memory storing the control program and data, which executes alternate processing in response to the control program, and which controls all operations for the apparatus. 
     When the alternate processing controller  31  performs the alternate processing for data which is written to the defective sector, it temporarily stores data to the internal buffer memory  32 . After processing all of the data, the alternate processing controller  31  stores at one time a plurality of sector data resulting from performing the alternate processing to the spare sector  23 . 
     Thus, the external memory  30  provides the buffer memory  32  which temporarily stores data when the alternate processing controller  31  checks for a detective sector and performs alternate processing for data which is written to the defective sector. The external memory  30  stores at one time a plurality of the sector data resulting from performing the alternate processing, to the spare sector area  23 . 
     The following describes operations of the storage device and the alternate processing method for the defective sectors of the storage device constructed as mentioned above. 
     In a write operation in which the external memory  30  writes data from a host, when a plurality of defective sectors exist over a plurality of blocks in a data area which the host writes, the following alternate processing is performed. 
     (1) When a defective sector is found, data which is written to the defective sector is temporarily stored to the buffer memory  32  in the alternate processing controller  31  with address information of the defective sector. 
     Normal sectors, other than the defective sector are written to an applicable user sector area  21 . 
     (2) When a next write data exists, the same processing as mentioned above occurs. All data which is written to the defective sector is stored to the buffer memory  32  in the alternate processing controller  31 . 
     (3) When writing of all data which is transferred from the host terminates, alternate data stored to the buffer memory  32  in the alternate processing controller  31  is written in the same block of the spare sector area  23 . Further, address information of the defective sector and information of the address which is alternated in the spare sector area  23 , are stored to the alternate information area  22  of the memory  15 . 
     As mentioned above, the storage device and the alternate processing method for the defective sectors of the storage device according to the first preferred embodiment is made up of the host interface  11 , the micro controller  12  which controls throughout the apparatus, the buffer memory  13  which stores supplied write data, the alternate processing controller  31  which performs the alternate processing and checking of the defective sector, and which has the buffer memory  32 , and the memory  15 . The memory is made up of the user sector area  21  which stores the user data, the alternate information area  22  which has the address information of the defective sector and the alternate sector which is alternated for the defective sector, and the spare sector area  23  which stores the data which is written to the defective sector on the user sector area  21 . When the alternate processing controller  31  performs the alternate processing for data which is written to the detective sector, the data is stored temporarily to the internal buffer memory  32  and the plurality of the sector data resulting from the alternate processing are stored from the buffer memory  32  to the spare sector area  23  at one time. As a result, the inventive method can decrease the number of data write cycles for the alternate processing and can achieve a high speed for the data write operation. 
     FIG. 3 is a schematic diagram showing a storage device and an alternate processing method for defective sectors of the storage device according to a second preferred embodiment of the present invention. 
     As shown in FIG.3, an external memory  40  is preferably made up of a host interface  11  for connecting to an external host computer, a memory  43 , a micro controller  12  for controlling data read and write operations to a memory  43 , a buffer memory  13  for storing supplied write data, and an alternate processing controller  41  for performing alternate processing and defective sector checking, and which provides a buffer memory  42  (a data storing unit). 
     When the alternate processing controller  41  performs alternate processing for data which is written to a defective sector, it temporarily stores such data to the buffer memory  42  of the internal memory  43 . Further, a plurality of sector data resulting from the alternate processing is stored to spare sector area  23 . 
     The memory  43  is a non-volatile semiconductor memory with block unit erase only, and is made up of an EEPROM. 
     FIG.4 is a schematic diagram showing a layout of memory  43  of the external memory  40 . 
     As shown in FIG. 3, the memory  43  is preferably made up of a user sector area  21  for storing an user data, an alternate information area  22  having an address information for a defective sector and an alternate sector which is alternated for the defective sector, a temporary area  51  for storing temporary blocks including a defective sector, and a spare sector area  23  for storing data written to the defective sector in the user sector area  21 . 
     The temporary area  51  is made up of a plurality of blocks. Here, the number of the sectors included in one block is eight. The temporary area  51  is made up of eight blocks. 
     The external memory  40  provides the buffer memory  42  for storing data temporarily when the alternate processing controller  41  is performing the alternate processing and the defective sector checking, performs alternate processing for data which is written to the defective sector, and provides the temporary area  51  for temporarily storing a data block, including the defective sector. The external memory  40  stores at one time the data corresponding to a plurality of the defective sector, to the spare sector area  23  using the buffer memory  42  and the temporary area  51 . 
     The following describes operations of the storage device and the alternate processing method for the defective sectors of the storage device constructed as mentioned above. 
     In a write operation in which the external memory  40  writes data from the host, a block has sectors which are written data from the host, and the block has at least one of the defective sectors. In these circumstances, when data is written to the plurality of the sectors including the defective sectors, the following alternate processing is performed. 
     When the defective sector is found, the data is not written to a block of the user sector area  21  including the defective sector, but is written to the temporary area  51 . The address of the block including the defective sector, the address of a storing area in the temporary area  51 , and address information for the defective sector in the block, is stored in the alternate information area  22 . Whenever the defective sector is found, the following the alternate processing is performed. 
     After that, in the operation of the external memory  40 , when accessing data in a block including a defective sector of the user sector area  21 , the block is stored in the temporary area  51  based on the address information of the alternate information area  22 , which is assigned. 
     Then, when the number of the defective sectors becomes eight sectors (the number of sectors in one block), the normal sectors are stored to the user sector area  21  from the data stored temporarily to the temporary area  51 , and the defective sectors are stored to the spare sector area  23  from the data written to the defective sectors stored temporarily to the temporary area  51 . 
     FIG.5 is a schematic diagram showing the data alternate processing in the temporary area  51 . 
     (1) Data in the temporary area  51  are read every block, in turn. 
     (2) Only sectors applicable to the defective sector which are detected, are stored to the buffer memory  42  of the alternate processing controller  41 . 
     (3) When all sectors applicable to the defective sector are read, they are stored to the spare sector area  23  as alternate sectors for the defective sectors, as shown in (a) of FIG. 5 . 
     (4) Data of each block stored in the temporary area  51  is copied to the user sector area  21 , which would be stored there originally. At this time, for the sector which is decided as the defective sector, information about the sector is stored. 
     (5) An address of the defective sector, an address which is alternated in the spare sector area  23 , and information about which data in the temporary area  51  is written to a defective sector, is stored to the alternate information area  22 . 
     After that, when performing the write operation for the block including the defective sector, data is stored temporarily to the temporary area  51 , and the same processing as mentioned above is performed. 
     Accordingly, data which is alternated for the defective sector, can be stored to the spare sector area  23  at one time. Further, the normal sector is stored to the user sector area  21  and the defective sector is stored to the spare sector area  23 . The use of this area except for storing the defective sector of the block is avoided. 
     As mentioned above, the storage device and the alternate processing method for the defective sectors of the storage device according to the second preferred embodiment is made up of the buffer memory  42  which stores data temporarily, the alternate processing controller  41  for performing the alternate processing and the defective sector checking, and which performs the alternate processing for data written to the defective sector, and the temporary area  51  which temporarily stores the block including the defective sector. Since data corresponding to the plurality of the defective sectors are stored to the spare sector area  23  at one time, using the buffer memory  42  and the temporary area  51  can decrease the number of write cycles for the data for the alternate processing and can achieve high for the data write operation. 
     While the present invention has been described with reference to the illustrative embodiments, this description is not intended to be construed in a limiting sense. Various modifications of the illustrative embodiments, as well as other embodiments of the invention, will be apparent to those skilled in the art on reference to this description. It is therefore contemplated that the appended claims will cover any such modifications or embodiments as fall within the true scope of the invention.