DEVICE, DATA SAVING PROCESS METHOD AND MEDIUM FOR DATA SAVING PROCESS PROGRAM
20170255411 ยท 2017-09-07
Assignee
Inventors
Cpc classification
G06F1/3287
PHYSICS
G06F12/0868
PHYSICS
Y02D30/50
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
Y02D10/00
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
G06F12/08
PHYSICS
International classification
Abstract
A pre-copy creator creates a copy of a memory area that is used by an application that is switched to a background and updates a memory management table. At a time of transition to a hibernation mode, an uncopied-area saving unit refers to the memory management table and creates a copy of a memory area that is used by the application and excludes the memory area of which the copy has been created by the pre-copy creator.
Claims
1. A device comprising: a processor configured to: create, in a non-volatile storage device, a copy of a memory area that is used by an application that is switched to a background; and at a time of transition to a hibernation mode, create, in the non-volatile storage device, a copy of a memory area that is used by a normal application and excludes the memory area of which the copy has been created at the first creating.
2. The device according to claim 1, wherein, when an application other than a resident application is additionally started by the processor or when a foreground application is switched, the processor is configured to create, in the non-volatile storage device, a copy of a memory area that is used by an application switched to the background.
3. The device according to claim 1, wherein the processor is configured to create copies in a hibernation area of the non-volatile storage device.
4. The device according to claim 1, wherein the processor is configured to create copies in a swap area of the non-volatile storage device.
5. The device according to claim 4, the processor is configured to create, at a time of transition to the hibernation mode, a copy of a memory area that is used and is not used by the application in the hibernation area of the non-volatile memory device.
6. A data saving process method performed by a computer, the method comprising: creating, in a non-volatile storage device, a copy of a memory area that is used by an application that is switched to a background; and at a time of transition to a hibernation mode, creating, in the non-volatile storage device, a copy of a memory area that is used by a normal application and excludes the memory area of which the copy has been created.
7. A non-transitory computer-readable recording medium having stored therein a program that causes a computer to execute a process comprising: creating, in a non-volatile storage device, a copy of a memory area that is used by an application that is switched to a background; and at a time of transition to a hibernation mode, creating, in the non-volatile storage device, a copy of a memory area that is used by a normal application and excludes the memory area of which the copy has been created.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
DESCRIPTION OF EMBODIMENTS
[0037] Preferred embodiments of the present invention will be explained with reference to accompanying drawings. Note that the embodiments do not limit the technology disclosed herein.
[a] First Embodiment
[0038] First, data saving and data restoration performed by a smart device according to a first embodiment will be described.
[0039] As illustrated in
[0040] When the application switches from a foreground to a background, the smart device 1 saves, in the hibernation area, the data of the memory area that is used by the application. The foreground refers to a mode where a screen that is output by the application is displayed on a display device and the background refers to a mode where the screen that is output by the application is not displayed on the display device. The data of the memory area that is used by the application contains the program code of the application.
[0041] The background application stays in the memory but is not executed. For this reason, when the time from when the smart device 1 is started lengthens, there is a large volume of memory area secured by the application in the hibernation mode. The memory area that is secured by the application in the hibernation mode does not change unless the application is switched or the application is forcibly terminated. Accordingly, the data of the memory area that is used by the background application is saved in advance and is not updated and therefore, at a time of transition to the hibernation mode, data saving is not needed.
[0042] For this reason, the smart device 1 collectively saves only unsaved data in the hibernation area in the saving process at a time of transition to the hibernation mode. The smart device 1 restores the data of the hibernation area in the restoration process at a time of its recovery from the hibernation mode.
[0043] In this manner, when the application is switched from the foreground to the background, the smart device 1 saves, in the storage 7, the data of the memory area that is used by the application. Accordingly, compared to the case where the data of the memory is saved periodically, the smart device 1 is able to reduce the number of times of writing in the storage 7.
[0044] The functional configuration of the smart device 1 according to the first embodiment will be described here.
[0045] The terminal mode controller 2 manages the mode of the smart device 1. The mode of the smart device 1 includes an active mode and a hibernation mode. When the mode of the smart device 1 transitions to the hibernation mode, the terminal mode controller 2 notifies a hibernation unit 30, which will be described below, of the transition to the hibernation mode.
[0046] The memory manager 3 manages a memory 6 per block. The memory manager 3 creates a memory management table, which will be described below. The application manager 4 manages the mode of the application. The application manager 4 starts and ends the application and switches the application between the foreground and the background, i.e., the application manager 4 is in charge of entire control on the application. The application manager 4 notifies a pre-copy creator 21, which will be described below, of the status of execution of the application.
[0047] The data saving processor 5 performs processing related to saving of the data that is stored in the memory 6 in the storage 7. The data saving processor 5 includes a memory management table storage unit 10, a data copy manager 20, and the hibernation unit 30.
[0048] The memory management table storage unit 10 stores a memory management table in which information for managing the status of the memory 6 with respect to each block is registered.
[0049] The copy creation status represents whether a copy of the block is created in the storage 7, and copied represents that a copy of the block is created in the storage 7 and uncopied represents that no copy of the block is created in the storage 7. With respect to a block that is not used, (unused) is used as the copy creation status.
[0050] The data copy manager 20 manages creation of a copy of the data stored in the memory 6 in the storage 7. The data copy manager 20 includes a pre-copy creator 21 and an uncopied-area saving unit 22.
[0051] When the smart device 1 is in the active mode, the pre-copy creator 21 creates a copy of the memory area that is used by the application switched to the background and then sets copied for the copy creation status that is associated in the memory management table with a block contained in the memory area of which the copy is created.
[0052] The pre-copy creator 21 also deletes a copy of the memory area that has been used by an ended application from the storage 7 and sets unused for the copy creation status that is associated in the memory management table with a block that is freed by the ended application. The pre-copy creator 21 sets uncopied for the copy creation status that is associated in the management table with a block contained in the memory area that is used by the application switched to the foreground.
[0053] The uncopied-area saving unit 22 refers to the memory management table and, with respect to a block regarding which the copy creation status is uncopied, when the smart device 1 transitions to the hibernation mode, notifies an area-to-be-saved choosing unit 31 of an uncopied area to create a copy of the block.
[0054] The hibernation unit 30 creates a copy of a block of the memory 6 according to an instruction of the data copy manager 20. The hibernation unit 30 also deletes a copy that is created in the storage 7 according to an instruction of the data copy manager 20. The hibernation unit 30 includes the area-to-be-saved choosing unit 31 and a data saving unit 32.
[0055] On receiving a notification of transition of the mode to the hibernation mode from the terminal mode controller 2, the area-to-be-saved choosing unit 31 makes an inquiry to the uncopied-area saving unit 22 about an uncopied area. The uncopied-area saving unit 22 having received the inquiry refers to the memory management table and notifies the area-to-be-saved choosing unit 31 of the uncopied area.
[0056] Specifically, the uncopied-area saving unit 22 notifies the area-to-be-saved choosing unit 31 of a list of blocks regarding which the copy creation status in the memory management table is uncopied. On receiving the notification of the uncopied area, the area-to-be-saved choosing unit 31 passes the notification as a list of blocks of which copies are to be created to the data saving unit 32.
[0057] On receiving the block list of blocks of which copies are to be created from the area-to-be-saved choosing unit 31, the data saving unit 32 reads the data of the blocks that is listed up in the block list from the memory 6 and writes the data in the storage 7.
[0058] Furthermore, on receiving a block list of blocks of which copies are to be created from the pre-copy creator 21, the data saving unit 32 reads the data of the blocks listed up in the block list and writes the data in the storage 7. Furthermore, on receiving a block list of blocks of which copies are to be deleted from the pre-copy creator 21, the data saving unit 32 deletes the data of the blocks listed up in the block list from the storage 7.
[0059] The hibernation unit 30 saves data in the register of the CPU etc., in the storage 7 when the smart device 1 transitions to the hibernation mode and restores the data in the register of the CPU etc. when the smart device 1 recovers from the hibernation mode.
[0060] The flow of the process performed by the pre-copy creator 21 will be described here.
[0061] When the event type is determined to be switching of the foreground application, the pre-copy creator 21 creates a copy of a memory area that is used by the application turned into the background (step S2) and updates the memory management table (step S3).
[0062] When the event type is additionally starting an application, the pre-copy creator 21 determines which type the started application is (step S4). When the type of the started application is a resident application, there is no application to be switched to the background and therefore the pre-copy creator 21 proceeds to step S3. On the other hand, when the type of the started application is not the resident application, there is an application to be switched to the background and therefore the pre-copy creator 21 proceeds to step S2.
[0063] When the event type is ending of an application, the pre-copy creator 21 deletes the copied data of the application (step S5) and proceeds to step S3.
[0064] As described above, the pre-copy creator 21 creates in advance a copy of the memory area that is used by the application turned into the background, and accordingly the smart device 1 is able to shorten the time to save data when transitioning to the hibernation mode.
[0065] The flow of the process performed by the uncopied area saving unit 22 will be described here.
[0066] As described above, the uncopied area saving unit 22 creates the list of blocks of which copies are not created and transmits the created list to the area-to-be-saved choosing unit 31, and accordingly the area-to-be-saved choosing unit 31 is able to specify, for the data saving unit 32, a block whose data is to be saved.
[0067] The flow of the process performed by the area-to-be-saved choosing unit 31 will be described here.
[0068] As described above, by making an inquiry about the uncopied area to the uncopied area saving unit 22, the area-to-be-saved choosing unit 31 is able to acquire the list of blocks whose data is to be saved.
[0069] As described above, in the first embodiment, the pre-copy creator 21 creates a copy of a memory area that is used by the application switched to the background and updates the memory management table. At a time of transition to the hibernation mode, the uncopied area saving unit 22 refers to the memory management table and creates a copy of a memory area, among the memory area used by the application, excluding the memory area of which the copy is created by the pre-copy creator 21. Accordingly, the smart device 1 is able to reduce frequency of writing in advance a copy of a memory area used by the application in the storage 7 and inhibit the life of the storage 7 from shortening.
[0070] According to the first embodiment, the pre-copy creator 21 determines that there is an application that is switched to the background when a new application other than the resident application is started or the foreground application is switched. Accordingly, the pre-copy creator 21 is able to accurately determine an application that is switched to the background.
[b] Second Embodiment
[0071] The case where a copy of the memory data is created in the hibernation area in advance has been described as the first embodiment; however, a copy may be created in a swap area instead of the hibernation area. A case where a copy of the memory data is crated in a swap area in advance will be described as a second embodiment. The swap area refers to an area in the storage 7 in which, when the memory area is insufficient, the data of a part of the memory area is written in order to create a free area in the memory 6.
[0072]
[0073] In the saving process performed when transitioning to the hibernation mode, the smart device 1a divides the unsaved data into needed data and unneeded data to restart the user processing when recovering from the hibernation mode and saves the divided data separately in the storage 7. In other words, the smart device 1a saves the data unneeded to restart the user processing when recovering from the hibernation mode in the swap area and, saves the data needed to restart the user processing when recovering from the hibernation mode in the hibernation area.
[0074] In the restoration process at a time of recovery from the hibernation mode, the smart device 1a restores only the data in the hibernation area and transitions to the pre-active mode. In the pre-active mode, the smart device 1a restarts the user processing and restores the data in the swap area by swap-in and, when all the data in the swap area is restored, transitions to the active mode.
[0075] In other words, the smart device 1a performs swap and hibernation to save and restore data.
[0076] As illustrated in
[0077] As illustrated in
[0078] As described above, the smart device 1a performs swap hibernation to save and restore data and accordingly it is possible to shorten the time until the restart of the user processing when recovering from the hibernation mode.
[0079] The functional configuration of the smart device 1a according to the second embodiment will be described.
[0080] As illustrated in
[0081] While the terminal mode controller 2a has a similar function to that of the terminal mode controller 2, the terminal mode controller 2a notifies an uncopied area saving unit 22a of a data copy manager 20a, which will be described below, of the transition of the mode to the hibernation mode. While the memory manager 3a has a similar function to that of the memory manager 3, when the memory 6 becomes insufficient, the memory manager 3a notifies an area-to-be-saved choosing unit 41a of a swap unit 40a, which will be described below, of the insufficiency of the memory.
[0082] Differently from the data saving processor 5 illustrated in
[0083] The data copy manager 20a manages a copy of the data of the memory 6 as the data copy manager 20 does; however the data copy manager 20a only manages the memory 6 that a normal application uses. In other words, the data copy manager 20a does not manage data of, for example, the operation system (OS), middleware, and the resident application, needed to restore the user processing.
[0084] Differently from the data copy manager 20 illustrated in
[0085] While the pre-copy creator 21a has a similar function to that of the pre-copy creator 21, the pre-copy creator 21a passes a block list not to the hibernation unit 30 but to the swap unit 40a and instructs the swap unit 40a to create a copy of the blocks.
[0086] The uncopied area saving unit 22a creates a list of blocks of an uncopied area as the uncopied area saving unit 22 does but does not receive any inquiry about the uncopied area. The uncopied area saving unit 22a receives a notification of the transition of the mode to the hibernation mode from the terminal mode controller 2a and creates a list of blocks of the uncopied area. The uncopied area saving unit 22a passes the block list not to the hibernation unit 30 but to the swap unit 40a and instructs the swap unit 40a to create a copy of the blocks.
[0087] The hibernation unit 30a saves, in the storage 7, the data needed to restart the user processing including data in the register of the CPU etc. in the last half of the saving process. The hibernation unit 30a restores, from the storage 7 to the memory 6, the data needed to restart the user processing including the data in the register of the CPU etc. in the restoration process.
[0088] The swap unit 40a creates a copy of blocks of the memory 6 in the swap area of the storage 7 according to an instruction of the data copy manager 20a. The swap unit 40a includes the area-to-be-saved choosing unit 41a and a data saving unit 42a.
[0089] On receiving a notification of insufficiency of the memory from the memory manager 3a, the area-to-be-saved choosing unit 41a chooses blocks to be saved in the storage 7 and passes the list of the chosen blocks to the data saving unit 42a.
[0090] The data saving unit 42a receives the lists of blocks to be saved from the area-to-be-saved choosing unit 41a, the uncopied area saving unit 22a, and the pre-copy creator 21a and copies the data of the blocks in the lists in the swap area of the storage 7. On receiving a block list of blocks of which copies are to be deleted from the pre-copy creator 21a, the data saving unit 42a deletes the data of the blocks listed up in the block list from the storage 7.
[0091] The flow of the process performed by the uncopied area saving unit 22a will be described.
[0092] As described above, in the second embodiment, the data copy manager 20a passes the block list to the swap unit 40a and instructs the swap unit 40a to save the data. The data saving unit 42a of the swap unit 40a then creates copies of the blocks in the block list in the swap area of the storage 7. Accordingly, when recovering from the hibernation mode, the smart device 1a in the pre-active mode is able to restore the data not needed to restart the user processing and restart the user processing in a short time.
[0093] The data saving processors according to the first and second embodiments are implemented by a computer by executing data a saving process program with the same functions. The computer that executes the data saving process program will be described here.
[0094]
[0095] The CPU 50a is a processing device that reads and executes an application or a program, such as the data saving process program stored in the memory 50c. The flash memory 50b is a non-volatile memory that stores, for example, the application and the data saving process program. The flash memory 50b corresponds to the storage 7 illustrated in
[0096] The memory 50c is a random access memory (RAM) that stores, for example, the application and the data saving process program that are read from the flash memory 50b. The memory 50c stores, for example, the data needed to execute the data saving process program and the intermediate result of execution of the data saving process program. The memory 50c corresponds to the memory 6 illustrated in
[0097] The display unit 50d is a device that displays a screen that is output by the application and is, for example, a liquid crystal display device. The display unit 50d accepts a touch operation of the user and passes the accepted data to the CPU 50a.
[0098] The wireless communication unit 50e is a module that performs wireless communications, such as communications via a local area network (LAN), Bluetooth (trademark), and mobile phones. The wireless communication unit 50e may have multiple wireless communication functions.
[0099] According to an aspect of the embodiments, it is possible to inhibit the life of the storage from shortening.
[0100] All examples and conditional language recited herein are intended for pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.