Master-slave modularized intelligent lock control system and low-power-consumption optimization method thereof
Through the master-slave modular design and power consumption optimization technology, the problem of large size and high power consumption of smart lock products is solved, free combination of functions and low power consumption is achieved, battery life is extended, and the cost-effectiveness and user experience of smart locks is improved. .
Patent Information
- Application Number
- CN202410113517.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2024-12-20
AI Technical Summary
The existing smart lock products are large in size, complex in functions, and high in power consumption, resulting in increased manufacturing costs, limited user actual use functions, and it is difficult to achieve ultra-low power consumption while ensuring efficient and stable operation.
Adopt the master-slave modular design, including low-power main control MCU, power management circuit, module detection and power control circuit, sound and light prompt circuit, etc., power supply control through MOSFET transistor, slave functional modules are automatically identified and combined to achieve dynamic and static Optimize power consumption to reduce system power consumption.
It realizes free combination of functions, reduces the power consumption of smart locks, extends the battery life, and ensures efficient and stable operation of the system, improving cost-effectiveness.
Smart Images

Figure CN119169723A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart locks, and in particular to a master-slave modularized smart lock control system and a low power consumption optimization method thereof. Background Art
[0002] The smart lock industry was initiated by European and American countries and popularized in Japan and South Korea. Its development history is about 20 years earlier than that of China. Although China's smart lock development time is relatively short, its development speed is the fastest in the world. With the rapid development of biometric technology, the rapid promotion and popularization of domestic smart locks, the gradual formation of standardized standards in the market, the support of national export policies, and the formation of overseas shopping platforms with the development of globalization, China's smart lock technology has begun to be exported, and Chinese smart lock products have been at the forefront of the market in the European and American markets.
[0003] At present, the smart locks on the market are large in size, highly integrated, and have complicated functions. The unlocking methods are diverse, but their practicality is not high. Generally, users often use only one or two functions. At the same time, such a design also increases power consumption and requires a larger power supply, resulting in a larger size for the entire lock body. Other less useful electronic functions and a larger lock body also increase manufacturing costs.
[0004] Because smart locks are powered by dry batteries or lithium batteries, the power consumption requirements are relatively stringent. We need to achieve ultra-low power consumption while ensuring efficient and stable operation. The market is in urgent need of practical and cost-effective smart locks, which should be slim and compact in size, and can be freely separated and combined according to needs and habits. The smart lock control system adopts a new functional separation design to improve cost-effectiveness, reduce power consumption, and make operation easier to ensure the user experience. Summary of the invention
[0005] The purpose of the present invention is to provide a master-slave modular smart lock control system and a low power consumption optimization method thereof. The smart lock control system adopts a modular design, can flexibly combine functions, and reduce system power consumption while ensuring efficient and stable operation of the system.
[0006] In order to achieve the above-mentioned purpose, the technical solution adopted by the present invention is: a master-slave modular smart lock control system, including a main control module and multiple slave functional modules, the main control module includes a low-power main control MCU, a power management circuit, a power detection circuit, a module detection and power control circuit, an audio and video prompt circuit, a motor drive circuit, a download and debugging interface, a control button circuit and a FLASH storage module, the slave functional modules include a matrix keyboard module, an RFID module, a touch keyboard module, a display module, a wireless communication module, a voice module, a face recognition module, a fingerprint recognition module and a human motion detection module, the slave functional modules can be freely selected and combined and connected to the main control module to form a one-master-multiple-slave modular system in different combinations.
[0007] Furthermore, the main control module is connected to each slave functional module through a variety of connection methods including I / O interface, IIC bus, SPI bus, UART bus, and DAC interface.
[0008] Furthermore, the main control module automatically identifies the selected slave function modules through the module detection and power control circuit, and controls the power supply of each slave function module through the switch circuit composed of MOSFET transistors.
[0009] Furthermore, the software program of the smart lock control system consists of three levels, including HAL library, driver layer and application layer; among them, the HAL library encapsulates the underlying code of the main control MCU to simplify the development process; the driver layer encapsulates hardware-related functions and provides relevant API interfaces for use by the application layer; the application layer implements the relevant logic of the smart lock.
[0010] Furthermore, the driver layer includes a touch panel driver based on I2C communication, an audio-visual prompt circuit driver, a fingerprint recognition module driver based on UART communication, a motor switch lock driver, a PC interaction driver based on UART communication, a main control MCU operation mode conversion driver, and a data storage driver; the driver layer encapsulates the hardware module functions and uses interrupt control and DMA control drivers to reduce CPU occupancy as much as possible; the driver layer provides an API function interface and an API function description, and the application layer can completely ignore the hardware layer and only focus on the API function functions, output parameters, and output parameters.
[0011] Furthermore, the application layer consists of three parts, including data storage and reading in storage, and two state machines in mach, including the main state machine and the fingerprint module driver state machine;
[0012] The storage implements data storage of the system, including relevant parameters of factory settings, relevant parameters of system operation, and passwords of administrators and users; makes judgments on parameters when interacting with users; and records and processes the relative relationship between data;
[0013] The main state machine of the mach implements all functions of the smart lock and user interaction part; implements the relevant process of generating and testing the smart lock; and interacts with the PC through the serial port;
[0014] The fingerprint module of the mach drives the state machine, which mainly realizes the functions related to the interaction between the smart lock and the user through fingerprints.
[0015] Furthermore, the main state machine is implemented as follows:
[0016] The current state of the state machine is defined by two parameters, where __curr_func is used to represent the response processing function of the current state, and __curr_param is used to represent additional parameters. The state machine is run by frequently calling __curr_func. All response processing functions have three parameters:
[0017] 1) work_time, which represents the duration of the state, is used to synchronize the actions in each state and is cleared every time the state switches;
[0018] 2) key, current key status, including no key pressed, 0 to 9, EMTEK key and multi-key status;
[0019] 3) param, additional parameters, directly pass in __curr_param to ensure the parameters designed for compatibility;
[0020] The process of each state machine response includes the following logic and actions:
[0021] A) Process possible serial port data;
[0022] B) Debounce the buttons, etc.
[0023] C) Execute the response function of the fingerprint state machine. The fingerprint state machine is directly bound to the relevant parameters of the main state machine, that is, the state of each main state machine fixedly responds to the response function of the same fingerprint state machine and shares the main state machine parameters. In the process, it mainly includes: ① processing the events sent by the fingerprint recognition module and making corresponding responses; ② operating the fingerprint and interacting according to the events of the fingerprint recognition module;
[0024] D) Execute the response function of the main state machine. The state machine response program isolates the API of the hardware operation from the API of the driver layer. After the response function of the state machine is finished, the API of the driver layer is called according to the response result of the state machine.
[0025] E) Execute the response function of the sub-state machine. This item is determined during formal programming to determine whether it is used. The role of the sub-state machine is to provide certain assistance to the state machine;
[0026] F) Response to the sound and light prompt, where the driver layer API is called and the response action of the state machine is maintained within several milliseconds;
[0027] Each state machine response function handles the following logic:
[0028] A) The sound and light prompts that appear within a certain period of time after entering this state;
[0029] B) The default sound and light prompts in this state;
[0030] C) Implement interaction with the user, including responding to user buttons, updating the status of sound and light prompts, and controlling other hardware of the system through the driver layer API;
[0031] D) Make possible state transitions and enter the next state.
[0032] The present invention also provides a low power consumption optimization method for the master-slave modular smart lock control system, including dynamic power consumption optimization and static power consumption optimization; the implementation method of the dynamic power consumption optimization is:
[0033] (1) Add a MOS switch circuit to the main control module circuit, and use the main control MCU to control the partial circuit to be shut down in time when there is no functional demand;
[0034] (2) Design the on-chip switching program of the main MCU and the on-chip switching program of the slave functional module in the driver layer program. When the on-chip peripherals of the main MCU have no functional requirements, they are turned off in time; when the on-chip peripheral functions are needed again, the driver layer program is notified to turn them on again through external interrupts or signal source detection methods;
[0035] (3) Design the clock management program of the main control MCU in the driver layer; increase the clock frequency in time when there are large-scale computing business needs or high-frequency signal source detection; select the 2MHz operation mode when the system is idle;
[0036] (4) The pull-up and pull-down resistors in the system circuit use the GPIO pull-up and pull-down resistors in the main MCU to control and reduce power consumption;
[0037] (5) By adjusting the R connected to RBIAS in the internal bias adjustment circuit of the touch keyboard module Band the internal I2C clock adjustment circuit R IB To reduce the dynamic power consumption of the touch keyboard module;
[0038] (6) The sound and light prompt circuit uses white LED as the key backlight source, adopts white PCB board and convex lens focusing principle, reduces the current limiting resistor and power consumption while ensuring brightness;
[0039] The implementation method of the static power consumption optimization is:
[0040] The system circuit uses MOS tube switch circuit as the power control of the module. The static current I Sleep The leakage current N×I between the drain and source of N MOS tubes in the off state DDS , Touch keyboard module IC standby current I TKS , Fingerprint recognition module standby current I FPS , Motor driver chip static current I MotorS , the power conversion chip static current I LDOS 、The current consumption of the main MCU in low power mode I MCUSleep These 6 parts are represented by the following formula:
[0041] I Sleep =N×I DDS +I TKS +I FPS +I MotorS +I LDOS +I MCUSleep
[0042] (1) For I DDS , I MotorS , I LDOS Optimization: When selecting hardware, choose ultra-low power consumption components while meeting the system electrical parameters;
[0043] (2) For I TKS Optimization: By adjusting the internal bias adjustment circuit in the touch keyboard module, R connected to SRBIAS SB The resistor value is used to adjust the current consumption in IDLE mode;
[0044] (3) For I MCUSleep Optimization: Select the appropriate sleep mode combination according to system requirements, and select the stop mode with RTC (STOPO mode);
[0045] (4) For I FPS Optimization: Use time-sharing detection + MOS switch circuit to reduce the working time of the touch wake-up module and reduce power consumption; link with the touch keyboard module and abandon the touch wake-up module of the fingerprint recognition module.
[0046] Compared with the prior art, the present invention has the following beneficial effects: the present invention provides a master-slave modular intelligent lock control system and its low power consumption optimization method, adopts a one-master-multiple-slave modular function separation mode to construct an intelligent lock control system, the system consists of a master control module and a plurality of freely combinable slave function modules, the master control module is based on a low-power processor, with power detection and power control circuits, the master control module can automatically identify the slave function module and perform corresponding power supply control to meet the different intelligent lock product requirements with freely tailored functions; the control system adopts a Mach master state machine to manage and coordinate the work of each function module, reduces the dynamic power consumption of the system by reducing the operating frequency and the power gating of the slave module, and optimizes the static power consumption of the system by reducing the circuit leakage current. The intelligent lock control system of the present invention adopts a function separation design, which can be separated and combined freely according to the functional requirements, and meets the different intelligent lock product requirements with freely tailored functions. After the static power consumption and dynamic power consumption optimization processing, the system power consumption is greatly reduced, which can greatly extend the battery life, and has ultra-low power consumption while ensuring the efficient and stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a schematic diagram of the structure of a smart lock control system according to an embodiment of the present invention;
[0048] Figure 2 is a flow chart of the implementation of the Mach master state machine in an embodiment of the present invention;
[0049] Figure 3 is a schematic structural diagram of a touch keyboard module in an embodiment of the present invention;
[0050] Figure 4 It is the minimum system circuit diagram of the low-power master control MCU in the embodiment of the present invention;
[0051] Figure 5 is a power management circuit diagram in an embodiment of the present invention;
[0052] Figure 6 This is a circuit diagram of electric quantity detection in an embodiment of the present invention;
[0053] Figure 7 It is a diagram of module detection and power supply control in an embodiment of the present invention;
[0054] Figure 8 is a circuit diagram of a sound prompt in an embodiment of the present invention;
[0055] Fig. 9 is a motor driving circuit diagram in an embodiment of the present invention;
[0056] Fig.10 is a circuit diagram of a touch key in an embodiment of the present invention;
[0057] Fig.11 This is a key light display circuit diagram in an embodiment of the present invention;
[0058] Fig.12 is a diagram of a fingerprint recognition module in an embodiment of the present invention;
[0059] Fig.13 is a physical diagram of a smart lock control system in an embodiment of the present invention;
[0060] Fig.14 is a power-on initialization current curve diagram in an embodiment of the present invention;
[0061] Fig.15 is a current curve diagram of a dormant state in an embodiment of the present invention;
[0062] Fig.16 : is a curve diagram of password unlocking current in an embodiment of the present invention;
[0063] Fig.17 It is a fingerprint unlocking current curve diagram in an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0065] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0066] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0067] This embodiment builds a smart lock control system based on a one-master-multiple-slave modular embedded system. To achieve functional separation and combination, the entire system is divided into a main control module and multiple slave function modules that can be freely combined. The overall framework is as follows: Figure 1 shown.
[0068] 1. Overall system design
[0069] The main control module includes a low-power main control MCU, a power management circuit, a power detection circuit, a module detection and power control circuit, an audio-visual prompt circuit, a motor drive circuit, a download and debug interface, a control button circuit and a FLASH storage module. The slave function modules include a matrix keyboard module, an RFID module, a touch keyboard module, a display module, a wireless communication module, a voice module, a face recognition module, a fingerprint recognition module and a human motion detection module. The slave function modules can be freely selected and combined and connected to the main control module to form a one-master-multiple-slave modular system in different combinations.
[0070] The main control module is connected to each slave functional module through various connection methods such as I / O interface, IIC bus, SPI bus, UART bus, DAC interface, etc., and is selected and combined according to actual needs.
[0071] The main control module automatically identifies the selected slave function modules through the module detection and power control circuit, and controls the power supply of each slave function module through the switch circuit composed of MOSFET transistors.
[0072] In order to achieve ultra-low power consumption while ensuring efficient and stable operation, it is necessary to select high-performance, low-power MCU and power management chip:
[0073] (1) Main MCU: STM32L031K6T6
[0074] The STM32L0 series is STMicroelectronics' entry-level 32-bit ultra-low-power MCU product, combining high performance -M0+ 32-bit RISC core, designed to achieve excellent low power consumption levels. 0.23uA standby mode (2 wake-up pins), 0.35uA stop mode (16 wake-up lines), 0.6uA stop mode + RTC + 8KB RAM retention, as low as 76uA / MHz in run mode.
[0075] (2) Power management chip: Weimo Electronics ME6214A33PG
[0076] The ME6214 series is an ultra-low static power, low dropout linear regulator manufactured in CMOS technology. The regulator consumes about 0.7uA of current, and the power consumption after enabling shutdown is 0.01uA (typical).
[0077] 2. System software function design
[0078] The software program of the smart lock control system consists of three layers, including HAL library, driver layer and application layer. Among them, the HAL library uses the official library of ST company, which encapsulates the underlying code of the main control MCU to simplify the development process; the driver layer encapsulates the hardware related functions and provides relevant API interfaces for the application layer; the application layer implements the relevant logic of the smart lock.
[0079] 2.1 Driver layer programming
[0080] The driver layer includes a touch panel driver based on I2C communication, an audio and visual prompt circuit driver, a fingerprint recognition module driver based on UART communication, a motor switch lock driver, a PC interaction driver based on UART communication, a main control MCU operation mode conversion driver, and a data storage driver. The driver layer encapsulates the hardware module functions and uses interrupt control and DMA control drivers to reduce CPU usage as much as possible. The driver layer provides an API function interface and an API function description. The application layer can completely ignore the hardware layer and only focus on the API function functions, output parameters, and output parameters.
[0081] 2.2 Application layer structure and function design
[0082] The application layer consists of three parts, including data storage and reading in storage, and two state machines in mach, including the main state machine and the fingerprint module driver state machine.
[0083] 1) The storage implements data storage of the system, including relevant parameters of factory settings, relevant parameters of system operation, passwords of administrators and users, etc.; when interacting with users, it judges the parameters; and records and processes the relative relationship between data.
[0084] 2) The main state machine of mach implements all functions of the smart lock and user interaction part; implements the relevant processes of generating and testing the smart lock; and interacts with the PC through the serial port.
[0085] 3) The fingerprint module of the mach drives the state machine, which mainly realizes the functions related to the interaction between the smart lock and the user through fingerprints. It is a supplement to the main state machine.
[0086] 2.3 Functional design of the main state machine
[0087] (1) Overall design of Mach main state machine
[0088] The overall design process of the Mach main state machine is as follows Figure 2 The main state machine is implemented as follows:
[0089] The current state of the state machine is defined by two parameters, where __curr_func is used to represent the response processing function of the current state, and __curr_param is used to represent additional parameters. The state machine is run by calling __curr_func frequently (the frequency of the call is not guaranteed, but except in sleep mode, it must be called at least once every 10ms). All response processing functions have three unified parameters:
[0090] 1) work_time, which represents the duration of the state in milliseconds, is used to synchronize the actions in each state, that is, a timer that is reset every time the state switches;
[0091] 2) key, current key status, including no key pressed, 0 to 9, EMTEK key and multi-key status;
[0092] 3) param, additional parameter, directly pass in __curr_param, which is designed to ensure compatibility.
[0093] Each state machine response process needs to include the following logic and actions in order:
[0094] A) Process possible serial port data;
[0095] B) Debounce the buttons, etc.
[0096] C) Execute the response function of the fingerprint state machine. The fingerprint state machine is directly bound to the relevant parameters of the main state machine, that is, the state of each main state machine fixedly responds to the response function of the same fingerprint state machine and shares the main state machine parameters. In the process, the main things include two: ① Process the events sent by the fingerprint recognition module and make corresponding responses; ② Operate the fingerprint and interact according to the events of the fingerprint recognition module;
[0097] D) Execute the response function of the main state machine. In order to simplify the writing of some state machines, the API of the hardware operation of the state machine response program should be isolated from the API of the driver layer. After the response function of the state machine is completed, the API of the driver layer is called according to the response result of the state machine;
[0098] E) Execute the response function of the sub-state machine. This item is determined during formal programming whether it is used. The role of the sub-state machine is to provide certain assistance to the state machine. It can be used flexibly in each state process, such as using the sub-state machine to cooperate with the flag bit to delay for a period of time;
[0099] F) Response to audio and visual prompts. The driver layer API is called here, and the response action of the state machine must be maintained within several milliseconds to improve the user experience.
[0100] (2) Overall design of main state machine response
[0101] Each state machine response function handles the following logic (in order):
[0102] A) The sound and light prompts that should be present within a certain period of time after entering this state;
[0103] B) The default sound and light prompts in this state;
[0104] C) Implement interaction with the user, including responding to user buttons, updating the status of sound and light prompts, and controlling other system hardware (such as motors, low-power actions, etc.) through the driver layer API;
[0105] D) Make possible state transitions and enter the next state.
[0106] 3. System low power consumption optimization method
[0107] This embodiment also provides a low power consumption optimization method for the above-mentioned master-slave modular smart lock control system, including dynamic power consumption optimization and static power consumption optimization.
[0108] CMOS is a circuit technology, the full name is "Complementary Metal-Oxide-Semiconductor", which is one of the most commonly used manufacturing technologies in modern integrated circuits. It has low power consumption, high integration and good anti-noise characteristics, so it is widely used in low-power embedded systems. The power consumption of CMOS includes the following: static leakage power consumption P Static , internal short circuit power consumption P Internal and dynamic power consumption P Dynamic , P CMOS It is expressed by formula (1):
[0109] P CMOS =P Dynamic +P Static +P Internal (1)
[0110] The internal short-circuit power consumption is determined at the beginning of the integrated IC design and is generally negligible. Therefore, the power consumption analysis and optimization of the control system of the present invention mainly starts from the dynamic power consumption and static power consumption.
[0111] Dynamic power consumption is the power consumed when the device is running or when the signal changes. Assume that α is the flip factor, N is the number of transistors, C is the load equivalent capacitance, V DD is the power supply voltage, and f is the operating frequency. Dynamic power consumption P Dynamic The simplified formula of is expressed by formula (2):
[0112]
[0113] Static power consumption is the power consumed when the device is powered on but the signal does not change, that is, the power consumed when all modules of the system are in sleep state. Static The simplified formula of is expressed by formula (3):
[0114] P Static =V DD ×I Sleep (3)
[0115] The dynamic power consumption optimization of the smart lock control system of the present invention mainly considers the power supply V in formula (2) DD , and the operating frequency f. Under the premise of ensuring stable system operation and meeting the computing power required by the system, the system operating frequency f is reduced, and power gating is designed to shut down modules that have no functional requirements. The optimization of system static power consumption requires reducing module leakage current.
[0116] This embodiment takes a smart lock control system composed of a main control module, a touch keyboard module, and a fingerprint recognition module as an example to illustrate the low power consumption optimization processing method.
[0117] 3.1 Dynamic Power Optimization
[0118] (1) Add a MOS switch circuit to the main control module circuit, and use the main control MCU to control some circuits to be shut down in time when there is no functional requirement (for example: power detection, motor drive detection, sound and light prompt module, fingerprint recognition module of fingerprint recognition module, etc.).
[0119] (2) Design the on-chip switching program of the main MCU and the on-chip switching program of the slave functional module in the driver layer program. When the on-chip peripherals of the main MCU have no functional requirements, they are shut down in time; when the on-chip peripheral functions are needed again, the driver layer program is notified to turn them on again through external interrupts or signal source detection (for example: when the touch keyboard module is in idle state, the I2C function in the main MCU is disabled, and the I2C function of the module IC is disabled through GPIO).
[0120] (3) Design the clock management program of the main control MCU in the driver layer. Increase the clock frequency in time when there are a large number of computing business needs or high-frequency signal source detection. Select the 2MHz operating mode when the system is idle, and use the STM32CubeMX software to calculate the main control MCU at V DD = As low as 115uA / MHZ in the range of 1.8V-3.6V (typical value), and the overall operating current is 245uA.
[0121] (4) The pull-up and pull-down resistors in the system circuit should use the GPIO pull-up and pull-down resistors in the main control MCU as much as possible to facilitate control and reduce power consumption.
[0122] (5) By adjusting the R connected to RBIAS in the internal bias adjustment circuit of the touch keyboard module B and the internal I2C clock adjustment circuit R IB To reduce the dynamic power consumption of the touch keyboard module, such as Figure 3 As shown, the adjusted value can be confirmed by actual system circuit testing.
[0123] (6) The sound and light prompt circuit uses white light LED as the key backlight source, and adopts white PCB board and convex lens focusing principle (glue dispensing) and other means to reduce the current limiting resistor and power consumption while ensuring the brightness.
[0124] 3.2 Static Power Consumption Optimization
[0125] The system circuits all use MOS tube switch circuits as the power supply control of the modules. The control system of the present invention has a quiescent current I Sleep The leakage current N×I between the drain and source of N MOS tubes in the off state DDS , Touch keyboard module IC standby current I TKS , Fingerprint recognition module standby current I FPS , Motor driver chip static current I MotorS , the power conversion chip static current I LDOS 、The current consumption of the main MCU in low power mode I MCUSleep These six parts are represented by formula (4):
[0126] I Sleep =N×I DDS +I TKS +I FPS +I MotorS +I LDOS +I MCUSleep (4)
[0127] (1) For I DDS , I MotorS , I LDOS Optimization: When selecting hardware, select ultra-low power consumption components under the premise of meeting the system electrical parameters. Example: The I DDS =1uA (maximum), and the present invention selects TI's FemtoFET TM MOSFET I DDS =50nA (maximum value).
[0128] (2) For I TKSOptimization: By adjusting Figure 3 The R connected to SRBIAS in the internal bias adjustment circuit in the touch keyboard module frame diagram SB The current consumption in IDLE mode can be adjusted by adjusting the resistance value, but the corresponding response time will also change accordingly. It is necessary to confirm the adjusted value through actual system circuit testing while ensuring user experience.
[0129] (3) For I MCUSleep Optimization: Select a suitable sleep mode combination according to system requirements. The control system of the present invention needs to keep RAM active, the real-time clock RTC heartbeat and the IWDG watchdog function in the sleep state, so the stop mode (STOPO mode) with RTC is selected. The STM32CubeMX software is used to calculate I MCUSleep =880nA.
[0130] (4) For I FPS Optimization: The standby current of the fingerprint recognition module is the touch wake-up module of the module is integrated in the module sensor. Since the module is a whole, it cannot be changed temporarily. The present invention proposes a new optimization scheme: 1) Use time-sharing detection + MOS switch circuit to reduce the working time of the touch wake-up module and reduce power consumption. 2) Link with the touch keyboard module and abandon the touch wake-up module of the fingerprint recognition module.
[0131] 4. Specific examples and test results analysis
[0132] 4.1 Control System Example
[0133] This embodiment takes a smart lock control system composed of a main control module, a touch keyboard module, and a fingerprint recognition module as an example to design a low-power embedded control system for a smart lock.
[0134] The main control module mainly includes: a low-power processor, a power management circuit, a power detection circuit, a module detection and power control circuit, a sound prompt circuit (i.e., a sound and light prompt circuit), and a motor drive circuit.
[0135] The minimum system circuit of a low-power processor is Figure 4 As shown, the STM32L0 series 32-bit ultra-low power processor STM32L031K6T6 of STMicroelectronics is used as the control core.
[0136] Power management circuits such as Figure 5 As shown, the power management circuit is designed with the ME6214A33PG chip of Weimeng Electronics, and a 9V multilayer battery is selected for power supply, with an output voltage of 3.3 to supply each functional module.
[0137] The power detection circuit is as follows Figure 6As shown, the detection circuit is turned on and off by controlling the conduction and cutoff of the Q5 MOS tube through the PB2 pin of the processor, and the power detection is performed through the ADC voltage sampling of the PB1 pin.
[0138] Module detection and power control circuit such as Figure 7 As shown in the figure, the module detection is mainly carried out through the information sending and replying of the serial communication port. For example, the UART communication port of the PA2 and PA3 pins is connected with the fingerprint recognition model, and the existence of the module is detected by sending instructions, and then the conduction and cutoff of the Q6 MOS tube are controlled by the PB5 pin to realize the opening and closing of the power supply of the fingerprint module.
[0139] Sound prompt circuit such as Figure 8 As shown, a pulse signal of different frequencies is generated on the PA6 pin through a timer to control the on and off of the Q3 MOS tube to generate different prompt sounds.
[0140] Motor drive circuit such as Fig. 9 As shown, the DVR8837 motor current driver chip is used to control the forward and reverse rotation of the DC motor in the clutch of the smart lock to realize the opening and closing of the unlocking clutch.
[0141] The touch keyboard module in the slave module mainly includes: touch key circuit and key light display circuit. The touch key circuit is as follows: Fig.10 As shown in the figure, the touch key circuit of the system is designed using the ADS TSM12 chip. The processor exchanges data with ADS TSM12 through the IIC bus of PA11 and PA12. There are 11 keys in total, which are numeric keys: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and a function key "E".
[0142] Button light display circuit Fig.11 As shown, the display light of the function key "E" controls the red light and the blue light through PA0 and PA1 to match the colors, and can display three states of "red", "yellow" and "green". The display of the 10 numeric keys is controlled by PA4, and the normal display is "white".
[0143] The circuit diagram of the fingerprint recognition module is as follows Fig.12 As shown, the fingerprint recognition circuit of the system is designed using the SF5622A fingerprint recognition chip, and the processor interacts with the SF5622A through the UART interface.
[0144] The designed smart lock control system is as follows Fig.13 As shown, it consists of two PCB circuit boards, the upper PCB board is the touch button circuit board, and other circuit components are placed on the back of the lower PCB board. The fingerprint recognition head is fixed on the lower panel, and the touch panel is made of acrylic material. The touch panel is bonded to the upper PCB board.
[0145] 4.2 Control system power consumption test process
[0146] Electronic smart locks are powered by dry batteries, which have limited capacity. Appropriate measures should be taken to optimize power consumption and improve battery life. Testing power consumption can help us understand the power consumption of the lock in different states, such as standby, unlocked, and awake. This information is very important for optimizing the performance of the lock and improving the user experience.
[0147] In this embodiment, 6 sample locks are prepared and divided into two groups for comparison and two test processes. Group A has 3 sample locks (power consumption optimization has been performed), and Group B has 3 sample locks (power consumption optimization has not been performed). Group A and Group B are marked as A / B1~3 locks respectively. Each group is tested 7 times for each process, and the entire test process is monitored by connecting a low-power current tester. Test environment temperature: room temperature 26°C. Test tools: high-precision low-power current tester + visual current test software.
[0148] (1) Test process TS1: Unlock with fingerprint. A1 lock is unlocked 10 times within half an hour of testing, A2 lock is unlocked 15 times, and A3 lock is unlocked 20 times. Each unlocking needs to wake up from low power mode, and it is necessary to wait for the lock to enter low power mode after unlocking. Then A1, A2, and A3 are monitored for half an hour of low power current (monitoring the battery main circuit output current, i.e., battery discharge current). The test process of Group B is the same as that of Group A, and records are kept.
[0149] (2) Test procedure TS2: Unlock by key password. The test procedure is the same as TS1.
[0150] (3) Test process TS3: Group A conducts a systematic functional test on Group B to test the sensitivity of the sample locks of Group A and Group B under the same functional operations (for example, "add", "delete", "change", "check" and "reset" passwords and fingerprints), as well as the user experience.
[0151] Assume that the power consumption of the switch lock for half an hour is C Dynamic , the power consumption in low power mode for half an hour is C Sleep 24-hour smart lock power consumption C LD It can be expressed by formula (5).
[0152] C LD =C Dynamic +(47*C Sleep ) (5)
[0153] Assume the battery capacity is C Battery , comprehensive battery efficiency coefficient η. The battery life T (days) can be expressed by formula (6):
[0154] T=ηC Battery / C LD (6)
[0155] 4.3 System power consumption test results and analysis
[0156] During the test of the three sample locks in group A (power consumption optimization has been performed), a high-precision low-power current tester + visual current test software was used to test the current consumption of power-on initialization, sleep state, password unlocking, and fingerprint unlocking. The current curves of the test results are as follows: Figure 14-17 As shown, the horizontal axis represents the operating time and the vertical axis represents the current consumed.
[0157] The three sample locks in group A (power consumption optimization has been performed) and the three sample locks in group B (power consumption optimization has not been performed) were tested using test processes TS1 and TS2 respectively. The test results are shown in Table 1-4:
[0158] Table 1 TS1 process group A power consumption statistics
[0159]
[0160] Table 2 TS1 process group B power consumption statistics
[0161]
[0162] Table 3 TS2 process group A power consumption statistics
[0163]
[0164] Table 4 TS2 process group B power consumption statistics
[0165]
[0166] Table 5: 9V laminated battery types and parameters
[0167]
[0168]
[0169] The control system of the present invention is designed to be compact and the lock body space is limited, so it uses a 9V laminated battery for power supply. Based on the typical capacity of the common 9V alkaline zinc-manganese battery on the market in Table 5, combined with the use environment and the battery self-discharge rate, DC motor, circuit and other parameter fluctuations, and the system of the present invention is a small current intermittent discharge (the actual discharge amount of the battery will be greater than the typical capacity value) and other factors, the comprehensive battery efficiency coefficient η = 90%. The battery life of the sample lock of group A is calculated by formula (6) according to test process TS1 and test process TS2 to obtain Table 6.
[0170] Table 6 Battery life statistics
[0171]
[0172] The results of the systematic functional test of test process TS3 show that the smart lock with power consumption optimization can run stably and efficiently, and the user experience is no different from that of the unoptimized smart lock. According to the power consumption comparison of Table 1 and Table 2 monitored in test process TS1, the power consumption comparison of Table 3 and Table 4 monitored in test process TS2, and the data of the battery life statistics table in Table 6, it is shown that after the power consumption of the control system of the present invention is optimized, the system power consumption is greatly reduced, which can greatly extend the battery life.
[0173] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A master-slave modular intelligent lock control system, characterized in that: The system comprises a main control module and a plurality of slave function modules. The main control module comprises a low-power main control MCU, a power management circuit, a power detection circuit, a module detection and power control circuit, an audio-visual prompt circuit, a motor drive circuit, a download and debug interface, a control key circuit and a FLASH storage module. The slave function modules comprise a matrix keyboard module, an RFID module, a touch keyboard module, a display module, a wireless communication module, a voice module, a face recognition module, a fingerprint recognition module and a human motion detection module. The slave function modules can be freely selected and combined and connected with the main control module to form a one-master-multiple-slave modular system in different combinations.
2. A master-slave modularized smart lock control system according to claim 1, characterized in that: The main control module is connected to each slave functional module through a variety of connection modes including I / O interface, IIC bus, SPI bus, UART bus, and DAC interface.
3. A master-slave modularized smart lock control system according to claim 1, characterized in that: The main control module automatically identifies the selected slave function modules through the module detection and power control circuit, and controls the power supply of each slave function module through the switch circuit composed of MOSFET transistors.
4. A master-slave modularized smart lock control system according to claim 1, characterized in that: The software program of the smart lock control system consists of three levels, including the HAL library, the driver layer and the application layer; the HAL library encapsulates the underlying code of the main control MCU to simplify the development process; the driver layer encapsulates hardware-related functions and provides relevant API interfaces for the application layer to use; the application layer implements the relevant logic of the smart lock.
5. A master-slave modularized smart lock control system according to claim 4, characterized in that: The driver layer includes a touch panel driver based on I2C communication, an audio-visual prompt circuit driver, a fingerprint recognition module driver based on UART communication, a motor switch lock driver, a PC interaction driver based on UART communication, a main control MCU operation mode conversion driver, and a data storage driver; the driver layer encapsulates the hardware module functions and uses interrupt control and DMA control drivers to reduce CPU occupancy as much as possible; the driver layer provides an API function interface and an API function description, and the application layer can completely ignore the hardware layer and only focus on the API function functions, output parameters, and output parameters.
6. A master-slave modularized smart lock control system according to claim 4, characterized in that: The application layer consists of three parts, including data storage and reading in storage, and two state machines in mach, including the main state machine and the fingerprint module driver state machine; The storage implements data storage of the system, including relevant parameters of factory settings, relevant parameters of system operation, and passwords of administrators and users; makes judgments on parameters when interacting with users; and records and processes the relative relationship between data; The main state machine of the mach implements all functions of the smart lock and the user interaction part; realizes the relevant process of the generation test of the smart lock; And interact with the PC through the serial port; The fingerprint module of the mach drives the state machine, which mainly realizes the functions related to the interaction between the smart lock and the user through fingerprints.
7. A master-slave modularized smart lock control system according to claim 6, characterized in that: The main state machine is implemented as follows: The current state of the state machine is defined by two parameters, where __curr_func is used to represent the response processing function of the current state, and __curr_param is used to represent additional parameters. The state machine is run by frequently calling __curr_func. All response processing functions have three parameters: 1) work_time, which represents the duration of the state, is used to synchronize the actions in each state and is cleared every time the state switches; 2) key, current key status, including no key pressed, 0 to 9, EMTEK key and multi-key status; 3) param, additional parameters, directly pass in __curr_param to ensure the parameters designed for compatibility; The process of each state machine response includes the following logic and actions: A) Process possible serial port data; B) Debounce the buttons, etc. C) Execute the response function of the fingerprint state machine. The fingerprint state machine is directly bound to the relevant parameters of the main state machine, that is, the state of each main state machine fixedly responds to the response function of the same fingerprint state machine and shares the main state machine parameters. In the process, it mainly includes: ① processing the events sent by the fingerprint recognition module and making corresponding responses; ② operating the fingerprint and interacting according to the events of the fingerprint recognition module; D) Execute the response function of the main state machine. The state machine response program isolates the API of the hardware operation from the API of the driver layer. After the response function of the state machine is finished, the API of the driver layer is called according to the response result of the state machine. E) Execute the response function of the sub-state machine. This item is determined during formal programming to determine whether it is used. The role of the sub-state machine is to provide certain assistance to the state machine; F) Response to the sound and light prompt, where the driver layer API is called and the response action of the state machine is maintained within several milliseconds; Each state machine response function handles the following logic: A) The sound and light prompts that appear after entering this state for a certain period of time; B) The default sound and light prompts in this state; C) Implement interaction with the user, including responding to user buttons, updating the status of sound and light prompts, and controlling other hardware of the system through the driver layer API; D) Make possible state transition and enter the next state.
8. A low power consumption optimization method for a master-slave modularized smart lock control system according to any one of claims 1 to 7, characterized in that: It includes dynamic power consumption optimization and static power consumption optimization; the implementation method of the dynamic power consumption optimization is: (1) Add a MOS switch circuit to the main control module circuit, and use the main control MCU to control the partial circuit to be shut down in time when there is no functional demand; (2) Design the on-chip switch program of the main MCU and the on-chip switch program of the slave functional module in the driver layer, and shut down the on-chip switch program of the main MCU when there is no functional demand for the on-chip switch of the main MCU; When the chip peripheral function is needed again, the driver layer program is notified to start again through external interrupt or signal source detection; (3) Design the clock management program of the main control MCU at the driver layer; Increase the clock frequency in time when there are a lot of computing business needs or high-frequency signal source detection; select the 2MHz operation mode when the system is idle; (4) The pull-up and pull-down resistors in the system circuit use the GPIO pull-up and pull-down resistors in the main MCU to control and reduce power consumption; (5) By adjusting the R connected to RBIAS in the internal bias adjustment circuit of the touch keyboard module B and the internal I2C clock adjustment circuit R IB To reduce the dynamic power consumption of the touch keyboard module; (6) The sound and light prompt circuit uses white LED as the key backlight source, adopts white PCB board and convex lens focusing principle, reduces the current limiting resistor and power consumption while ensuring brightness; The implementation method of the static power consumption optimization is: The system circuit uses MOS tube switch circuit as the power control of the module. The static current I Sleep The leakage current N×I between the drain and source of N MOS tubes in the off state DDS , Touch keyboard module IC standby current I TKS , Fingerprint recognition module standby current I FPS , Motor driver chip static current I MotorS , the power conversion chip static current I LDOS 、The current consumption of the main MCU in low power mode I MCUSleep These 6 parts are represented by the following formula: I Sleep =N×I DDS +I TKS +I FPS +I MotorS +I LDOS +I MCUSleep (1) For I DDS , I MotorS , I LDOS Optimization: When selecting hardware, choose ultra-low power consumption components while meeting the system electrical parameters; (2) For I TKS Optimization: By adjusting the internal bias adjustment circuit in the touch keyboard module, R connected to SRBIAS SB The resistor value is used to adjust the current consumption in IDLE mode; (3) For I MCUSleep Optimization: Select the appropriate sleep mode combination according to system requirements, and select the stop mode with RTC (STOPO mode); (4) For I FPS Optimization: Use time-sharing detection + MOS switch circuit to reduce the working time of the touch wake-up module and reduce power consumption; link with the touch keyboard module and abandon the touch wake-up module of the fingerprint recognition module.
