Mobile terminal and sensor and display screen common-battery operated control method and storage medium
Technical field
The present invention relates to field of mobile terminals, more particularly to a kind of mobile terminal and sensor and display screen common-battery source
Control method and storage medium.
Background technology
At present, mobile terminal is provided with direction sensor, and it is current to sense mobile terminal by direction sensor
Direction, the on this basis display to mobile terminal are controlled, such as when mobile terminal turns over 180 degree, and the action can be with
Sensed by direction sensor, so as to control display content also to rotate with 180 degree.In the prior art, the confession of display screen
Electricity is separate with direction sensor power supply, and two power supplies control respectively, but so need duplex feeding, compare
It is power-consuming, influence the battery durable of mobile terminal.
Therefore, the prior art is defective, has much room for improvement and develops.
The content of the invention
The technical problem to be solved in the present invention is, for the drawbacks described above of prior art, there is provided a kind of mobile terminal and
Sensor and display screen common-battery operated control method and storage medium.The present invention provides a kind of direction sensor and display screen common-battery
The control method in source, it is intended to make the direction sensor of mobile terminal only to be needed to use with display screen by method provided by the invention
Power all the way, reduce the power consumption under mobile terminal working condition, to provide the battery durable ability of mobile terminal, provide the user
It is convenient.
The technical proposal for solving the technical problem of the invention is as follows:
A kind of mobile terminal sensor and display screen common-battery operated control method, wherein, including:
The direction sensor of mobile terminal is connected with display screen in advance and powered all the way;
When display screen electric power starting, whether detection direction sensor has been switched on, and is deprived if direction sensor has turned on
Direction sensor is to the control of direction probe power, and control direction probe power exports always;
When display screen power-off, whether detection direction sensor has been switched on, will if direction sensor has been switched on
The control of direction sensor power supply gives back direction sensor;
When direction sensor is opened, whether detection display screen power supply has been switched on, and is shelled if display screen power supply has been switched on
Take control of the direction sensor to direction probe power by force, and control direction probe power exports always;If display screen
Power supply is not opened, and the control of direction sensor power supply gives direction sensor, i.e. direction sensor power supply is by direction sensor
Voluntarily control;
When direction sensor is closed, control direction probe power is closed.
The mobile terminal sensor and display screen common-battery operated control method, wherein, the display screen power supply, display screen institute
Module input power;The input power of display screen is display screen power supply, defeated by processor always after display screen unlatching
Go out to the module where display screen;Then display screen power supply is also opened for the unlatching of display screen, the closing of display screen then display screen power supply
Closing.
The mobile terminal sensor and display screen common-battery operated control method, wherein, the direction sensor is using interruption
Mode works, and the direction sensor power supply is frequently opens, the power supply of closing, the input electricity of the module where direction sensor
Source;The input power of direction sensor is direction sensor power supply, and its control is by side in the case of display screen power-off
Grasped to sensor;
Direction sensor is by the request opened to processor sending direction probe power, so that processor outbound course passes
Sensor power supply is to the module where direction sensor;Direction sensor is by closing to processor sending direction probe power
Request, so that processor stops outbound course probe power to the module where direction sensor.
The mobile terminal sensor and display screen common-battery operated control method, wherein, it is described to deprive direction sensor other side
To probe power control the step of include:
Control of the direction sensor to direction probe power is deprived, refers to that processor ignores module where direction sensor
For direction sensor electric power starting or the request of closing.
The mobile terminal sensor and display screen common-battery operated control method, wherein, it is described by direction sensor power supply
Control gives back direction sensor, refers to that processor receives direction sensor place module and opened for direction sensor power supply
The request opened or closed;If the request that module where direction sensor is opened to processor sending direction probe power,
Processor outbound course probe power;If module is closed to processor sending direction probe power where direction sensor
Request, then processor stop outbound course probe power.
A kind of mobile terminal, wherein, including processor, and the memory being connected with the processor, the memory
Sensor and the common power supply control program of display screen are stored with, the sensor is with the common power supply control program of display screen by the processor
Following steps are realized during execution:
When display screen electric power starting, whether detection direction sensor has been switched on, and is deprived if direction sensor has turned on
Direction sensor is to the control of direction probe power, and control direction probe power exports always;
When display screen power-off, whether detection direction sensor has been switched on, will if direction sensor has been switched on
The control of direction sensor power supply gives back direction sensor;
When direction sensor is opened, whether detection display screen power supply has been switched on, and is shelled if display screen power supply has been switched on
Take control of the direction sensor to direction probe power by force, and control direction probe power exports always;If display screen
Power supply is not opened, and the control of direction sensor power supply gives direction sensor, i.e. direction sensor power supply is by direction sensor
Voluntarily control;
When direction sensor is closed, control direction probe power is closed;
The processor is used to call the sensor and display screen power supply control program instruction altogether.
The mobile terminal, wherein, mobile terminal also includes the display screen being connected respectively with the processor and direction passes
Sensor;
Inside processor also include display screen energy supply control module, direction sensor energy supply control module, display screen control module,
Direction sensor control module:
Display screen energy supply control module is connected with display screen, and it provides power supply signal for display screen;
Direction sensor energy supply control module is connected with direction sensor, and it provides power supply signal for direction sensor;
Display screen control module is used to receive the operation that user starts, closes display screen;
Direction sensor control module is used to receive user's startup, the operation of closing direction sensor.
The mobile terminal, wherein, the display screen power supply, the input power of the module where display screen;Display screen
Input power is display screen power supply, always as the module where processor is exported to display screen after display screen unlatching;Display screen
Unlatching then display screen power supply is also opened, the closing of the closing then display screen power supply of display screen;
The direction sensor is worked using interrupt mode, and the direction sensor power supply is frequently opens, the power supply of closing, side
To the input power of the module where sensor;The input power of direction sensor is direction sensor power supply, in display screen electricity
Its control is grasped by direction sensor in the case that source is closed;
Direction sensor is by the request opened to processor sending direction probe power, so that processor outbound course passes
Sensor power supply is to the module where direction sensor;Direction sensor is by closing to processor sending direction probe power
Request, so that processor stops outbound course probe power to the module where direction sensor.
The mobile terminal, wherein, it is described to deprive control of the direction sensor to direction probe power, refer to locating
Module is for direction sensor electric power starting or the request of closing where reason device ignores direction sensor;
The control by direction sensor power supply gives back direction sensor, refers to that processor receives direction sensor institute
In module for direction sensor electric power starting or the request of closing;If module where direction sensor is to processor sender
The request opened to probe power, then processor outbound course probe power;If module where direction sensor is to place
The request that device sending direction probe power is closed is managed, then processor stops outbound course probe power.
A kind of storage medium, wherein, the storage medium is stored with sensor and the common power supply control program of display screen, the biography
Sensor realizes the mobile terminal sensor and display screen common-battery source with display screen when power supply control program is executed by processor altogether
The step of control method.
Beneficial effect:Mobile terminal and sensor provided by the present invention and display screen common-battery operated control method and storage
Medium, methods described is by the way that when display screen electric power starting, whether detection direction sensor has been switched on, if direction sensor
Have been switched on, deprive control of the direction sensor to direction probe power, and control direction probe power is defeated always
Go out;When display screen power-off, whether detection direction sensor has been switched on, the general side if direction sensor has been switched on
Direction sensor is given back to the control of probe power;When direction sensor is opened, whether detection display screen power supply
Through opening, control of the direction sensor to direction probe power is deprived if display screen power supply has been switched on, and control
Direction sensor power supply exports always;The control of direction sensor power supply gives direction biography if display screen power supply is not opened
Sensor, i.e. direction sensor power supply are voluntarily controlled by direction sensor;When direction sensor is closed, control direction sensor electricity
Source is closed.It is intended to make the direction sensor of mobile terminal only need to use with display screen by method provided by the invention to supply all the way
Electricity, the power consumption under mobile terminal working condition is reduced, to provide the battery durable ability of mobile terminal, provided the user conveniently.
Brief description of the drawings
Fig. 1 is mobile terminal sensor of the present invention and the flow chart of the preferred embodiment of display screen common-battery operated control method.
Fig. 2 is the structured flowchart of mobile terminal sensor of the present invention and display screen common-battery source.
Fig. 3 is mobile terminal preferred embodiment functional schematic block diagram of the present invention.
Embodiment
To make the objects, technical solutions and advantages of the present invention clearer, clear and definite, develop simultaneously embodiment pair referring to the drawings
The present invention is further described.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and do not have to
It is of the invention in limiting.
Embodiment one
Fig. 1 is referred to, Fig. 1 is mobile terminal sensor of the present invention and the stream of the preferred embodiment of display screen common-battery operated control method
Cheng Tu.As shown in figure 1, mobile terminal sensor described in the embodiment of the present invention and display screen common-battery operated control method, including it is following
Step:
Step S10, the direction sensor of mobile terminal is connected with display screen in advance and powered all the way;
In the embodiment of the present invention, as shown in Fig. 2 using the mobile terminal, including processor 100, and with the processor
The memory 400. of 100 connections
Mobile terminal also includes the display screen 200 and direction sensor 300 being connected respectively with the processor 100;
Also include display screen energy supply control module 120, direction sensor energy supply control module 140, display screen inside processor 100
Control module 110, direction sensor control module 130.
Display screen energy supply control module 120 is connected with display screen 200, and it is that display screen 200 provides power supply signal;
Direction sensor energy supply control module 140 is connected with direction sensor 300, and it provides power supply signal for direction sensor.
Display screen control module 110 is used to receive the operation that user starts, closes display screen;
Direction sensor control module 130 is used to receive user's startup, the operation of closing direction sensor.
In the embodiment of the present invention, the direction sensor 300 of mobile terminal is connected with display screen 200 and powered all the way.
The display screen power supply, the input power of the module where display screen;The input power of display screen is display screen
Power supply, always as the module where processor is exported to display screen after display screen unlatching;Then display screen is electric for the unlatching of display screen
Source is also opened, the closing for closing then display screen power supply of display screen.
In the embodiment of the present invention, the direction sensor is worked using interrupt mode, and the direction sensor power supply is frequency
Numerous power supply opened, closed, the input power of the module where direction sensor;The input power of direction sensor is that direction passes
Sensor power supply, its control is grasped by direction sensor in the case of display screen power-off.
Direction sensor is by the request opened to processor sending direction probe power, so that processor output side
To probe power to the module where direction sensor;Direction sensor to processor sending direction probe power by closing
The request closed, so that processor stops outbound course probe power to the module where direction sensor.
It should be noted that:
The input power of display screen 200, if the operation that display screen control module 110 receives user's startup display screen just starts
Display screen 200, while provide power supply signal to display screen by display screen energy supply control module 120;If display screen controls mould
Display screen 200 is just closed in the operation that block 110 receives user's closing display screen, while passes through display screen energy supply control module 120
Stop providing power supply signal to display screen.
The input power of direction sensor 300 is voluntarily controlled by direction sensor 300, if direction sensor control module
130 operations for receiving user's startup direction sensor just start direction sensor 130, when direction sensor energy supply control module
140 energy supply control modules of direction sensor when receiving the power up request that direction sensor 300 sends over 140 are to direction
Sensor 300 provides power supply signal, is sended over when direction sensor energy supply control module 140 receives direction sensor 300
Power-off request when direction sensor energy supply control module 140 stop providing power supply signal to direction sensor 300;Such as
Fruit direction sensor control module 130 receives the operation of user's closing direction sensor just closing direction sensor 300, simultaneously
Stop providing power supply signal to direction sensor by direction sensor energy supply control module 140.
Step S20, when display screen electric power starting, whether detection direction sensor has been switched on, if direction sensor
Have turned on, deprive control of the direction sensor to direction probe power, and control direction probe power exports always.
In the embodiment of the present invention, when display screen electric power starting, whether detection direction sensor has been switched on, if direction
Sensor has turned on, and deprives control of the direction sensor to direction probe power, and control direction probe power is always
Output.It is described to deprive control of the direction sensor to direction probe power, refer to that processor ignores direction sensor institute
In module for direction sensor electric power starting or the request of closing.
Step S30, when display screen power-off, whether detection direction sensor has been switched on, if direction sensor
Have been switched on, the control of direction sensor power supply is given back into direction sensor.
In the embodiment of the present invention, when display screen power-off, whether detection direction sensor has been switched on, if direction
Sensor has been switched on, and the control of direction sensor power supply is given back into direction sensor.
The control by direction sensor power supply gives back direction sensor, refers to that processor receives direction sensing
Module is for direction sensor electric power starting or the request of closing where device;If module is sent out to processor where direction sensor
The request of direction sensor electric power starting is sent, then processor outbound course probe power;If module where direction sensor
To processor sending direction probe power close request, then processor stop outbound course probe power.
Step S40, when direction sensor is opened, whether detection display screen power supply has been switched on, if display screen power supply
Have been switched on, deprive control of the direction sensor to direction probe power, and control direction probe power is defeated always
Go out;The control of direction sensor power supply gives direction sensor, i.e. direction sensor electricity if display screen power supply is not opened
Source is voluntarily controlled by direction sensor.
In the embodiment of the present invention, the direction sensor is worked using interrupt mode, and the direction sensor power supply is frequency
Numerous power supply opened, closed, the input power of the module where direction sensor;The input power of direction sensor is that direction passes
Sensor power supply, its control is grasped by direction sensor in the case of display screen power-off.
Step S50, when direction sensor is closed, control direction probe power is closed.
In the embodiment of the present invention, when direction sensor is closed, control direction probe power is closed, to save electric energy,
Extend the mobile terminal standby time.
The present invention is described in further detail below by way of specific Application Example:
The present embodiment provides method and comprised the following steps:
When user opens display screen functions:
Step S101, when display screen control module 110, which receives user, opens the operation of display screen, direction sensor control is passed through
Molding block 130 obtains whether direction sensor function has been switched on;Step is performed if direction sensor function has been switched on
S102;Otherwise step S103 is performed.
Step S102, setting direction probe power control module 140 ignores the power supply that direction sensor 300 sends over
Request(Asked including power up request and power-off);Also, make direction sensor energy supply control module 140 always to side
To the out-put supply signal of sensor 300;Step S103 is performed afterwards.
Step S103, from display screen energy supply control module 120 to the out-put supply signal of display screen 200, controlled by display screen
The control display screen function of module 110 is opened.
When user closes display screen functions:
Step S201, when display screen control module 110, which receives user, closes the operation of display screen, direction sensor control is passed through
Molding block 130 obtains whether direction sensor function has been switched on;Step is performed if direction sensor function has been switched on
S202;Otherwise step S203 is performed;
Step S202, setting direction probe power control module 140 receives the power request that direction sensor 300 sends over
(Asked including power up request and power-off);Mould is controlled by direction sensor 300 come control direction probe power
Block 140 whether out-put supply signal;Step S203 is performed afterwards;
Step S203, from display screen energy supply control module 120 to the out-put supply signal of display screen 200, by display screen control module
110 control display screen functions are closed.
When user's opening direction sensor function:
Step S301, when direction sensor control module 130 receives the operation of user's opening direction sensor, display is passed through
Screen control module 110 obtains whether display screen functions have been switched on;Step S302 is performed if display screen functions have been switched on;
Otherwise step S303 is performed.
Step S302, setting direction probe power control module 140 ignores the power supply that direction sensor 300 sends over
Request(Asked including power up request and power-off);Also, make direction sensor energy supply control module 140 always to side
To the out-put supply signal of sensor 300;Step S304 is performed afterwards.
Step S303, setting direction probe power control module 140 receives the power supply that direction sensor 300 sends over
Request(Asked including power up request and power-off);I.e. by direction sensor 300 come control direction probe power control
Molding block 140 whether out-put supply signal;Step S304 is performed afterwards.
Step S304, opened by the control direction sensor function of direction sensor control module 130.
When user's closing direction sensor function:
Step S401, when direction sensor control module 130 receives the operation of user's closing direction sensor, passed by direction
The control direction sensor function of sensor control module 130 is closed;Out-put supply is stopped by direction sensor energy supply control module 140
Signal.
Therefore a kind of direction sensor of the present invention and the control method in display screen common-battery source, methods described is by working as
During display screen electric power starting, whether detection direction sensor is had been switched on, and direction is deprived if direction sensor has been switched on
Sensor is to the control of direction probe power, and control direction probe power exports always;When display screen power-off
When, whether detection direction sensor has been switched on, by the control of direction sensor power supply if direction sensor has been switched on
Power gives back direction sensor;When direction sensor is opened, whether detection display screen power supply has been switched on, if display screen is electric
Source has been switched on, and deprives control of the direction sensor to direction probe power, and control direction probe power is defeated always
Go out;The control of direction sensor power supply gives direction sensor, i.e. direction sensor electricity if display screen power supply is not opened
Source is voluntarily controlled by direction sensor;When direction sensor is closed, control direction probe power is closed.Carried by the present invention
The method of confession is intended to make the direction sensor of mobile terminal only need to use with display screen to power all the way, reduces mobile terminal work
Power consumption under state, to provide the battery durable ability of mobile terminal, provide the user conveniently.
Certainly, one of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method,
It is that related hardware can be instructed by sensor and the common power supply control program of display screen(Such as processor, controller etc.)Come
Into described program can be stored in a computer-readable storage medium, and the program may include each as described above upon execution
The flow of embodiment of the method.Wherein described storage medium can be memory, magnetic disc, CD etc..
Embodiment two
The embodiment of the present invention additionally provides a kind of mobile terminal, and the mobile terminal of the embodiment of the present invention can be mobile phone, such as Fig. 3 institutes
Show, mobile terminal described in the present embodiment, including processor 100, and the memory 400 being connected with the processor 100, it is described
Memory 400 is stored with sensor and the common power supply control program of display screen, the sensor and the common power supply control program quilt of display screen
The processor 100 realizes following steps when performing:
When display screen electric power starting, whether detection direction sensor has been switched on, and is deprived if direction sensor has turned on
Direction sensor is to the control of direction probe power, and control direction probe power exports always;
When display screen power-off, whether detection direction sensor has been switched on, will if direction sensor has been switched on
The control of direction sensor power supply gives back direction sensor;
When direction sensor is opened, whether detection display screen power supply has been switched on, and is shelled if display screen power supply has been switched on
Take control of the direction sensor to direction probe power by force, and control direction probe power exports always;If display screen
Power supply is not opened, and the control of direction sensor power supply gives direction sensor, i.e. direction sensor power supply is by direction sensor
Voluntarily control;
When direction sensor is closed, control direction probe power is closed;As detailed above.
The processor 100 is used to call the sensor and display screen power supply control program instruction altogether.
Further, the mobile terminal also includes the display screen 200 being connected respectively with the processor 100 and direction passes
Sensor 300;
Also include display screen energy supply control module 120, direction sensor energy supply control module 140, display screen inside processor 100
Control module 110, direction sensor control module 130;As detailed above.
Display screen energy supply control module 120 is connected with display screen 200, and it is that display screen 200 provides power supply signal.
Direction sensor energy supply control module 140 is connected with direction sensor 300, and it is that direction sensor 300 provides electricity
Source signal.
Display screen control module 110 is used to receive the operation that user starts, closes display screen 200;As detailed above.
Direction sensor control module 130 is used to receive user's startup, the operation of closing direction sensor.
Further, the display screen power supply, the input power of the module where display screen 200;The input of display screen 200
Power supply is display screen power supply, always as the module where processor 100 is exported to display screen after display screen unlatching;Display screen
Open then display screen power supply also to open, the closing for closing then display screen power supply of display screen.
The direction sensor is worked using interrupt mode, and the direction sensor power supply is frequently opens, the electricity of closing
Source, the input power of the module where direction sensor;The input power of direction sensor is direction sensor power supply, is being shown
Its control is grasped by direction sensor in the case of screen power-off.
Direction sensor is by the request opened to the sending direction probe power of processor 100, so that processor 100
Outbound course probe power is to the module where direction sensor;Direction sensor to the sending direction of processor 100 by passing
The request of sensor power-off, so that processor 100 stops outbound course probe power to the mould where direction sensor
Block.
Further, it is described to deprive control of the direction sensor to direction probe power, refer to that processor 100 is neglected
Module is for direction sensor electric power starting or the request of closing slightly where direction sensor;
The control by direction sensor power supply gives back direction sensor, refers to that processor 100 receives direction sensing
Module is for direction sensor electric power starting or the request of closing where device;If module where direction sensor is to processor
The request that 100 sending direction probe powers are opened, then the outbound course probe power of processor 100;If direction sensor
The request that place module is closed to the sending direction probe power of processor 100, then processor 100 stop outbound course sensor
Power supply;As detailed above.
Embodiment three
The present embodiment provides a kind of storage medium, and the storage medium is stored with sensor and the common power supply control program of display screen,
The sensor realizes the mobile terminal sensor and display screen with display screen when power supply control program is performed by processor 100 altogether
The step of common-battery operated control method, as detailed above.
In summary, mobile terminal and sensor provided by the present invention and display screen common-battery operated control method and storage
Medium, methods described is by the way that when display screen electric power starting, whether detection direction sensor has been switched on, if direction sensor
Have been switched on, deprive control of the direction sensor to direction probe power, and control direction probe power is defeated always
Go out;When display screen power-off, whether detection direction sensor has been switched on, the general side if direction sensor has been switched on
Direction sensor is given back to the control of probe power;When direction sensor is opened, whether detection display screen power supply
Through opening, control of the direction sensor to direction probe power is deprived if display screen power supply has been switched on, and control
Direction sensor power supply exports always;The control of direction sensor power supply gives direction biography if display screen power supply is not opened
Sensor, i.e. direction sensor power supply are voluntarily controlled by direction sensor;When direction sensor is closed, control direction sensor electricity
Source is closed.It is intended to make the direction sensor of mobile terminal only need to use with display screen by method provided by the invention to supply all the way
Electricity, the power consumption under mobile terminal working condition is reduced, to provide the battery durable ability of mobile terminal, provided the user conveniently.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can
To be improved or converted according to the above description, all these modifications and variations should all belong to the guarantor of appended claims of the present invention
Protect scope.