CN112230575A - Low-power-consumption switch detection control method and device and electronic equipment - Google Patents

Low-power-consumption switch detection control method and device and electronic equipment Download PDF

Info

Publication number
CN112230575A
CN112230575A CN202010980460.0A CN202010980460A CN112230575A CN 112230575 A CN112230575 A CN 112230575A CN 202010980460 A CN202010980460 A CN 202010980460A CN 112230575 A CN112230575 A CN 112230575A
Authority
CN
China
Prior art keywords
voltage
single chip
chip microcomputer
switch detection
time
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.)
Granted
Application number
CN202010980460.0A
Other languages
Chinese (zh)
Other versions
CN112230575B (en
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.)
Huizhou Topband Electronic Technology Co Ltd
Original Assignee
Huizhou Topband Electronic 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 Huizhou Topband Electronic Technology Co Ltd filed Critical Huizhou Topband Electronic Technology Co Ltd
Priority to CN202010980460.0A priority Critical patent/CN112230575B/en
Publication of CN112230575A publication Critical patent/CN112230575A/en
Application granted granted Critical
Publication of CN112230575B publication Critical patent/CN112230575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G05B19/0423Input/output
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/327Testing of circuit interrupters, switches or circuit-breakers
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24215Scada supervisory control and data acquisition

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Power Sources (AREA)
  • Microcomputers (AREA)

Abstract

The invention is suitable for the technical field of electronic circuits, and provides a low-power-consumption switch detection control method, a low-power-consumption switch detection control device and electronic equipment, wherein the method comprises the following steps: acquiring preset interface configuration parameters and awakening time parameters of the single chip microcomputer; setting a voltage output port and voltage parameters of a target single chip microcomputer of the switch power supply system according to the interface configuration parameters; and configuring the awakening time of the target single chip microcomputer according to the awakening time parameter so that the single chip microcomputer is in an awakening state in the awakening time, and outputting a voltage signal corresponding to the voltage parameter through a voltage output port. According to the embodiment, the voltage output port and the voltage parameter of the single chip microcomputer are set according to the interface configuration parameters, the awakening time of the single chip microcomputer is set according to the awakening time information, so that the single chip microcomputer outputs a voltage signal to the switch element for switch detection at the awakening time, the single chip microcomputer is controlled to output the voltage signal only at the awakening time without continuously outputting the voltage signal for switch detection, and the power consumption of the switch detection in a standby state can be effectively reduced.

Description

Low-power-consumption switch detection control method and device and electronic equipment
Technical Field
The invention belongs to the technical field of electronic circuits, and particularly relates to a low-power-consumption switch detection control method and device and electronic equipment.
Background
The circuit needs to detect the switch to detect whether the switch is pressed, and the switch signal is a discrete signal, has the advantages of convenient sampling, stable and reliable signal and the like, and is commonly used for detecting various sensor signals.
The switching signal of the switching type sensor requires an external pull-up signal to detect the switching signal. The conventional switch signal detection method is to provide an uncontrollable pull-up signal, as shown in fig. 1, fig. 1 is a schematic diagram of a circuit structure of a conventional scheme in which a VCC (single chip power supply) of a single chip microcomputer outputs the pull-up signal, and then the signal is sampled by an interruption or scanning query method, which has the disadvantages that a pull-up signal needs to be provided all the time, and if the pull-up signal is too weak, an interference signal is detected, so that a continuous large current is consumed, and even in a standby state, a mechanical normally open switch and a normally closed switch inevitably generate electric leakage due to continuous power supply of the single chip microcomputer, so that electric energy consumption is reduced, and low power consumption is difficult to ensure.
Disclosure of Invention
The invention provides a low-power-consumption switch detection control method, and aims to solve the problem of power consumption caused by electric leakage generated by continuous power supply of a single chip microcomputer.
The invention is realized in this way, a low power consumption switch detection control method, the method includes the following steps:
acquiring preset interface configuration parameters and awakening time parameters of the single chip microcomputer;
setting a voltage output port and voltage parameters of a target single chip microcomputer of the switch power supply system according to the interface configuration parameters;
and configuring the awakening time of the target single chip microcomputer according to the awakening time parameter so that the single chip microcomputer is in an awakening state in the awakening time, and outputting a voltage signal corresponding to the voltage parameter through a voltage output port.
Furthermore, the step of setting the voltage output port and the voltage parameter of the target single chip microcomputer of the switch power supply system according to the interface configuration parameter comprises the following steps:
extracting interface information and voltage information in the interface configuration parameters;
setting an I/O port of the target singlechip as a voltage output port according to the interface information;
and setting the voltage value of the voltage output port according to the voltage information so that the voltage output port outputs a voltage signal of the voltage value.
Furthermore, the step of configuring the wake-up time of the target singlechip according to the wake-up time parameter comprises the following steps:
acquiring a preset switch detection life cycle;
and configuring the awakening time of the target single chip microcomputer in the switch detection life cycle according to the awakening time parameter.
Furthermore, after the step of configuring the wake-up time of the target single chip microcomputer according to the wake-up time parameter so that the single chip microcomputer is in a wake-up state within the wake-up time and outputting the voltage signal corresponding to the voltage parameter through the voltage output port, the method further comprises the following steps:
acquiring the ratio of the wake-up time to the switch detection life cycle;
and when the ratio does not accord with the preset condition, prolonging the time length of the switch detection life cycle until the ratio accords with the preset condition.
In a second aspect, the present application further provides a low power consumption switch detection control apparatus, including:
the parameter acquisition unit is used for acquiring preset interface configuration parameters and awakening time parameters of the single chip microcomputer;
the interface setting unit is used for setting a voltage output port and voltage parameters of a target singlechip of the switch power supply system according to the interface configuration parameters;
and the awakening configuration unit is used for configuring the awakening time of the target single chip microcomputer according to the awakening time parameter so as to enable the single chip microcomputer to be in an awakening state in the awakening time, and outputting a voltage signal corresponding to the voltage parameter through the voltage output port.
Further, the interface setting unit includes:
the information extraction subunit is used for extracting interface information and voltage information in the interface configuration parameters;
the interface setting subunit is used for setting an I/O port of the target singlechip as a voltage output port according to the interface information;
and the voltage setting subunit is used for setting the voltage value of the voltage output port according to the voltage information so as to enable the voltage output port to output a voltage signal of the voltage value.
Further, the wake-up configuration unit includes:
the period acquisition subunit is used for acquiring a preset switch detection life period;
and the awakening setting subunit is used for configuring the awakening time of the target single chip microcomputer in the switch detection life cycle according to the awakening time parameter.
Still further, the apparatus further comprises:
the ratio acquisition unit is used for acquiring the ratio of the awakening time to the switch detection life cycle;
and the cycle extension unit is used for extending the duration of the switch detection life cycle until the ratio accords with the preset condition when the ratio does not accord with the preset condition.
In a third aspect, the present application also provides a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the method as described above.
In a fifth aspect, the present application further provides a switch detection circuit, which includes a single chip and a switch element, wherein an input/output port of the single chip is connected to the switch element, and the switch detection circuit adopts the above method, so that the single chip outputs a voltage signal to the switch element through the voltage output port at the wake-up time to perform switch detection.
In a sixth aspect, the present application further provides an electronic product, which includes the low power consumption switch detection control device.
According to the embodiment of the invention, the voltage output port and the voltage parameter of the target single chip microcomputer are set according to the interface configuration parameters, and the awakening time of the target single chip microcomputer is set according to the awakening time information, so that the target single chip microcomputer outputs the voltage signal corresponding to the voltage parameter through the voltage output port at the awakening time, the voltage signal is output to the switching element for switching detection, the voltage signal is output only at the awakening time through controlling the voltage output port of the target single chip microcomputer, the target single chip microcomputer is not required to continuously output the voltage signal for switching detection, and the power consumption of the switching detection in a standby state can be effectively.
Drawings
Fig. 1 is a schematic circuit diagram of a switch detection circuit provided in the prior art;
FIG. 2 is a flow chart illustrating a low power consumption switch detection control method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a process for setting the voltage of a voltage signal according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating setting a wake-up time according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of setting switch detection lifecycle time according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of an embodiment of a low power consumption switch detection control apparatus provided in the present invention;
fig. 7 is a schematic block diagram of an interface setting unit of the low power consumption switch detection control apparatus provided in the present application;
fig. 8 is a schematic block diagram of a wake-up configuration unit of the low power consumption switch detection control apparatus provided in the present application;
fig. 9 is a schematic block diagram of another embodiment of a low power consumption switch detection control apparatus provided in the present application;
fig. 10 is a schematic circuit diagram of an embodiment of a switch detection circuit provided in the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention 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 invention and are not intended to limit the invention.
The existing switch detection needs to continuously provide a pull-up signal, and the power consumption is high. According to the method, the voltage output port and the voltage parameter of the target single chip microcomputer are set according to the interface configuration parameters, the awakening time of the target single chip microcomputer is set according to the awakening time information, so that the target single chip microcomputer outputs the voltage signal corresponding to the voltage parameter through the voltage output port at the awakening time, the voltage signal is output to the switching element for switching detection, the voltage signal is output only at the awakening time through controlling the voltage output port of the target single chip microcomputer, the target single chip microcomputer is not required to continuously output the voltage signal for switching detection, and the power consumption of the switching detection in a standby state can be effectively reduced.
Example one
In some optional embodiments, please refer to fig. 2, and fig. 2 is a schematic flowchart of a low power consumption switch detection control method according to an embodiment of the present application.
As shown in fig. 2, the present application provides a low power consumption switch detection control method, which includes the following steps:
s1100, acquiring preset interface configuration parameters and awakening time parameters of the single chip microcomputer;
when the switch power supply system is implemented, a target single chip microcomputer of the switch power supply system is connected with the switch element, and the voltage signal is output through the target single chip microcomputer. The system firstly obtains preset awakening time parameters and interface configuration parameters of the single chip microcomputer, in some embodiments, the awakening time parameters and the interface configuration parameters of the single chip microcomputer can be set in advance and stored in a local database, and the system can obtain the awakening time parameters and the interface configuration parameters of the single chip microcomputer by accessing the local database.
S1200, setting a voltage output port and voltage parameters of a target single chip microcomputer of the switch power supply system according to the interface configuration parameters;
the interface configuration parameters include interface parameters and output voltage value information, the interface parameters map an interface of the single chip microcomputer for outputting voltage signals, for example, an input/output (I/O) port of the single chip microcomputer is set as a voltage output port, the output voltage value information maps a voltage value of the output voltage signals of the single chip microcomputer, and both output voltage and voltage output duration of the I/O port of the single chip microcomputer can be controlled, so that a function of performing on-off detection on voltage output to the switching element through intermittence of the I/O port of the single chip microcomputer is realized. The system sets the voltage output port and the voltage parameter of the single chip microcomputer according to the interface configuration parameter so that the voltage signal output by the voltage output port of the single chip microcomputer meets the output voltage value information.
S1300, setting the awakening time of the target single chip microcomputer according to the awakening time parameter so that the target single chip microcomputer is in an awakening state in the awakening time, and outputting a voltage signal corresponding to the voltage parameter to the switch element through the voltage output port to perform switch detection.
The target single chip microcomputer of the switch power supply system comprises an awakening state and a sleeping state, wherein when the target single chip microcomputer is in the sleeping state, the target single chip microcomputer does not output voltage signals, and when the target single chip microcomputer is in the awakening state, the target single chip microcomputer outputs the voltage signals. The system sets the awakening time of the target single chip microcomputer according to the awakening time parameter so as to control the awakening time of the target single chip microcomputer, and when the system is implemented, the single awakening time and the single sleeping time of the target single chip microcomputer form a switch detection period, namely, the target single chip microcomputer can realize the switch detection function without continuously sleeping and awakening, and the target single chip microcomputer does not need to continuously output a voltage signal, so that the standby power consumption can be effectively reduced.
In some embodiments, taking a switch detection cycle as 3 seconds as an example, the system configures the wake-up time of the target single chip microcomputer according to the wake-up time parameter, for example, setting the wake-up time of the target single chip microcomputer to be 100 milliseconds, and then in a switch detection cycle, the wake-up time and the sleep time of the target single chip microcomputer are 100 milliseconds and 2900 milliseconds, respectively, so that in a switch detection cycle, the duration of the voltage signal output by the voltage output port of the target single chip microcomputer is 100 milliseconds, and in the switch detection cycle, the wake-up time of the target single chip microcomputer is 100 milliseconds, for example, one end of the switch element is connected to the voltage output port of the target single chip microcomputer, and the other end of the switch element is connected to the MCU for switch detection, and when the voltage signal is output by the voltage output port of the target single chip microcomputer, when the switch element, and the target single chip microcomputer does not need to output voltage signals in the sleep time, other components in the circuit do not have standby voltage, and the standby power consumption is reduced. It should be noted that the switch detection period and the wake-up time are exemplary values, and in implementation, specific values of the switch detection period and the wake-up time may also be other values, and the duration of the switch detection period is greater than the duration of the wake-up time.
According to the embodiment of the application, the voltage output port and the voltage parameter of the target single chip microcomputer are set according to the interface configuration parameters, the awakening time of the target single chip microcomputer is set according to the awakening time information, so that the target single chip microcomputer outputs the voltage signal corresponding to the voltage parameter through the voltage output port at the awakening time, the voltage signal is output to the switching element and used for switching detection, the voltage signal is only output at the awakening time through controlling the voltage output port of the target single chip microcomputer, the target single chip microcomputer is not required to continuously output the voltage signal for switching detection, and the power consumption of the switching detection in a standby state can be.
Example two
In some alternative embodiments, please refer to fig. 3, fig. 3 is a schematic flow chart illustrating the setting of the voltage output port and the voltage signal according to an embodiment of the present application.
As shown in fig. 3, the step of setting the voltage output port and the voltage parameter of the target single chip of the switch power supply system according to the interface configuration parameter includes the following steps:
s1210, extracting interface information and voltage information in the interface configuration parameters;
s1220, setting an I/O port of the target single chip microcomputer as a voltage output port according to the interface information;
and S1230, setting the voltage value of the voltage output port according to the voltage information so that the voltage output port outputs a voltage signal of the voltage value.
In some embodiments, the single chip microcomputer can output a voltage signal of 0-5V, for example, the single chip microcomputer can directly output 0-3.3V through a DAC (Digital to analog converter), and a corresponding amplifying circuit is required to be added to output the voltage signal of 0-5V. When the system is implemented, the interface information maps the I/O port as a voltage output port, and the system sets the voltage parameter of the I/O port of the target single chip microcomputer according to the voltage information, so that a voltage signal output by the I/O port of the target single chip microcomputer is a voltage value corresponding to the voltage information, and a switch detection function is met or voltage balance between the system and other module circuits is kept.
EXAMPLE III
In some alternative embodiments, please refer to fig. 4, and fig. 4 is a flowchart illustrating a process of setting a wake-up time according to an embodiment of the present application.
As shown in fig. 4, the step of configuring the wake-up time of the single chip microcomputer according to the wake-up time parameter includes the following steps:
s1310, acquiring a preset switch detection life cycle;
when the method is implemented, in order to reduce standby power consumption, the switching detection of the switching element is carried out intermittently, namely, the target single chip microcomputer comprises wake-up time and sleep time, the adjacent wake-up time and sleep time form a switching detection life cycle, the target single chip microcomputer outputs a voltage signal to the switching element at the wake-up time to carry out switching detection, the single chip microcomputer does not output the voltage signal at the sleep time, and the intermittent output of the voltage signal to the switching element can meet the switching detection function. In some embodiments, the switch detection lifecycle is pre-set, for example, the switch detection lifecycle is set to 3 seconds and saved to a local database or system configuration parameters.
S1320, configuring the awakening time of the target single chip microcomputer in the switch detection life cycle according to the awakening time parameter.
The system sets the awakening time of the target single chip microcomputer according to the awakening time parameter, namely the awakening time of the target single chip microcomputer in each switch detection life cycle, and takes the switch detection life cycle as 2 seconds as an example, the awakening time is 1 second, namely the target single chip microcomputer is awakened to output a voltage signal of 1 second in the switch detection life cycle with the duration of 2 seconds, so that the sleeping time of the target single chip microcomputer in the switch detection life cycle is 1 second, and the standby power consumption is reduced. Of course, the wake-up time and the switch detection lifecycle are not limited to the above-described exemplary durations, and in some embodiments, the duration of the switch detection lifecycle may also be adjusted, please refer to fig. 5, where fig. 5 is a schematic flow chart illustrating setting of the switch detection lifecycle time according to an embodiment of the present application.
As shown in fig. 5, after the step of configuring the wake-up time of the target single chip microcomputer according to the wake-up time parameter, so that the single chip microcomputer is in a wake-up state within the wake-up time, and outputting the voltage signal corresponding to the voltage parameter through the voltage output port, the method further includes the following steps:
s1400, acquiring a ratio of the wake-up time to the switch detection life cycle;
and S1500, when the ratio does not accord with the preset condition, prolonging the time length of the switch detection life cycle until the ratio accords with the preset condition.
The system compares the time length of the wake-up time with the time length of the switch detection life cycle to obtain a ratio of the wake-up time to the switch detection life cycle, and judges whether the ratio meets a preset condition, for example, the ratio is compared with a preset threshold, when the ratio is greater than the preset threshold, the ratio is judged not to meet the preset condition, the time length of the switch detection life cycle is prolonged, for example, the switch detection life cycle is prolonged by 1.2 times, the ratio of the wake-up time to the switch detection life cycle is calculated again, whether the ratio meets the preset condition is judged, and if not, the time length of the switch detection life cycle is continuously prolonged until the ratio meets the preset condition.
In some embodiments, taking the preset threshold as 0.1 as an example, when the ratio is greater than 0.1, it is determined that the ratio does not meet the preset condition, for example, the wake-up time of the target single chip microcomputer is 400 milliseconds, and the switch detection life cycle is 2 seconds, then the ratio of the wake-up time to the switch detection life cycle is 0.2, which is greater than 0.1, and then the switch detection life cycle is extended, for example, the switch detection life cycle is extended to 4 seconds, then the ratio of the wake-up time to the switch detection life cycle is 0.1, which meets the preset condition, at this time, the switch detection life cycle is extended from 2 seconds to 4 seconds, and the sleep time of the target single chip microcomputer is extended from 1.6 seconds to 3.6 seconds, so that while the switch detection function is ensured, the proportion of the wake-up time in the switch detection life cycle is reduced, and the standby power consumption can.
Example four
In some alternative embodiments, please refer to fig. 6, fig. 6 is a block diagram of a low power consumption switch detection control apparatus according to an embodiment of the present application.
As shown in fig. 6, the present application also provides a low power consumption switch detection control apparatus, which includes:
a parameter obtaining unit 2100, configured to obtain interface configuration parameters and wake-up time parameters of a preset single chip;
the interface setting unit 2200 is used for setting a voltage output port and voltage parameters of a target single chip microcomputer of the switch power supply system according to the interface configuration parameters;
and the wakeup configuration unit 2300 is configured to configure the wakeup time of the target single chip microcomputer according to the wakeup time parameter, so that the single chip microcomputer is in a wakeup state within the wakeup time, and outputs a voltage signal corresponding to the voltage parameter through the voltage output port.
According to the embodiment of the application, the voltage output port and the voltage parameter of the target single chip microcomputer are set according to the interface configuration parameters, the awakening time of the target single chip microcomputer is set according to the awakening time information, so that the target single chip microcomputer outputs the voltage signal corresponding to the voltage parameter through the voltage output port in the awakening time, the voltage signal is used for detecting the switch of the switching element, the voltage output port of the target single chip microcomputer can be controlled to output the voltage signal only in the awakening time, the target single chip microcomputer is not required to continuously output the voltage signal for switching detection, and the power consumption of the switching detection in a standby state can be.
In some alternative embodiments, as shown in fig. 7, the interface setting unit 2200 of the low power consumption switch detection control apparatus provided by the present application includes:
an information extraction subunit 2210, configured to extract interface information and voltage information in the interface configuration parameters;
an interface setting subunit 2220 configured to set an I/O port of the target single chip microcomputer as a voltage output port according to the interface information;
and a voltage setting subunit 2230, configured to set a voltage value of the voltage outlet according to the voltage information, so that the voltage outlet outputs a voltage signal of the voltage value.
In some optional embodiments, as shown in fig. 8, the wake-up configuration unit 2300 of the low power switch detection control apparatus provided by the present application includes:
a period acquisition sub-unit 2310 for acquiring a preset switch detection life period;
and the wakeup setting subunit 2320 is configured to configure the wakeup time of the target single chip microcomputer in the switch detection life cycle according to the wakeup time parameter.
In some optional embodiments, as shown in fig. 9, the low power consumption switch detection control apparatus provided by the present application further includes:
a ratio obtaining unit 2400, configured to obtain a ratio between a wake-up time and a switch detection life cycle;
and a period extension unit 2500, configured to, when the ratio does not meet the preset condition, extend a duration of the switch detection life cycle until the ratio meets the preset condition.
The low-power-consumption switch detection control device provided by the embodiment of the invention has the same implementation principle and technical effect as the method embodiment, and for brief description, no part of the embodiment of the device is mentioned, and reference can be made to the corresponding content in the method embodiment.
EXAMPLE five
In some optional embodiments, the present application further provides a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method as described above when executing the computer program.
EXAMPLE six
In some alternative embodiments, the present application further provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method as described above.
Illustratively, a computer program can be partitioned into one or more modules, which are stored in memory and executed by a processor to implement the present invention. One or more of the modules may be a sequence of computer program instruction segments for describing the execution of a computer program in a computer device that is capable of performing certain functions. For example, the computer program may be divided into the steps of the methods provided by the various method embodiments described above.
Those skilled in the art will appreciate that the above description of a computer apparatus is by way of example only and is not intended to be limiting of computer apparatus, and that the apparatus may include more or less components than those described, or some of the components may be combined, or different components may be included, such as input output devices, network access devices, buses, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center for the computer device and the various interfaces and lines connecting the various parts of the overall computer device.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the computer device by running or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The modules/units integrated by the computer device may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, electrical signals, software distribution medium, and the like.
EXAMPLE seven
In some optional embodiments, the present application further provides a switch detection circuit, which includes a single chip and a switch element, wherein an input/output port of the single chip is connected to the switch element, and the switch detection circuit adopts the above method, so that the single chip outputs a voltage signal to the switch element through the input/output port at the wake-up time to perform switch detection.
Referring to fig. 10, fig. 10 is a schematic circuit structure diagram of an embodiment of a switch detection circuit provided in the present application.
As shown in fig. 10, the output/input port MCUI/0_3 of the single chip is divided into two paths, the first path is connected to one end of a current limiting resistor R1, the other end of the current limiting resistor R1 is connected to the MCU I/0_1 of the switch detection MCU, and the other end of the current limiting resistor R1 is grounded through a microswitch S1; the second path is connected with one end of a current limiting resistor R2, the other end of the current limiting resistor R2 is connected with the MCU I/0_2 of the switch detection MCU, and the other end of the current limiting resistor R2 is grounded through a microswitch S2. In the standby state, the micro switch S1 and the micro switch S2 must have a closed state, and the switch detection MCU is used for performing the first path of switch detection according to the voltage level of the MCU I/0_1, for example, when the micro switch S1 is closed, the switch detection MCU detects a low level, and when the micro switch S1 is opened, the switch detection MCU detects a high level. The switch detection principle of the second path is consistent with that of the first path, and is not described herein again. The voltage signal is output by controlling the input and output port of the singlechip at the awakening time of the singlechip, the singlechip is not required to continuously output the voltage signal, and the standby power consumption can be effectively reduced.
Example eight
In some optional embodiments, the present application further provides an electronic product, which includes the low power consumption switch detection control device as described above.
According to the embodiment of the application, the voltage parameters of the input and output port of the single chip microcomputer are set according to the interface configuration parameters, and the awakening configuration parameters of the single chip microcomputer are set according to the awakening time information, so that the single chip microcomputer outputs the voltage signals corresponding to the voltage parameters to the switch element for switch detection at the awakening time through the input and output port, the input and output port of the single chip microcomputer can be controlled to only output the voltage signals at the awakening time, the single chip microcomputer is not required to continuously output the voltage signals for switch detection, and the power consumption of the switch detection in a standby state can.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A low-power consumption switch detection control method is characterized by comprising the following steps:
acquiring preset interface configuration parameters and awakening time parameters of the single chip microcomputer;
setting a voltage output port and voltage parameters of a target single chip microcomputer of the switch power supply system according to the interface configuration parameters;
and configuring the awakening time of the target single chip microcomputer according to the awakening time parameter so as to enable the single chip microcomputer to be in an awakening state in the awakening time, and outputting a voltage signal corresponding to the voltage parameter through the voltage output port.
2. The low power consumption switch detection control method according to claim 1, wherein the step of setting the voltage output port and the voltage parameter of the target single chip microcomputer of the switch power supply system according to the interface configuration parameter comprises the steps of:
extracting interface information and voltage information in the interface configuration parameters;
setting an I/O port of the target singlechip as the voltage output port according to the interface information;
and setting the voltage value of the voltage output port according to the voltage information so as to enable the voltage output port to output a voltage signal of the voltage value.
3. The low power consumption switch detection control method of claim 1, wherein the step of configuring the wake-up time of the target single chip according to the wake-up time parameter comprises the steps of:
acquiring a preset switch detection life cycle;
and configuring the awakening time of the target single chip microcomputer in the switch detection life cycle according to the awakening time parameter.
4. The low power consumption switch detection control method according to claim 3, wherein after the step of configuring the wake-up time of the target single chip microcomputer according to the wake-up time parameter, so that the single chip microcomputer is in a wake-up state within the wake-up time, and outputting the voltage signal corresponding to the voltage parameter through the voltage output port, the method further comprises the following steps:
acquiring the ratio of the wake-up time to the switch detection life cycle;
and when the ratio does not accord with the preset condition, prolonging the time length of the switch detection life cycle until the ratio accords with the preset condition.
5. A low power consumption switch detection control apparatus, the apparatus comprising:
the parameter acquisition unit is used for acquiring preset interface configuration parameters and awakening time parameters of the single chip microcomputer;
the interface setting unit is used for setting a voltage output port and voltage parameters of a target single chip microcomputer of the switch power supply system according to the interface configuration parameters;
and the awakening configuration unit is used for configuring the awakening time of the target single chip microcomputer according to the awakening time parameter so as to enable the single chip microcomputer to be in an awakening state in the awakening time, and outputting a voltage signal corresponding to the voltage parameter through the voltage output port.
6. The low power consumption switch detection control apparatus of claim 5, wherein the interface setting unit comprises:
the information extraction subunit is used for extracting the interface information and the voltage information in the interface configuration parameters;
the interface setting subunit is used for setting an I/O port of the target singlechip as the voltage output port according to the interface information;
and the voltage setting subunit is used for setting the voltage value of the voltage output port according to the voltage information so as to enable the voltage output port to output a voltage signal of the voltage value.
7. The low power switch detect control apparatus of claim 5, wherein the wake-up configuration unit comprises:
the period acquisition subunit is used for acquiring a preset switch detection life period;
and the awakening setting subunit is used for configuring the awakening time of the target single chip microcomputer in the switch detection life cycle according to the awakening time parameter.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 4 are implemented when the computer program is executed by the processor.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
10. An electronic product, characterized in that the electronic product comprises the low-power-consumption switch detection control device according to any one of claims 5 to 7.
CN202010980460.0A 2020-09-17 2020-09-17 Low-power-consumption switch detection control method and device and electronic equipment Active CN112230575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010980460.0A CN112230575B (en) 2020-09-17 2020-09-17 Low-power-consumption switch detection control method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010980460.0A CN112230575B (en) 2020-09-17 2020-09-17 Low-power-consumption switch detection control method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112230575A true CN112230575A (en) 2021-01-15
CN112230575B CN112230575B (en) 2022-04-08

Family

ID=74107579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010980460.0A Active CN112230575B (en) 2020-09-17 2020-09-17 Low-power-consumption switch detection control method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112230575B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114137881A (en) * 2021-11-30 2022-03-04 杭州涂鸦信息技术有限公司 Chip awakening device, method and medium thereof

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040175438A1 (en) * 2003-03-03 2004-09-09 Benjamin Wiegand Methods for alleviating symptoms associated with menopause using sensory regimen
US20090138738A1 (en) * 2007-11-23 2009-05-28 Asustek Computer Inc. Method for automatically switching power states
CN101854055A (en) * 2010-05-11 2010-10-06 唐山松下产业机器有限公司 Thyristor malfunction detection system and method based on singlechip control
US20110238495A1 (en) * 2008-03-24 2011-09-29 Min Soo Kang Keyword-advertisement method using meta-information related to digital contents and system thereof
CN102663880A (en) * 2012-03-31 2012-09-12 北京博电新力电气股份有限公司 Monitoring method for low-power intelligent wireless temperature measurement system
CN102759704A (en) * 2011-04-26 2012-10-31 周杨一帆 Switch detection device
CN103076512A (en) * 2012-11-30 2013-05-01 天津市松正电动汽车技术股份有限公司 Switching value detection circuit
CN104216500A (en) * 2013-05-29 2014-12-17 纬创资通股份有限公司 Embedded controller and power-saving control method
US20150189592A1 (en) * 2013-12-27 2015-07-02 Qualcomm Incorporated Target wake time flow identification in twt acknowledgement
CN105988554A (en) * 2016-01-27 2016-10-05 上海华测导航技术股份有限公司 Method for enabling single-chip microcomputer to periodically and regularly enter low-power-consumption mode
CN205946220U (en) * 2016-08-23 2017-02-08 浙江绍兴苏泊尔生活电器有限公司 Low-power standby circuit and induction cooker
CN107436672A (en) * 2016-05-26 2017-12-05 中兴通讯股份有限公司 The processing method and terminal of a kind of application
CN208210387U (en) * 2018-06-01 2018-12-07 深圳盈特创智能科技有限公司 It is always on functional switch detection circuit and intelligent-induction lamp
CN109298323A (en) * 2018-08-15 2019-02-01 安徽宏远仪表有限公司 A kind of low power consumption switch detection circuit
CN110207840A (en) * 2019-06-19 2019-09-06 深圳市麦格米特驱动技术有限公司 A kind of detection circuit
CN110954823A (en) * 2019-12-30 2020-04-03 江苏紫喻智能科技有限公司 Single CT charges and drop switch monitor terminal of sampling
CN111106831A (en) * 2018-10-28 2020-05-05 新唐科技股份有限公司 Oscillation frequency control system and method

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040175438A1 (en) * 2003-03-03 2004-09-09 Benjamin Wiegand Methods for alleviating symptoms associated with menopause using sensory regimen
US20090138738A1 (en) * 2007-11-23 2009-05-28 Asustek Computer Inc. Method for automatically switching power states
US20110238495A1 (en) * 2008-03-24 2011-09-29 Min Soo Kang Keyword-advertisement method using meta-information related to digital contents and system thereof
CN101854055A (en) * 2010-05-11 2010-10-06 唐山松下产业机器有限公司 Thyristor malfunction detection system and method based on singlechip control
CN102759704A (en) * 2011-04-26 2012-10-31 周杨一帆 Switch detection device
CN102663880A (en) * 2012-03-31 2012-09-12 北京博电新力电气股份有限公司 Monitoring method for low-power intelligent wireless temperature measurement system
CN103076512A (en) * 2012-11-30 2013-05-01 天津市松正电动汽车技术股份有限公司 Switching value detection circuit
CN104216500A (en) * 2013-05-29 2014-12-17 纬创资通股份有限公司 Embedded controller and power-saving control method
US20150189592A1 (en) * 2013-12-27 2015-07-02 Qualcomm Incorporated Target wake time flow identification in twt acknowledgement
CN105988554A (en) * 2016-01-27 2016-10-05 上海华测导航技术股份有限公司 Method for enabling single-chip microcomputer to periodically and regularly enter low-power-consumption mode
CN107436672A (en) * 2016-05-26 2017-12-05 中兴通讯股份有限公司 The processing method and terminal of a kind of application
CN205946220U (en) * 2016-08-23 2017-02-08 浙江绍兴苏泊尔生活电器有限公司 Low-power standby circuit and induction cooker
CN208210387U (en) * 2018-06-01 2018-12-07 深圳盈特创智能科技有限公司 It is always on functional switch detection circuit and intelligent-induction lamp
CN109298323A (en) * 2018-08-15 2019-02-01 安徽宏远仪表有限公司 A kind of low power consumption switch detection circuit
CN111106831A (en) * 2018-10-28 2020-05-05 新唐科技股份有限公司 Oscillation frequency control system and method
CN110207840A (en) * 2019-06-19 2019-09-06 深圳市麦格米特驱动技术有限公司 A kind of detection circuit
CN110954823A (en) * 2019-12-30 2020-04-03 江苏紫喻智能科技有限公司 Single CT charges and drop switch monitor terminal of sampling

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114137881A (en) * 2021-11-30 2022-03-04 杭州涂鸦信息技术有限公司 Chip awakening device, method and medium thereof
CN114137881B (en) * 2021-11-30 2024-04-02 杭州涂鸦信息技术有限公司 Chip awakening device, method and medium thereof

Also Published As

Publication number Publication date
CN112230575B (en) 2022-04-08

Similar Documents

Publication Publication Date Title
CN107564518B (en) Intelligent device control method and device and computer device
CN110456259B (en) PCBA single board test method and test system
WO2017156925A1 (en) Unlock method and mobile terminal
US20100229011A1 (en) Power Reduction in Microcontrollers
WO2013081578A1 (en) Methods and apparatuses to wake computer systems from sleep states
CN104050973A (en) Low power audio trigger via intermittent sampling
US20200117633A1 (en) Methods and apparatus to enable status change detection in a low power mode of a microcontroller unit
CN112230575B (en) Low-power-consumption switch detection control method and device and electronic equipment
US8659563B2 (en) Electronic device with a page turning function during a sleep mode of the electronic device
CN108806679B (en) Voice wake-up method and device
CN108845727B (en) Mutual capacitance type touch screen based awakening method and device
CN104597790A (en) Serial port controller and awakening method for micro-controller system based on the same
CN110910878A (en) Voice wake-up control method and device, storage medium and household appliance
CN204462781U (en) A kind of PLC Collaborative Control device based on EP1C6
CN105739986B (en) A kind of awakening method and terminal of terminal
CN111522593B (en) Chip dormancy awakening control system with high adaptability and control method
CN201503569U (en) South bridge chip power supply circuit
US20050235169A1 (en) Power reduction for unintentional activation of a wireless input device
CN114137881B (en) Chip awakening device, method and medium thereof
US8954717B2 (en) System capable of booting through a universal serial bus device and method thereof
CN102831889B (en) System of voice PWM (Pulse-Width Modulation) output
CN105159708A (en) Information processing method and electronic device
CN205899493U (en) Low -power consumption public service intelligent terminal machine
CN210696956U (en) Intelligent mirror
CN217388529U (en) Control circuit, encryption chip and electronic equipment

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
GR01 Patent grant
GR01 Patent grant