Control apparatus, control method, computer program product, and semiconductor device

According to an embodiment, a control apparatus for controlling a target device includes an estimation unit and an issuing unit. The estimation unit is configured to estimate a second amount of energy required for the entire system including the target device and the control apparatus until the target device completes an execution of its function that is requested in accordance with an execution request for the target device. The issuing unit is configured to issue a control command for causing the target device to execute its function in accordance with the execution request, when the first amount of energy at a time point of receiving the execution request is greater than the second amount of energy.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2012-066990, filed on Mar. 23, 2012 and Japanese Patent Application No. 2013-053796, filed on Mar. 15, 2013; the entire contents of which are incorporated herein by reference.

FIELD

Embodiments described herein relate generally to a control apparatus, a control method, a computer program product, and a semiconductor device.

BACKGROUND

In the past, there has been known a system that operates by accessorily using power generated by a power generator that converts natural energy into power. There has been known a technique of operating a task processing in such a system only when an amount of energy required for the task processing is able to be covered by an auxiliary power supply unit that stores power generated by a power generator.

However, in the conventional technique, since power required in a system (for example, power consumed in a memory or the like) other than power required for a task processing until completion of the task processing is not considered at all, there is also a fear that power supply will be lost in the middle of the task processing.

DETAILED DESCRIPTION

According to an embodiment, a control apparatus for controlling a target device includes an estimation unit and an issuing unit. The estimation unit is configured to estimate a second amount of energy required for the entire system including the target device and the control apparatus until the target device completes an execution its function that is requested in accordance with an execution request for the target device. The issuing unit is configured to issue a control command for causing the target device to execute its function in accordance with the execution request, when the first amount of energy at a time point of receiving the execution request is greater than the second amount of energy.

Hereinafter, various embodiments will be described in detail with reference to the accompanying drawings.

First Embodiment

FIG. 1is a block diagram illustrating an example of a functional configuration of a system100according to a first embodiment. As illustrated inFIG. 1, the system100includes a power supply unit10, a plurality of target devices20, a user process30, a device access control unit40, a first memory unit50, and a plurality of device drivers60corresponding one to one to the plurality of devices20. In addition, the system may be configured such that one device driver60corresponds to a plurality of devices.

The power supply unit10is a supply source of power supplied to the system100. The power supply unit10includes an energy conversion unit11and an electric storage unit12. The energy conversion unit11converts energy other than electricity, which is received from outside the power supply unit10, into electric energy (power). The energy conversion unit11includes, for example, a solar cell (solar panel), a radio generating electricity by receiving an electromagnetic wave, or the like; however, the embodiment is not limited thereto. Also, the electric storage unit12stores electric energy (power) that is converted into by the energy conversion unit11. The electric storage unit12may include, for example, a battery, a capacitor, or the like. In the first embodiment, the electric storage unit12is configured by a capacitor.

The device20is a device supplied with power from the power supply unit10. The device20may include, for example, a NAND type flash memory, a disk drive such as a DVD (Digital Versatile Disk) drive, a USB memory, or the like. The device20may be embedded in the system100, or may be connected (external) to the system100like a USB memory or the like.

The user process30is an application program that is being executed by a CPU of the system100. The user process30requests the device access control unit40to execute various types of processing. For example, the user process30transmits an execution request for requesting the device20to execute its function to the device access control unit40.

When receiving an execution request from the user process30, and when a predetermined condition is satisfied, the device access control unit40issues a control command for causing the device to execute its function, to the device driver60corresponding to the relevant device. On the other hand, if the predetermined condition is not satisfied, the device access control unit40outputs an error notification indicating the impossibility of causing the device to execute its function, to the user process30as a response to the execution request. This will be described in detail later.

As illustrated inFIG. 1, the device access control unit40includes a detection unit41, an estimation unit42, and an issuing unit43. The detection unit41measures a first amount of energy that the power supply unit10can supply. In the first embodiment, the detection unit41measures the amount of power stored in the electric storage unit12as the first amount of energy, but is not limited thereto. For example, the detection unit41may measure the first amount of energy taking an average value of the amounts of electric energy (amount of power) converted most recently by the energy conversion unit11into consideration.

The estimation unit42estimates a second amount of energy that is the amount of energy required in the entire system100until the device20completes an execution of its function that is requested in accordance with an execution request made with respect to the device20. More specifically, this is as follows. Herein, the first memory unit50stores therein identification information for identifying the function of the device20, a third amount of energy that is the amount of energy required for the execution of the function of the device20, and an execution time length for which the device20executes the function, in an associated manner. In an example ofFIG. 2, the first memory unit50stores therein one or more pieces of correspondence information in which a device name for identifying the device20, identification information, a third amount of energy and an execution time length are associated with one another. In the example ofFIG. 2, as an example, a third amount of energy and an execution time length corresponding to each of a NAND read operation (Read) and a NAND write operation (Write) are illustrated; however, the embodiment is not limited thereto. Meanwhile, in information of NAND read operation and NAND write operation inFIG. 2, the time and the amount of energy required to read/write data corresponding to one page of a NAND device (required for a unit of execution of a function) are stored. Therefore, in order to determine the time and the amount of energy for a function of the NAND device, an actual amount of energy is calculated by calculating the amount of read or write data based on information received as a parameter of an execution request and determining how many pages it corresponds to. For example, if one page is 2K bytes and a data size as a parameter of a device read request is 8K bytes, since data corresponding to four pages is read out, the amount of energy may be estimated as 40 nWs and the read time may be estimated as 120 ns. In the example ofFIG. 2, a third amount of energy is defined as the amount of energy required for a unit of execution of a function of the device20and an execution time length is defined as the time required for a unit of execution of the device20; however, the embodiment is not limited thereto. For example, a third amount of energy may be defined as the total amount of energy required for an execution of a function of the device20and an execution time length may be defined as the total time from the start to the completion of an execution of a function of the device20. Hereinafter, for convenience of description, it is assumed that the first memory unit50stores therein identification information and a third amount of energy that is the total amount of energy required for an execution of the function of the device20, and an execution time length for which the device20executes the function, in an associated manner.

The estimation unit42reads, from the first memory unit50, a third amount of energy and an execution time length that correspond to identification information for identifying the function of the device that is requested by an execution request, and estimates a second amount of energy by using the read execution time length and the read third amount of energy. More specifically, the estimation unit42estimates a second amount of energy from the sum of a fourth amount of energy and the third amount of energy read from the first memory unit50. Herein, the fourth amount of energy is an amount of energy that is obtained by multiplying a set power, which is set in advance as the power required in the system100other than the power required for an execution of the function of the device20, by the execution time length read from the first memory unit50. The set power may be set to, for example, a value obtained by adding the power of a CPU, a memory, or the like, or the power consumed in the device20in a standby state and also considering a certain degree of margin. In short, the set power may be considered as the power required in the system100other than the power required for an execution of a function of the device20.

Referring back toFIG. 1, the description will be continued. When receiving an execution request from the user process30, and when the first amount of energy is greater than the second amount of energy, the issuing unit43issues a control command for causing the device20to execute the function in accordance with the received execution request to the device driver60corresponding to the device20. In the first embodiment, when the first amount of energy is greater than the second amount of energy, the issuing unit43issues the received execution request to the device driver60. That is, the control command in this example is the received execution request itself. However, a type of control command is not limited thereto, but is optional. When receiving the control command, the device driver60performs a control for causing the device20to execute the function. In the first embodiment, when receiving the execution request from the issuing unit43, the device driver60performs a control for causing the corresponding device20to execute the function. On the other hand, when the first amount of energy is smaller than the second amount of energy, the issuing unit43issues an error notification to the user process30as a response to the received execution request, without issuing a control command for causing the device20to execute the function in accordance with the received execution request, to the device driver60.

Meanwhile, the control command issued by the issuing unit43may be any one as long as it causes the device20to execute the function. For example, the issuing unit43may be configured to have a function of the device driver60. In this case, the issuing unit43issues an electrical signal for causing the device20to execute the function, to the device20as the control command. In short, the issuing unit43may be any one as long as it issues a control command for causing the device to execute the function in accordance with the execution request, when the first amount of energy is greater than the second amount of energy at the time point of receiving the execution request.

Herein, in addition to the above-described power supply unit10and the device20, a hardware configuration of the system100according to the first embodiment includes a computer device having a CPU (Central Processing Unit), a ROM, a RAM, and the like. The respective functions of the user process30, the detection unit41, the estimation unit42, the issuing unit43, and the device driver60described above are implemented by developing and executing programs stored in the ROM or the like on the RAM by the CPU. That is, in this example, a computer device (computer device included in the system100) capable of implementing the respective functions of the detection unit41, the estimation unit42, and the issuing unit43described above may also be considered as corresponding to the “control apparatus” of the invention. In addition, the invention is not limited thereto, and for example, at least a portion of the functions of the detection unit41, the estimation unit42, the issuing unit43, and the device driver60may also be implemented by a separate circuit (hardware). For example, each of the detection unit41, the estimation unit42, and the issuing unit43may also be configured by a hardware circuit. That is, the device access control unit40may also be configured by a hardware circuit. In this case, the device access control unit (device access control unit)40configured by a hardware circuit may also be considered as corresponding to the “control apparatus” of the invention.

Next, an example of an operation of the device access control unit40will be described with reference toFIG. 3.FIG. 3is a flowchart illustrating an example of an operation of the device access control unit40. As illustrated inFIG. 3, when receiving an execution request from the user process30(Yes in step S1), the device access control unit40executes a determination process (step S2). Hereinafter, the determination process will be described in detail with reference toFIG. 4.FIG. 4is a conceptual diagram for describing the determination process.

When receiving an execution request from the user process30(Yes in step S1), the issuing unit43requests the detection unit41to measure the first amount of energy. When receiving the request, the detection unit41measures an electric storage amount Ec of the electric storage unit12at this time point as the first amount of energy and notifies the issuing unit43of the measured first amount of energy. For convenience of description, the first amount of energy notified to the issuing unit43will be denoted by “first amount of energy Ec”.

Also, the issuing unit43requests the estimation unit42to estimate the second amount of energy that is the amount of energy required in the entire system100from the start until the completion of an execution of the function of the device20in accordance with the received execution request. In this example, the issuing unit43makes a request for estimation of the second amount of energy by transferring information specifying a requested function of the device20(for example, it may be the execution request itself). When receiving the request, the estimation unit42reads a third amount of energy Ed and an execution time length Td corresponding to identification information identifying a function requested by the execution request, from the first memory unit50. Then, the estimation unit42determines a fourth amount of energy (=Pm×Td) by multiplying a predetermined set power Pm by the execution time length Td read from the first memory unit50, estimates the sum of the determined fourth amount of energy and the third amount of energy Ed as a second amount of energy (=Pm×Td+Ed), and notifies the issuing unit43of the estimated second amount of energy. For convenience of description, the second amount of energy notified from the estimation unit42to the issuing unit43will be denoted by “second amount of energy E2”.

The issuing unit43compares the first amount of energy Ec notified from the detection unit41with the second amount of energy E2(=Pm×Td+Ed) notified from the estimation unit42, and determines whether the first amount of energy Ec is greater than the second amount of energy E2. The above is the content of the determination process.

Referring back toFIG. 3, the description will be continued. As a result of the determination process, when it is determined that the first amount of energy Ec is greater than the second amount of energy E2(Yes in step S3), the issuing unit43issues the received execution request to the device driver60(step S4). On the other hand, when it is determined that the first amount of energy Ec is smaller than the second amount of energy E2(No in step S3), the issuing unit43issues an error notification to the user process30as a response to the received execution request, without issuing the received execution request to the device driver60(step S5).

As described above, in the first embodiment, when receiving an execution request from the user process30, the issuing unit43compares the first amount of energy Ec at the time point of receiving the execution request with the second amount of energy E2required in the entire system100until the target device20completes an execution of its function that is requested in accordance with the execution request made with respect to the device20. When the first amount of energy Ec is greater than the second amount of energy E2,the issuing unit43issues a control command (in this embodiment, the execution request itself) for causing the device to execute the function. On the other hand, when the first amount of energy Ec is smaller than the second amount of energy E2,the issuing unit43does not issue a control command for causing the device to execute the function. Accordingly, the loss of power supply in the middle of execution of the function of the device can be certainly prevented.

As a result of the above-described determination process, when it is determined that the first amount of energy Ec is equal to the second amount of energy E2,the issuing unit43may issue the received execution request to the device driver60or may issue an error notification to the user process30. The type of configuration to be used may vary optionally according to design conditions.

Second Embodiment

A second embodiment is different from the first embodiment in that it estimates, at a first time point after the start of an execution of a function of the device20, a fifth amount of energy that is the amount of energy required in the entire system100from the first time point until the completion of the execution of a requested function of the device20, compares a first amount of energy at the first time point with the fifth amount of energy, and performs a control according to the comparison result. Hereinafter, a description thereof will be given in detail. In addition, an overlap with the first embodiment will be denoted by the same reference symbol, and a description thereof will not be made properly.

An example of an operation of the device access control unit40will be described with reference toFIG. 5.FIG. 5is a flowchart for describing an example of an operation of the device access control unit40after the start of an execution of a functon of the device20.

As illustrated inFIG. 5, when it is determined that a first time point is reached (Yes in step S11), the device access control unit40executes a second determination process. A method of setting the first time point is optional. For example, the time point when a time measured by a timer reaches a predetermined time may be set as the first time point, the time when an electric storage amount of the electric storage unit12is smaller than a predetermined threshold value may be set as the first time point, or the point of time when a control is transferred to an OS by the notification of various requests from the user process30to the device access control unit40, may be set as the first time point. The device access control unit40has a function of detecting whether the first time point is reached. In this example, the issuing unit43has a function of detecting whether the first time point is reached; however, the embodiment is not limited thereto.

Next, the second determination process will be described in detail with reference toFIG. 6.FIG. 6is a conceptual diagram for describing the second determination process. When it is determined that the first time point is reached (Yes in step S11), the issuing unit43requests the detection unit41to measure the first amount of energy. When receiving the request, the detection unit41measures an electric storage amount Ec2of the electric storage unit12at this time point as the first amount of energy and notifies the issuing unit43of the measured first amount of energy. For convenience of description, the first amount of energy notified to the issuing unit43will be denoted by “first amount of energy Ec2”.

Furthermore, the issuing unit43requests the estimation unit42to estimate a fifth amount of energy required in the entire system100from the first time point until the completion of an execution of the function of the device20. In this example, the issuing unit43transmits time information indicating an elapsed time t from the time point of receiving an execution request from the user process30to the first time point to the estimation unit42, and requests the estimation unit42to estimate the fifth amount of energy. When receiving the request, the estimation unit42estimates the fifth amount of energy by using a third amount of energy and an execution time length Td, which correspond to identification information indentifying a function currently executed by the device20, and the elapsed time t. More specifically, this is as follows.

In the second embodiment, a table illustrating a relation between the remaining time until the completion of an execution of the function of the device20and the amount of energy required for the execution of the function of the device20is stored for each device20in a memory (not illustrated). The estimation unit42determines the remaining time Td−t until the completion of an execution of the function of the device20by subtracting the elapsed time t from the execution time length Td read from the first memory unit50, and reads an amount of energy corresponding to the determined remaining time from the table corresponding to the relevant device20. The read amount of energy is the remaining amount of energy Edr required for an execution of the function of the device20from the first time point until the completion of the execution of the function of the device20. In addition, in the second embodiment, a table illustrating a relation between the remaining time until the completion of an execution of a function of the device20and the amount of energy required for the execution of the function of the device20is stored in a memory (not illustrated); however, the embodiment is not limited thereto. For example, in another configuration, a calculation equation for determining the remaining amount of energy Edr required for an execution of a function of the device20with respect to the remaining time until the completion of the execution of the function of the device20may be stored in a memory. In this configuration, the estimation unit42may determine the amount of energy Edr corresponding to the remaining time Td−t until the completion of an execution of a function of the device20, by using the calculation equation read from the memory.

Furthermore, the estimation unit42calculates an amount of energy (=Pm×(Td−t)+Edr) required in the system100other than the amount of energy required for an execution of a function of the device20from the first time point until the completion of the execution of the function of the device20, by multiplying the remaining time Td−t until the completion of the execution of the function of the device20by a predetermined set power Pm. Then, the estimation unit42estimates the sum of the calculated amount of energy and the above-described amount of energy Edr as the fifth amount of energy, and notifies the issuing unit43of the estimated fifth amount of energy. For convenience of description, the fifth amount of energy notified from the estimation unit42to the issuing unit43will be denoted by “fifth amount of energy E5”.

The issuing unit43compares the first amount of energy EC2notified from the detection unit41and the fifth amount of energy E5(=Pm×(Td−t)+Edr) notified from the estimation unit42, and determines whether the first amount of energy EC2is greater than the fifth amount of energy E5. The above is the content of the second determination process.

Referring back toFIG. 5, the description will be continued. As a result of the second determination process, when it is determined that the first amount of energy EC2is greater than the fifth amount of energy E5(Yes in step S13), the process is ended. That is, the execution of the function of the device20is continued. On the other hand, when it is determined that the first amount of energy EC2is smaller than the fifth amount of energy E5(No in step S13), the issuing unit43performs a control for reducing the power consumption of the system100while causing the device20to continuously execute the function (step S14). For example, the issuing unit43may perform a control for suppressing the power consumption of the CPU. As an example, the issuing unit43may reduce the process speed of the CPU by using DVFS or the like. Alternatively, the issuing unit43may cause the CPU to be changed into an idle state (state of executing no process), and may perform a control such that an idle state is continued over a predetermined time period. Still alternatively, the issuing unit43may perform a control for stopping the power supply to the device20to which the power supply can be stopped (for example, liquid crystal back light and the like), among the device20that is not requested to execute its function.

As described above, in the second embodiment, whenever the above-described first time point is reached after the start of an execution of a function of the device20, the first amount of energy EC2at the first time point is compared with the fifth amount of energy E5required in the entire system100from the first time point until the completion of the execution of the function of the device20. When the first amount of energy EC2is smaller than the fifth amount of energy E5,a control for reducing the power consumption of the system100is performed while causing the device20to continuously execute the function. Accordingly, for example, in an operation separate from an execution of a function of the device20, the loss of power supply in the middle of the execution of the function of the device20can be maximally prevented even when the amount of energy required in the entire system100until the completion of the execution of the function of the device20is greater than the value estimated at the time point of receiving the execution request because the calculation amount of the CPU increases suddenly.

Third Embodiment

A third embodiment is different from the above-described embodiments in that, after the start of an execution of a function of the device20(hereinafter, referred to as “first device”), when receiving an execution request (hereinafter, referred to as “second execution request”) for requesting another device20(hereinafter, referred to as “second device20”) different from the first device20to execute its function, a sixth amount of energy that is the amount of energy required in the entire system100from the time point of receiving the second execution request until the completion of the execution of functions of the first device20and the second device20is estimated, the sixth amount of energy is compared with a first amount of energy at the time point of receiving the second execution request, and a control according to the comparison result is performed. Hereinafter, a description thereof will be given in detail. In addition, an overlap with the above-described respective embodiments will be denoted by the same reference symbol, and a description thereof will be not provided properly.

An example of an operation of the device access control unit40according to the third embodiment will be described with reference toFIG. 7.FIG. 7is a flow chart for describing an example of an operation of the device access control unit40after the start of an execution of a function of the first device20. As illustrated inFIG. 7, when receiving the second execution request from the user process30(Yes in step S21), the device access control unit40executes a third determination process (step S22). Hereinafter, the content of the third determination process will be described in detail.

When receiving the second execution request from the user process30(Yes in step S21), the issuing unit43requests the detection unit41to measure the first amount of energy. When receiving the request, the detection unit41measures an electric storage amount Ec3of the electric storage unit12at this time point as the first amount of energy and notifies the issuing unit43of the measured first amount of energy. For convenience of description, the first amount of energy notified to the issuing unit43will be denoted by “first amount of energy Ec3”.

Furthermore, the issuing unit43requests the estimation unit42to estimate a sixth amount of energy required in the entire system100from the time point of receiving the second execution request until the completion of the execution of the functions of the first device20and the second device20. In this example, the issuing unit43transfers information specifying a function requested by the second execution request (for example, it may be the second execution request itself) and time information indicating an elapsed time t2from the time point of receiving the execution request for requesting the first device20to execute the function to the time point of receiving the second execution request, to the estimation unit42, and requests the estimation unit42to estimate the sixth amount of energy. When receiving the request, the estimation unit42estimates the sixth amount of energy by using: an execution time length Td and a third amount of energy that correspond to identification information identifying a function requested by the execution request for requesting the first device20to execute the function; an elapsed time t2; and a third amount of energy and an execution time length Td that correspond to identification information indentifying a function requested by the second execution request. More specifically, this is as follows. Hereinafter, the third amount of energy corresponding to the identification information identifying a function requested by the execution request will be denoted by Ed1, the execution time length corresponding to the identification information indentifying a function requested by the execution request will be denoted by Td1,the third amount of energy corresponding to the identification information identifying a function requested by the second execution request will be denoted by Ed2,and the execution time length corresponding to the identification information identifying a function requested by the second execution request will be denoted by Td2.

As in the second embodiment, the estimation unit42determines the remaining time (Td1−t2) until the completion of an execution of a function of the first device20, and reads an amount of energy corresponding to the determined remaining time from a table corresponding to the first device20. More specifically, the estimation unit42determines the remaining time (Td1−t2) until the completion of an execution of a function of the first device20by reading the execution time length Td1corresponding to the identification information identifying a function (a function executed by the first device20) requested by the execution request from the first memory unit50and subtracting the elapsed time t2from the read execution time length Td1. Then, the estimation unit42reads an amount of energy corresponding to the determined remaining time from a table corresponding to the first device20. The read amount of energy is the remaining amount of energy Ed1r required for an execution of a function of the first device20from the time point of receiving the second execution request until the completion of the execution of the function of the first device20.

Furthermore, as in the first embodiment, the estimation unit42reads the third amount of energy Ed2and the execution time length Td2corresponding to an execution of a function of the second device20from the first memory unit50.

In addition, in the third embodiment, the estimation unit42compares the remaining time (Td1−t2) until the completion of an execution of a function of the first device20and the execution time length Td2that correspond to the identification information identifying a function requested by the second execution request. When the relation of Td1−t2>Td2is established, the estimation unit42determines an amount of energy (=Pm×(Td1−t2)) required in the system100other than the amount of energy required for an execution of a function of the device20, by multiplying the remaining time (Td1−t2) until the completion of the execution of a function of the first device20by a predetermined set power Pm. Then, the estimation unit42estimates the sum (=Pm×(Td1−t2)+Ed1r+Ed2) of the above-determined amount of energy (=Pm×(Td1−t2)), the remaining amount of energy Ed1r required for an execution of a function of the first device20, and the third amount of energy Ed2corresponding to the identification information identifying a function requested by the second execution request, as the sixth amount of energy.

On the other hand, when the relation of Td1−t2<Td2is established, the estimation unit42determines an amount of energy (=Pm×Td2) required in the system100other than the amount of energy required for an execution of a function of the device20, by multiplying the execution time length Td2corresponding to the identification information indentifying a function requested by the second execution request by the set power Pm. Then, the estimation unit42estimates the sum (=Pm×Td2+Ed1r+Ed2) of the above-determined amount of energy (=Pm×Td2), the remaining amount of energy Ed1r required for an execution of a function of the first device20, and the third amount of energy Ed2corresponding to the identification information identifying a function requested by the second execution request, as the sixth amount of energy.

The estimation unit42notifies the issuing unit43of the above-estimated sixth amount of energy. For convenience of description, the sixth amount of energy notified from the estimation unit42to the issuing unit43will be denoted by “sixth amount of energy E6”.

The issuing unit43compares the first amount of energy Ec3notified from the detection unit41and the sixth amount of energy E6notified from the estimation unit42, and determines whether the first amount of energy Ec3is greater than the sixth amount of energy E6.The above is the content of the third determination process.

Referring back toFIG. 7, the description will be continued. As a result of the third determination process, when it is determined that the first amount of energy Ec3is greater than the sixth amount of energy E6(Yes in step S23), the issuing unit43issues a control command for causing the second device20to execute the function (in this example, the received second execution request itself) to the device driver60corresponding to the second device20(step S24). On the other hand, when it is determined that the first amount of energy Ec3is smaller than the sixth amount of energy E6(No in step S23), the issuing unit43issues an error notification to the user process30as a response to the second execution request, without issuing a control command for causing the second device20to execute the function to the device driver60(step S25).

As described above, in the third embodiment, after the start of an execution of a function of the first device20, when receiving the second execution request for requesting the second device20to execute a function, the issuing unit43compares the first amount of energy Ec3at the time point of receiving the second execution request and the sixth amount of energy E6required in the entire system100from the time point receiving the second execution request until the completion of the execution of the functions of the first device20and the second device20. When the first amount of energy Ec3is greater than the sixth amount of energy E6,the issuing unit43issues a second control command for causing the second device20to execute the function (in this embodiment, the second execution request itself). On the other hand, when the first amount of energy Ec3is smaller than the sixth amount of energy E6,the issuing unit43does not issue the second control command to the device driver60corresponding to the second device20. Accordingly, the loss of power supply in the middle of the execution of the function of the device20can be certainly prevented.

Fourth Embodiment

A fourth embodiment is different from the above-described embodiments in that, when it is determined that the device20cannot be caused to execute a function in accordance with an execution request received from the user process30(for example, when First Amount of Energy Ec<Second Amount of Energy E2is established), a device access control unit400performs a control for holding the received execution request. Hereinafter, a description thereof will be given in detail. Hereinafter, a difference from the first embodiment will be mainly described, an overlap with the first embodiment will be denoted by the same reference symbol, and a description thereof will be not provided properly.

FIG. 8is a block diagram illustrating an example of a functional configuration of a system200according to the fourth embodiment. As illustrated inFIG. 8, the system200is different from the first embodiment in that it further includes a second memory unit70capable of storing an execution request from the user process30. Also, in addition to the functions described in the first embodiment, an issuing unit430of the device access control unit400performs a control for writing an execution request received from the user process30in the second memory unit70in a predetermined case.

Next, an example of an operation of the device access control unit400according to the fourth embodiment will be described with reference toFIG. 9.FIG. 9is a flow chart illustrating an example of an operation of the device access control unit400. The contents of steps S1to S3and step S5are the same as those in the example ofFIG. 3, and thus a detailed description thereof will be not provided. The fourth embodiment is different from the above-described first embodiment in that, as a result of the above-described determination process, when it is determined that the first amount of energy Ec is smaller than the second amount of energy E2(No in step S3), the issuing unit430performs a control for writing an execution request received from the user process30in the second memory unit70(step S6).

Then, at a second time point after the execution request from the user process30is written in the second memory unit70, the device access control unit400estimates the second amount of energy required in the entire system200until the completion of an execution of a function of the device20in accordance with the execution request written in the second memory unit70, compares the second amount of energy and a first amount of energy at the second time point, and performs a control according to the comparison result. Hereinafter, a description thereof will be given in detail.FIG. 10is a flow chart for describing an example of an operation of the device access control unit400after the execution request from the user process30is written in the second memory unit70.

As illustrated inFIG. 10, when it is determined that a second time point is reached (Yes in step S31), the device access control unit400executes a determination process (step S32). In addition, a method of setting the second time point is optional. For example, the time point when a time measured by a timer reaches a predetermined time may be set as the second time point, the time when an electric storage amount of the electric storage unit12is greater than a predetermined threshold value may be set as the second time point, or the time point of receiving an event such as an interrupt may be set as the second time point. The device access control unit400has a function of detecting whether the second time point is reached. In this example, the issuing unit430has a function of detecting whether the second time point is reached; however, the embodiment is not limited thereto.

The content of a determination process in step S32is basically identical to the content of the determination process in the first embodiment. When it is determined that the second time point is reached (Yes in step S31), the issuing unit430requests the detection unit41to measure the first amount of energy. When receiving the request, the detection unit41measures an electric storage amount Ec of the electric storage unit12at this time point as the first amount of energy and notifies the issuing unit430of the measured first amount of energy. For convenience of description, the first amount of energy notified to the issuing unit430will be denoted by “first amount of energy Ec”.

Furthermore, the issuing unit430requests the estimation unit42to estimate the second amount of energy that is the amount of energy required in the entire system200until the completion of an execution of a requested function of the device20in accordance with the execution request. In this example, the issuing unit430makes a request for estimation of the second amount of energy by transferring information specifying a function requested by the execution request stored in the second memory unit70(for example, it may be the execution request itself). When receiving the request, the estimation unit42reads a third amount of energy Ed and an execution time length Td that correspond to identification information identifying a function requested by the execution request stored in the second memory unit70, from the first memory unit50. Then, the estimation unit42determines a fourth amount of energy (=Pm×Td) by multiplying a predetermined set power Pm by the execution time length Td read from the first memory unit50, estimates the sum of the determined fourth amount of energy and the third amount of energy Ed as a second amount of energy (=Pm×Td+Ed), and notifies the issuing unit430of the estimated second amount of energy. For convenience of description, the second amount of energy notified from the estimation unit42to the issuing unit430will be denoted by “second amount of energy E2”.

The issuing unit430compares the first amount of energy Ec notified from the detection unit41and the second amount of energy E2(=Pm×Td+Ed) notified from the estimation unit42, and determines whether the first amount of energy Ec is greater than the second amount of energy E2. The above is the content of a determination process in step S33.

Referring back toFIG. 10, the description will be continued. As a result of the determination process, when it is determined that the first amount of energy Ec is greater than the second amount of energy E2(Yes in step S33), the issuing unit430issues an execution request stored in the second memory unit70to the device driver60(step S34), and deletes the execution request from the second memory unit70. On the other hand, when it is determined that the first amount of energy Ec is smaller than the second amount of energy E2(No in step S33), the issuing unit430performs a control for holding the execution request (step S35). More specifically, without issuing an execution request stored in the second memory unit70to the device driver60, the issuing unit430performs a control for retaining the execution request in the second memory unit70.

As described above, in the fourth embodiment, when receiving an execution request from the user process30, the issuing unit430compares the first amount of energy Ec at the time point of receiving the execution request and the second amount of energy E2required for the entire system200until the completion of an execution of a function of the device20requested by the execution request. When the first amount of energy Ec is smaller than the second amount of energy E2,the issuing unit430writes the received execution request in the second memory unit70without issuing an error notification to the user process30. Thereafter, at a second time point, the issuing unit430compares a first amount of energy Ec at the second time point and a second amount of energy E2required for the entire system200until the completion of an execution of a function of the device20requested by the execution request written in the second memory unit70. When the first amount of energy Ec is greater than the second amount of energy E2,the issuing unit430issues the execution request written in the second memory unit70to the device driver60. On the other hand, when the first amount of energy Ec is smaller than the second amount of energy E2,the issuing unit430holds the execution request written in the second memory unit70, without issuing the execution request written in the second memory unit70to the device driver60. That is, the execution request is held until the function requested by the execution request from the user process30can be executed. Therefore, the user process30may issue the execution request only once. Accordingly, the loss of power supply in the middle of the execution of a function of the device20can be certainly prevented.

Modified Example of Fourth Embodiment

At the second time point described above, when another device20(for convenience of description, referred to as “first device20”) is executing its function separately from the device20(for convenience of description, referred to as “second device20”) that is requested to execute a function in accordance with an execution request written in the second memory unit70, the device access control unit400may estimate the amount of energy required for the entire system200from the second time point until the completion of the execution of the functions of the first device20and the second device20, compare the estimated amount of energy and the first amount of energy at the second time point, and perform a control according to the comparison result. In this example, since the second time point may be considered as “the time point of receiving the second execution request” in the third embodiment, the amount of energy required for the entire system from the second time point until the completion of the execution of the functions of the first device20and the second device20may also be considered as the sixth amount of energy in the third embodiment. Hereinafter, the amount of energy required for the entire system from the second time point until the completion of the execution of the functions of the first device20and the second device20will be referred to as a “sixth amount of energy ”.

FIG. 11is a flow chart for describing an example of an operation of the device access control unit400after the execution request from the user process30is written in the second memory unit70. As illustrated inFIG. 11, when it is determined that the second time point is reached (Yes in step S41), the device access control unit400executes a third determination process (step S42). The content of the third determination process in step S42is basically identical to the content of the third determination process in the third embodiment.

When it is determined that the second time point is reached (Yes in step S41), the issuing unit430requests the detection unit41to measure the first amount of energy. When receiving the request, the detection unit41measures an electric storage amount Ec3of the electric storage unit12at this time point as the first amount of energy and notifies the issuing unit430of the measured first amount of energy. For convenience of description, the first amount of energy notified to the issuing unit430will be denoted by a “first amount of energy Ec3”.

Furthermore, the issuing unit430requests the estimation unit42to estimate a sixth amount of energy required for the entire system200from the time point of reaching the second time point (which may be considered as the time point of receiving the second execution request) until the completion of an execution of the functions of the first device20and the second device20. In this example, the issuing unit430transfers information specifying a function requested by the execution request stored in the second memory unit70(for example, it may be the execution request itself stored in the second memory unit70) and time information indicating an elapsed time t2from the time point of receiving an execution request for requesting the first device20to execute the function to the second time point, to the estimation unit42, and requests the estimation unit42to estimate the sixth amount of energy.

When receiving the request from the issuing unit430, the estimation unit42estimates the sixth amount of energy by using: an execution time length Td and a third amount of energy that correspond to identification information indentifying a function executed by the first device20; an elapsed time t2; and an execution time length Td and a third amount of energy that correspond to identification information identifying a function executed by the second device20. This content is the same as that in the third embodiment described above, a detailed description thereof will not be repeated. Then, the estimation unit42notifies the issuing unit430of the estimated sixth amount of energy. For convenience of description, the sixth amount of energy notified from the estimation unit42to the issuing unit430will be denoted by a “sixth amount of energy E6”.

The issuing unit430compares the first amount of energy Ec3notified from the detection unit41and the sixth amount of energy E6notified from the estimation unit42, and determines whether the first amount of energy Ec3is greater than the sixth amount of energy E6.The above is the content of the third determination process.

Referring back toFIG. 11, the description will be continued. As a result of the third determination process, when it is determined that the first amount of energy Ec3is greater than the sixth amount of energy E6(Yes in step S43), the issuing unit430issues an execution request stored in the second memory unit70to the device driver60(step S44), and deletes the execution request from the second memory unit70. On the other hand, when it is determined that the first amount of energy Ec3is smaller than the sixth amount of energy E6(No in step S43), the issuing unit430performs a control for holding the execution request (step S45). More specifically, without issuing an execution request stored in the second memory unit70to the device driver60, the issuing unit430performs a control for retaining the execution request in the second memory unit70.

An example of an application of the embodiments described above will be described below. When electric energy converted from energy other than electricity is used not auxiliary but mainly, there is a fear that power supply will be lost when the power consumption of the system is greater than the electric generation amount. Therefore, it is necessary to stop the system stably before the loss of power supply. In this case, when a memory is a nonvolatile memory, the state of a processing task such as calculation, which is performed solely by a CPU and a memory and does not involve an execution of a function of a device, can be saved in the main memory before the loss of power supply, so that the system can be stopped stably before the loss of power supply. However, for example, when power supply is lost in the middle of writing into a device such as a NAND, there is a risk that a state in the NAND will be destroyed and become irreparable. In this case, the invention according to each of the above-described embodiments is effective.

In the above-described first embodiment, the device access control unit40includes the detection unit41; however, it is not limited to this and, for example, the device access control unit40may not include the detection unit41. For example, as illustrated inFIG. 12, the detection unit41may be included in the power supply unit10. Moreover, for example, the detection unit41may be provided separately (independently) from the power supply unit10and the device access control unit40. In other words, it is sufficient that the control device according to the present invention includes the estimation unit and the output unit.

Moreover, the device access control unit40described above may be composed of a semiconductor integrated circuit (IC chip) capable of executing at least each function of the estimation unit42and the output unit43described above. In other words, the present invention can be applied also to a semiconductor device and it is sufficient that the semiconductor device according to the present invention includes the estimation unit and the output unit.

Moreover, in the first embodiment described above, when the detection unit41receives a request from the output unit43, the detection unit41detects the first power amount (the electric storage amount Ec of the electric storage unit12); however, it is not limited to this and, for example, the detection unit41may detect the first power amount constantly or at predetermined intervals. In this case, when the detection unit41receives a request from the output unit43, the detection unit41notifies the output unit43of the latest detection result.

Furthermore, in the first embodiment described above, the power supply unit10includes the energy conversion unit11and the electric storage unit12; however, it is not limited to this and, for example, as illustrated inFIG. 13, the power supply unit10may be configured to include only the electric storage unit12without including the energy conversion unit11. In the example inFIG. 13, the electric storage unit12can store power supplied from an energy supplying unit13configured to be attachable to and detachable from the electric storage unit12. It is sufficient that the energy supplying unit13has a function of supplying power, and the energy supplying unit13may be composed of, for example, a solar cell system or an AC power source (commercial power source).

In the example inFIG. 13, the electric storage unit12is charged by connecting the electric storage unit12to the energy supplying unit13. Then, when charging is completed, a method of use is considered in which the electric storage unit12is disconnected from the energy supplying unit13and the system100is driven by discharging the power stored in the electric storage unit12. In this case, the amount of power (first power amount) that the power supply unit10can supply is the amount of power (Wh) that can be drawn from the electric storage unit12, and the amount of power can be calculated by multiplying the rated voltage (V) of the electric storage unit12by the electric storage capacity (Ah). In this case, the electric storage capacity of the electric storage unit12decreases monotonically as the electric storage unit12discharges the power; therefore, for example, as illustrated inFIG. 14, the amount of power (first power amount) that the power supply unit10(the electric storage unit12) can supply decreases monotonically as the time of operating the device passes.

Also, a program executed in the above-described control device may be provided by being stored on a computer connected to a network such as the Internet and then downloaded through the network. Further, a program executed in the above-described control device may be provided or distributed through a network such as the Internet. Also, a program executed in the above-described control device may be provided by being embedded in a ROM or the like.