CN112650126A - Method and device for reducing power consumption of controller, computer equipment and storage medium - Google Patents

Method and device for reducing power consumption of controller, computer equipment and storage medium Download PDF

Info

Publication number
CN112650126A
CN112650126A CN202011578966.5A CN202011578966A CN112650126A CN 112650126 A CN112650126 A CN 112650126A CN 202011578966 A CN202011578966 A CN 202011578966A CN 112650126 A CN112650126 A CN 112650126A
Authority
CN
China
Prior art keywords
key
circuit
port
time
power
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011578966.5A
Other languages
Chinese (zh)
Inventor
于春田
曾祥义
姜绍义
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Hanlin Intelligent Technology Co ltd
Original Assignee
Shenzhen Hanlin Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Hanlin Intelligent Technology Co ltd filed Critical Shenzhen Hanlin Intelligent Technology Co ltd
Priority to CN202011578966.5A priority Critical patent/CN112650126A/en
Publication of CN112650126A publication Critical patent/CN112650126A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors

Abstract

The present application relates to the field of controller technologies, and in particular, to a method and an apparatus for reducing power consumption of a controller, a computer device, and a storage medium. The method comprises the following steps: judging whether a pressing electric signal triggered by closing of a first key in the key circuit is received; if not, calculating the time when the pressing electric signal is not received to obtain first time; judging whether the first time is greater than the first preset time or not; if the voltage is higher than the preset voltage, the first port is set to be output at a low level, and a field effect tube in the power circuit is cut off, so that the power circuit is cut off to supply power to the outside. Through the very first time, not receiving the signal of pressing an electric signal that first button closure triggered, setting up first port into low level output, cut off the external power supply of power supply circuit, button circuit and MCU circuit all are in to have the electric current to pass through this moment, can not waste power supply circuit's electric quantity, solve current controller still have great consumption under the standby dormant state, waste battery electric quantity's problem.

Description

Method and device for reducing power consumption of controller, computer equipment and storage medium
Technical Field
The present application relates to the field of controller technologies, and in particular, to a method and an apparatus for reducing power consumption of a controller, a computer device, and a storage medium.
Background
In daily life, a user does not need to use the controller for a long time, and the controller is in a standby dormant state most of the time. At present, when a controller is in a standby dormant state, an MCU only closes the functions of most peripheral circuits, and the MCU works at a low speed, so that high power consumption still exists, and the electric quantity of a battery is wasted.
Disclosure of Invention
Aiming at the defects in the prior art, the application provides a method and a device for reducing the power consumption of a controller, computer equipment and a storage medium, and aims to solve the problem that the power consumption of a battery is wasted due to the fact that the existing controller has large power consumption in a standby dormant state.
The technical scheme provided by the application is as follows:
a method of controller power consumption reduction, the method comprising:
judging whether a pressing electric signal triggered by closing of a first key in a key circuit is received, wherein the first key is any one of a plurality of keys in the key circuit and is a switch for supplying power to the MCU circuit in a first circuit for the power circuit;
if not, calculating the time when the pressing electric signal is not received to obtain first time;
judging whether the first time is greater than the first preset time or not;
if so, setting the first port as low level output, and stopping a field effect transistor in the power circuit to cut off the power supply of the power circuit to the outside, wherein the first port is a port of the power circuit for supplying power to the MCU circuit in a second line.
Further, after the step of setting the first port to a low level output, the method comprises:
powering on, wherein the powering on triggers the field effect transistor to be conducted for the first key to be closed, and conducts the power circuit to supply power to the outside;
and setting the first port to be high-level output, and keeping the first port for a second preset time to enable the triode of the power circuit in the second line to be conducted, so that the field effect transistor keeps conducting when the first key is closed or disconnected.
Further, the method further comprises:
acquiring the pressing time of closing the first key for multiple times;
selecting the minimum value from the multiple pressing times to obtain a second time;
the step of setting the first port to a high level output includes:
and setting the first port to be output at a high level within a third preset time, wherein the third preset time is less than the second time.
Further, after the step of setting the first port to a high level output, the method includes:
judging whether the first key is disconnected or not;
if not, identifying the identity information of the first key;
and executing the key function corresponding to the identity information.
Further, after the step of determining whether the first key is off, the method includes:
if yes, acquiring a key identification from a specified storage position, wherein when the first key is disconnected, the key circuit stores the key identification of the first key in the specified storage position;
analyzing the key identification to obtain the identity information of the first key;
and executing the key function corresponding to the identity information.
Further, after the step of setting the first port to a high level output, the method includes:
and triggering and judging whether a pressing electric signal triggered by closing of a first key in the key circuit is received.
Further, after the step of determining whether an electrical pressing signal triggered by the closing of the first key in the key circuit is received, the method includes:
if so, identifying the identity information of the first key;
and executing the key function corresponding to the identity information.
The present application further provides a device for reducing power consumption of a controller, the device comprising:
the first judgment module is used for judging whether a pressing electric signal triggered by the closing of a first key in the key circuit is received, wherein the first key is any one of a plurality of keys in the key circuit and is a switch for supplying power to the MCU circuit by the power circuit in a first circuit;
the calculation module is used for calculating the time when the pressing electric signal is not received if the pressing electric signal is not received, and obtaining first time;
the second judging module is used for judging whether the first time is greater than the first preset time;
and the processing module is used for setting the first port to be low-level output if the MCU circuit is in the low-level output state, so that a field effect tube in the power circuit is cut off to cut off the external power supply of the power circuit, wherein the first port is a port for the power circuit to supply power to the MCU circuit in a second line.
The present application further provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the method of any one of the above when executing the computer program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of any of the above.
According to the technical scheme, the method has the advantages that: through the very first time, not receiving the signal of pressing an electric signal that first button closure triggered, set up first port into low level output, make field effect transistor among the power supply circuit end to cut off power supply circuit and supply power to the outside, button circuit and MCU circuit all are in to have the electric current to pass through this moment, can not waste power supply circuit's electric quantity, solve current controller still have great consumption under standby dormant state, waste battery electric quantity's problem.
Drawings
FIG. 1 is a flow chart of a method for reducing power consumption of a controller according to an embodiment of the present application;
FIG. 2 is a functional block diagram of an apparatus for reducing power consumption of a controller provided by an embodiment of the present application;
FIG. 3 is a block diagram schematically illustrating a computer device according to an embodiment of the present disclosure;
FIG. 4 is a circuit diagram of a power circuit provided by an embodiment of the present application;
FIG. 5 is a schematic circuit diagram of a key circuit according to an embodiment of the present disclosure;
fig. 6 is a circuit schematic diagram of an MCU circuit provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As shown in fig. 1, an embodiment of the present application provides a method for reducing power consumption of a controller, where the method includes the following steps:
step S101, judging whether a pressing electric signal triggered by closing of a first key in a key circuit is received, wherein the first key is any one of a plurality of keys in the key circuit and is a switch for supplying power to the MCU circuit in a first circuit for a power circuit.
In this embodiment, the controller includes a power supply circuit, a key circuit, and an MCU circuit that are electrically connected to each other, and specifically, the controller is a wireless controller.
The user presses the first key, the first key is in a closed state, the user releases the first key, and the first key is in an open state. When the first key is closed, the key circuit is conducted with the MCU circuit through the first key.
The power supply circuit supplies power to the MCU circuit, the MCU circuit works normally, and the MCU circuit judges whether the pressing electric signal from the key circuit is received.
And S102, if not, calculating the time when the pressing electric signal is not received to obtain first time.
If the MCU circuit does not receive the pressing electric signal, the MCU circuit calculates the time when the pressing electric signal is not received, so as to obtain a first time, and the starting point of the first time is calculated to be the time when the pressing electric signal is received last time.
Step S103, judging whether the first time is greater than the first preset time.
The user presets a time as a first preset time, in this embodiment, the first preset time is 30s, and the MCU circuit determines whether the first time is greater than 30 s.
And step S104, if so, setting the first port to be low level output, and stopping a field effect transistor in the power circuit to cut off the power supply of the power circuit to the outside, wherein the first port is a port of the power circuit for supplying power to the MCU circuit in a second line.
If the first time is longer than the first preset time, the MCU circuit sets the first port of the MCU circuit to be low level output, the second line is disconnected, the field effect tube is cut off, and the power circuit cuts off external power supply. The key circuit and the MCU circuit do not work, power consumption cannot be generated, the power consumption of the power supply circuit is only the cut-off current of the field effect transistor, the cut-off current is very small and is generally less than 100nA, and the power consumption is about 0.1 uA.
In the embodiment, the controller is powered off directly when in sleep, and the product does not work, so that power consumption is avoided; meanwhile, when the user operates the controller, the controller can be powered on in time, so that the controller can wake up to work.
The application is applied to all low-power-consumption products with keys and powered by batteries.
In this embodiment, the first port is a GPIO port. Specifically, the first port is GPIO7 as in fig. 6.
In the present embodiment, after step S104, the method includes:
powering on, wherein the powering on triggers the field effect transistor to be conducted for the first key to be closed, and conducts the power circuit to supply power to the outside;
and setting the first port to be high-level output, and keeping the first port for a second preset time to enable the triode of the power circuit in the second line to be conducted, so that the field effect transistor keeps conducting when the first key is closed or disconnected.
The power supply circuit does not supply power to the outside, and the key circuit and the MCU circuit do not work. When a user presses the first key, the first key is closed, the field effect tube is conducted, and the power circuit supplies power to the outside. Because the first key is closed, the power circuit supplies power to the key circuit and the MCU circuit, the MCU circuit is powered on, the first port is set to be high-level output, and the second preset time is kept, namely the first port is high-level output in the second preset time. The first port is high level output, so that the triode in the second circuit of the power circuit is switched on, at the moment, the state of the field effect transistor cannot be influenced by the on or off of the first key, and the field effect transistor is in a conducting state.
In this embodiment, the method further includes:
acquiring the pressing time of closing the first key for multiple times;
and selecting the minimum value from the multiple pressing time to obtain a second time.
And obtaining the pressing time of the user for pressing the first key for multiple times, sequencing the multiple pressing times from small to large, and selecting the minimum value to obtain the second time.
The step of setting the first port to a high level output includes:
and setting the first port to be output at a high level within a third preset time, wherein the third preset time is less than the second time.
It is desirable to complete setting the first port to the high level output within a third predetermined time, which ensures that the first port is set to the high level output before the user releases the press.
In some embodiments, the method further comprises:
acquiring the pressing time of closing the first key for multiple times;
and calculating the average value of the pressing time for multiple times to obtain a third time.
And obtaining the pressing time of the user for pressing the first key for multiple times, and calculating an average value according to the multiple pressing times so as to obtain a third time.
The step of setting the first port to a high level output includes:
and setting the first port to be output at a high level within a fourth preset time, wherein the fourth preset time is less than the third time.
The first port is set to be high-level output within the fourth preset time, and the fourth preset time is longer than the third preset time, so that the requirements on parts are relatively reduced, and the cost is saved.
In this embodiment, after the step of setting the first port to a high level output, the method includes:
judging whether the first key is disconnected or not;
if not, identifying the identity information of the first key;
and executing the key function corresponding to the identity information.
Judging whether the first key pressed before is disconnected, if the first key is not disconnected, identifying the identity information of the first key, and executing the key function corresponding to the identity information according to a relation table of key functions corresponding to the preset identity information, so that the MCU circuit can be powered on and the key function corresponding to the first key can be realized by pressing the first key once.
In this embodiment, after the step of determining whether the first key is turned off, the method includes:
if yes, acquiring a key identification from a specified storage position, wherein when the first key is disconnected, the key circuit stores the key identification of the first key in the specified storage position;
analyzing the key identification to obtain the identity information of the first key;
and executing the key function corresponding to the identity information.
When the first key is disconnected, the key circuit stores the key identification of the first key in the appointed storage position, the MCU circuit judges that the first key is disconnected, the key identification is obtained from the appointed storage position, corresponding identity information is identified according to the key identification, and therefore the key function corresponding to the identity information is executed, the first key is pressed once, the MCU circuit can be powered on, and the key function corresponding to the first key can be achieved.
In this embodiment, after the step of setting the first port to a high level output, the method includes:
and triggering and judging whether a pressing electric signal triggered by closing of a first key in the key circuit is received.
After the first port outputs high level, triggering and judging whether a pressing electric signal triggered by the closing of the first key in the key circuit is received, so that whether the first key is closed can be judged in time, and the operation of a user is avoided.
In this embodiment, after the step of determining whether the electrical pressing signal triggered by the closing of the first key in the key circuit is received, the method includes:
if so, identifying the identity information of the first key;
and executing the key function corresponding to the identity information.
After the MCU is powered on, if a user presses the first key, the key function corresponding to the first key is normally executed.
In the present embodiment, as shown in fig. 4, the power supply circuit includes a field-effect transistor Q1, a resistor RP1, a resistor RP2, a resistor RP3, a resistor RP4, a first lead, a second lead, and a transistor QP 1.
The drain of the field-effect transistor Q1 is electrically connected to the first end of the resistor RP1, the first end of the resistor RP1 is electrically connected to the battery power supply, the gate of the field-effect transistor Q1 is electrically connected to the second end of the resistor RP1, the second end of the resistor RP1 is electrically connected to the first end of the resistor RP2, the second end of the resistor RP2 is electrically connected to the first end of the first lead, the first end of the first lead is electrically connected to the collector of the transistor QP1, the base of the transistor QP1 is electrically connected to the first end of the resistor RP4, the emitter of the transistor QP1 is electrically connected to the second end of the resistor RP4 and grounded, the first end of the resistor RP4 is electrically connected to the first end of the resistor RP3, and the second end of the resistor RP3 is.
As shown in fig. 5, the key circuit includes a plurality of key switch circuits, each of which includes a third lead, a fourth lead, a diode D1, a key SK1, a resistor RK9, and a resistor RK 10.
The first end of the third lead is electrically connected with the second end of the first lead, the second end of the third lead is electrically connected with the positive electrode of the diode D1, the negative electrode of the diode D1 is electrically connected with the first end of the key SK1, the second end of the key SK1 is electrically connected with the first end of the resistor RK9, the second end of the key SK1 is electrically connected with the first end of the resistor RK10 and grounded, and the second end of the resistor RK9 is electrically connected with the first end of the fourth lead.
The key switch further comprises a fifth lead, a triode QK4, a resistor RK4 and a resistor RK 5.
The base electrode of the triode QK4 is electrically connected with the first end of the resistor RK4, the second end of the resistor RK4 is grounded, the first end of the resistor RK5 is electrically connected with the first end of the resistor RK4, the second end of the resistor RK5 is electrically connected with the emitter electrode of the triode QK4, the first end of the fifth lead is electrically connected with the first end of the resistor RK5, and the second end of the resistor RK5 is electrically connected with the cathode of the diode D1.
As shown in fig. 6, the MCU circuit includes a first port and a second port disposed on the MCU, the first port is electrically connected to the second end of the second lead, and the second port is electrically connected to the second end of the fourth lead.
The MCU circuit comprises a third port arranged on the MCU, and the second end of the fifth lead is electrically connected with the third port.
Specifically, when the circuit power supply cuts off the external power supply, in fig. 4, V1 is VBAT, VGS (Q1) of the P-MOS (Q1) is 0, the P-MOS (Q1) is turned off, the circuit power supply is cut off, the power consumption at this time is only the off current-IDS of the P-MOS (Q1), the off current of the current P-MOS (Q1) is extremely small, generally less than 100nA, and the key circuit and the MCU circuit do not operate at this time, and the power consumption is about 0.1 uA.
When the key SK1 in FIG. 5 is pressed, VBAT goes to GND through RP1, RP2, D1, RK 10. In fig. 4 at this time:
V1=(VBAT-VD1)(RP2+RK10)/(RP1+RP2+RK10)+VD1
=(3-0.7)(0.33+1)/(47+0.33+1)+0.7
=0.763(V)
VGS(Q1)=V1-VBAT=0.763-3
=-2.237(V)
since the turn-on threshold voltage of the P-MOS (Q1) is VGS (th) < -0.5V, Q1 is turned on and the MCU circuit is powered on.
After the MCU circuit is powered on, the MCU in FIG. 6 is started, and then the GPIO7 is set to be H level and kept for 30S for the first time.
In FIG. 4, QP1 is turned on and RP2 goes through QP1 to GND, at which time if SK1 is released:
V1=(VBAT-VCE(QP1))(RP2)/(RP1+RP2)+VCE(QP1)
=(3-0.6)(0.33)/(47+0.33)+0.6
=0.62(V)
VGS(Q1)=V1-VBAT=0.62-3
=-2.38(V)
therefore, Q1 is on and the MCU circuit power supply remains powered.
Then, the MCU will set KEY0 to 1 and KEY 1-KEY 3 to 0 (default); at this time, QK4 is turned on, QK 1-QK 3 is turned off; KEY4 port level V (KEY4):
V(KEY4)=(IOVCC-VCE(QK4))(RK9+RK10)/RK10
=(3-0.6)(0.33+1)/1
=3.2V
KEY 5-KEY 7 port level is 0V;
the MCU recognizes that the KEY4 input is high level, the KEY 5-KEY 7 input is low level; thus recognizing the SK1 key press and performing the function of the corresponding key, such as transmitting the code of the corresponding SK1 key.
In conclusion, through the first time, the pressing electric signal triggered by the closing of the first key is not received, the first port is set to be output at a low level, the field effect transistor in the power circuit is cut off, and therefore the power circuit is cut off to supply power to the outside, the key circuit and the MCU circuit are both in a state that no current passes through, the electric quantity of the power circuit cannot be wasted, and the problems that the existing controller still has large power consumption and the electric quantity of a battery under a standby dormant state are solved.
As shown in fig. 2, the present embodiment provides an apparatus 1 for reducing controller power consumption, where the apparatus 1 includes a first determining module 11, a calculating module 12, a second determining module 13, and a processing module 14.
The first judging module 11 is configured to judge whether a pressing electric signal triggered by closing of a first key in a key circuit is received, where the first key is any one of a plurality of keys in the key circuit, and is a switch for supplying power to the MCU circuit by the power circuit in the first circuit.
In this embodiment, the controller includes a power supply circuit, a key circuit, and an MCU circuit that are electrically connected to each other, and specifically, the controller is a wireless controller.
The user presses the first key, the first key is in a closed state, the user releases the first key, and the first key is in an open state. When the first key is closed, the key circuit is conducted with the MCU circuit through the first key.
The power supply circuit supplies power to the MCU circuit, the MCU circuit works normally, and the MCU circuit judges whether the pressing electric signal from the key circuit is received.
And the calculating module 12 is used for calculating the time when the pressing electric signal is not received if the pressing electric signal is not received, so as to obtain the first time.
If the MCU circuit does not receive the pressing electric signal, the MCU circuit calculates the time when the pressing electric signal is not received, so as to obtain a first time, and the starting point of the first time is calculated to be the time when the pressing electric signal is received last time.
And a second judging module 13, configured to judge whether the first time is greater than the first preset time.
The user presets a time as a first preset time, in this embodiment, the first preset time is 30s, and the MCU circuit determines whether the first time is greater than 30 s.
And the processing module 14 is configured to set the first port to be low-level output if the first port is the low-level output, so that the field-effect transistor in the power circuit is turned off to cut off the external power supply of the power circuit, where the first port is a port through which the power circuit supplies power to the MCU circuit in the second line.
If the first time is longer than the first preset time, the MCU circuit sets the first port of the MCU circuit to be low level output, the second line is disconnected, the field effect tube is cut off, and the power circuit cuts off external power supply. The key circuit and the MCU circuit do not work, power consumption cannot be generated, the power consumption of the power supply circuit is only the cut-off current of the field effect transistor, the cut-off current is very small and is generally less than 100nA, and the power consumption is about 0.1 uA.
In the embodiment, the controller is powered off directly when in sleep, and the product does not work, so that power consumption is avoided; meanwhile, when the user operates the controller, the controller can be powered on in time, so that the controller can wake up to work.
The application is applied to all low-power-consumption products with keys and powered by batteries.
In this embodiment, the first port is a GPIO port. Specifically, the first port is GPIO7 as in fig. 6.
In the present embodiment, the apparatus 1 comprises:
the power-on module is used for powering on, wherein the power-on triggers the field effect transistor to be conducted for the first key to be closed, and conducts the power circuit to supply power to the outside;
and the setting module is used for setting the first port to be high-level output and keeping the first port for a second preset time to enable the triode of the power circuit in the second line to be conducted, so that the field effect transistor keeps conducting when the first key is closed or disconnected.
The power supply circuit does not supply power to the outside, and the key circuit and the MCU circuit do not work. When a user presses the first key, the first key is closed, the field effect tube is conducted, and the power circuit supplies power to the outside. Because the first key is closed, the power circuit supplies power to the key circuit and the MCU circuit, the MCU circuit is powered on, the first port is set to be high-level output, and the second preset time is kept, namely the first port is high-level output in the second preset time. The first port is high level output, so that the triode in the second circuit of the power circuit is switched on, at the moment, the state of the field effect transistor cannot be influenced by the on or off of the first key, and the field effect transistor is in a conducting state.
In this embodiment, the apparatus 1 further comprises:
the first obtaining module is used for obtaining the pressing time of closing the first key for multiple times;
and the selecting module is used for selecting the minimum value from the multiple pressing time to obtain the second time.
And obtaining the pressing time of the user for pressing the first key for multiple times, sequencing the multiple pressing times from small to large, and selecting the minimum value to obtain the second time.
The setting module includes:
and the first sub-setting module is used for setting the first port to be high-level output within a third preset time, wherein the third preset time is less than the second time.
It is desirable to complete setting the first port to the high level output within a third predetermined time, which ensures that the first port is set to the high level output before the user releases the press.
In some embodiments, the apparatus 1 further comprises:
the second acquisition module is used for acquiring the pressing time of closing the first key for multiple times;
and the first calculating module is used for calculating the average value of the pressing time for multiple times to obtain third time.
And obtaining the pressing time of the user for pressing the first key for multiple times, and calculating an average value according to the multiple pressing times so as to obtain a third time.
The setting module includes:
and the second sub-setting module is used for setting the first port to be high-level output within fourth preset time, wherein the fourth preset time is less than the third time.
The first port is set to be high-level output within the fourth preset time, and the fourth preset time is longer than the third preset time, so that the requirements on parts are relatively reduced, and the cost is saved.
In the present embodiment, the apparatus 1 comprises:
the third judging module is used for judging whether the first key is disconnected;
the first identification module is used for identifying the identity information of the first key if the first key is not the same as the first key;
and the first execution module is used for executing the key function corresponding to the identity information.
Judging whether the first key pressed before is disconnected, if the first key is not disconnected, identifying the identity information of the first key, and executing the key function corresponding to the identity information according to a relation table of key functions corresponding to the preset identity information, so that the MCU circuit can be powered on and the key function corresponding to the first key can be realized by pressing the first key once.
In the present embodiment, the apparatus 1 comprises:
a third obtaining module, configured to obtain a key identifier from a specified storage location if it is determined that the first key is turned off, where the key circuit stores the key identifier of the first key in the specified storage location when the first key is turned off;
the analysis module is used for analyzing the key identification to obtain the identity information of the first key;
and the second execution module is used for executing the key function corresponding to the identity information.
When the first key is disconnected, the key circuit stores the key identification of the first key in the appointed storage position, the MCU circuit judges that the first key is disconnected, the key identification is obtained from the appointed storage position, corresponding identity information is identified according to the key identification, and therefore the key function corresponding to the identity information is executed, the first key is pressed once, the MCU circuit can be powered on, and the key function corresponding to the first key can be achieved.
In the present embodiment, the apparatus 1 comprises:
and the triggering module is used for triggering and judging whether a step of receiving a pressing electric signal triggered by closing of a first key in the key circuit is received.
After the first port outputs high level, triggering and judging whether a pressing electric signal triggered by the closing of the first key in the key circuit is received, so that whether the first key is closed can be judged in time, and the operation of a user is avoided.
In the present embodiment, the apparatus 1 comprises:
the first identification module is used for identifying the identity information of the first key if an electric pressing signal is received;
and the third execution module is used for executing the key function corresponding to the identity information.
After the MCU is powered on, if a user presses the first key, the key function corresponding to the first key is normally executed.
In the present embodiment, as shown in fig. 4, the power supply circuit includes a field-effect transistor Q1, a resistor RP1, a resistor RP2, a resistor RP3, a resistor RP4, a first lead, a second lead, and a transistor QP 1.
The drain of the field-effect transistor Q1 is electrically connected to the first end of the resistor RP1, the first end of the resistor RP1 is electrically connected to the battery power supply, the gate of the field-effect transistor Q1 is electrically connected to the second end of the resistor RP1, the second end of the resistor RP1 is electrically connected to the first end of the resistor RP2, the second end of the resistor RP2 is electrically connected to the first end of the first lead, the first end of the first lead is electrically connected to the collector of the transistor QP1, the base of the transistor QP1 is electrically connected to the first end of the resistor RP4, the emitter of the transistor QP1 is electrically connected to the second end of the resistor RP4 and grounded, the first end of the resistor RP4 is electrically connected to the first end of the resistor RP3, and the second end of the resistor RP3 is.
As shown in fig. 5, the key circuit includes a plurality of key switch circuits, each of which includes a third lead, a fourth lead, a diode D1, a key SK1, a resistor RK9, and a resistor RK 10.
The first end of the third lead is electrically connected with the second end of the first lead, the second end of the third lead is electrically connected with the positive electrode of the diode D1, the negative electrode of the diode D1 is electrically connected with the first end of the key SK1, the second end of the key SK1 is electrically connected with the first end of the resistor RK9, the second end of the key SK1 is electrically connected with the first end of the resistor RK10 and grounded, and the second end of the resistor RK9 is electrically connected with the first end of the fourth lead.
The key switch further comprises a fifth lead, a triode QK4, a resistor RK4 and a resistor RK 5.
The base electrode of the triode QK4 is electrically connected with the first end of the resistor RK4, the second end of the resistor RK4 is grounded, the first end of the resistor RK5 is electrically connected with the first end of the resistor RK4, the second end of the resistor RK5 is electrically connected with the emitter electrode of the triode QK4, the first end of the fifth lead is electrically connected with the first end of the resistor RK5, and the second end of the resistor RK5 is electrically connected with the cathode of the diode D1.
As shown in fig. 6, the MCU circuit includes a first port and a second port disposed on the MCU, the first port is electrically connected to the second end of the second lead, and the second port is electrically connected to the second end of the fourth lead.
The MCU circuit comprises a third port arranged on the MCU, and the second end of the fifth lead is electrically connected with the third port.
Specifically, when the circuit power supply cuts off the external power supply, in fig. 4, V1 is VBAT, VGS (Q1) of the P-MOS (Q1) is 0, the P-MOS (Q1) is turned off, the circuit power supply is cut off, the power consumption at this time is only the off current-IDS of the P-MOS (Q1), the off current of the current P-MOS (Q1) is extremely small, generally less than 100nA, and the key circuit and the MCU circuit do not operate at this time, and the power consumption is about 0.1 uA.
When the key SK1 in FIG. 5 is pressed, VBAT goes to GND through RP1, RP2, D1, RK 10. In fig. 4 at this time:
V1=(VBAT-VD1)(RP2+RK10)/(RP1+RP2+RK10)+VD1
=(3-0.7)(0.33+1)/(47+0.33+1)+0.7
=0.763(V)
VGS(Q1)=V1-VBAT=0.763-3
=-2.237(V)
since the turn-on threshold voltage of the P-MOS (Q1) is VGS (th) < -0.5V, Q1 is turned on and the MCU circuit is powered on.
After the MCU circuit is powered on, the MCU in FIG. 6 is started, and then the GPIO7 is set to be H level and kept for 30S for the first time.
In FIG. 4, QP1 is turned on and RP2 goes through QP1 to GND, at which time if SK1 is released:
V1=(VBAT-VCE(QP1))(RP2)/(RP1+RP2)+VCE(QP1)
=(3-0.6)(0.33)/(47+0.33)+0.6
=0.62(V)
VGS(Q1)=V1-VBAT=0.62-3
=-2.38(V)
therefore, Q1 is on and the MCU circuit power supply remains powered.
Then, the MCU will set KEY0 to 1 and KEY 1-KEY 3 to 0 (default); at this time, QK4 is turned on, QK 1-QK 3 is turned off; KEY4 port level V (KEY4):
V(KEY4)=(IOVCC-VCE(QK4))(RK9+RK10)/RK10
=(3-0.6)(0.33+1)/1
=3.2V
KEY 5-KEY 7 port level is 0V;
the MCU recognizes that the KEY4 input is high level, the KEY 5-KEY 7 input is low level; thus recognizing the SK1 key press and performing the function of the corresponding key, such as transmitting the code of the corresponding SK1 key.
In conclusion, through the first time, the pressing electric signal triggered by the closing of the first key is not received, the first port is set to be output at a low level, the field effect transistor in the power circuit is cut off, and therefore the power circuit is cut off to supply power to the outside, the key circuit and the MCU circuit are both in a state that no current passes through, the electric quantity of the power circuit cannot be wasted, and the problems that the existing controller still has large power consumption and the electric quantity of a battery under a standby dormant state are solved.
As shown in fig. 3, in the embodiment of the present application, a computer device is further provided, where the computer device may be a server, and an internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing data such as models of methods for reducing power consumption of the controller. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method for controller power consumption reduction.
The processor executes the method for reducing the power consumption of the controller, and comprises the following steps: judging whether a pressing electric signal triggered by closing of a first key in a key circuit is received, wherein the first key is any one of a plurality of keys in the key circuit and is a switch for supplying power to an MCU circuit by a power circuit in a first circuit; if not, calculating the time when the pressing electric signal is not received to obtain first time; judging whether the first time is greater than the first preset time or not; if so, setting the first port as low level output, and stopping a field effect transistor in the power circuit to cut off the power supply of the power circuit to the outside, wherein the first port is a port of the power circuit for supplying power to the MCU circuit in a second line.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is only a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects may be applied.
The computer equipment of this application embodiment, through the very first time, not receive the press electric signal of telecommunication that first button closure triggered, set up first port into low level output, make field effect transistor among the power supply circuit end, thereby cut off power supply circuit and supply power to the outside, button circuit and MCU circuit all are in to have the electric current to pass through this moment, can not waste power supply circuit's electric quantity, solve current controller still have great consumption under the standby dormant state, the problem of extravagant battery power.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for reducing power consumption of a controller, and specifically: judging whether a pressing electric signal triggered by closing of a first key in a key circuit is received, wherein the first key is any one of a plurality of keys in the key circuit and is a switch for supplying power to an MCU circuit by a power circuit in a first circuit; if not, calculating the time when the pressing electric signal is not received to obtain first time; judging whether the first time is greater than the first preset time or not; if so, setting the first port as low level output, and stopping a field effect transistor in the power circuit to cut off the power supply of the power circuit to the outside, wherein the first port is a port of the power circuit for supplying power to the MCU circuit in a second line.
The storage medium of this application embodiment, through the very first time, does not receive the press signal of telecommunication that first button closure triggered, sets up first port into low level output, makes field effect transistor among the power supply circuit end to cut off power supply circuit and supply power to the outside, button circuit and MCU circuit all are in to have the electric current to pass through this moment, can not waste power supply circuit's electric quantity, solve current controller still have great consumption under the standby dormant state, the problem of extravagant battery power.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for controller power consumption reduction, the method comprising:
judging whether a pressing electric signal triggered by closing of a first key in a key circuit is received, wherein the first key is any one of a plurality of keys in the key circuit and is a switch for supplying power to an MCU circuit by a power circuit in a first circuit;
if not, calculating the time when the pressing electric signal is not received to obtain first time;
judging whether the first time is greater than the first preset time or not;
if so, setting the first port as low level output, and stopping a field effect transistor in the power circuit to cut off the power supply of the power circuit to the outside, wherein the first port is a port of the power circuit for supplying power to the MCU circuit in a second line.
2. The method of claim 1, wherein after the step of setting the first port to a low output, comprising:
powering on, wherein the powering on triggers the field effect transistor to be conducted for the first key to be closed, and conducts the power circuit to supply power to the outside;
and setting the first port to be high-level output, and keeping the first port for a second preset time to enable the triode of the power circuit in the second line to be conducted, so that the field effect transistor keeps conducting when the first key is closed or disconnected.
3. The method for controller power consumption reduction according to claim 2, further comprising:
acquiring the pressing time of closing the first key for multiple times;
selecting the minimum value from the multiple pressing times to obtain a second time;
the step of setting the first port to a high level output includes:
and setting the first port to be output at a high level within a third preset time, wherein the third preset time is less than the second time.
4. The method of controller power consumption reduction according to claim 2, comprising, after the step of setting the first port to a high level output:
judging whether the first key is disconnected or not;
if not, identifying the identity information of the first key;
and executing the key function corresponding to the identity information.
5. The method for reducing power consumption of a controller according to claim 3, wherein after the step of determining whether the first key is off, the method comprises:
if yes, acquiring a key identification from a specified storage position, wherein when the first key is disconnected, the key circuit stores the key identification of the first key in the specified storage position;
analyzing the key identification to obtain the identity information of the first key;
and executing the key function corresponding to the identity information.
6. The method of controller power consumption reduction according to claim 2, comprising, after the step of setting the first port to a high level output:
and triggering and judging whether a pressing electric signal triggered by closing of a first key in the key circuit is received.
7. The method for reducing power consumption of a controller according to claim 1, wherein after the step of determining whether the pressing electric signal triggered by the closing of the first key in the key circuit is received, the method comprises:
if so, identifying the identity information of the first key;
and executing the key function corresponding to the identity information.
8. An apparatus for controller power consumption reduction, the apparatus comprising:
the first judgment module is used for judging whether a pressing electric signal triggered by the closing of a first key in a key circuit is received, wherein the first key is any one of a plurality of keys in the key circuit, and is a switch for supplying power to the MCU circuit in a first circuit for the power circuit;
the calculation module is used for calculating the time when the pressing electric signal is not received if the pressing electric signal is not received, and obtaining first time;
the second judging module is used for judging whether the first time is greater than the first preset time;
and the processing module is used for setting the first port to be low-level output if the MCU circuit is in the low-level output state, so that a field effect tube in the power circuit is cut off to cut off the external power supply of the power circuit, wherein the first port is a port for the power circuit to supply power to the MCU circuit in a second line.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202011578966.5A 2020-12-28 2020-12-28 Method and device for reducing power consumption of controller, computer equipment and storage medium Pending CN112650126A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011578966.5A CN112650126A (en) 2020-12-28 2020-12-28 Method and device for reducing power consumption of controller, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011578966.5A CN112650126A (en) 2020-12-28 2020-12-28 Method and device for reducing power consumption of controller, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112650126A true CN112650126A (en) 2021-04-13

Family

ID=75363468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011578966.5A Pending CN112650126A (en) 2020-12-28 2020-12-28 Method and device for reducing power consumption of controller, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112650126A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024007679A1 (en) * 2022-07-06 2024-01-11 珠海格力电器股份有限公司 Key control circuit, method and apparatus, device, storage medium, and remote controller

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060038657A1 (en) * 1994-11-15 2006-02-23 Denison William D Electronic access control device
CN103558774A (en) * 2013-09-24 2014-02-05 康佳集团股份有限公司 Arbitrary key wakeup control device and terminal
CN108701180A (en) * 2017-04-26 2018-10-23 华为技术有限公司 A kind of method and apparatus of device power-up
CN208228818U (en) * 2017-12-26 2018-12-14 宁波帅风电器制造有限公司 A kind of water dispenser of energy auto sleep
CN110569091A (en) * 2019-09-02 2019-12-13 深圳市丰润达科技有限公司 single chip microcomputer key processing method and device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060038657A1 (en) * 1994-11-15 2006-02-23 Denison William D Electronic access control device
CN103558774A (en) * 2013-09-24 2014-02-05 康佳集团股份有限公司 Arbitrary key wakeup control device and terminal
CN108701180A (en) * 2017-04-26 2018-10-23 华为技术有限公司 A kind of method and apparatus of device power-up
CN208228818U (en) * 2017-12-26 2018-12-14 宁波帅风电器制造有限公司 A kind of water dispenser of energy auto sleep
CN110569091A (en) * 2019-09-02 2019-12-13 深圳市丰润达科技有限公司 single chip microcomputer key processing method and device and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024007679A1 (en) * 2022-07-06 2024-01-11 珠海格力电器股份有限公司 Key control circuit, method and apparatus, device, storage medium, and remote controller

Similar Documents

Publication Publication Date Title
US8618780B2 (en) Multimode voltage regulator and method for providing a multimode voltage regulator output voltage and an output current to a load
CN103105921A (en) Method for reducing lithium battery static power consumption under laptop shutdown state
CN112650126A (en) Method and device for reducing power consumption of controller, computer equipment and storage medium
CN108540664B (en) Starting method and electronic equipment
CN204810138U (en) Terminal equipment&#39;s automation start shooting circuit and terminal equipment
CN210780130U (en) Power-off control circuit
CN110545303A (en) combined wake-up control circuit and method for vehicle-mounted multimedia system terminal
CN117022159A (en) Power supply switching system, power supply switching method, electronic device, readable storage medium and vehicle
CN116094105A (en) Soft starting circuit and battery starting system
CN210776362U (en) Power supply zero-power-consumption control circuit and electronic equipment
CN215772542U (en) Power supply circuit and electronic equipment
CN210404824U (en) Power supply circuit and electronic equipment
CN211351757U (en) Low-power consumption standby circuit, mobile power supply and robot
CN108054828A (en) Saving Power Control Circuit and its control method
CN110456232B (en) Low-power-consumption current detection circuit of fault indicator battery independent power supply mode
CN203838507U (en) Energy-saving control circuit of embedded system
CN113127246A (en) Watchdog circuit, control method and watchdog chip
CN218997929U (en) Infrared pen power supply control circuit and infrared pen
CN112858894A (en) Detection method and detection device for working state of contactor, storage medium and vehicle
CN103809496A (en) Energy-saving control circuit of embedded system
CN112527133A (en) Touch control pen
CN210074872U (en) Power supply switching circuit
CN111884496B (en) ALD power-on circuit following AISG3.0 protocol
CN106655465B (en) System clock power supply device, method and electric appliance
CN216872087U (en) Low-power consumption wake-up circuit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210413

RJ01 Rejection of invention patent application after publication