The foregoing and other aspects of these teachings are made more evident in the following Detailed Description of the Preferred Embodiments, when read in conjunction with the attached Drawing Figures, wherein:
In the prior art noted above, the guaranteed performance by wear leveling provides a much lower performance guarantee than the true physical capabilities of the storage media. Defragmentation functions in the prior art rely on the host computing device directly controlling the physical addresses of clusters in the storage media. According to the present invention, the storage media controls the file allocation system for itself so that the host computing device has access to the logical layers but the storage media retains control over the physical layer issues for defragmentation (or other performance enhancing programs or functions). The term “file allocation system” is used generically to represent a system of software allocation for stored files. Some know examples of file allocation systems include, but are not limited to: file allocation tables FAT; new technology file system NTFS (Microsoft); heirarchical file system HFS (Apple Computer), second extended file system ext2 (Linux); third (journalled) extended file system ext3 (Linux), a CD-ROM file system for use with CD-ROM ISO 9660, on-disk stgructure ODS-5 (Hewlett-Packard); and universal disk format UDF for optical media. In one embodiment of this invention, the host computer ‘fine-tunes’ the file allocation system in the storage media. In a first variation, the storage media will not know which blocks are valid or not valid, and needs the host to move files into continuous physical sequence (defragmentation). Because the storage media does not know which blocks are valid or invalid, it cannot initiate defragmentation on its own because it has no knowledge (apart from being informed by the host computing device) of its current overall fragmentation condition against which to compare against a threshold; initiating defragmentation will then rely on the host or a user input. In a second variation, the storage media can read its own storage and determine its own overall fragmentation condition and can initiate defragmentation when its current view of that current condition falls below some threshold. Defragmentation in this second variation need not rely on the host using caching as is common in the prior art defragmentation processes; caching may be performed entirely within the storage media itself.
In another embodiment, the host accesses a logical layer of the storage media for the defragmentation function, but the storage media itself handles the physical layer issues. This is related to the first embodiment, but broader. The interface between the host computing device and the storage media, at least for the defragmentation function, is at the file level rather than the block level. The file allocation system still resides in the storage media, and the storage media itself controls its own file allocation system as well as having the means to execute the defragmentation function. The host may have direct access to the physical layer via specific commands and registers (e.g., the file allocation system), and may command the storage media to execute a defragmentation function, but that function is executed within the storage media, which in this instance know which blocks are valid and invalid and can therefore in some instances execute the defragmentation function by comparing its own current fragmentation condition to some stored threshold. Relatedly, the host computing device might merely communicate to the storage media some higher level information (e.g., file name and the file data), and the storage media handles storage and fragmentation issues on its own (e.g., logical file system and physical layer issues, such as which blocks to store the file data).
These aspects and embodiments are detailed more particularly below. The term host computing device refers to a computing device that currently controls the storage media, and may be a processor (of the single or multi-processor varieties), a stand-alone personal computer (desktop/laptop), a portable computing device (e.g., personal digital assistant, mobile phone, mobile email device, music/video device, etc.). The storage media is advantageously removable so that it may come under the control of different host computing devices at different times, though it may be fixed to one host device. Preferably, the storage media is of the solid state variety (e.g., a flash drive) rather than the rotating disc variety.
The means for initiating a defragmentation function is within the peripheral device. As an example, one means for initiating can be block validity parameters and data segments sequences stored in the peripheral device, at block 108. Block validity parameters are known in the art, but to the inventors' knowledge of the prior art are not stored in a peripheral device but must be generated by a host processor anytime they are needed. These parameters might be read from the peripheral device by the host and stored in a register of the peripheral device, or may be read by a processor of the peripheral device itself. When the block validity parameter(s) fall below some threshold, the defragmentation function will be initiated. As another example, the means for initiating can be a pair of registers at block 106, one storing a current performance metric such as fragmentation of an individual program or an average fragmentation of all programs as currently stored in the peripheral device memory, and the other register storing some threshold that when compared against the first-mentioned register will trigger the defragmentation program. The current register can be updated continuously in background, or periodically, or based on some discrete event such as writing a new file that exceeds a certain size to the peripheral device, erasing a file that exceeds a certain size from the peripheral device, or the like.
Once the means to initiate defragmentation at block 104 is examined and defragmentation is deemed appropriate at blocks 106 or 108, then block 110 initiates the defragmentation function on the data storage of the peripheral device. Actual execution of the defragmentation function may be by a command from the host device that reads the register(s) or file names and deems no conflicts with other programs that might be accessing the peripheral device data storage, or it may be automatically executed once initiated. During defragmentation, the host device handles the logical layers of the data storage in the peripheral device, and the peripheral device itself handles the physical layers. The host device might also have direct access to the physical layers, or a processor in the peripheral device may operate in conjunction with the host processor in executing the defragmentation function. Data files are moved to new storage locations of the peripheral device by writing them to a cache and then copying them to the new storage location. Data transfer between the host and peripheral device may use the physical addresses or the file names (e.g., from the file allocation system). In some embodiments, the cache 216 is wholly within the peripheral device; in other embodiments, the cache might be in the host device so that all re-written data is moved through an interface between the host and peripheral devices.
While running or once the defragmentation function (computer software program) is completed, at block 112 the logical/physical table associating logical file segments with their physical addresses in the peripheral device is updated to reflect the new addresses. At block 114, the means to initiate defragmentation is also updated. For example, if the performance registers of block 106 were used, the current performance metric is updated since it is changed due to the defragmentation function being executed; or if the block validity parameters were used as the means to initiate then those are updated since the formerly invalid blocks may or may not be valid after defragmentation (most if not all should be valid immediately after).
It is noted that the storage components described below are logical storage components and not necessarily tied to particular physical locations within the peripheral device 200; the relation between the two is reflected in the logical/physical address table 208. When defragmentation is executed, certain segments may be overwritten and moved, and the allocation of the functional/logical segments described herein may move among different physical storage units as different operations occur within the peripheral device. The segments are physically separated from one another just as any other data files are separated at the end of all write processes and related register updates.
Disposed within the body 202 is a data storage segment 206 for storing data files that a user may read from and write to by use of an attached host device. The data storage segment 206 is shown as a block with vertical lines that represent clusters in varying degrees of fragmentation. Also within the body is a logical/physical address table 208 that stores a register of physical addresses mapped to the logical files for each separate cluster of the data storage segment 206. The logical/physical address table 208 is updated anytime a file is written to or erased from the data storage segment 206. Other events may also cause the logical/physical address table 208 to update.
A threshold performance metric register 210 stores a performance metric that relates to optimum performance of the data storage segment 206. In one embodiment, this optimum performance metric is a minimum performance figure if the data files if the data storage segment 206 were in optimal fragmentation. The minimum performance figure may be a relative term that varies with the amount of data files stored in the data storage segment, and possibly their sizes, so it too may be updated at block 114 of
A means to initiate 212 a performance enhancing computer program to execute on the removable storage media 200, such as arguments (e.g., block validity parameters, comparison of a current performance measure against a threshold) used in triggering the defragmentation function, may also be stored on the peripheral device 200 itself Preferably, the defragmentation program is resident on the host device to which the peripheral device 200 is coupled, and the means to initiate 212 is simply a command that passes over the interface of the coupling means 204 that causes the host device to execute, at least on the data storage segment 206, a de-fragmentation program or similar such performance-enhancing program. Alternatively, the performance-enhancing program may be stored on the peripheral device 200 itself. The performance-enhancing program, whether run by a processor 218 of the peripheral device or more universally by a processor of the host device, will then de-fragment or otherwise clean up the various clusters on at least the data file segment 206, and derive a measure of memory available (or equivalently of memory used by user data files) in the peripheral device 200. Since de-fragmentation or other optimizing program was just run on the media, that measure of available memory is an optimized measure.
That measure of memory available is then entered into an actual performance register 214 that is optionally within the peripheral device 200. This is to enhance the portability of the device 200. When the peripheral device 200 is de-fragmented by a first host and the measure of memory available is stored in the actual performance register 214, a second host to which the peripheral device 200 is later coupled can merely read the measure stored on the peripheral device 200 rather than analyze the data file structure of the newly inserted device independently. As noted with respect to
Whereas
In certain instances, it may be advantageous to prevent the peripheral device from being powered down while the performance-enhancing program is running. Whether the program is resident in the host device or the peripheral device, it can prevent a power shutdown itself via software commands and restrictions on competing power-down commands. However, under current technology it is atypical for removable media to carry its own power supply and generally relies on that of the host device. Extracting the peripheral device 200 from the host device during de-fragmentation or other such performance-enhancing programs may cause loss of data or corruption of the program, especially if that program is resident on the peripheral device. To prevent this, the performance enhancing program can merely interrupt further inputs from the user at whatever user interface is available (e.g., electrical busy signal such as a data line low or setting a status register bit) and possibly display an indication of computer activity (e.g., shading a graphical display screen, displaying a “do not interrupt” message) to warn the user not to disconnect either power or the solid state media on which the program is being run (if the media is removable).
As to the mobile station 300, the blocks are functional and the functions described below may or may not be performed by a single physical entity as described with reference to
Voice or other aural inputs are received at a microphone 312 that may be coupled to the processor 310 through a buffer memory 314. Computer programs such as drivers for the display 304, algorithms to modulate, encode and decode, data arrays such as look-up tables, and in certain embodiments the de-fragmentation program detailed above (when run from host device rather than stored on and run from the MMC 302) and others are stored in a main memory storage media 316 which may be an electronic, optical, or magnetic memory storage media as is known in the art for storing computer readable instructions and programs and data. The main memory 316 is typically partitioned into volatile and non-volatile portions, and is commonly dispersed among different storage units, some of which may be removable. The MS 300 communicates over a network link such as a mobile telephony link via one or more antennas 318 (internal antennas shown) that may be selectively coupled via a T/R switch 320, or a dipole filter, to a transmitter 322 and a receiver 324. The MS 300 may additionally have secondary transmitters and receivers for communicating over additional networks, such as a WLAN, WIFI, Bluetooth®, or to receive digital video broadcasts. Audible output from the MS 300 is transduced at a speaker 326.
A port 328 is configured to receive a MMC 302. As illustrated, the port 328 is within a cavity of the host mobile station 300, though it may be an electrical receptacle disposed along an exterior surface of the host device (as with a desktop or laptop computer to which the removable media 200 of
When the MMC is plugged into the host device, the host device reads it and lists it (internally) as another storage location. Where a personal computer is the host, this is typically manifest in the computer listing the removable media as a separate drive, indistinguishable from other internal drives except for a letter designation. But the host device will not know that the removable media also carries the above-described command instruction, performance metric, or register to which the host device is expected to write. The host device therefore is also equipped with a driver according to the present invention.
The driver is a set of computer software code that instructs the host device how to read the portable peripheral device. In this instance, the driver becomes active upon the peripheral device being electrically (or magnetically or optically) coupled to the host device. The driver can be a part of the host device operating system (e.g., programmed at the device manufacturer), it may be uploaded to the host device from the removable peripheral device itself, or may be downloaded to the host device from another source (e.g., downloading a particular software program or an update to the host device operating system). In the case of the mobile station being the host device, the driver may be downloaded wirelessly over a wireless cellular network. The driver allows software on the removable peripheral device, such as the command to initiate a de-fragmentation program, to be recognized in the host device. The driver may also instruct the host device to write the current performance measure to the register in the peripheral device.
The above description of
Although described in the context of particular embodiments, it will be apparent to those skilled in the art that a number of modifications and various changes to these teachings may occur. Thus, while the invention has been particularly shown and described with respect to certain detailed embodiments, it will be understood by those skilled in the art that certain modifications or changes may be made therein without departing from the scope and spirit of the invention as set forth above, or from the scope of the ensuing claims.