CN112530056B - Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium - Google Patents

Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium Download PDF

Info

Publication number
CN112530056B
CN112530056B CN202011299093.4A CN202011299093A CN112530056B CN 112530056 B CN112530056 B CN 112530056B CN 202011299093 A CN202011299093 A CN 202011299093A CN 112530056 B CN112530056 B CN 112530056B
Authority
CN
China
Prior art keywords
door lock
intelligent door
idle
time length
power consumption
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.)
Active
Application number
CN202011299093.4A
Other languages
Chinese (zh)
Other versions
CN112530056A (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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New 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 TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202011299093.4A priority Critical patent/CN112530056B/en
Publication of CN112530056A publication Critical patent/CN112530056A/en
Application granted granted Critical
Publication of CN112530056B publication Critical patent/CN112530056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)
  • Lock And Its Accessories (AREA)

Abstract

The application discloses a method for reducing power consumption of an intelligent door lock, the intelligent door lock and a storage medium, wherein the method for reducing power consumption of the intelligent door lock comprises the following steps: when the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length; when the idle time length meets the sleep condition, acquiring data of each functional interface; and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter the dormant state. The intelligent door lock has the advantages that the technical problem that the battery needs to be replaced frequently due to the fact that the intelligent door lock is high in power consumption caused by the fact that the intelligent door lock is more in functional modules is solved, the power consumption of the intelligent door lock is effectively reduced, the replacement times of the battery are reduced, and the service life of the intelligent door lock is prolonged.

Description

Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium
Technical Field
The application relates to the technical field of intelligent door locks, in particular to a method for reducing power consumption of an intelligent door lock, the intelligent door lock and a storage medium.
Background
With the continuous development of science and technology, the home industry gradually develops to intelligence, the common door lock can not meet the requirements of people in the aspect of safety performance, and the intelligent door lock has great advantages in the aspects of safety performance and user experience, has great development prospect, and will occupy an important position in the field of home application. The intelligent door lock is powered by a battery, and due to the fact that the intelligent door lock is multiple in functional modules, the power consumption of the whole machine is increased, the battery replacement period is too short, the cost is increased, the environment is polluted, and meanwhile the user experience can be affected.
Disclosure of Invention
The embodiment of the application aims to solve the problems that the power consumption of the intelligent door lock is high and the battery needs to be replaced frequently due to the fact that the intelligent door lock has more functional modules by providing the method for reducing the power consumption of the intelligent door lock, the intelligent door lock and the storage medium.
In order to achieve the above object, in one aspect, the present application provides a method for reducing power consumption of an intelligent door lock, where the method for reducing power consumption of the intelligent door lock includes the following steps:
when the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length;
when the idle time length meets the sleep condition, acquiring data of each functional interface;
and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter a dormant state.
Optionally, the step of controlling the intelligent door lock system to enter a sleep state includes:
carrying out low-power-consumption configuration on each external module; and
and setting the wake-up time length and controlling the main control chip to enter a sleep state.
Optionally, when the idle duration satisfies the sleep condition, the step of acquiring data of each functional interface includes:
acquiring a first preset dormancy time;
and if the first preset dormancy time is smaller than the idle time, acquiring the data of each function interface.
Optionally, the step of setting the wake-up duration includes:
acquiring a second preset dormancy time length, and comparing the second preset dormancy time length with the idle time length;
if the second preset dormancy time length is smaller than the idle time length, determining that the second preset dormancy time length is the wakeup time length; or alternatively
And if the second preset dormancy time length is longer than the idle time length, determining that the idle time length is the awakening time length.
Optionally, after the step of controlling the intelligent door lock system to enter the sleep state, the method further includes:
when the current sleep time length reaches the wake-up time length, automatically waking up the intelligent door lock system;
and acquiring the current first idle time, and controlling the intelligent door lock system to enter the sleep state again if the first idle time meets the sleep condition and the user task is in the idle state.
Optionally, after the step of controlling the intelligent door lock system to enter the sleep state, the method further includes:
when a wake-up signal is received, waking up the main control chip; and
and carrying out wake-up configuration on each external module, and correcting the beat of the intelligent door lock system.
Optionally, the step of waking up the main control chip when receiving a wake-up signal includes:
when the target key is detected to be in a pressed state, a high-level signal is generated;
and waking up the main control chip according to the high-level signal.
Optionally, after the step of performing wake-up configuration on each external module and correcting the beat of the intelligent door lock system, the method further includes:
acquiring a scheduling instruction, wherein the scheduling instruction is used for indicating the user task to be executed;
and starting the intelligent door lock system to process the user task according to the scheduling instruction.
In addition, in order to achieve the above object, another aspect of the present application further provides an intelligent door lock, where the intelligent door lock includes a memory, a processor, and a program for reducing power consumption of the intelligent door lock stored in the memory and running on the processor, and the steps of the method for reducing power consumption of the intelligent door lock are implemented when the processor executes the program for reducing power consumption of the intelligent door lock.
In addition, in order to achieve the above object, another aspect of the present application further provides a computer readable storage medium, where a program for reducing power consumption of an intelligent door lock is stored, where the program for reducing power consumption of an intelligent door lock, when executed by a processor, implements the steps of the method for reducing power consumption of an intelligent door lock as described above.
When the intelligent door lock system is detected to enter an idle state, the current idle time is acquired; when the idle time length meets the sleep condition, acquiring data of each functional interface; and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter the dormant state. Through carrying out the low-power consumption setting to each external module when intelligent lock system and each user task are in idle state to and set up wake-up time and make master control MCU get into sleep state, solved because intelligent lock functional module is more, lead to the consumption of intelligent lock higher, need frequently change the problem of battery, effectively reduced the consumption of intelligent electric lock, reduced the change number of times of battery and improved intelligent lock's life-span.
Drawings
FIG. 1 is a schematic diagram of an intelligent door lock structure of a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a first embodiment of a method for reducing power consumption of an intelligent door lock according to the present application;
FIG. 3 is a flowchart illustrating a second embodiment of a method for reducing power consumption of an intelligent door lock according to the present application;
FIG. 4 is a schematic flow chart of controlling the intelligent door lock system to enter a sleep state in the method for reducing the power consumption of the intelligent door lock according to the present application;
fig. 5 is a schematic flow chart of setting a wake-up duration in the method for reducing power consumption of an intelligent door lock according to the present application;
FIG. 6 is a flowchart illustrating a method for reducing power consumption of an intelligent door lock after controlling the intelligent door lock system to enter a sleep state;
fig. 7 is a schematic flow chart of waking up the main control chip when a wake-up signal is received in the method for reducing power consumption of the intelligent door lock;
fig. 8 is a schematic flow chart after the steps of performing wake-up configuration on each external module and correcting the beat of the intelligent door lock system in the method for reducing the power consumption of the intelligent door lock according to the present application;
fig. 9 is a software flow diagram of a method for reducing power consumption of an intelligent door lock according to the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The main solutions of the embodiments of the present application are: when the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length; when the idle time length meets the sleep condition, acquiring data of each functional interface; and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter a dormant state.
Because the existing intelligent door lock is mostly powered by a battery, and the functional modules are numerous, the power consumption of the whole machine is increased, the battery replacement period is too short, the cost is increased, the environment is polluted, and the user experience is influenced. When the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length; when the idle time length meets the sleep condition, acquiring data of each functional interface; and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter the dormant state. Through carrying out the low-power consumption setting to each external module when intelligent lock system and each user task are in idle state to and set up wake-up time and make master control MCU get into sleep state, solved because intelligent lock functional module is more, lead to the consumption of intelligent lock higher, need frequently change the problem of battery, effectively reduced the consumption of intelligent electric lock, reduced the change number of times of battery and improved intelligent lock's life-span.
As shown in fig. 1, fig. 1 is a schematic structural diagram of an intelligent door lock of a hardware running environment according to an embodiment of the present application.
As shown in fig. 1, the smart door lock may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the smart door lock may further include a camera, an RF (Radio Frequency) circuit, a sensor, a remote control, an audio circuit, a WiFi module, a detector, and the like. Of course, the intelligent door lock may be further configured with other sensors such as a gyroscope, a barometer, a hygrometer, a temperature sensor, etc., which will not be described herein.
It will be appreciated by those skilled in the art that the smart door lock structure shown in fig. 1 is not limiting of the smart door lock device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a program for reducing power consumption of the smart door lock may be included in a memory 1005, which is a computer-readable storage medium.
In the intelligent door lock shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to invoke the smart door lock power consumption reducing program in the memory 1005 and perform the following operations:
when the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length;
when the idle time length meets the sleep condition, acquiring data of each functional interface;
and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter a dormant state.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a method for reducing power consumption of an intelligent door lock according to the present application.
Embodiments of the present application provide embodiments of a method of reducing power consumption of a smart door lock, it being noted that although a logic sequence is shown in the flow chart, in some cases the steps shown or described may be performed in a different order than that shown or described herein.
The method for reducing the power consumption of the intelligent door lock comprises the following steps:
step S10, when the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length;
the application environment of the method provided by the embodiment is that the method is applied to an intelligent door lock, the hardware of the intelligent door lock adopts an LPC55S6x series chip as a main control, and software adopts an RTOS system, wherein a Real-time operating system (Real-time operating system, RTOS) is also called an instant operating system.
After the intelligent door lock is electrified and initialized, executing a current user task, and when a user has no interaction with the intelligent door lock for a long time, enabling the RTOS system to enter an idle state (namely a standby state); at this time, the RTOS system executes an idle task, and in executing the idle task, the period Ti for which the system is idle and is expected to be maintained, that is, the idle period is first read by the RTOS system interface.
Step S20, when the idle time length meets the dormancy condition, acquiring data of each functional interface;
in order to avoid frequent dormancy and awakening of the RTOS system in a short time, a user is preset with the shortest dormancy time, namely a first preset dormancy time length, and the time length is generally set to be a few seconds, such as 5 seconds; meanwhile, the device can be set according to the actual demands of users, and is not limited herein. Comparing the first preset dormancy time length with the time Ti of the expected idle maintenance, and if the first preset dormancy time length is longer than the time Ti of the expected idle maintenance, keeping the RTOS system in an activated state continuously; if the first preset dormancy time is smaller than the preset dormancy time Ti, the condition of the first preset dormancy time is met, whether each user task is in an idle state is further judged, wherein the user task comprises a daily task, a burst task, a monitoring task, analysis and the like, and different user tasks can be generated based on different requirements of users. When the first preset dormancy time is smaller than the idle expected maintenance time Ti, the intelligent door lock initiates a collection request of the data of each function interface to the task scheduling module; after receiving the acquisition request, the task scheduling module stores the corresponding request data into a database, and builds a task acquisition table corresponding to the task; meanwhile, a task starting command comprising task starting parameters required by the task acquisition module is generated according to the task related data and is sent to the task acquisition module, and the task acquisition module performs corresponding acquisition work of the function data according to the starting parameters so as to acquire the data of the function interfaces. Wherein the request data includes: task name, data type, number of task concurrency, extraction mode, extraction frequency, etc.
And step S30, if the user task is determined to be in an idle state based on the data, controlling the intelligent door lock system to enter a dormant state.
When the intelligent door lock acquires the data of each functional interface fed back by the task acquisition module, the data is analyzed to determine whether each user task is in an idle state currently. Specifically, a task execution table corresponding to the data is obtained, whether user tasks waiting for execution exist in the task execution table is judged, if not, whether the executing user is executed completely is judged, and if all the executing user tasks are executed completely, the current user tasks are in an idle state. At this time, after the intelligent door lock performs the relevant low power consumption configuration, the control system enters a low power consumption sleep state. When the system enters a dormant state, all external modules, a CPU, a timer, a serial port and the like stop working, and only external interruption continues to work. Meanwhile, an instruction for enabling the system to enter the sleep state is the last instruction executed by the system before the sleep state, after entering the sleep state, data in a data memory and a special function register which are not related to a program in the MCU are kept at original values, and the system can be triggered by an external interrupt low level or by a falling edge or a hardware reset mode. When the interrupt wake-up single system is used, the program continues to run from the original stop, and when the hardware reset wake-up system is used, the program is executed from the beginning.
Further, referring to fig. 4, the step of controlling the intelligent door lock system to enter a sleep state includes:
step S31, carrying out low-power-consumption configuration on each external module; and
step S32, the wake-up duration is set, and the main control chip is controlled to enter a dormant state.
The low power consumption is a very important index of the MCU, such as some wearable devices, the electric quantity carried by the wearable devices is limited, and if the electric quantity consumed by the whole circuit is particularly large, the situation of insufficient electric quantity often occurs, so that the user experience is affected. Therefore, when the RTOS system goes to sleep, low power consumption configuration is required for each external module and the master MCU. For example: and the external module is configured to enter a low-power consumption mode, the upper peripheral and the clock which are irrelevant to low power consumption are closed, and the proper pin level is configured to avoid electric leakage. Meanwhile, the level state of the I/O port is required to be matched, a pull-up resistor is arranged in or outside the general I/O port, and if the level state of each I/O port is not set when the MCU enters the dormant state, a part of electric quantity is consumed. For example: if a certain I/O port has a 10kΩ pull-up resistor, the pin is pulled to 4V, and when the MCU goes into sleep, the I/O port is set to output a low level, and according to ohm's law, the pin consumes 4V/10k=0.4ma of current, which would cause power consumption if there were a plurality of such I/O ports. Therefore, before the MCU enters a dormant state, detecting the states of the I/O ports one by one, and if the I/O ports are provided with pull-up resistors, setting the I/O ports as high-level output or high-resistance input; if the I/O port is provided with a pull-down resistor, the pull-down resistor is set to be a low-level output or a high-resistance input.
After the low power consumption mode is successfully set, the program needs to be run periodically, then the low power consumption mode is entered, and after a certain time interval, the program continues to be run. At this time, the RTC clock is required to wake up the low power mode, and a periodic wake-up function is set, for example, the RTC alarm clock wakes up the low power mode automatically once every 50 s. Meanwhile, RTC/GINT interrupt needs to be set, GINT initializes more than 2 pins to the same group of interrupt, when no polarity effective signal exists in the same group, any one pin generates a polarity effective signal, and then the interrupt is generated. After the matching of each external module, the I/O port, the RTC wake-up, the GINT interrupt and the like is completed, the main control MCU enters a dormant state.
Further, referring to fig. 5, the step of setting the wake-up duration includes:
step S320, a second preset dormancy time length is obtained, and the second preset dormancy time length is compared with the idle time length;
step S321, if the second preset sleep time length is less than the idle time length, determining that the second preset sleep time length is the wake-up time length; or alternatively
Step S322, if the second preset sleep time period is longer than the idle time period, determining that the idle time period is the wake-up time period.
The maximum sleep time length, namely the second preset sleep time length, is preset in the intelligent door lock, and can be set to be a few minutes, a few hours or a few days, and the wake-up time length needs to be determined based on the maximum sleep time length before the MCU enters the sleep state. Specifically, comparing the time Ti of the idle predicted maintenance with the maximum dormancy time, and if the time Ti of the idle predicted maintenance is smaller than the maximum dormancy time, taking the time Ti of the idle predicted maintenance as the wakeup time; if the idle expected maintenance time Ti is greater than the maximum dormancy time, the maximum dormancy time is taken as the awakening time.
When the intelligent door lock system is detected to enter an idle state, the current idle time is acquired; when the idle time length meets the sleep condition, acquiring data of each functional interface; and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter the dormant state. Through carrying out the low-power consumption setting to each external module when intelligent lock system and each user task are in idle state to and set up wake-up time and make master control MCU get into sleep state, solved because intelligent lock functional module is more, lead to the consumption of intelligent lock higher, need frequently change the problem of battery, effectively reduced the consumption of intelligent electric lock, reduced the change number of times of battery and improved intelligent lock's life-span.
Further, referring to fig. 3, a second embodiment of the method for reducing power consumption of the intelligent door lock is provided.
The second embodiment of the method for reducing power consumption of the intelligent door lock is different from the first embodiment of the method for reducing power consumption of the intelligent door lock in that after the step of controlling the intelligent door lock system to enter the sleep state, the method further includes:
step S33, when the current sleep time length reaches the wake-up time length, automatically waking up the intelligent door lock system;
step S34, obtaining a current first idle duration, and if the first idle duration meets the sleep condition and the user task is in an idle state, controlling the intelligent door lock system to enter the sleep state again.
The intelligent door lock has two awakened conditions, one is to achieve automatic awakening of the sleep time, and the other is to receive an awakening signal to awaken. When the sleep time of the intelligent door lock reaches the wake-up time and the wake-up signal is not received, the intelligent door lock is awakened by an internal RTC; after awakening, the system resumes scheduling, and if no event needs to be processed (user task is idle), the system invokes an idle task, and can sleep again in the idle task. That is, in case that the RTOS system is detected to be idle and all user tasks are idle, it is determined that the sleep condition is satisfied, and the MCU enters the sleep state again. For example: the wake-up time is 1 hour, the intelligent door lock does not receive a wake-up signal within 1 hour, automatic wake-up is carried out, data of each functional interface is detected after wake-up, when it is determined that each current user task is in an idle state, the current sleep condition is met, the RTOS system is controlled to enter the sleep state again, and the next periodic wake-up is waited.
Further, referring to fig. 6, after the step of controlling the intelligent door lock system to enter the sleep state, the method further includes:
step S35, when a wake-up signal is received, the main control chip is waken up; and
when the intelligent door lock receives a wake-up signal, namely after an external event occurs or the RTC wakes up, the main control MCU wakes up from a power-down mode, wherein the sleep mode of the intelligent door lock generally comprises: sleep mode, deep sleep mode, power down mode, and deep power down mode, and for each mode selection, two metrics are included: the sleep current is low and the wake-up speed is fast.
Further, referring to fig. 7, the step of waking up the main control chip when receiving the wake-up signal includes:
step S350, when the target key is detected to be in a pressed state, a high-level signal is generated;
and S351, waking up the main control chip according to the high-level signal.
In the intelligent door lock, a key module is in communication connection with a main control MCU through an SPI port, and a plurality of target keys are preset by a user and are used for waking up a system. Meanwhile, the target key is connected with the main control MCU, and when the target key is pressed, a high-level signal is generated to wake up the main control MCU, wherein the high-level signal can be triggered by manual operation or autonomous intelligent triggering. Optionally, the target key may also be a virtual key, for example: when a user presses a target virtual key on the mobile phone, a high-level signal is generated, and the mobile phone sends the high-level signal to the intelligent door lock so as to wake up the main control MCU.
Optionally, the wake-up operation of the master control MCU may also be performed through voice information sent by the user, for example: the user presets a wake-up word of small T and small T, and the wake-up word is stored in the intelligent door lock. When a user sends a small T and a small T to the intelligent door lock, the intelligent door lock automatically recognizes the voice information to acquire text content in the voice information, and if the text content is consistent with a prestored awakening word, the main control MCU is awakened.
And S36, performing wake-up configuration on the external modules, and correcting the beat of the intelligent door lock system.
After the main control MCU is awakened, the external modules are further subjected to awakening configuration, the system beat of the intelligent door lock is corrected, specifically, after the main control MCU is awakened, the working mode of each external module is set to be an operation mode, meanwhile, the power supply, related pins, clocks and the like of each external module are set, and when the clocks are set, clock parameters such as opening of an external high-speed clock crystal oscillator, setting of a system clock and the like are required to be set. Secondly, when the intelligent door lock is in sleep, a system clock (system beat) is stopped, so that the system beat is stopped in the sleep period, and after the intelligent door lock is awakened, the system beat is added with the system beat number corresponding to the sleep time. Where all operating systems need to provide a system clock beat for the system to handle time-dependent events (timebases), such as delays, timeouts, etc. The system clock beats are specific periodic interrupts, the clock intervals between the interrupts depend on different applications, the time base is set, and the time base is generally about 1ms, meanwhile, the clock beats interrupt enables tasks to be delayed by a plurality of clock beats (the CPU is released to other tasks and then executed after a plurality of times); when a task wait event occurs, a wait timeout wait is also provided, and the faster the clock beat frequency, the greater the system overhead. Therefore, after the intelligent door lock is awakened, the system beat needs to be corrected in time so as to avoid high system cost caused by too fast system beat frequency.
Further, referring to fig. 8, after the step of performing wake-up configuration on the external modules and correcting the beat of the intelligent door lock system, the method further includes:
step S360, a scheduling instruction is obtained, wherein the scheduling instruction is used for indicating the user task to be executed;
step S361, starting the intelligent door lock system to process the user task according to the scheduling instruction.
After receiving the wake-up signal, the intelligent door lock automatically generates a scheduling instruction or receives the scheduling instruction issued by a dispatcher from the client, wherein the scheduling instruction is used for indicating the user task to be executed, and the intelligent door lock system is started to process the user task according to the scheduling instruction. Specifically, the intelligent door lock divides the user task into three low levels in advance, such as: the first level (emergency), the second level (important) and the third level (common) further adopt different scheduling methods for user tasks with different priorities according to the load condition of the system. For example: for a user task of a first level, firstly searching an idle working thread from a system, and scheduling the user task to the idle working thread for execution; if no idle worker thread is found, a new idle worker thread is created and the user task is scheduled to the newly created worker thread. For user tasks of a second level, firstly, obtaining expected waiting time of each user task in a waiting queue from a system, comparing the expected waiting time with the latest execution time of the current user task, obtaining a task queue with expected waiting time smaller than the latest execution time of the current user task, and dispatching the current user task to the tail end of the task queue; if the matched task queue is not found, searching an idle working thread in the system, and scheduling the current user task to the idle time thread. And for the user task of the first level, acquiring the content corresponding to the execution of the user task, searching a non-idle working thread matched with the content in the system, and scheduling the user task to the non-idle working thread. By dividing the user tasks into three different grades and adopting different scheduling schemes based on the different grades, the user tasks can be executed in time, and the requirement of the user on real-time performance is met.
In the embodiment, after an external event occurs or the RTC wakes up, the main control MCU wakes up from a power-down mode, wakes up each external module and corrects the system beat, and simultaneously, the system is started to process the user task in time through the scheduling instruction by acquiring the scheduling instruction, so that each transaction can be processed in time after the system is waken up, and the normal operation of the system is ensured.
In order to better explain the scheme of the embodiment of the application, the operation flow of the method for reducing the power consumption of the intelligent door lock in terms of software is as follows:
referring to fig. 9, after the smart door lock is powered on, the RTOS system enters an initialization, and after the initialization is completed, processes the current user task. When the user does not interact with the intelligent door lock for a long time (such as 2 hours), whether the RTOS system enters an idle state (namely a standby state) is detected, if so, an idle task is executed, and if not, the step of detecting whether the RTOS system enters the idle state is executed again. In the process of executing the idle task, acquiring the expected maintenance time Ti of the system idle, namely the idle time, judging whether the idle time meets the dormancy requirement, and if the expected maintenance time Ti of the system idle is larger than the shortest dormancy time, judging that the idle time meets the dormancy requirement; if the idle expected sustain time Ti is less than the minimum sleep time, the step of detecting whether the RTOS system enters an idle state is performed back. When the idle time meets the sleep requirement, acquiring data of each functional interface of the system, judging whether user tasks in the system are idle or not according to the data, and if so, performing low-power-consumption sleep configuration on an external module; if any non-idle user task exists, returning to execute the step of detecting whether the RTOS system enters an idle state. When the sleep configuration of the external module with low power consumption is carried out, the external module is required to be configured to enter a low power consumption mode, an upper peripheral and a clock which are irrelevant to the low power consumption are closed, proper pin levels are configured to avoid electric leakage and the like, the RTC wake-up and the GINT wake-up are further required to be configured, the idle predicted maintenance time Ti is compared with the maximum sleep time, and if the idle predicted maintenance time Ti is smaller than the maximum sleep time, the idle predicted maintenance time Ti is taken as the wake-up time; if the idle expected maintenance time Ti is greater than the maximum dormancy time, the maximum dormancy time is taken as the awakening time. After the configuration is completed, the main control MCU is controlled to enter a power-down mode, and meanwhile, RTC/GINT timing interruption is set. When a wake-up signal is received, the main control MCU is waken up, wake-up configuration is carried out on each external module, the beat of the intelligent door lock system is corrected, a scheduling instruction is obtained at the same time, and the intelligent door lock system is started to process the user task according to the scheduling instruction. After the system is awakened to work normally, the real-time detection is continued to be carried out whether the RTOS system enters an idle state (namely a standby state).
According to the embodiment, when the intelligent door lock system and each user task are in an idle state, low power consumption is set for each external module, wake-up time is set, and the main control MCU enters a dormant state, so that the problems that the intelligent door lock has higher power consumption and needs to be replaced frequently due to the fact that the intelligent door lock has more functional modules are solved, the power consumption of the intelligent electric door lock is effectively reduced, the replacement times of the battery are reduced, and the service life of the intelligent door lock is prolonged.
In addition, the application also provides a system for reducing power consumption of the intelligent door lock, in one embodiment, the system comprises a memory, a processor and a program for reducing power consumption of the intelligent door lock, wherein the program is stored on the memory and can run on the processor, and the following steps are realized when the program for reducing power consumption of the intelligent door lock is executed by the processor:
when the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length;
when the idle time length meets the sleep condition, acquiring data of each functional interface;
and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter a dormant state.
In an embodiment, the system for reducing power consumption of an intelligent door lock includes a first acquisition module, a second acquisition module, and a determination module;
the first acquisition module is used for acquiring the current idle time length when the intelligent door lock system is detected to enter an idle state;
the second obtaining module is used for obtaining the data of each functional interface when the idle time length meets the dormancy condition;
and the determining module is used for controlling the intelligent door lock system to enter a dormant state if the user task is determined to be in an idle state based on the data.
Further, the determining module comprises a configuration unit;
the configuration unit is used for carrying out low-power-consumption configuration on each external module; and
the configuration unit is also used for setting the wake-up time length and controlling the main control chip to enter the sleep state.
Further, the second acquisition module comprises an acquisition unit;
the acquisition unit is used for acquiring a first preset dormancy time;
the acquiring unit is further configured to acquire data of each functional interface if the first preset sleep duration is less than the idle duration.
Further, the configuration unit comprises an acquisition subunit and a determination subunit;
the obtaining subunit is configured to obtain a second preset sleep duration, and compare the second preset sleep duration with the idle duration;
the determining subunit is configured to determine that the second preset sleep duration is the wake-up duration if the second preset sleep duration is less than the idle duration; or alternatively
The determining subunit is further configured to determine that the idle duration is the wakeup duration if the second preset sleep time period is longer than the idle duration.
Further, the determining module further comprises a wake-up unit;
the awakening unit is used for automatically awakening the intelligent door lock system when the current sleep time reaches the awakening time;
the wake-up unit is further configured to obtain a current first idle duration, and if the first idle duration meets the sleep condition and the user task is in an idle state, control the intelligent door lock system to enter the sleep state again.
Further, the wake-up unit is further configured to wake up the main control chip when receiving a wake-up signal; and
the wake-up unit is further used for carrying out wake-up configuration on the external modules and correcting the beat of the intelligent door lock system.
Further, the wake-up unit comprises a detection subunit and a wake-up subunit;
the detection subunit is used for generating a high-level signal when the target key is detected to be in a pressed state;
and the awakening subunit is used for awakening the main control chip according to the high-level signal.
Further, the wake-up unit further comprises an acquisition subunit and a scheduling subunit;
the obtaining subunit is configured to obtain a scheduling instruction, where the scheduling instruction is used to indicate the user task to be executed;
and the scheduling subunit is used for starting the intelligent door lock system to process the user task according to the scheduling instruction.
The implementation of the functions of each module of the system for reducing the power consumption of the intelligent door lock is similar to the process in the embodiment of the method, and will not be described in detail herein.
In addition, the application also provides an intelligent door lock, which comprises a memory, a processor and a program which is stored in the memory and runs on the processor and used for reducing the power consumption of the intelligent door lock, wherein when the intelligent door lock detects that an intelligent door lock system enters an idle state, the intelligent door lock acquires the current idle time; when the idle time length meets the sleep condition, acquiring data of each functional interface; and if the user task is determined to be in the idle state based on the data, controlling the intelligent door lock system to enter the dormant state. Through carrying out the low-power consumption setting to each external module when intelligent lock system and each user task are in idle state to and set up wake-up time and make master control MCU get into sleep state, solved because intelligent lock functional module is more, lead to the consumption of intelligent lock higher, need frequently change the problem of battery, effectively reduced the consumption of intelligent electric lock, reduced the change number of times of battery and improved intelligent lock's life-span.
In addition, the application further provides a computer readable storage medium, wherein the computer readable storage medium stores a program for reducing the power consumption of the intelligent door lock, and the program for reducing the power consumption of the intelligent door lock realizes the steps of the method for reducing the power consumption of the intelligent door lock when being executed by a processor.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.
While alternative embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following appended claims be interpreted as including alternative embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (8)

1. A method for reducing power consumption of an intelligent door lock, the method comprising:
when the intelligent door lock system is detected to enter an idle state, acquiring the current idle time length, wherein the idle time length is the time length of the system which is expected to be maintained when the system is idle;
when the idle time length meets the sleep condition, acquiring data of each functional interface;
if the user task is determined to be in an idle state based on the data, controlling the intelligent door lock system to enter a dormant state;
the step of controlling the intelligent door lock system to enter a sleep state comprises the following steps:
carrying out low-power-consumption configuration on each external module; and
setting a wake-up time length and controlling the main control chip to enter a sleep state;
the step of performing low power consumption configuration on each external module comprises the following steps:
carrying out low-power consumption configuration on the pin level of each external module and the level state of the I/O port;
the step of setting the wake-up time length and controlling the main control chip to enter the sleep state comprises the following steps:
acquiring a second preset dormancy time length, and comparing the second preset dormancy time length with the idle time length;
if the second preset dormancy time is smaller than the idle time, determining that the second preset dormancy time is the wakeup time and controlling a main control chip to enter a dormancy state; or alternatively
If the second preset dormancy time length is longer than the idle time length, determining that the idle time length is the awakening time length, and controlling a main control chip to enter a dormancy state;
after the step of controlling the intelligent door lock system to enter the sleep state, the method further comprises:
when the current sleep time length reaches the wake-up time length or an external event occurs, waking up the intelligent door lock system, and adding the system beats of the intelligent door lock system to the system beats corresponding to the sleep time length.
2. The method for reducing power consumption of an intelligent door lock according to claim 1, wherein the step of acquiring data of each functional interface when the idle duration satisfies a sleep condition comprises:
acquiring a first preset dormancy time;
and if the first preset dormancy time is smaller than the idle time, acquiring the data of each function interface.
3. The method according to any one of claims 1 to 2, further comprising, after the step of waking up the smart door lock system when the current sleep time period reaches the wake-up time period:
and acquiring the current first idle time, and controlling the intelligent door lock system to enter the sleep state again if the first idle time meets the sleep condition and the user task is in the idle state.
4. The method according to any one of claims 1 to 2, wherein the step of waking up the smart door lock system when the current sleep time period reaches the wake time period or when an external event occurs includes:
when the current sleep time length reaches the wake-up time length or an external event occurs, waking up the main control chip; and
and carrying out wake-up configuration on the external modules.
5. The method for reducing power consumption of an intelligent door lock according to claim 4, wherein the step of waking up the main control chip when an external event occurs comprises:
when the target key is detected to be in a pressed state, a high-level signal is generated;
and waking up the main control chip according to the high-level signal.
6. The method for reducing power consumption of a smart door lock according to claim 4, further comprising, after said step of waking up each external module when an external event occurs:
acquiring a scheduling instruction, wherein the scheduling instruction is used for indicating the user task to be executed;
and starting the intelligent door lock system to process the user task according to the scheduling instruction.
7. A smart door lock, characterized in that it comprises a memory, a processor and a program for reducing the power consumption of the smart door lock stored on the memory and running on the processor, said processor implementing the steps of the method according to any one of claims 1 to 6 when executing said program for reducing the power consumption of the smart door lock.
8. A computer readable storage medium, characterized in that it has stored thereon a program for reducing the power consumption of a smart door lock, which when executed by a processor, implements the steps of the method according to any of claims 1 to 6.
CN202011299093.4A 2020-11-18 2020-11-18 Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium Active CN112530056B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011299093.4A CN112530056B (en) 2020-11-18 2020-11-18 Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011299093.4A CN112530056B (en) 2020-11-18 2020-11-18 Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium

Publications (2)

Publication Number Publication Date
CN112530056A CN112530056A (en) 2021-03-19
CN112530056B true CN112530056B (en) 2023-07-25

Family

ID=74981273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011299093.4A Active CN112530056B (en) 2020-11-18 2020-11-18 Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium

Country Status (1)

Country Link
CN (1) CN112530056B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153305A (en) * 2021-11-19 2022-03-08 江苏林洋能源股份有限公司 Intelligent ammeter based on light-weight real-time operating system and low-power-consumption management method
CN114286431B (en) * 2021-12-02 2024-03-22 海尔优家智能科技(北京)有限公司 Method and device for starting low-power mode, storage medium and electronic device
CN114158027B (en) * 2021-12-14 2023-07-25 深圳Tcl新技术有限公司 Communication connection method, device, terminal and storage medium
CN114155636B (en) * 2021-12-14 2024-06-04 深圳Tcl新技术有限公司 Equipment control method, device, electronic equipment and storage medium
CN114495338A (en) * 2022-03-10 2022-05-13 珠海格力电器股份有限公司 Door lock control method and device, electronic equipment and storage medium
CN117994960A (en) * 2022-06-02 2024-05-07 武汉领普科技有限公司 Wireless switch, processing method and control system of wireless switch
CN115993996B (en) * 2023-03-22 2023-06-09 南京芯驰半导体科技有限公司 Method and system for realizing sleep mode based on RTOS

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105225316A (en) * 2015-09-23 2016-01-06 曾松峰 A kind of dormancy of electron key low-power consumption power supply plan and awakening method
WO2019001331A1 (en) * 2017-06-27 2019-01-03 阿里巴巴集团控股有限公司 Clock tick interrupt configuration method and device
CN109448178A (en) * 2018-10-15 2019-03-08 上海顺舟智能科技股份有限公司 A kind of low power-consumption intelligent door-locking system and its control method

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3498373B2 (en) * 1994-06-23 2004-02-16 マツダ株式会社 Locking device
CN102222022A (en) * 2011-07-15 2011-10-19 范示德汽车技术(上海)有限公司 Real-time task scheduling method based on multicore processor
CN103176841A (en) * 2013-03-06 2013-06-26 深圳市文鼎创数据科技有限公司 Implementation method and device for Tick clock of real time operating system (RTOS)
CN105630132A (en) * 2015-12-23 2016-06-01 深圳市万普拉斯科技有限公司 Power consumption control method and system as well as terminal
CN106375396A (en) * 2016-08-30 2017-02-01 乐视控股(北京)有限公司 Method and device for dormancy and awakening of vehicle-mounted intelligent terminal
CN107733994A (en) * 2017-09-20 2018-02-23 美的智慧家居科技有限公司 Control method, intelligent door lock and the readable storage medium storing program for executing of intelligent door lock
CN107977606B (en) * 2017-11-13 2023-09-29 深圳贝特莱电子科技股份有限公司 Embedded fingerprint identification device and method with ultralow standby power consumption
CN109356459A (en) * 2018-10-23 2019-02-19 郑州博雅讯科技有限公司 The low-power consumption regulation method, apparatus and intelligent electronic lock of intelligent electronic lock
WO2020168481A1 (en) * 2019-02-20 2020-08-27 深圳市汇顶科技股份有限公司 Smart lock power supply control method, smart lock system and storage medium
CN209855432U (en) * 2019-03-14 2019-12-27 深圳中集智能科技有限公司 Intelligent electronic lock
CN110424831B (en) * 2019-08-12 2021-06-22 北京百佑科技有限公司 Low-power consumption intelligence lock
CN111047758A (en) * 2019-11-29 2020-04-21 深圳市云天智能终端有限公司 Awakening method and system of intelligent electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105225316A (en) * 2015-09-23 2016-01-06 曾松峰 A kind of dormancy of electron key low-power consumption power supply plan and awakening method
WO2019001331A1 (en) * 2017-06-27 2019-01-03 阿里巴巴集团控股有限公司 Clock tick interrupt configuration method and device
CN109448178A (en) * 2018-10-15 2019-03-08 上海顺舟智能科技股份有限公司 A kind of low power-consumption intelligent door-locking system and its control method

Also Published As

Publication number Publication date
CN112530056A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN112530056B (en) Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium
CN105354044B (en) A kind of application awakening method and device
TWI494857B (en) Method for performing wake-up event management, and associated apparatus and associated computer program product
US9152199B2 (en) Power state dependent wake-up alarm
CN102483706B (en) Information processing device, control method of information processing device
EP3650983B1 (en) Method for managing trigger, and terminal device
EP3268842B1 (en) Methods and systems for coordination of operating states amongst multiple socs within a computing device
US9952897B2 (en) Managing processes within suspend states and execution states
WO2016041190A1 (en) Method and apparatus for running application program
EP2756385A1 (en) Managing processes within suspend states and execution states
CN106959857B (en) Application control method and device of electronic equipment
CN103345415A (en) Terminal energy-saving method and device for management timer
CN111225434B (en) Application response method, system, storage medium and communication module
CN105353864A (en) Static power consumption management method and system for electronic device
CN113129479A (en) Intelligent lock control method, device, equipment and storage medium
CN106484075A (en) Method and device for adjusting application program wake-up time
JP2003015783A (en) Information processor and its power management method
CN109062624A (en) It is a kind of to interrupt the processing method waken up for vehicle electronic control unit
CN111857841A (en) Awakening method of main control chip, storage medium and intelligent terminal
WO2018010438A1 (en) Responding method and apparatus for terminal
US8751841B2 (en) Data processing system, method for processing data and computer program product
CN111352796B (en) Method and device for acquiring electric quantity by intelligent wearable equipment
JP5670967B2 (en) Method for controlling power state of portable information terminal device, computer program, and portable information terminal device
CN107526603B (en) Application awakening method and device
CN104077195A (en) State detection method, state detection device and terminal

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