1. Field of the Invention
Embodiments of the present disclosure relate to systems and methods for managing data, and particularly to a system and method for storing data in a mobile device.
2. Description of Related Art
In our modern information-oriented society, compact-sized mobile phones are broadly utilized by people in daily life. Mobile phones can be used to communicate with each other via telephones or short messages almost anytime and anywhere. Often, if storage space of the mobile phone is full and is not released in time, new received data will fail to be stored promptly or even lost. In one method, an extra storage, e.g., an electrically erasable read only memory (E2PROM), may be used to store the new received data if a main storage of the mobile phone is full.
However, the above-mentioned method is inconvenient for a programmer to manage the extra storage of the mobile phone. For example, if the user wants to delete data stored in the extra storage, the data needs to be first copied to the main storage of the mobile phone before deletion.
What is needed, therefore, is an improved system and method for storing data in a memory of a mobile device, which can overcome the aforementioned problem.
All of the processes described below may be embodied in, and fully automated via, software code modules executed by one or more general purpose mobile devices or processors. The code modules may be stored in any type of readable medium or other storage device. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the readable medium may be a hard disk drive, a compact disc, a digital video disc, or a tape drive.
The CPU 1 is configured for controlling execution of the data processing unit 20. The data processing unit 20 is configured for reserving a free block in the memory 21, saving received new data in the free block, and reserving a new free block again for receiving new data received next time.
The memory initializing module 201 is configured for initializing the memory 21 of the mobile device when the mobile device is powered on.
The memory reserving module 202 is configured for allocating a free block of memory from the memory 21. In one embodiment, a block size of the free block is pre-determined.
The data saving module 203 is configured for saving received new data in the free block.
The memory reserving module 202 is further configured for allocating a new free block of memory from the memory 21, and detecting if the new free block allocation is a success or a failure. In one embodiment, the memory reserving module 202 determines that allocating the new free block fails if a total free space of the memory 21 is less than the block size.
The prompting module 204 is configured for prompting for sufficient memory space to be manually freed from the memory 21 if the new free block allocation is a failure.
The memory reserving module 202 is further configured for detecting if sufficient memory space has been manually freed from the memory 21 for the received new data, and also determining a preset prompt time. In one embodiment, the memory reserving module 202 determines that sufficient memory space has not been manually freed if a total free space of the memory 21 after being manually freed is less than the block size. In one embodiment, the preset prompt time may be defined as the number of times that the memory reserving module 202 prompts a user to free sufficient memory space manually from the memory 21 in response to receiving new data. The number of times may be three times in one exemplary embodiment.
In block S401, the memory initializing module 201 initializes the memory 21 of the mobile device when the mobile device is powered on.
In block S402, the memory reserving module 202 allocates a free block of memory from the memory 21. In one embodiment, a block size of the free block may be predetermined, such as one megabyte
In block S403, the mobile device receives new data. In one embodiment, the new data may be a short message or a multimedia message service (MMS).
In block S404, the data saving module 203 saves the new data in the free block.
In block S405, the memory reserving module 202 allocates a new free block of memory from the memory 21 again for receiving new data received next time.
In block S406, the memory reserving module 202 detects if the new free block allocation is a success or a failure. In one embodiment, the memory reserving module 202 determines that allocating the new free block fails if a total free space of the memory 21 is less than the block size. If the new free block allocation is a failure, the process goes to block S407. Otherwise, the process ends if the new free block allocation is a success.
In block S407, the prompting module 204 prompts for sufficient memory space to be manually freed from the memory 21.
In block S408, the memory reserving module 202 detects if sufficient memory space has been manually freed from the memory 21 for the received new data. In one embodiment, the memory reserving module 202 determines that sufficient memory space has not been manually freed if a total free space of the memory 21, after being manually freed, is less than the block size. If sufficient memory space has not been manually freed, the process goes to block S409. Otherwise, the process goes to block S405 if sufficient memory space has been manually freed.
In block S409, the memory reserving module 202 determines if a preset prompt time has been prompted. If the preset prompt time has been prompted, the process ends. Otherwise, the process goes to block S407 if the preset prompt time has not been prompted. In other words, the memory reserving module 202 re-prompts a user to manually free sufficient memory space from the memory 21 until the preset prompt time has been prompted.
It should be emphasized that the above-described embodiments of the present disclosure, particularly, any embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
200810304742.8 | Oct 2008 | CN | national |