Disclosure of Invention
The present invention provides a mobile terminal, a method for controlling a common power supply of a sensor and a display, and a storage medium, which are used to solve the above-mentioned drawbacks of the prior art. The invention provides a control method of a common power supply of a direction sensor and a display screen, which aims to ensure that the direction sensor and the display screen of a mobile terminal only need to use one path of power supply, reduce the power consumption of the mobile terminal in a working state, provide the battery endurance of the mobile terminal and provide convenience for users.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a common power control method for a mobile terminal sensor and a display screen comprises the following steps:
connecting a direction sensor of a mobile terminal with a display screen in advance to supply power;
when the power supply of the display screen is turned on, detecting whether the direction sensor is turned on, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time;
when the power supply of the display screen is turned off, detecting whether the direction sensor is turned on, and if the direction sensor is turned on, returning the control right of the power supply of the direction sensor to the direction sensor;
when the direction sensor is started, detecting whether the power supply of the display screen is started, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time; if the power supply of the display screen is not started, the control right of the power supply of the direction sensor is given to the direction sensor, namely, the power supply of the direction sensor is automatically controlled by the direction sensor;
and when the direction sensor is turned off, controlling the power supply of the direction sensor to be turned off.
The mobile terminal sensor and display screen share power supply control method, wherein the display screen power supply and the input power supply of a module where the display screen is located are adopted; the input power supply of the display screen is the display screen power supply, and the input power supply is always output to a module where the display screen is located by the processor after the display screen is started; and when the display screen is turned on, the power supply of the display screen is also turned on, and when the display screen is turned off, the power supply of the display screen is turned off.
The power control method for the mobile terminal sensor and the display screen is characterized in that the direction sensor works in an interruption mode, the power supply of the direction sensor is frequently turned on and off, and the input power supply of a module where the direction sensor is located; the input power supply of the direction sensor is the direction sensor power supply, and the control right of the direction sensor is mastered by the direction sensor under the condition that the display screen power supply is turned off;
the direction sensor sends a request for turning on the power supply of the direction sensor to the processor, so that the processor outputs the power supply of the direction sensor to a module where the direction sensor is located; the direction sensor sends a request for turning off the power supply of the direction sensor to the processor, so that the processor stops outputting the power supply of the direction sensor to the module where the direction sensor is located.
The power control method for the mobile terminal sensor and the display screen is shared, wherein the step of depriving the direction sensor of the control right of the direction sensor to the power supply of the direction sensor comprises the following steps:
depriving the direction sensor of control over the direction sensor power means that the processor ignores the request of the module in which the direction sensor is located to turn on or off the direction sensor power.
The method for controlling the power sharing of the sensor and the display screen of the mobile terminal comprises the following steps that the control right of the power supply of the direction sensor is returned to the direction sensor, namely a processor receives a request of a module where the direction sensor is located for turning on or turning off the power supply of the direction sensor; if the module where the direction sensor is located sends a request for turning on the power supply of the direction sensor to the processor, the processor outputs the power supply of the direction sensor; and if the module where the direction sensor is located sends a request for turning off the power supply of the direction sensor to the processor, the processor stops outputting the power supply of the direction sensor.
A mobile terminal comprises a processor and a memory connected with the processor, wherein the memory stores a sensor and display screen common power control program, and the sensor and display screen common power control program realizes the following steps when executed by the processor:
when the power supply of the display screen is turned on, detecting whether the direction sensor is turned on, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time;
when the power supply of the display screen is turned off, detecting whether the direction sensor is turned on, and if the direction sensor is turned on, returning the control right of the power supply of the direction sensor to the direction sensor;
when the direction sensor is started, detecting whether the power supply of the display screen is started, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time; if the power supply of the display screen is not started, the control right of the power supply of the direction sensor is given to the direction sensor, namely, the power supply of the direction sensor is automatically controlled by the direction sensor;
when the direction sensor is turned off, controlling the power supply of the direction sensor to be turned off;
the processor is used for calling the common power supply control program instruction of the sensor and the display screen.
The mobile terminal further comprises a display screen and a direction sensor which are respectively connected with the processor;
the processor also comprises a display screen power supply control module, a direction sensor power supply control module, a display screen control module and a direction sensor control module:
the display screen power supply control module is connected with the display screen and provides a power supply signal for the display screen;
the direction sensor power supply control module is connected with the direction sensor and provides a power supply signal for the direction sensor;
the display screen control module is used for receiving the operation of starting and closing the display screen by a user;
the direction sensor control module is used for receiving the operation of starting and closing the direction sensor by a user.
The mobile terminal comprises a display screen power supply and an input power supply of a module where the display screen is located; the input power supply of the display screen is the display screen power supply, and the input power supply is always output to a module where the display screen is located by the processor after the display screen is started; the power supply of the display screen is turned on when the display screen is turned on, and the power supply of the display screen is turned off when the display screen is turned off;
the direction sensor works in an interruption mode, the power supply of the direction sensor is a power supply which is frequently switched on and off, and the input power supply of a module where the direction sensor is located; the input power supply of the direction sensor is the direction sensor power supply, and the control right of the direction sensor is mastered by the direction sensor under the condition that the display screen power supply is turned off;
the direction sensor sends a request for turning on the power supply of the direction sensor to the processor, so that the processor outputs the power supply of the direction sensor to a module where the direction sensor is located; the direction sensor sends a request for turning off the power supply of the direction sensor to the processor, so that the processor stops outputting the power supply of the direction sensor to the module where the direction sensor is located.
The mobile terminal deprives the control right of the direction sensor to the direction sensor power supply, and the processor ignores the request of a module where the direction sensor is located to turn on or turn off the direction sensor power supply;
the step of returning the control right of the power supply of the direction sensor to the direction sensor means that the processor receives a request of a module where the direction sensor is located for turning on or turning off the power supply of the direction sensor; if the module where the direction sensor is located sends a request for turning on the power supply of the direction sensor to the processor, the processor outputs the power supply of the direction sensor; and if the module where the direction sensor is located sends a request for turning off the power supply of the direction sensor to the processor, the processor stops outputting the power supply of the direction sensor.
A storage medium stores a sensor and display screen common power control program, and the sensor and display screen common power control program realizes the steps of the mobile terminal sensor and display screen common power control method when executed by a processor.
Has the advantages that: the method comprises the steps that when the power supply of the display screen is started, whether the direction sensor is started or not is detected, if the direction sensor is started, the control right of the direction sensor to the power supply of the direction sensor is deprived, and the power supply of the direction sensor is controlled to output all the time; when the power supply of the display screen is turned off, detecting whether the direction sensor is turned on, and if the direction sensor is turned on, returning the control right of the power supply of the direction sensor to the direction sensor; when the direction sensor is started, detecting whether the power supply of the display screen is started, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time; if the power supply of the display screen is not started, the control right of the power supply of the direction sensor is given to the direction sensor, namely, the power supply of the direction sensor is automatically controlled by the direction sensor; and when the direction sensor is turned off, controlling the power supply of the direction sensor to be turned off. The method provided by the invention aims to ensure that the direction sensor and the display screen of the mobile terminal only need to use one path of power supply, reduce the power consumption of the mobile terminal in the working state, provide the battery endurance of the mobile terminal and provide convenience for users.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Example one
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for controlling a common power supply of a sensor and a display screen of a mobile terminal according to a preferred embodiment of the present invention. As shown in fig. 1, the method for controlling the common power supply of the sensor and the display screen of the mobile terminal according to the embodiment of the present invention includes the following steps:
step S10, connecting a direction sensor of the mobile terminal with a display screen in advance to supply power;
in the embodiment of the present invention, as shown in fig. 2, the mobile terminal includes a processor 100 and a memory 400 connected to the processor 100.
The mobile terminal further comprises a display screen 200 and a direction sensor 300 respectively connected with the processor 100;
the processor 100 also includes a display power control module 120, a direction sensor power control module 140, a display control module 110, and a direction sensor control module 130.
The display screen power control module 120 is connected to the display screen 200 and provides a power signal to the display screen 200;
the direction sensor power control module 140 is connected to the direction sensor 300, which provides a power signal to the direction sensor.
The display screen control module 110 is configured to receive operations of starting and closing a display screen by a user;
the direction sensor control module 130 is used for receiving the operation of starting and closing the direction sensor by the user.
In the embodiment of the present invention, the direction sensor 300 of the mobile terminal is connected to the display screen 200 for power supply.
The display screen power supply is an input power supply of the module where the display screen is located; the input power supply of the display screen is the display screen power supply, and the input power supply is always output to a module where the display screen is located by the processor after the display screen is started; and when the display screen is turned on, the power supply of the display screen is also turned on, and when the display screen is turned off, the power supply of the display screen is turned off.
In the embodiment of the invention, the direction sensor works in an interruption mode, the power supply of the direction sensor is a power supply which is frequently turned on and off, and the input power supply of a module where the direction sensor is positioned; the input power of the direction sensor, namely the direction sensor power, is controlled by the direction sensor under the condition that the display screen power is turned off.
The direction sensor sends a request for turning on the power supply of the direction sensor to the processor, so that the processor outputs the power supply of the direction sensor to a module where the direction sensor is located; the direction sensor sends a request for turning off the power supply of the direction sensor to the processor, so that the processor stops outputting the power supply of the direction sensor to the module where the direction sensor is located.
It should be noted that:
the input power of the display screen 200, if the display screen control module 110 receives the operation of starting the display screen by the user, the display screen 200 is started, and meanwhile, the display screen power control module 120 provides a power signal to the display screen; if the display control module 110 receives an operation of turning off the display by the user, the display 200 is turned off, and the power supply signal to the display is stopped by the display power control module 120.
The input power of the direction sensor 300 is controlled by the direction sensor 300, if the direction sensor control module 130 receives the operation of starting the direction sensor by the user, the direction sensor 130 is started, when the direction sensor power control module 140 receives the power on request sent by the direction sensor 300, the direction sensor power control module 140 provides a power signal to the direction sensor 300, and when the direction sensor power control module 140 receives the power off request sent by the direction sensor 300, the direction sensor power control module 140 stops providing the power signal to the direction sensor 300; if the direction sensor control module 130 receives an operation of turning off the direction sensor by the user, the direction sensor 300 is turned off, and the power supply signal to the direction sensor is stopped by the direction sensor power supply control module 140.
And step S20, when the power supply of the display screen is turned on, detecting whether the direction sensor is turned on, if so, depriving the control right of the direction sensor to the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time.
In the embodiment of the invention, when the power supply of the display screen is turned on, whether the direction sensor is turned on or not is detected, if the direction sensor is turned on, the control right of the direction sensor on the power supply of the direction sensor is deprived, and the power supply of the direction sensor is controlled to output all the time. The deprivation of the control right of the direction sensor to the direction sensor power supply means that the processor ignores the request of the module where the direction sensor is located to turn on or turn off the direction sensor power supply.
And step S30, when the power supply of the display screen is turned off, detecting whether the direction sensor is turned on, and if the direction sensor is turned on, returning the control right of the power supply of the direction sensor to the direction sensor.
In the embodiment of the invention, when the power supply of the display screen is turned off, whether the direction sensor is turned on or not is detected, and if the direction sensor is turned on, the control right of the power supply of the direction sensor is returned to the direction sensor.
The step of returning the control right of the power supply of the direction sensor to the direction sensor means that the processor receives a request of a module where the direction sensor is located for turning on or turning off the power supply of the direction sensor; if the module where the direction sensor is located sends a request for turning on the power supply of the direction sensor to the processor, the processor outputs the power supply of the direction sensor; and if the module where the direction sensor is located sends a request for turning off the power supply of the direction sensor to the processor, the processor stops outputting the power supply of the direction sensor.
Step S40, when the direction sensor is turned on, detecting whether the power supply of the display screen is turned on, if the power supply of the display screen is turned on, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time; if the power supply of the display screen is not turned on, the control right of the power supply of the direction sensor is given to the direction sensor, namely, the power supply of the direction sensor is controlled by the direction sensor.
In the embodiment of the invention, the direction sensor works in an interruption mode, the power supply of the direction sensor is a power supply which is frequently turned on and off, and the input power supply of a module where the direction sensor is positioned; the input power of the direction sensor, namely the direction sensor power, is controlled by the direction sensor under the condition that the display screen power is turned off.
And step S50, when the direction sensor is closed, controlling the power supply of the direction sensor to be closed.
In the embodiment of the invention, when the direction sensor is turned off, the power supply of the direction sensor is controlled to be turned off so as to save electric energy and prolong the standby time of the mobile terminal.
The invention is described in further detail below by means of specific application examples:
the method provided by the embodiment comprises the following steps:
when the user starts the display screen function:
step S101, when the display screen control module 110 receives an operation of opening the display screen by a user, whether the function of the direction sensor is already opened or not is obtained through the direction sensor control module 130; if the direction sensor function has been turned on, executing step S102; otherwise, step S103 is executed.
Step S102, setting the direction sensor power control module 140 to ignore the power request (including the power on request and the power off request) sent by the direction sensor 300; and, the direction sensor power control module 140 always outputs a power signal to the direction sensor 300; step S103 is then performed.
Step S103, the display power control module 120 outputs a power signal to the display 200, and the display control module 110 controls the display function to be turned on.
When the user turns off the display screen function:
step S201, when the display screen control module 110 receives the operation of closing the display screen by the user, whether the function of the direction sensor is already started is obtained through the direction sensor control module 130; if the direction sensor function has been turned on, step S202 is performed; otherwise, executing step S203;
step S202, the power supply control module 140 of the direction sensor is arranged to receive the power supply request (including the power supply turn-on request and the power supply turn-off request) sent by the direction sensor 300; that is, the direction sensor 300 controls whether the direction sensor power control module 140 outputs a power signal; then step S203 is executed;
step S203, the display power control module 120 outputs a power signal to the display 200, and the display control module 110 controls the display function to be turned off.
When the user turns on the direction sensor function:
step S301, when the direction sensor control module 130 receives an operation of opening the direction sensor by a user, acquiring whether the function of the display screen is already opened through the display screen control module 110; if the display screen function is already turned on, executing step S302; otherwise, step S303 is executed.
Step S302, the power control module 140 of the direction sensor is configured to ignore the power request (including the power on request and the power off request) sent by the direction sensor 300; and, the direction sensor power control module 140 always outputs a power signal to the direction sensor 300; step S304 is then performed.
Step S303, the power control module 140 of the direction sensor receives power requests (including power on request and power off request) sent by the direction sensor 300; that is, the direction sensor 300 controls whether the direction sensor power control module 140 outputs a power signal; step S304 is then performed.
Step S304, the direction sensor control module 130 controls the direction sensor function to be turned on.
When the user turns off the direction sensor function:
step S401, when the direction sensor control module 130 receives the operation of closing the direction sensor by the user, the direction sensor control module 130 controls the function of the direction sensor to be closed; the output of the power signal is stopped by the direction sensor power control module 140.
Therefore, the method detects whether the direction sensor is started or not when the power supply of the display screen is started, deprives the control right of the direction sensor to the power supply of the direction sensor if the direction sensor is started, and controls the power supply of the direction sensor to output all the time; when the power supply of the display screen is turned off, detecting whether the direction sensor is turned on, and if the direction sensor is turned on, returning the control right of the power supply of the direction sensor to the direction sensor; when the direction sensor is started, detecting whether the power supply of the display screen is started, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time; if the power supply of the display screen is not started, the control right of the power supply of the direction sensor is given to the direction sensor, namely, the power supply of the direction sensor is automatically controlled by the direction sensor; and when the direction sensor is turned off, controlling the power supply of the direction sensor to be turned off. The method provided by the invention aims to ensure that the direction sensor and the display screen of the mobile terminal only need to use one path of power supply, reduce the power consumption of the mobile terminal in the working state, provide the battery endurance of the mobile terminal and provide convenience for users.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a sensor and display screen co-powered control program to instruct related hardware (such as a processor, a controller, etc.) to complete the processes. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
Example two
As shown in fig. 3, the mobile terminal of the embodiment of the present invention may be a mobile phone, and as shown in fig. 3, the mobile terminal of the embodiment of the present invention includes a processor 100 and a memory 400 connected to the processor 100, where the memory 400 stores a sensor and display screen common power control program, and when the sensor and display screen common power control program is executed by the processor 100, the following steps are implemented:
when the power supply of the display screen is turned on, detecting whether the direction sensor is turned on, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time;
when the power supply of the display screen is turned off, detecting whether the direction sensor is turned on, and if the direction sensor is turned on, returning the control right of the power supply of the direction sensor to the direction sensor;
when the direction sensor is started, detecting whether the power supply of the display screen is started, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time; if the power supply of the display screen is not started, the control right of the power supply of the direction sensor is given to the direction sensor, namely, the power supply of the direction sensor is automatically controlled by the direction sensor;
when the direction sensor is turned off, controlling the power supply of the direction sensor to be turned off; as described above.
The processor 100 is configured to invoke the sensor and display screen common power control program instruction.
Further, the mobile terminal further includes a display screen 200 and a direction sensor 300 respectively connected to the processor 100;
the processor 100 further includes a display power control module 120, a direction sensor power control module 140, a display control module 110, and a direction sensor control module 130; as described above.
The display power control module 120 is connected to the display 200 and provides a power signal to the display 200.
The direction sensor power control module 140 is connected to the direction sensor 300, which provides a power signal to the direction sensor 300.
The display screen control module 110 is configured to receive operations of a user to start and close the display screen 200; as described above.
The direction sensor control module 130 is used for receiving the operation of starting and closing the direction sensor by the user.
Further, the display screen power supply is an input power supply of the module where the display screen 200 is located; the input power of the display screen 200, i.e. the display screen power, is always output to the module where the display screen is located by the processor 100 after the display screen is turned on; and when the display screen is turned on, the power supply of the display screen is also turned on, and when the display screen is turned off, the power supply of the display screen is turned off.
The direction sensor works in an interruption mode, the power supply of the direction sensor is a power supply which is frequently switched on and off, and the input power supply of a module where the direction sensor is located; the input power of the direction sensor, namely the direction sensor power, is controlled by the direction sensor under the condition that the display screen power is turned off.
The direction sensor sends a request for turning on the power supply of the direction sensor to the processor 100, so that the processor 100 outputs the power supply of the direction sensor to the module where the direction sensor is located; the direction sensor sends a direction sensor power-off request to the processor 100, thereby causing the processor 100 to stop outputting direction sensor power to the module in which the direction sensor is located.
Further, depriving the direction sensor of control over the direction sensor power means that the processor 100 ignores the request of the module in which the direction sensor is located for turning on or off the direction sensor power;
the returning of the control right of the direction sensor power to the direction sensor means that the processor 100 receives a request for turning on or off the direction sensor power from the module in which the direction sensor is located; if the module in which the direction sensor is located sends a request for turning on the power supply of the direction sensor to the processor 100, the processor 100 outputs the power supply of the direction sensor; if the module in which the direction sensor is located sends a request for turning off the power supply of the direction sensor to the processor 100, the processor 100 stops outputting the power supply of the direction sensor; as described above.
EXAMPLE III
The present embodiment provides a storage medium, where a sensor and display screen power sharing control program is stored, and when the sensor and display screen power sharing control program is executed by the processor 100, the steps of the mobile terminal sensor and display screen power sharing control method are implemented, which are specifically described above.
In summary, the mobile terminal, the sensor and display screen power sharing control method and the storage medium provided by the invention detect whether the direction sensor is turned on when the display screen power is turned on, deprive the direction sensor of the control right of the direction sensor to the direction sensor power if the direction sensor is turned on, and control the direction sensor power to output all the time; when the power supply of the display screen is turned off, detecting whether the direction sensor is turned on, and if the direction sensor is turned on, returning the control right of the power supply of the direction sensor to the direction sensor; when the direction sensor is started, detecting whether the power supply of the display screen is started, if so, depriving the direction sensor of the control right of the power supply of the direction sensor, and controlling the power supply of the direction sensor to output all the time; if the power supply of the display screen is not started, the control right of the power supply of the direction sensor is given to the direction sensor, namely, the power supply of the direction sensor is automatically controlled by the direction sensor; and when the direction sensor is turned off, controlling the power supply of the direction sensor to be turned off. The method provided by the invention aims to ensure that the direction sensor and the display screen of the mobile terminal only need to use one path of power supply, reduce the power consumption of the mobile terminal in the working state, provide the battery endurance of the mobile terminal and provide convenience for users.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.