The present invention relates to a program execution system, and more particularly to a method for launching resident programs.
As a device (program execution device) provided with a program execution system, such as a smartphone or a tablet terminal, those into which an application can freely be introduced (installed) by a user have been widespread, for example. Further, applications that can be introduced by a user include an application including a program (resident program) which is automatically launched at startup of a system and resides in the system. Due to a resident program residing in a system, reduction in an operation burden on a user and continuous service are implemented.
However, in the case where a user introduces a lot of applications into a program execution device, if the resident programs thereof are launched without any limitation, resources (memory capacity or a processing speed of a central processing unit (CPU)) of the program execution device become insufficient, and therefore, it is feared that the applications cannot normally be executed. To address such problem, a general program execution device limits a type of applications allowed to reside, or force-quits an application with low priority when a free space of memory is decreased.
Further, Patent Document 1 below discloses a technology of automatically switching an application to be launched according to a time at which a system is started. Patent Document 2 discloses a technology in which applications are classified into a resident type and a non-resident type (temporary type), and when memory shortage of an information terminal device occurs, a non-resident type application is force quitted. Patent Document 3 discloses a technology of determining priority of each application on the basis of the use frequency thereof.
In a conventional program execution device, a sequence in which resident programs are launched at system startup is the same every time. Therefore, if resource shortage occurs due to a resident program, only the same resident program is launched every time. In other words, there is a resident program that is not launched at all. However, resident programs include the one having a substantial need to be periodically launched, such as an automatic update program of an application, and therefore, it is undesirable that there is a resident program which is not launched at all.
The present invention is accomplished to solve the problems described above, and aims to provide a program execution system that can prevent the generation of a resident program which is not launched at all.
A program execution system according to the present invention includes a program execution unit configured to execute a plurality of programs including a plurality of resident programs; and a resident program launch controller configured to control a sequence in which the plurality of resident programs is launched, wherein the program execution unit sequentially launches the plurality of resident programs, at system startup, according to a launch sequence definition that is information specifying a sequence in which the plurality of resident programs is to be launched, and the resident program launch controller modifies the launch sequence definition at current system startup and uses the modified launch sequence definition at next system startup, when an amount of resources being used exceeds a certain value due to the launch of the plurality of resident programs.
According to the present invention, in the case where an amount of resources being used due to the launch of a resident program exceeds a certain value, the launch sequence definition modified from the launch sequence definition used at the current system startup is used at the next system startup, whereby, at the next system startup, the sequence in which a plurality of resident programs is launched is different from the launch sequence definition at the current system startup. This can prevent the generation of a resident program that is not launched at all.
The objects, features, aspects and advantages of the present invention will become more apparent with the following detailed description and the accompanying drawings.
The start switch 21 is a power source switch of the program execution device 10, and when a power source of the program execution device 10 is turned on by user's operation on the start switch 21, the program execution system is started. The start switch 21 may be a remote controller that remotely controls the program execution device 10, or may be built into the program execution device 10. Further, in the case where the program execution system is applied to an on-vehicle device, the start switch 21 may be configured to operate in conjunction with a power source switch or an ignition switch of a vehicle.
While a liquid crystal display is typical as the display 22, an arbitrary device (for example, a display unit of a smartphone, a tablet terminal, or an instrument panel of a vehicle) having an image display function may be used. In addition, the display 22 may be a touch panel functioning as an input receiving a user's operation. While a speaker or a headphone is typical as the audio output device 23, an arbitrary device having an audio output function may be used therefor.
The program execution device 10 includes a program execution unit 11, a storage unit 12, a resource monitor 13, and a resident program launch controller 14. The program execution device 10 is configured by using a computer, and the program execution unit 11, the resource monitor 13, and the resident program launch controller 14 are implemented by the computer operating according to a program. The storage unit 12 is constituted by a non-volatile storage medium such as a hard disk or a removable disk.
The program execution unit 11 can simultaneously execute a plurality of applications. In addition, the program execution unit 11 can output the execution result of each application from the display 22 or the audio output device 23 according to the operation of the application.
In general, an application executed by the program execution device is formed as a package including one or more programs and a definition file having various information pieces concerning the application. In addition, as illustrated in
Examples of the resident program include a map update confirmation program for navigation, a post confirmation program for social networking service (SNS) application, a latest news acquiring program of a news application, an update confirmation program of a music application, and a latest information acquiring program of a weather report application.
An application executed by the program execution unit 11 is stored in the storage unit 12. It is supposed in this context that applications stored in the storage unit 12 include a plurality of applications including a resident program. Further, the program execution unit 11 launches the resident programs of the plurality of applications in a predefined sequence at system startup. A “launch sequence definition” is information specifying a sequence (resident program launch sequence) in which a plurality of resident programs is to be launched by the program execution unit 11. The launch sequence definition is stored in the storage unit 12, and read by the program execution unit 11 at system startup.
In the case where the launch sequence definition illustrated in
The resource monitor 13 monitors the use status of resource by each application. Examples of the information indicating the use status of resource include an amount of memory being used or CPU utilization. In the present embodiment, the resource monitor 13 is supposed to monitor an amount of memory being used in the program execution device 10.
Here, programs executed by the program execution unit 11 include a program (system program) for implementing a basic operation of the program execution device 10 as well as a program included in an application introduced by a user. Since the system program has to be always executed, a part of the memory capacity of the program execution device 10 is reserved as an area for the system program, and the remaining part is used as an area for applications in general, as illustrated in
The resident program launch controller 14 controls the sequence (resident program launch sequence) in which a plurality of resident programs is to be launched. Specifically, in the case where memory shortage caused by the launch of a resident program at system startup is detected, the resident program launch controller 14 modifies the launch sequence definition used at the current system startup and uses the modified launch sequence definition at next system startup. That is, the resident program launch controller 14 updates the content of the launch sequence definition stored in the storage unit 12. Thus, the resident program launch sequence to be used at the next system startup is modified from the one at the current system startup.
Next, the operation of the program execution device 10 at system startup will be described with reference to
When the power source of the program execution device 10 is turned on by the start switch 21 to start the system, the program execution unit 11 launches the resident program A that is an object to be launched according to the launch sequence definition (
As illustrated in part (c) of
As described above, in the present embodiment, the content of the launch sequence definition is modified by changing the resident program, which is to be launched first, without modifying the loop of the launch sequence definition. Accordingly, any of the resident programs has a chance to be executed during the system is repeatedly started and shut down, and this prevents the generation of a resident program which is not at all launched.
When the power source of the program execution device 10 is turned on by the start switch 21 to start the system, the program execution unit 11 acquires the launch sequence definition from the storage unit 12 (step S11), and launches a resident program that is an object to be launched (step S12). Then, the resource monitor 13 monitors an amount of memory being used in the program execution device 10 to confirm whether or not the amount of memory being used is not more than the upper limit of memory usage (step S13). If the amount of memory being used is not more than the upper limit of memory usage (YES in step S13), an object to be launched is changed to the next resident program (step S14), and then, the process returns to step S12.
If the amount of memory being used exceeds the upper limit of memory usage (NO in step S13), the program execution unit 11 quits the last launched resident program (step S15). Further, the resident program launch controller 14 determines the resident program, which is the current object to be launched, to be the object to be launched at the next system startup (step S16), and stores the launch sequence definition in which this resident program is the object to be launched in the storage unit 12 (step S17). Thus, the startup process of the system is completed.
In the above description, it is determined whether or not memory shortage occurs (step S13) after a resident program is actually launched (step S12). However, if an amount of memory to be used by each resident program is recognized in advance, it may be determined whether or not memory shortage will occur before the launch of a resident program. In this case, the resident program may be launched and reside only when it is determined that memory shortage will not occur.
For example, when information of an amount of memory to be used by a resident program is written on the definition file (
The operation of the program execution device 10 at system startup when an amount of memory to be used by a resident program can be determined beforehand will be described below in more detail.
When the power source of the program execution device 10 is turned on by the start switch 21 to start the system, the program execution unit 11 acquires the launch sequence definition from the storage unit 12 (step S21). Then, the program execution unit 11 predicts an amount of memory to be used when the resident program which is the object to be launched is launched on the basis of the current amount of memory being used in the program execution device 10 detected by the resource monitor 13 and the amount of memory to be used by the resident program which is the object to be launched, and determines whether or not the amount of memory to be used at that time is not more than the upper limit of memory usage (step S22).
When determining that the amount of memory to be used is not more than the upper limit of memory usage even if the resident program which is the object to be launched is launched (YES in step S22), the program execution unit 11 launches this resident program (step S23). Then, the program execution unit 11 changes the object to be launched to the next resident program (step S24), and then, the process returns to step S22.
On the other hand, when determining that the amount of memory to be used exceeds the upper limit of memory usage when the resident program which is the object to be launched is launched (NO in step S22), the program execution unit 11 does not launch this resident program. In this case, the resident program launch controller 14 determines the resident program, which is the current object to be launched, to be the object to be launched at the next system startup (step S25), and stores the launch sequence definition in which this resident program is the object to be launched in the storage unit 12 (step S26). Thus, the startup process of the system is completed.
When a user introduces a new application into the program execution device 10, the resident program launch controller 14 adds the new resident program (F) to the sequence of the resident programs in the launch sequence definition stored in the storage unit 12 as illustrated in
In the case where the amount of memory to be used by the new resident program F is 20 MB, the average of the amounts of memory to be used by all resident programs A to F included in the launch sequence definition after the addition of the resident program F is 20.0 MB as illustrated in
In the embodiment 1, the content of the launch sequence definition is modified by changing a resident program, which is to be launched first, without modifying the loop of the launch sequence definition. However, the method for modifying the resident program launch sequence is not limited thereto. In an embodiment 2, when modifying a resident program launch sequence, a resident program launch controller 14 randomly determines the sequence of resident programs as illustrated in
In the embodiment 1, when memory shortage occurs due to the launch of a resident program, subsequent resident programs are not launched. For example, in the example in
However, in the state illustrated in part (d) of
Specifically, a program execution unit 11 in the program execution device 10 according to the embodiment 3 repeatedly performs, according to the launch sequence definition, an operation for causing the next resident program to reside by skipping the resident program which is the cause of the memory shortage. The repeated operation is executed until a round of the resident programs in the launch sequence definition is ended.
This operation will be described with reference to
When the power source of the program execution device 10 is turned on by the start switch 21 to start the system, the program execution unit 11 launches the resident program A that is an object to be launched according to the launch sequence definition (
As illustrated in part (c) of
As illustrated in part (e) of
The resident program launch controller 14 modifies the launch sequence definition such that the resident program, which becomes the first cause for which the amount of memory being used exceeds the upper limit of memory usage, is launched first at the next system startup. In the operation illustrated in
As described above, in the present embodiment, when memory shortage occurs due to the launch of a resident program, a resident program which can be launched instead is searched, and if such resident program is found, this program is launched. Accordingly, the number of the residing resident programs can be increased more than the embodiment 1.
When the power source of the program execution device 10 is turned on by the start switch 21 to start the system, the program execution unit 11 acquires the launch sequence definition from the storage unit 12 (step S31), and launches a resident program that is an object to be launched (step S32). Then, the resource monitor 13 monitors an amount of memory being used in the program execution device 10 to confirm whether or not the amount of memory being used is not more than the upper limit of memory usage (step S33).
If the amount of memory being used is not more than the upper limit of memory usage (YES in step S33), an object to be launched is changed to the next resident program (step S34). In this case, if the object to be launched does not make a round of the resident programs in the launch sequence definition (NO in step S35), the process returns to step S32.
On the other hand, in step S33, if the amount of memory being used exceeds the upper limit of memory usage (NO in step S33), the program execution unit 11 quits the last launched resident program (step S36). In this case, if it is the first time that the amount of memory being used exceeds the upper limit of memory usage (YES in step S37), the resident program launch controller 14 determines the resident program, which is the current object to be launched, as the object to be launched at the next system startup (step S38), and then, the process proceeds to step S34. If it is not the first time that the amount of memory being used exceeds the upper limit of memory usage (NO in step S37), the process in step S38 is not performed, and the process proceeds to step S34.
The process described above is repeatedly performed. When the object to be launched makes a round of the resident programs in the launch sequence definition (YES in step S35), it is confirmed whether or not the object to be launched at the next system startup has already been determined (that is, whether or not the process in step S38 has already been performed) (step S39). If the object to be launched at the next system startup has not yet been determined (NO in step S39), the resident program launch controller 14 determines the resident program, which is the current object to be launched, to be the object to be launched at the next system startup (step S40), and stores the launch sequence definition specified as such in the storage unit 12 (step S41).
If the object to be launched at the next system startup has already been determined (YES in step S39), the resident program launch controller 14 stores the launch sequence definition in which the object to be launched is specified as determined in step S38 into the storage unit 12 without performing the process in step S40 (step S41). Thus, the startup process of the system is completed.
Even in the embodiment 3, in the case where the amount of memory to be used by each resident program is recognized beforehand, it may be determined whether memory shortage will occur or not without actually launching a resident program.
In the embodiment 3, the resident program launch controller 14 modifies the content of the launch sequence definition such that the resident program, which is the first cause for which the amount of memory being used exceeds a certain value, is to be launched first at the next system startup without modifying the loop in the launch sequence definition. However, when modifying the launch sequence definition, the resident program launch controller 14 may randomly determine the sequence of resident programs in the launch sequence definition by applying the embodiment 2.
While the embodiment 1 describes the example in which the program execution device 10 uses only one launch sequence definition, an embodiment 4 shows an example in which the program execution device 10 uses a plurality of launch sequence definitions. Specifically, a resident program launch controller 14 manages a plurality of launch sequence definitions illustrated in
For example, in the case where a plurality of launch sequence definitions is switched according to a current position condition, a plurality of launch sequence definitions corresponding to the respective current position conditions is stored in the storage unit 12. The resident program launch controller 14 acquires a current position at startup of the program execution device 10, and issues an instruction to read the launch sequence definition according to the current position from the storage unit 12 to the program execution unit 11 in step S11 in
Examples of considerable conditions of criteria for determining which launch sequence definition should be selected include a weather condition and a user condition, besides the current position condition. The operation of the program execution device 10 using such conditions may be similar to the operation described above, and the resident program launch controller 14 may issue an instruction to read the launch sequence definition according to a current weather or a user from the storage unit 12 to the program execution unit 11 in step S11 in
According to the embodiment 4, the launch sequence definition can be used according to a current position or weather at the time when the program execution device 10 is started. Further, the launch sequence definition can be switched for each user using the program execution device 10. Particularly, in the case where an application can be independently introduced by each user, resident programs introduced by each of users may differ as illustrated in
An embodiment 5 describes a program execution device 10 configured such that priority is specified for each of a plurality of resident programs, and a resident program launch controller 14 manages a plurality of launch sequence definitions, each of which corresponds to each priority.
In this case, the resident programs having low priority may be launched only when there is room in memory capacity even after all of the resident programs having high priority are launched. However, in this case, the resident programs with low priority may not be launched at all. In view of this, the sequence in which the resident programs are launched is preferably determined such that at least one of resident programs with each priority can be executed. If at least one of resident programs with each priority is executed at system startup, all of the resident programs with low priority have a chance to be launched during the system is repeatedly started and shut down, and this can prevent the generation of the resident program which is not at all launched.
When the power source of the program execution device 10 is turned on by the start switch 21 to start the system, the program execution unit 11 acquires the launch sequence definition for resident programs with high priority and the launch sequence definition for resident programs with low priority from the storage unit 12 (step S51). Then, the program execution unit 11 launches an object to be launched in the resident programs with high priority (step S52). Next, the resource monitor 13 monitors an amount of memory being used in the program execution device 10 to confirm whether or not the amount of memory being used is not more than the upper limit of memory usage (step S53). If the amount of memory being used is not more than the upper limit of memory usage (YES in step S53), an object to be launched in the resident programs with high priority is changed to the one next to the current object to be launched (step S54), and then, the process returns to step S52.
When the amount of memory being used exceeds the upper limit of memory usage due to the repeated processes in steps S52 to S54 (NO in step S53), the program execution unit 11 quits the last launched resident program with high priority (step S55). With the process so far, the resident programs with high priority are launched within the range in which the amount of memory being used does not exceed the upper limit of memory usage.
Then, the program execution unit 11 launches an object to be launched in the resident programs with low priority (step S56). Next, the resource monitor 13 confirms whether or not the amount of memory being used is not more than the upper limit of memory usage (step S57). If the amount of memory being used is not more than the upper limit of memory usage (YES in step S57), an object to be launched in the resident programs with low priority is changed to the one next to the current object to be launched (step S58), and then, the process returns to step S56.
If the amount of memory being used exceeds the upper limit of memory usage (NO in step S57), the program execution unit 11 confirms whether or not two or more resident programs with low priority are launched (step S59). Note that, since step S56 is executed before step S59, at least one of the resident programs with low priority has already been launched in step S59.
When only one resident program with low priority is launched (NO in step S59), the last launched one of the currently-launched resident programs with high priority is quitted in order to reduce the amount of memory being used while keeping the operation of the launched resident program with low priority (step S60). Further, the object to be launched in the resident programs with high priority is changed to the previous one of the current object to be launched (step S61). Thus, the object to be launched in the resident programs with high priority is the resident program quitted in step S60. Thereafter, the resource monitor 13 again confirms whether or not the amount of memory being used is not more than the upper limit of memory usage (step S62), and if the amount of memory being used exceeds the upper limit of memory usage (NO in step S62), the process returns to step S60. That is, the processes in steps S60 and S61 are repeatedly performed until the amount of memory being used becomes not more than the upper limit of memory usage. With this, the amount of memory being used can be lowered to be equal to or less than the upper limit of memory usage, while the operation of the only resident program with low priority which is currently launched is continued.
When the amount of memory being used becomes not more than the upper limit of memory usage (YES in step S62), the process returns to step S56. Thus, in the case where the amount of space of memory increased by the process in step S60 is large, the resident program with low priority can further be launched, whereby the memory capacity can effectively be utilized.
On the other hand, when two or more resident programs with low priority are launched in step S59 (YES in step S59), the last launched one of the currently-launched resident programs with low priority is quitted in order to lower the amount of memory being used to be equal to or less than the upper limit of memory usage while keeping the operation of the resident program with high priority (step S63). Thereafter, the resident program launch controller 14 determines the current object to be launched in the resident programs with each priority to be the object to be launched at the next system startup (step S64), and stores the launch sequence definition for resident programs with each priority in the storage unit 12 (step S65). Thus, the startup process of the system is completed.
In the operation in
The operation of the program execution device 10 at system startup when an amount of memory to be used by a resident program can be determined beforehand will be described below.
When the power source of the program execution device 10 is turned on by the start switch 21 to start the system, the program execution unit 11 acquires the launch sequence definition for resident programs with high priority and the launch sequence definition for resident programs with low priority from the storage unit 12 (step S71). Then, the program execution unit 11 predicts an amount of memory to be used when an object to be launched in the resident programs with high priority and an object to be launched in the resident programs with low priority are launched on the basis of the current amount of memory being used in the program execution device 10 detected by the resource monitor 13, the amount of memory to be used by the object to be launched in the resident programs with high priority, and the amount of memory to be used by the object to be launched in the resident programs with low priority, and determines whether or not the amount of memory to be used at that time is not more than the upper limit of memory usage (step S72).
When determining that the amount of memory to be used is not more than the upper limit of memory usage even if the object to be launched in the resident programs with high priority and the object to be launched in the resident programs with low priority are launched (YES in step S72), the program execution unit 11 launches the object to be launched in the resident programs with high priority (step S73). Then, the object to be launched in the resident programs with high priority is changed to the one next to the current object to be launched (step S74), and then, the process returns to step S72. With the processes in steps S72 to S74, the resident programs with high priority are launched within the range in which the amount of memory being used does not exceed the upper limit of memory usage, while the memory capacity required for launching the object to be launched in the resident programs with low priority is left.
Thereafter, when it is determined that the amount of memory to be used exceeds the upper limit of memory usage if the object to be launched in the resident programs with high priority and the object to be launched in the resident programs with low priority are launched (NO in step S72), the program execution unit 11 predicts an amount of memory to be used when the object to be launched in the resident programs with low priority is launched on the basis of the current amount of memory being used detected by the resource monitor 13 and the amount of memory to be used by the object to be launched in the resident programs with low priority, and determines whether or not the amount of memory to be used at that time is not more than the upper limit of memory usage (step S75).
When determining that the amount of memory to be used is not more than the upper limit of memory usage even if the object to be launched in the resident programs with low priority is launched (YES in step S75), the program execution unit 11 launches the object to be launched in the resident programs with low priority (step S76). Then, the object to be launched in the resident programs with low priority is changed to the one next to the current object to be launched (step S77), and then, the process returns to step S75. As previously described, in steps S72 to S74, the memory capacity needed to launch the object to be launched in the resident programs with low priority is ensured, and therefore, YES determination is made at least once in step S75, whereby at least one of the resident programs with low priority is launched.
On the other hand, when it is determined that the amount of memory to be used exceeds the upper limit of memory usage when the object to be launched in the resident programs with low priority is launched (NO in step S75), another resident program with low priority is not launched. In this case, the resident program launch controller 14 determines the current object to be launched in the resident programs with each priority to be the object to be launched at the next system startup (step S78), and then, stores the launch sequence definition for resident programs with each priority in the storage unit 12 (step S79). Thus, the startup process of the system is completed.
Note that the priority of each resident program may not be fixed. For example, the priority may be changed according to a predetermined condition (condition such as a current position, weather, or user).
While the embodiments 1 to 5 describe that the program execution unit 11 launches a resident program only at system startup, a program execution unit 11 in an embodiment 6 changes a resident program to reside at a fixed cycle according to a launch sequence definition after system startup.
Specifically, the program execution unit 11 executes the process in the embodiment 1 (
This operation will be described with reference to
In the present embodiment, the resident program is switched according to the launch sequence definition during the system is operated, whereby the effect similar to the embodiment 1 can be obtained without shutting down the operation of the system. The present embodiment is particularly effective for a device of which power source is not frequently turned off, such as a smartphone. Notably, in the case where the process in
Further, while the embodiment 5 describes an example in which the process in the embodiment 1 (
The embodiments of the present invention can be freely combined, modified or omitted, as appropriate, within the scope of the invention.
While the invention has been shown and described in detail, the foregoing description is in all aspects illustrative and not restrictive. It is therefore understood that numerous modifications and variations can be conceived without departing from the scope of the invention.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2014/070891 | 8/7/2014 | WO | 00 |