The present invention relates to control of tasks.
In recent years, the number of information-processing devices installed with a multitasking OS (Operating System) capable of executing plural tasks simultaneously has increased. A smartphone is one such device. In a smartphone, tasks of application programs, even while a backlight of a liquid crystal screen of a device is turned off, require data synchronization with a server device or a processing relevant to a GPS (Global Positioning System) or a wireless LAN (Local Area Network), which results in a CPU frequently entering into an operating status, in contrast to a conventional portable device. Accordingly, a smartphone consumes much more power. Also, in a smartphone, the number of occurrences of wireless communication increases as a result of which the number of signals to be processed by a base station increases. Namely, a larger load is imposed on a base station and a mobile communication network by use of a smartphone. Further, due to simultaneous communication by plural smartphones (hereinafter referred to as “burst traffic”), a problem of a temporary overload on a base station or a mobile communication network occurs.
JP 8-255088A1 discloses, as a technique for controlling plural tasks, a system where task execution requests are controlled by dividing tasks into tasks with a time interval specified and tasks with a particular time specified. However, the system only reduces the number of occurrences of a timer interruption by dividing tasks into two categories, which system is not effective in terms of power-saving and reduction of a network load.
In view of the above problem in the prior art, the present invention intends to reduce a processing load by controlling appropriately the tasks to be performed by a device.
The present invention provides a task control device comprising a task control unit that executes a task of a first type, an execution time of which is not allowed to be changed, at a specified first time, and that executes a task of a second type, an execution time of which is allowed to be changed, at a second time different from the first time.
The task control unit may acquire execution request information including task identification information that identifies a subject task, an execution time of the subject task, and type information indicating whether the subject task is the first type or the second type. The task control unit may further determine whether the subject task is the first type or the second type based on the type information.
The task control unit may acquire execution request information including task identification information that identifies a subject task, an execution time of the subject task, and a type of the execution time of the subject task. The task control unit may further determine whether the subject task is the first type or the second type based on the type of the execution time.
The task control unit may comprise: a storage unit; and a storage processing unit that stores, for the task of the first type, data on the specified first time in the storage unit, and that sets, for the task of the second type, the second time different from the first time such that the task of the second type is executed simultaneously with another task of the second type, and stores data on the second time in the storage unit. The task control unit may further execute the task of the first type when the first time stored in the storage unit comes, and execute the task of the second type and the other task of the second type when the second time stored in the storage unit comes.
The storage processing unit, when the task of the second type is a periodic task, may set the second time such that the task of the second type is executed simultaneously with another task of the second type, which is a periodic task, wherein a common divisor exists between an execution period of the task of the second type and an execution period of the other task of the second type, and may store data on the second time in the storage unit.
The storage processing unit, when the task of the second type is a non-periodic task that does not cause a communication processing, may set the second time such that the task of the second type is executed simultaneously with another task of the first type.
The storage processing unit, when the task of the second type is a task that causes a communication processing, may set the second time based on a communication start time of the task of the second type such that communication caused by the task of the second type starts at the same time when communication caused by another task of the second type starts.
The task control unit may comprise: a storage unit; a storage processing unit that stores, in the storage unit, data on the first time specified for the task of the first type and data on an execution time specified for the task of the second type; and an execution unit that executes the task of the first type at the first time stored in the storage unit, and that, for the task of the second type, changes the execution time stored in the storage unit to the second time different from the first time such that the task of the second type is executed simultaneously with another task of the second type, and executes the task of the second type at the second time.
When the task control unit has transited from a dormant status to an operating status in response to a notification of an event to the task of the second type, and a time when the task control unit has transited from a dormant status to an operating status has passed an execution time specified for the task of the second type, the task control unit may set the execution time specified for the task of the second type to the second time, which is an execution time of another task of the second type, which is executed most recently subsequent to the time when the task control unit has transited from a dormant status to an operating status.
When the task control unit has transited from a dormant status to an operating status in response to a factor other than a request for executing the task of the second type and a notification of an event to the task of the second type, and a time when the task control unit has transited from a dormant status to an operating status has passed an execution time specified for the task of the second type, the task control unit may set the execution time specified for the task of the second type to the second time, which is an execution time of another task of the second type, which is executed most recently subsequent to the time when the task control unit has transited from a dormant status to an operating status.
The task control device may comprise a status management unit that manages a status of the task control device. The task control unit may determine, based on the status managed by the status management unit, whether to change the first time of the task of the first type or an execution time of the task of the second type, and thereafter executes the task of the first type or the task of the second type.
The task control device may comprise a control policy change unit that changes a control policy for the task control unit based on information input to the task control device. The task control unit may control execution of a task in accordance with the control policy changed by the control policy change unit.
The task control device may comprise a broadcast reception detection unit that detects a reception of broadcast information distributed to plural information-processing devices, one of which includes the task control device. When the broadcast reception detection unit has detected a reception of the broadcast information, and a time when the broadcast reception detection unit has detected the reception of the broadcast information has passed an execution time specified for the task of the second type, the storage processing unit may write, over the execution time specified for the task of the second type, the second time subsequent to the time when the broadcast reception detection unit has detected the reception of the broadcast information, and may store data on the second time in the storage unit.
The task control device may comprise a broadcast reception detection unit that detects a reception of broadcast information distributed to plural information-processing devices, one of which includes the task control device. When the broadcast reception detection unit has detected a reception of the broadcast information, and a time when the broadcast reception detection unit has detected the reception of the broadcast information has passed an execution time specified for the task of the second type, the storage processing unit may delete the execution time specified for the task of the second type
According to the present invention, a processing load is reduced by controlling tasks.
A preferred embodiment of an information-processing device according to the present invention will be described in detail below with reference to the drawings.
Task control unit 310 executes a task according to execution request information for the task, which task is registered using a function provided by task control unit 310. Execution request information for a task includes an execution time at which the task should be executed, and a set time type. The set time type indicates whether the execution time is an execution time set by a programmer or a user (hereinafter referred to as “programmer” collectively) or an execution time set by the system of information-processing device 100.
A task whose execution time is set by a programmer, which is a first task according to the present invention, and is hereinafter referred to as a “P-Task,” may include an alarm clock task. The alarm clock task is a task that operates at an execution time (for example, 7 am every day) specified by a user among times prepared by a programmer. A P-Task is not executed at a time different from a set execution time. In other words, a P-Task is a task designed so that changing its specified execution time is not permitted.
On the other hand, a task whose execution time is optimized by the system regardless of an execution time specified by a programmer, which is a second task according to the present invention, and is hereinafter referred to as an “S-Task.” An S-Task can be divided broadly into two types of tasks, tasks whose execution time is periodic and tasks whose execution time is not periodic. A periodic task may include a task, “Keep Alive,” that maintains a session of communication performed between information-processing device 100 and a server device over a mobile communication network. Since a session with a server device is maintained as long as the task is executed periodically, the task is not required to be executed at a particular time such as 7 am every day. Accordingly, the decision as to what the initial execution time for the task should be can be made by the system as required. The task may be executed periodically at the decided execution time. A non-periodic task has no restriction as to its execution time such that the task may be executed any time. Accordingly, the execution time for the task may be decided by the system as required. As described in the foregoing, an S-Task is a task that may operate at a time other than a particular time, and which is designed so that a time specified by a programmer is permitted to be changed.
Now
On the other hand, a task execution thread starts in response to a transition of execution unit 313 from a dormant status (or sleep status) to an operating status. Execution unit 313 accesses execution request information stored in storage unit 312 (step S3), and confirms the execution request information (step S4). Conditions in which execution unit 313 transits from a dormant status to an operating status include (1) a request for execution of a task, (2) a notification of an event relevant to a change in remaining battery level or to a network condition, and (3) a condition other than conditions (1) and (2) (for example, a condition relevant to device management by the kernel, or an input operation to input operation unit 650). Execution unit 313, if as a result of the confirmation of the execution request information, condition (1) is satisfied, issues an execution instruction to application A to execute a task (shown as task A in
An operation performed by storage processing unit 311 to store execution request information in storage unit 312 will be described with reference to
The storage processing for an S-Task will be described with reference to
If the common divisor does not exist (step S303; NO), storage processing unit 311 determines whether comparison with all tasks stored in storage unit 312 has been completed (step S305). If a task to be compared exists in storage unit 312 (step S305; NO), storage processing unit 311 returns to step S302 to perform the above-mentioned processing. If comparison with all tasks has been completed (step S305; YES), storage processing unit 311 identifies the maximum period among periods recorded in step S304 (step S306). Subsequently, storage processing unit 311 stores execution request information for task A in storage unit 312, in which a next execution time of a task having the maximum period is specified as a first execution time of task A (step S307).
A processing example of steps S301 to S307 will be described with reference to
A processing example of steps S308 to S312 will be described with reference to
After the execution request information is stored in storage unit 312 as described in the foregoing, when the execution time included in the execution request information comes, execution unit 313 executes task A.
The above embodiment may be modified as described below. The following modifications may be combined with each other.
In the embodiment, in a case where information-processing device 100 transits from a dormant status to an operating status in a condition that execution of a task has been requested, the task that triggered the activation is executed. However, execution unit 313 may acquire information on a status of information-processing device 100 (for example, information on whether a backlight of the display unit of a device is in an on-state or an off-state, a remaining battery level, a resource consumption amount, a network condition, or whether the information-processing device is connected or disconnected to a power cable) from an API (Application Program Interface) provided by the framework, and control executions of tasks based on the status information. In this case, task control unit 310 includes status management unit 314 that manages status information, as shown in
In a case where information on whether display unit 640 is in an on-state or an off-state is referred to as status information, task control unit 310 does not perform simultaneous execution of tasks when display unit 640 is in an on-state, and performs simultaneous execution of tasks when display unit 640 is in an off-state. When display unit 640 is in an on-state, it is likely that a user is viewing display unit 640 for, for example, web browsing; therefore, high responsiveness of a processing to an input operation is required. If tasks are simultaneously executed in such a situation, responsiveness of execution of a task is lowered; as a result, usability of a device for a user is likely to be lowered. On the other hand, when display unit 640 is in an off-state, it is likely that a user is not viewing display unit 640; therefore, high responsiveness of a processing to an input operation is not required. Accordingly, when display unit 640 is in an off-state, it is preferable that an execution time of a task is changed so that tasks are simultaneously executed to save energy and to reduce network load.
As shown in
In a case where an amount of resources consumed by information-processing device 100 when a task is executed is referred to as status information, and where a total amount of resources consumed by tasks to be simultaneously executed exceeds a threshold value, task control unit 310 excludes task(s) that consumes a larger amount of resources from tasks subjected to simultaneous execution so that the total amount of resources consumed does not become greater than the threshold value. If a data amount exceeds the capacity of a main memory, tasks are likely to freeze or crash. Therefore, in the case where the total amount of resources consumed exceeds the threshold value, the number of tasks subjected to simultaneous execution should be reduced. Information on a resource consumption amount for each task may be pre-included in execution request information for the task, which is referred to by task control unit 310. Alternatively, a resource consumption amount for each task may be learned by task control unit 310 by monitoring resources consumed when the task is executed.
Information relevant to a network such as a radio wave reception intensity or a communication throughput in communication with a base station of a mobile communication network or in a wireless LAN may be used as status information. In the case, task control unit 310, if determining that an extra communication band is available, may increase the number of tasks to be simultaneously executed.
A remaining battery level may be referred to as status information. In the case, when a remaining battery level is lower than or equal to a threshold value, task control unit 310 performs simultaneous execution of tasks to save power. The threshold value may be set by a user, or may be automatically set by the system of information-processing device 100.
Whether information-processing device 100 is connected to a power cable connected to a commercial power source may be referred to as status information. In the case, when information-processing device 100 is disconnected from the power cable, task control unit 310 performs simultaneous execution of tasks to save power.
In modification 1, it is decided whether to change an execution time of a task so that tasks are simultaneously executed, depending on a status of information-processing device 100. In the present modification, a control policy may be changed based on external input information, which cannot be acquired from the inside of information-processing device 100, so that control can be performed reflecting an intention of a user or a developer, a network condition, or a status of another information-processing device. In this case, task control unit 310 includes control policy change unit 331 that changes a control policy based on external input information, as shown in
Control policy change unit 331 may convert a control policy according to conversion rule 1200 for execution request information, as shown in
In the above example, execution history monitoring unit 316 registers a name of a task or an application, and execution request information in application list 1100 of server device 1000; however, those pieces of information may be registered by a user in application list 1100 of server device 1000. It is to be noted that conversion rule 1200 and application list 1100 may be held by each information-processing device 100, based on which information-processing device 100 may control tasks.
Control policy change unit 331 may communicate with a base station or an exchange of a mobile communication network to change an execution time of a task so that communication is not performed intensively at a particular time. For example, in a case where a base station or an exchange identifies occurrence of burst traffic at 7 am every day, an execution time of a task that performs communication at 7 am may be changed in some information-processing devices 100 to prevent the devices from executing the task at 7 am.
In a case where a developer tests an application at a developmental stage, information-processing device 100 may execute a task at an original execution time, without changing the execution time. In this case, an application may be attached with a flag indicating that the application is under development, so that it can be determined that the application is for testing, and task control unit 310 may be provided with a function by which an execution time of an application attached with such a flag is not changed.
In the embodiment, storage processing unit 311 changes an execution time of a task, and thereafter stores data on the changed execution time in storage unit 312. However, storage processing unit 311 may store data on an execution time of a task in storage unit 312, without changing the execution time, and execution unit 313 may change the execution time before executing the task. In the case, in
In the embodiment, plural tasks are simultaneously executed by making their execution times the same. However, in some tasks, a communication processing occurs several seconds to several tens of seconds after the task is executed. For example, as shown in
In the embodiment, only S-Tasks are simultaneously executed to avoid occurrence of burst traffic. However, a combination of an S-Task (that does not perform communication) and a P-Task, if simultaneously executed, does not cause burst traffic. In the present modification, as shown in
In the embodiment, where an execution time of a task is changed by storage processing unit 311 of framework 300, storage processing unit 311 may be realized by an application program. In this case, storage processing application 220 that realizes a function equivalent to that of storage processing unit 311 may be provided, instead of storage processing unit 311, as shown in
Information-processing device 100 may be a stand-alone information-processing device, instead of a communication device such as a mobile phone. A program executed in information-processing device 100 may be stored for distribution in a recording medium such as a magnetic tape, a magnetic disk, a floppy (Registered Trademark) disk, an optical recording medium, a magneto-optical medium, a CD (Compact Disk), a DVD (Digital Versatile Disk), or a RAM.
When plural information-processing devices 100, during a sleep or dormant status, receive information that is simultaneously distributed over a communication network such as a message reporting the occurrence of an emergency situation such as an earthquake (or an emergency earthquake alert) (which reception will be referred to as “broadcast reception”), information-processing devices 100 simultaneously transit from the dormant status to an operating status, and may display a message. After transiting to the operating status, plural information-processing devices 100 execute a task to be executed, if any. In the case, if an S-Task that performs communication is executed simultaneously in plural information-processing devices 100, burst traffic may occur. To prevent the occurrence of burst traffic, task control unit 310 includes broadcast reception detection unit 317 that detects a broadcast reception, as shown in
In
If the current time has passed the execution time (step S830; YES), storage processing unit 311 determines whether the task is a periodic task (step S840). If the task is a periodic task (step S840; YES), storage processing unit 311 rewrites, over the execution time of the execution request information acquired in step S820, a time obtained from following expression 1, and stores the rewritten execution request information in storage unit 312 (step S850).
NewSetTime=setTime+count×interval. expression 1
Therein, count=1+(now−setTime)/interval [therein, (now−setTime)/interval is a value calculated as an integer value];
newSetTime: a new execution time that is written over an old execution time;
setTime: an execution time included in execution request information to be overwritten acquired in step S820;
interval: a period of a task identified in execution request information to be overwritten acquired in step S820; and
now: a time when a broadcast reception has been detected (namely, a current time).
For example, in a case where now=18:00, setTime=17:55, and interval=15 (minutes), (now−setTime)/interval=5/15; however, since (now−setTime)/interval has to be an integer value as described above, a resulting value is “0.” Count=1+0=1. NewSetTime=setTime+count×interval=17:55+1×15 (minutes)=18:10. NewSetTime is always a value subsequent to a current time i.e., now.
On the other hand, if the task is not a periodic task (step S840; NO), storage processing unit 311 rewrites, over the execution time of the execution request information acquired in step S820, a time obtained from following expression 1, and stores the rewritten execution request information in storage unit 312 (step S860).
NewSetTime=setTime+count×t. expression 2
Therein, count=1+(now−setTime)/t [therein, (now−setTime)/t is a value calculated as an integer value];
newSetTime: a new execution time that is written over an old execution time;
setTime: an execution time included in execution request information to be overwritten acquired in step S820;
t: a predetermined time (for example, 15 minutes); and
now: a time when a broadcast reception has been detected.
For example, in a case where now=18:00, setTime=17:55, t=10 (minutes), (now−setTime)/t=5/10; however, since (now−setTime)/t has to be an integer value as described above, a resulting value is “0.” Count=1+0=1. NewSetTime=setTime+count×t=17:55+1×10 (minutes)=18:05. NewSetTime is always a value subsequent to a current time i.e., now.
Storage processing unit 311 calculates an execution time using expression 1 or 2 at step S850 or S860 because it is necessary to differentiate, in each information-processing device 100, an execution time of an S-Task subsequent to a time when a broadcast reception has been detected, so that occurrence of burst traffic is prevented. Any other algorithm may be used, instead of expression 1 or 2, whereby an execution time can be adequately differentiated in each information-processing device 100.
Storage processing unit 311 may, instead of overwriting an execution time of an S-Task whose execution time has passed, as described above, delete the execution time. If an execution time of a task is deleted, the task is not executed; however, such a measure may be employed in a case where preventing occurrence of burst traffic is emphasized.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/US2013/067676 | 10/31/2013 | WO | 00 |
Number | Date | Country | |
---|---|---|---|
Parent | 13673413 | Nov 2012 | US |
Child | 14407669 | US |