Electric quantity detection method of intelligent lock and intelligent lock
By continuously sampling the power supply voltage signal in the sleep state of the smart lock, filtering the maximum and minimum power values, determining the power status, and calculating the average power value, the problem of low accuracy of smart lock power detection is solved and more reliable power monitoring is achieved.
Patent Information
- Application Number
- CN202410673380.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-06
AI Technical Summary
During the power detection of the smart lock, due to the influence of power consumption of other modules, the accuracy of power monitoring is reduced, and the battery cannot be replaced in time, affecting the normal use of the device.
When the smart lock enters the sleep state, it continuously samples the power supply voltage detection signal, filters the maximum and minimum power sampling values, determines the power state, and calculates the average power value in the normal state to improve the accuracy of power detection.
Through this method, the accuracy of smart lock power detection is improved, the reliability of power monitoring is ensured, and the problem of untimely battery replacement caused by misjudgment is avoided.
Smart Images

Figure CN118604642A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power detection of smart locks, and specifically to a power detection method for smart locks and a smart lock. Background Art
[0002] Household appliances, such as smart locks, usually need to monitor the power of household appliances so as to replace the power supply of household appliances in time to avoid the household appliances from being unable to be used normally. When monitoring the power of household appliances, it is usually necessary to use a power detection circuit for monitoring. In the related art, because other modules of the smart lock also need to use electricity, when other modules of the smart lock use electricity, it will affect the power supply, causing the monitoring of the power supply power to fluctuate, affecting the accuracy of the power supply power obtained by the power detection circuit. Summary of the invention
[0003] The purpose of this application is to overcome the shortcomings and deficiencies in the prior art and to provide a method for detecting power of a smart lock and a smart lock, which can improve the accuracy of power detection.
[0004] A first aspect of an embodiment of the present application provides a method for detecting power of a smart lock, wherein the smart lock comprises a power detection circuit connected to a main controller and a smart lock power supply respectively;
[0005] The method comprises:
[0006] Determine the current status of the smart lock;
[0007] When the current state of the smart lock is a dormant state, receiving a power supply voltage detection signal;
[0008] Continuously sampling the received power supply voltage detection signal to obtain multiple power sampling values;
[0009] Filtering a maximum power sampling value and a minimum power sampling value from multiple power sampling values, and determining a current state of a power source according to the maximum power sampling value and the minimum power sampling value;
[0010] If the current power supply status is normal, the average power value is calculated based on multiple power sampling values as the current power of the smart lock.
[0011] A second aspect of the embodiment of the present application provides a smart lock, characterized in that it includes a power supply, a main controller and a power detection circuit; the power detection circuit includes a control end, an input end and an output end;
[0012] The output end of the power supply is connected to the input end of the power detection circuit, and is used to output a power supply voltage signal to the input end of the power detection circuit;
[0013] The output end and the control end of the power detection circuit are respectively connected to the main controller, and are used to transmit the power supply voltage detection signal to the main controller under the control of the main controller;
[0014] The main controller is used to execute the power detection method of the smart lock as described above.
[0015] Compared with the related art, the present application obtains a power detection control signal when the smart lock enters a sleep state, continuously samples the received power supply voltage detection signal, obtains multiple power sampling values, and then determines the current state of the power supply based on the maximum power sampling value and the minimum power sampling value. When the current state of the power supply is normal, the power average value can be calculated based on multiple power sampling values as the current power of the smart lock, thereby improving the accuracy of power detection.
[0016] In order to provide a clearer understanding of the present application, the specific implementation of the present application will be described below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flow chart of a method for detecting power of a smart lock according to an embodiment of the present application.
[0018] Figure 2 This is a schematic diagram of the module connection of a smart lock according to an embodiment of the present application.
[0019] Figure 3 A schematic diagram of a power detection circuit for a smart lock according to an embodiment of the present application.
[0020] Figure 4 This is a circuit diagram of a power detection circuit for a smart lock according to an embodiment of the present application.
[0021] 10. Smart lock; 11. Power supply; 12. Main controller; 13. Power detection circuit; 100. Power detection circuit; 101. Power supply voltage detection module; 103. Power supply voltage detection module; 105. Filter module. DETAILED DESCRIPTION
[0022] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0023] It should be clear that the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
[0024] When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. The singular forms of "a", "said" and "the" used in the present application and the appended claims are also intended to include the majority form, unless the context clearly indicates other meanings. The words "if" / "if" used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0025] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0026] See also Figure 1 , which is a flow chart of a power detection method of a smart lock according to an embodiment of the present application, and is applied to a smart lock, wherein the smart lock includes a power detection circuit connected to a main controller and a smart lock power supply, respectively. The power detection circuit is connected to the smart lock power supply, and is used to detect the power of the smart lock power supply.
[0027] The method comprises:
[0028] S1: Determine the current state of the smart lock.
[0029] Among them, the current state of the smart lock refers to the state of the main controller, including the sleep state and the wake-up state. When the current state of the smart lock is the sleep state, it can be understood that the main controller only connects a few circuit modules to the power supply, and disconnects the majority of circuit modules from the power supply. For example, the power detection circuit is connected to the power supply, and the display module, the unlocking information detection module (one or more of the fingerprint recognition module, the face recognition module, and the password input module) and other circuit modules are disconnected from the power supply. When the smart lock enters the sleep state, since there are fewer modules connected to the power supply, the impact on the power supply of the smart lock is small, and the power fluctuation caused by the power supply when the power supply is sampled can also be reduced.
[0030] When the current state of the smart lock is the awake state, it can be understood that the main controller has connected most or all circuit modules to the power supply, such as the display module, the unlocking information detection module (one or more of the fingerprint recognition module, the face recognition module, the password input module) and other circuit modules to the power supply.
[0031] The main controller may be a single chip microcomputer.
[0032] S2: When the current state of the smart lock is the sleep state, receiving the power supply voltage detection signal.
[0033] The power supply voltage detection signal refers to the electrical signal to be sampled that is output by the power supply to the main controller. By sampling the power supply voltage detection signal, data for determining the power supply state and / or power supply quantity can be obtained.
[0034] S3: Continuously sample the received power supply voltage detection signal to obtain multiple power sampling values.
[0035] The main controller can continuously collect the power supply voltage detection signal at a preset sampling frequency to obtain multiple power sampling values. Therefore, the number of power sampling values is proportional to the sampling frequency and the signal duration of the power supply voltage detection signal.
[0036] S4: Determine the current state of the power supply according to the maximum power sampling value and the minimum power sampling value.
[0037] The maximum power value is the largest power sampling value among multiple power sampling values, and the minimum power value is the smallest power sampling value among multiple power sampling values.
[0038] The step S4: determining the current state of the power supply according to the maximum power sampling value and the minimum power sampling value, comprises:
[0039] S41: Acquire the power difference between the maximum power value and the minimum power value.
[0040] The power difference is the difference between the maximum power value and the minimum power value, specifically: power difference = maximum power value - minimum power value.
[0041] S42: Compare the power difference with a preset power difference threshold. If the power difference is greater than the power difference threshold, determine that the current state of the power supply is an abnormal state; if the power difference is less than or equal to the power difference threshold, determine that the current state of the power supply is a normal state.
[0042] Among them, when the power difference is greater than the power difference threshold, it means that the power difference amplitude of multiple power sampling values is too large, and the current state of the power supply is abnormal; when the power difference is less than or equal to the power difference threshold, it means that the power difference amplitude of multiple power sampling values is small, and the current state of the power supply is normal.
[0043] S5: If the current power state is normal, the average power value is calculated based on multiple power sampling values as the current power of the smart lock.
[0044] When the power state is normal, the average value of power with high accuracy can be obtained by average calculation. That is, step S5: if the current power state is normal, the average value of power is calculated based on multiple power sampling values as the current power of the smart lock, which may include:
[0045] From the preset number of power sampling values, an average value of the power sampling values excluding the maximum power value and the minimum power value is determined as the power mean value.
[0046] Specifically, when calculating the average power value, excluding the maximum power value and the minimum power value can prevent the maximum power value and the minimum power value from being generated occasionally and affecting the accuracy of the average power value calculation.
[0047] S6: If the current state of the power supply is an abnormal state, and the number of consecutive abnormal states is greater than or equal to a preset abnormal state number threshold, report a power supply abnormality reminder to the cloud platform.
[0048] Wherein, step S6 further includes: if the current state of the power supply is an abnormal state, and the number of consecutive abnormal states is less than the abnormal state number threshold, obtaining the next state of the power supply.
[0049] Among them, obtaining the next state of the power supply refers to determining the power supply state based on multiple power sampling values obtained by new sampling, for example, determining the power supply state based on the maximum power sampling value and the minimum power sampling value among the multiple power sampling values obtained by new sampling. For ease of understanding, the multiple power sampling values corresponding to the current state of the power supply can be determined as the power sampling values of the current sampling cycle, and the new multiple power sampling values corresponding to the next state of the power supply can be determined as the power sampling values of the next sampling cycle.
[0050] When the number of consecutive abnormal states is less than the abnormal state number threshold, it can prevent power supply abnormality reminders caused by accidental events that cause the power supply state to be in a small number of consecutive abnormal states, thereby improving the credibility of the source abnormality reminder; and by inputting the detection switch signal into the power detection circuit multiple times to obtain the next state of the power supply, it can be helpful to accurately detect whether the power supply is abnormal in combination with the next state of the power supply.
[0051] Therefore, in step S6, when the power supply status is abnormal, it is necessary to consider the number of consecutive abnormal statuses to decide whether to report the power supply abnormality reminder, which can improve the credibility of the power supply abnormality reminder.
[0052] Compared with the related art, the present application obtains a power detection control signal when the smart lock enters a sleep state, continuously samples the received power supply voltage detection signal, obtains multiple power sampling values, and then determines the current state of the power supply according to the maximum power sampling value and the minimum power sampling value. When the current state of the power supply is normal, the power average value can be calculated based on multiple power sampling values as the current power of the smart lock, thereby improving the accuracy of power detection; and when the current state of the power supply is abnormal, and the number of consecutive abnormal states is greater than or equal to the preset abnormal state number threshold, a power abnormality reminder can be reported to the cloud platform to remind the user to pay attention to the power supply of the smart lock.
[0053] In a feasible embodiment, the step S3: continuously sampling the received power supply voltage detection signal to obtain a plurality of power sampling values includes:
[0054] S31: randomly obtaining a target sampling frequency from a preset sampling frequency set.
[0055] The sampling frequency set includes multiple elements, each of which is a different sampling frequency. Since the number of power sampling values collected is affected by the sampling frequency and the detection duration, each element of the sampling frequency set can represent the number of power sampling values that can be collected when the detection duration is the rated duration, such as [18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30], etc. It can also be a frequency set of positive integers set by the manufacturer or user of the smart lock. The units of each element in the sampling frequency set are the same, and the units of the sampling frequency set elements can be a sampling frequency of one second or a sampling frequency of a rated duration. Optionally, the minimum threshold of the sampling frequency set can also be set to ensure that the value of the randomly acquired element is greater than the minimum threshold of the set. For example, the minimum threshold of the set can be set to a positive integer such as 9 or 10.
[0056] S32: Continuously collect the received power supply voltage detection signal according to the target sampling frequency to obtain multiple power sampling values of the smart lock power supply.
[0057] In this embodiment, the target sampling frequency can be randomly obtained from a preset sampling frequency set to obtain the power status and power level according to different numbers of power sampling values, thereby improving the randomness of the power status judgment and power level detection, reducing the error caused by regular sampling, and increasing the accuracy of the power status judgment and power level detection.
[0058] In a feasible embodiment, the step S31: randomly acquiring a target sampling frequency from a preset sampling frequency set includes:
[0059] S311: If the last power state is an abnormal state, obtain the number of abnormal states between the last power state that is a normal state and the last power state that is a normal state.
[0060] Among them, the previous power state refers to the previous power state determined according to a preset number of power sampling values; the number of abnormal state intervals refers to the number of abnormal power states between the previous power state and the previous normal power state. For example, the previous normal power state is the 10th power state (serial number 10, that is, the 10th power state), the previous abnormal power state is the 12th power state (serial number 12, that is, the 11th power state and the 12th power state are abnormal states), and the current power state is the 13th power state. At this time, the number of abnormal state intervals includes the 11th and 12th power states, that is, the number of abnormal state intervals = 12 (serial number of the previous abnormal power state) - 10 (serial number of the previous normal power state) = 2.
[0061] S312: Obtain a temporary frequency set from the sampling frequency set according to the number of intervals between the abnormal states.
[0062] Wherein, step S312: the step of obtaining a temporary frequency set from the sampling frequency set according to the number of intervals between the abnormal states comprises:
[0063] S3121: Divide the number of abnormal state intervals by the abnormal state quantity threshold to obtain an element exclusion coefficient.
[0064] Take the abnormal state interval in the above example as an example:
[0065] If the preset abnormal state quantity threshold is 3, the element exclusion coefficient = 2 (the number of abnormal states) ÷ 3 (the abnormal state quantity threshold) = 2 / 3.
[0066] If the preset abnormal state quantity threshold is 5, the element exclusion coefficient = 2 (the number of abnormal states) ÷ 5 (the abnormal state quantity threshold) = 2 / 5.
[0067] S3122: Obtain the element exclusion quantity according to the element exclusion coefficient and the number of elements in the sampling frequency set.
[0068] Among them, the number of excluded elements is the product of the element exclusion coefficient and the number of elements in the sampling frequency set. For example, the element exclusion coefficient is 1 / 3, the number of elements in the sampling frequency set is 30, and the number of excluded elements = (2 / 3)*30 = 20 (elements); the element exclusion coefficient is 1 / 5, the number of elements in the sampling frequency set is 30, and the number of excluded elements = (2 / 5)*30 = 6 (elements).
[0069] S3123: Eliminate the elements of the sampling frequency set from small to large according to the element exclusion number, and obtain the temporary frequency set according to the remaining elements.
[0070] That is, in the sampling frequency set, the smallest elements are excluded first until the number of excluded elements reaches the element exclusion number. It can also be understood that the smaller elements in the sampling frequency set are excluded according to the element exclusion coefficient to retain the larger elements to form a temporary frequency set. Therefore, the elements of the temporary frequency set are all smaller than the elements in the sampling frequency set.
[0071] For example, the sampling frequency set has 30 elements and the number of excluded elements is 10, that is, the 10 smaller elements of the sampling frequency set are excluded, and only the larger 20 elements are retained to form a temporary frequency set; the sampling frequency set has 30 elements and the number of excluded elements is 3, that is, the 3 smaller elements of the sampling frequency set are excluded, and only the larger 27 elements are retained to form a temporary frequency set.
[0072] S313: Randomly obtain a target sampling frequency from the temporary frequency set.
[0073] For the temporary frequency set, a random sampling method may be used to randomly obtain the target sampling frequency, wherein the probability of each element of the temporary frequency set being extracted is the same.
[0074] In this embodiment, according to the number of consecutive abnormalities in the power status, the frequency value of the randomly acquired target sampling frequency is increased through a temporary frequency set, so that the probability of acquiring a target sampling frequency with a higher frequency can be increased, so as to collect more power sampling values, thereby improving the accuracy of acquiring the power status and power supply power.
[0075] In a feasible embodiment, the step S2: when the current state of the smart lock is a sleep state, receiving a power supply voltage detection signal includes:
[0076] S21: Randomly obtain a target detection duration from a preset detection duration set.
[0077] Among them, the detection duration set includes multiple elements, each element is a different detection duration, and since the number of power sampling values collected is affected by the sampling frequency and the detection duration, that is, each element of the detection duration set can represent the number of power sampling values that can be collected when the sampling frequency is the rated frequency, such as [5, 6, 7, 8, 9, 10, 11, 12, 13, 14], etc., or it can be a duration set of positive integers set by the manufacturer or user of the smart lock. Among them, the units of each element in the detection duration set are the same, and the units of the detection duration set elements can be seconds, minutes, etc. Optionally, the minimum threshold of the detection duration set can also be set to ensure that the value of the randomly acquired element is greater than the minimum threshold of the set. For example, the minimum threshold of the set can be set to a positive integer such as 2 or 3.
[0078] S22: receiving a power supply voltage detection signal according to the target detection duration.
[0079] Specifically, step S22 can be understood as that the signal duration of the power supply voltage detection signal is the same as the target detection duration, that is, the longer the target detection duration is, the longer the signal duration of the received power supply voltage detection signal is.
[0080] The step S3: continuously sampling the received power supply voltage detection signal to obtain a plurality of power sampling values comprises:
[0081] S301: Collect multiple power sampling values of the smart lock power supply according to the power supply voltage detection signal and a preset rated sampling frequency.
[0082] Since the rated sampling frequency is a rated value, the longer the signal duration of the power supply voltage detection signal is, the more power sampling values are collected.
[0083] In this embodiment, the target detection duration can be randomly obtained from a preset detection duration set to obtain the power status and power level according to different numbers of power sampling values, thereby improving the randomness of the power status judgment and power level detection, reducing the error caused by regular sampling, and increasing the accuracy of the power status judgment and power level detection.
[0084] In a feasible embodiment, the step S21: randomly obtaining a target detection duration from a preset detection duration set includes:
[0085] S211: If the last power state is an abnormal state, obtain the number of abnormal states between the last power state that is a normal state and the last power state that is a normal state.
[0086] Among them, the previous power state refers to the previous power state determined according to a preset number of power sampling values; the number of abnormal state intervals refers to the number of abnormal power states between the previous power state and the previous normal power state. For example, the previous normal power state is the 10th power state (serial number 10, that is, the 10th power state), the previous abnormal power state is the 12th power state (serial number 12, that is, the 11th power state and the 12th power state are abnormal states), and the current power state is the 13th power state. At this time, the number of abnormal state intervals includes the 11th and 12th power states, that is, the number of abnormal state intervals = 12 (serial number of the previous abnormal power state) - 10 (serial number of the previous normal power state) = 2.
[0087] S212: Obtain a temporary duration set from the detection duration set according to the number of intervals between the abnormal states.
[0088] Wherein, step S212: the step of obtaining a temporary duration set from the detection duration set according to the number of intervals between the abnormal states, comprises:
[0089] S2121: Divide the number of abnormal state intervals by the abnormal state quantity threshold to obtain an element exclusion coefficient.
[0090] Take the abnormal state interval in the above example as an example:
[0091] If the preset abnormal state quantity threshold is 3, the element exclusion coefficient = 2 (the number of abnormal states) ÷ 3 (the abnormal state quantity threshold) = 2 / 3.
[0092] If the preset abnormal state quantity threshold is 5, the element exclusion coefficient = 2 (the number of abnormal states) ÷ 5 (the abnormal state quantity threshold) = 2 / 5.
[0093] S2122: Obtain the number of element exclusions according to the element exclusion coefficient and the number of elements in the detection duration set.
[0094] Among them, the number of excluded elements is the product of the element exclusion coefficient and the number of elements in the detection duration set. For example, the element exclusion coefficient is 1 / 3, the number of elements in the detection duration set is 30, and the number of excluded elements = (2 / 3)*30 = 20 (elements); the element exclusion coefficient is 1 / 5, the number of elements in the detection duration set is 30, and the number of excluded elements = (2 / 5)*30 = 6 (elements).
[0095] S2123: Eliminate the elements of the detection duration set from small to large according to the element exclusion number, and obtain the temporary duration set according to the remaining elements.
[0096] That is, in the sampling frequency set, the smallest elements are excluded first until the number of excluded elements reaches the element exclusion number. It can also be understood that the smaller elements in the sampling frequency set are excluded according to the element exclusion coefficient to retain the larger elements to form a temporary frequency set. Therefore, the elements of the temporary frequency set are all smaller than the elements in the sampling frequency set.
[0097] For example, the sampling frequency set has 30 elements and the number of excluded elements is 10, that is, the 10 smaller elements of the sampling frequency set are excluded, and only the larger 20 elements are retained to form a temporary frequency set; the sampling frequency set has 30 elements and the number of excluded elements is 3, that is, the 3 smaller elements of the sampling frequency set are excluded, and only the larger 27 elements are retained to form a temporary frequency set.
[0098] S213: Randomly obtain a target detection duration from the temporary duration set.
[0099] In this embodiment, according to the number of consecutive anomalies in the power status, the duration value of the randomly acquired target detection duration is increased through a temporary duration set, so that the probability of obtaining a longer target detection duration can be increased, so as to collect more power sampling values, thereby improving the accuracy of obtaining the power status and power supply power.
[0100] See also Figure 2 The second embodiment of the present application provides a smart lock, including a power supply, a main controller and a power detection circuit; the power detection circuit includes a control end, an input end and an output end.
[0101] The output end of the power supply is connected to the input end of the power detection circuit, and is used to output a power supply voltage signal to the input end of the power detection circuit.
[0102] The output end and the control end of the power detection circuit are respectively connected to the main controller, and are used to transmit the power supply voltage detection signal to the main controller under the control of the main controller.
[0103] The main controller is used to execute the power detection method of the smart lock as described above.
[0104] See also Figure 3 The power detection circuit includes a switch module and a power supply voltage detection module; the power detection circuit includes a switch module and a power supply voltage detection module; wherein the switch module includes a switch drive end and a switch signal end; the power supply voltage detection module includes a sampling drive end, a sampling input end and a sampling output end.
[0105] like Figure 4As shown, the power detection circuit 100 includes: a switch module 101 and a power supply voltage detection module 103; wherein the switch module 101 includes a switch driving end and a switch signal end; the power supply voltage detection module 103 includes a driving end, an input end and an output end;
[0106] The input end of the power supply voltage detection module 103 is connected to the power supply for inputting a power supply voltage signal; the output end of the power supply voltage detection module 103 is connected to the main controller;
[0107] The switch driving end of the switch module 101 is used to receive a power detection control signal, and control the working state of the switch module 101 through the power detection control signal; the switch signal end of the switch module 101 is connected to the driving end of the power supply voltage detection module 103, and is used to drive the power supply voltage detection module 103 to output a power supply voltage detection signal to the main controller.
[0108] When the switch driving end of the switch module 101 receives a power detection control signal, the switch signal end of the switch module 101 outputs a conduction signal to the driving end of the power supply voltage detection module 103, the power supply voltage detection module 103 is turned on, and the power supply outputs a power supply voltage detection signal through the output end of the power supply voltage detection module 103.
[0109] The switch module 101 may be a switch tube that is turned on according to a power detection control signal, or may be a circuit module including a switch tube that is turned on according to a power detection control signal. The power detection control signal may be sent to the switch module 101 by a switch control circuit connected to a power source, and the switch control circuit refers to a circuit or chip connected to a power source that is turned on in response to the triggering of a function key.
[0110] The power supply voltage detection module 103 may be a switch tube that is turned on according to a conduction signal, or may be a circuit module including a switch tube that is turned on according to a conduction signal.
[0111] The switch tubes designed for the switch module 101 and the power supply voltage detection module 103 can be common electronic components such as triodes and MOS tubes that function as switches for switching between on and off states according to signals.
[0112] Compared with the prior art, the present invention includes a switch module 101 and a power supply voltage detection module 103. When the switch module 101 receives a power supply detection control signal, the power supply voltage detection module 103 is driven to be turned on to output a power supply voltage detection signal to the main controller, so that the main controller samples the power supply; when the switch module 101 does not receive a power supply detection control signal, the power supply voltage detection module 103 is driven to be turned off to stop the power supply voltage detection module 103 from working, so as to prevent the power supply voltage detection module 103 from consuming power due to working. The power supply voltage detection module 103 can be started when a power supply detection control signal is received, and can be turned off when no power supply detection control signal is received. There is no need to start the power supply voltage detection module 103 all the time, so as to achieve the technical effect of reducing the power consumption of the power supply detection circuit 100.
[0113] Wherein, the power supply voltage detection module includes a first switch tube, a first resistor and a voltage divider circuit;
[0114] The first switch tube includes a first driving end, a first signal end and a second signal end; the driving end of the first switch tube is connected to one end of the first resistor, the other end of the first resistor is the driving end of the power supply voltage detection module, the first signal end of the first switch tube is the input end of the power supply voltage detection module, the second signal end of the first switch tube is connected to the input end of the voltage divider circuit, and the output end of the voltage divider circuit is the output end of the power supply voltage detection module.
[0115] In this embodiment, a first resistor R6 can be used to provide a potential difference for the first switch tube Q1, so that the first switch tube Q1 is turned on when driven by the turned-on switch module, so that the power supply is connected to the voltage divider circuit through the first switch tube Q1, and the main controller samples the power of the power supply through the voltage divider circuit.
[0116] Among them, the voltage divider circuit includes a second resistor R9 and a third resistor R12, the second signal end of the first switch tube Q1 is grounded to the second resistor R9 and the third resistor R12 in sequence, and one end of the third resistor R12 connected to the second resistor R9 is the output end of the power supply voltage detection module 103.
[0117] In this embodiment, the second resistor R9 can be used for current limiting and the third resistor R12 can be used for voltage division to safely and accurately output a power supply voltage detection signal of the power supply, so that the main controller can sample the power of the power supply.
[0118] The device further includes a filter component 105 , which is connected in parallel to both ends of the third resistor R12 .
[0119] The filter component 105 is a filter capacitor C8, and the filter capacitor C8 is connected to both ends of the third resistor R12.
[0120] Specifically, the filter capacitor C8 can form an RC parallel filter circuit with the third resistor R12 to filter the output of the power supply to improve the accuracy of the acquired power supply voltage detection signal. In addition, since the filter component 105 is not directly connected to the power supply, but is connected to the power supply via the second resistor R9 and the first switch tube Q1, the filter component 105 only plays a filtering role when the first switch tube Q1 is turned on, and will not play a filtering role when the first switch tube Q1 is turned off to affect the power of the power supply.
[0121] In this embodiment, the accuracy of the acquired power supply voltage detection signal can be improved by using the filter capacitor C8 of the filter component 105 .
[0122] Wherein, the switch module 101 includes a second switch tube Q2 and a fourth resistor R8;
[0123] The second switch tube Q2 includes a second driving end, a third signal end and a fourth signal end; the second driving end of the second switch tube Q2 is the switch driving end of the switch module; the third signal end of the second switch tube Q2 is connected to the fourth resistor R8 and serves as the first switch signal end of the switch module 101; the fourth signal end of the second switch tube Q2 is the second switch signal end of the switch module.
[0124] When the driving end of the second switch tube Q2 receives the power detection control signal, the second switch tube Q2 is turned on, and the first signal end of the second switch tube Q2 is grounded via the second signal end of the second switch tube Q2, so that the driving end of the first switch tube Q1 is grounded via the first signal end of the second switch tube Q2. Therefore, the driving end of the first switch tube Q1 obtains a low-level signal, and the first switch tube Q1 is turned on.
[0125] Specifically, the second switch tube Q2 can adopt an NPN tube. When the user needs to perform power detection, he only needs to input a high-level power detection control signal into the second switch tube Q2 to turn on the second switch tube Q2. The driving end of the first switch tube Q1 will be grounded through the second switch tube Q2. At this time, the input level of the driving end of the first switch tube Q1 is a low level, that is, the turn-on signal provided by the second switch tube Q2 to the first switch tube Q1 is a low-level signal, thereby turning on the first switch tube Q1. Moreover, since the first switch tube Q1 is controlled by the second switch tube Q2, the power detection control signal input to the driving end of the second switch tube Q2 can adopt a voltage that is smaller than the power supply, thereby achieving the effect of small electricity controlling large electricity.
[0126] When the second switch tube Q2 is turned on, the fourth resistor R8 can prevent the driving end of the first switch tube Q1 from being directly grounded, thereby raising the voltage of the driving end of the first switch tube Q1 so that the first switch tube Q1 can be turned on smoothly.
[0127] In this embodiment, the driving end of the first switch tube Q1 is grounded via the fourth resistor R8 and the second switch tube Q2 through the second switch tube Q2, so that the switching state of the first switch tube Q1 can be safely controlled.
[0128] Among them, the switch module 101 also includes a fifth resistor R10 and a sixth resistor R14, and the second driving end of the second switch tube Q2 is connected to the fifth resistor R10 and the second resistor R16 before serving as the switch driving end of the switch module 101; the second driving end of the second switch tube Q2 is connected to one end of the sixth resistor R14, and the other end of the sixth resistor R14 is grounded.
[0129] The fifth resistor R10 is used to limit the current input to the driving end of the second switch tube Q2, and plays a current limiting role to protect the second switch tube Q2. The sixth resistor R14 can shunt the current to the ground, and plays a shunt role to protect the second switch tube.
[0130] In this embodiment, the current limiting function of the fifth resistor R10 and the current shunting function of the sixth resistor R14 can protect the power safety of the second switch tube Q2 from the two aspects of current limiting and current shunting.
[0131] It should be noted that when the smart lock 10 provided in the second embodiment of the present application executes the power detection method of the smart lock, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the smart lock 10 provided in the second embodiment of the present application and the power detection method of the smart lock of the first embodiment of the present application belong to the same concept. The implementation process is detailed in the method embodiment, which will not be repeated here.
[0132] The device embodiments described above are merely illustrative, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. Ordinary technicians in this field can understand and implement it without creative work.
[0133] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0134] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the function selected in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 function selected in a box or multiple boxes.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 steps for the function selected in a box or multiple boxes.
[0136] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0137] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0138] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0139] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0140] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for detecting the power of a smart lock, characterized in that: Applied to smart locks, including: Determine the current status of the smart lock; When the current state of the smart lock is a dormant state, receiving a power supply voltage detection signal; Continuously sampling the received power supply voltage detection signal to obtain multiple power sampling values; Filtering a maximum power sampling value and a minimum power sampling value from multiple power sampling values, and determining a current state of a power source according to the maximum power sampling value and the minimum power sampling value; If the current power supply status is normal, the average power value is calculated based on multiple power sampling values as the current power of the smart lock.
2. The method for detecting the power of a smart lock according to claim 1, characterized in that: If the current state of the power supply is an abnormal state, and the number of consecutive abnormal states is less than the abnormal state number threshold, the next state of the power supply is obtained.
3. The method for detecting the power of a smart lock according to claim 1, characterized in that: The step of determining the current state of the power supply according to the maximum power sampling value and the minimum power sampling value comprises: Obtaining a power difference between the maximum power value and the minimum power value; The power difference is compared with a preset power difference threshold. If the power difference is greater than the power difference threshold, the current state of the power supply is determined to be an abnormal state; if the power difference is less than or equal to the power difference threshold, the current state of the power supply is determined to be a normal state.
4. The method for detecting the power of a smart lock according to claim 1, characterized in that: The step of continuously sampling the received power supply voltage detection signal to obtain a plurality of power sampling values includes: Randomly obtain a target sampling frequency from a preset sampling frequency set; The received power supply voltage detection signal is continuously collected according to the target sampling frequency to obtain multiple power sampling values of the smart lock power supply.
5. The method for detecting the power of a smart lock according to claim 4, characterized in that: The step of randomly acquiring a target sampling frequency from a preset sampling frequency set comprises: If the last power state is an abnormal state, obtain the number of abnormal states between the last power state that is a normal state and the abnormal state; According to the number of intervals between the abnormal states, a temporary frequency set is obtained from the sampling frequency set; A target sampling frequency is randomly acquired from the temporary frequency set.
6. The method for detecting the power of a smart lock according to claim 5, characterized in that: The step of obtaining a temporary frequency set from the sampling frequency set according to the number of intervals between the abnormal states comprises: Divide the number of abnormal state intervals by the abnormal state quantity threshold to obtain an element exclusion coefficient; Obtaining the element exclusion quantity according to the element exclusion coefficient and the number of elements in the sampling frequency set; The elements of the sampling frequency set are excluded from small to large according to the element exclusion number, and the temporary frequency set is obtained according to the remaining elements.
7. The method for detecting the power of a smart lock according to claim 1, characterized in that: The step of receiving a power supply voltage detection signal when the current state of the smart lock is a dormant state includes: Randomly obtain the target detection duration from the preset detection duration set; receiving a power supply voltage detection signal according to the target detection duration; The step of continuously sampling the received power supply voltage detection signal to obtain a plurality of power sampling values includes: According to the power supply voltage detection signal and the preset rated sampling frequency, multiple power sampling values of the smart lock power supply are collected.
8. The method for detecting the power of a smart lock according to claim 7, characterized in that: The step of randomly obtaining the target detection duration from a preset detection duration set includes: If the last power state is an abnormal state, obtain the number of abnormal states between the last power state that is a normal state and the abnormal state; According to the number of intervals between the abnormal states, a temporary duration set is obtained from the detection duration set; The target detection duration is randomly obtained from the temporary duration set.
9. The method for detecting the power of a smart lock according to claim 8, characterized in that: The step of obtaining a temporary duration set from the detection duration set according to the number of intervals between the abnormal states comprises: Divide the number of abnormal state intervals by the abnormal state quantity threshold to obtain an element exclusion coefficient; Obtaining the number of element exclusions according to the element exclusion coefficient and the number of elements in the detection duration set; The elements of the detection duration set are excluded from small to large according to the element exclusion number, and the temporary duration set is obtained according to the remaining elements.
10. A smart lock, characterized in that: It includes a power supply, a main controller and a power detection circuit; the power detection circuit includes a control end, an input end and an output end; The output end of the power supply is connected to the input end of the power detection circuit, and is used to output a power supply voltage signal to the input end of the power detection circuit; The output end and the control end of the power detection circuit are respectively connected to the main controller, and are used to transmit the power supply voltage detection signal to the main controller under the control of the main controller; The main controller is used to execute the power detection method of the smart lock according to any one of claims 1 to 9.
Citation Information
Cited By
Property information management method and system based on artificial intelligence
CN121032135A
An artificial intelligence-based property information management method and system
CN121032135B
