Battery electric quantity detection method, system and equipment for intelligent door lock and medium

By fitting the battery discharge curve and sampling resistor in segments to calculate the power consumption, combined with sleep state compensation, the problem of low power detection accuracy of smart door locks is solved, and more accurate and efficient power detection is achieved, improving the user experience.

CN118962475APending Publication Date: 2024-11-15DESSMANN CHINA MACHINERY & ELECTRONICS +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411042959.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The battery capacity detection method of existing smart door locks fails to effectively consider the voltage changes of the battery under different states, resulting in low battery detection accuracy and large errors, which affects the user experience.

Method used

By fitting the battery discharge curve in segments, calculating the power consumption in combination with the sampling resistance and battery voltage, accurately calculate the current power, consider the compensation power in the sleep state, and improve the accuracy and efficiency of power detection.

Benefits of technology

It improves the accuracy and efficiency of battery capacity detection of smart door locks, reduces battery capacity detection errors, and enhances users' experience of using smart door locks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118962475A_ABST
    Figure CN118962475A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electronic locks, and discloses a battery capacity detection method, system and device of an intelligent door lock and a medium, and the method comprises the following steps: determining a battery voltage corresponding to a target intelligent door lock at a current working moment; substituting the battery voltage into a preset battery discharge curve to calculate the collected electric quantity at the current working moment, wherein the preset battery discharge curve is obtained by carrying out segmented fitting on the voltage and the electric quantity of the battery; calculating the consumed electric quantity at the current working moment based on the battery voltage and a preset sampling resistor, wherein the preset sampling resistor is connected in series with a battery of the target intelligent door lock; and subtracting the collected electric quantity from the consumed electric quantity to obtain the battery electric quantity of the target intelligent door lock at the current working moment. The voltage and the electric quantity are subjected to segmented fitting to obtain an effective battery discharge curve, meanwhile, voltage changes of the battery in different states are considered, the consumed electric quantity is calculated through the sampling resistance and the battery voltage, then the current electric quantity is solved, and the precision and efficiency of battery electric quantity detection can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic locks, and in particular to a battery power detection method, system, device and medium for an intelligent door lock. Background Art

[0002] Smart door locks are generally powered by their built-in batteries. In actual applications, in order to prevent the battery power from being too low and affecting the use of the smart door lock function, accurately judging the battery power is one of the important capabilities of the smart door lock.

[0003] At present, the mainstream power detection method of smart door locks is to collect the battery voltage value, obtain the battery discharge curve by fitting the voltage and power, and infer the current remaining battery power based on the battery discharge curve. However, in actual applications, since the battery voltage is not a stable decreasing process, especially when the smart door lock is in working state, the battery voltage will drop significantly, and as the smart door lock enters the sleep state, the battery power will rise again, which can easily cause the illusion of high and low power. Therefore, estimating the power based on the battery voltage will seriously affect the accuracy of the power detection result. In addition, since the battery voltage and power are not linearly related, that is, the battery discharge curve is not a straight line, the existing detection often uses a linear method to fit the discharge curve, which will also cause uneven changes in the battery power, and thus make the power detection error larger.

[0004] In summary, the existing power detection method does not take into account the voltage changes of the battery in different states, and there are situations where the power value fluctuates or the power consumption is fast or slow, resulting in a very large error in the detected power; and the existing fit between battery voltage and power is poor, resulting in poor power detection effect, which seriously affects the user's use of smart door locks. Summary of the invention

[0005] In view of this, the present invention provides a battery power detection method, system, device and medium for a smart door lock to solve the problem that the existing power detection ignores the voltage changes of the smart door lock in different states and cannot achieve effective fitting of voltage and power, resulting in low accuracy and poor effect of power detection, and it is difficult to meet the use requirements of the smart door lock.

[0006] In a first aspect, the present invention provides a method for detecting battery power of a smart door lock, the method comprising:

[0007] Determine the battery voltage corresponding to the target smart door lock at the current working moment;

[0008] Substitute the battery voltage into the preset battery discharge curve to calculate the collected power at the current working moment. The preset battery discharge curve is obtained by segmented fitting of the battery voltage and power;

[0009] The power consumption at the current working moment is calculated based on the battery voltage and the preset sampling resistor, and the preset sampling resistor is connected in series with the battery of the target smart door lock;

[0010] Subtract the collected power from the consumed power to obtain the battery power of the target smart door lock at the current working moment.

[0011] The present invention performs piecewise fitting on the voltage and power to obtain an effective battery discharge curve, solves the collected power at the current working moment based on the battery discharge curve, and takes into account the voltage change of the battery in different states, calculates the consumed power through the sampling resistor and the battery voltage, and calculates the current power based on the collected power and the consumed power, which can improve the accuracy and efficiency of battery power detection and meet the user's demand for the use of smart door locks.

[0012] In an optional implementation, determining the battery voltage corresponding to the target smart door lock at the current working moment includes:

[0013] Collect the initial voltage corresponding to the initial power-on moment of the target smart door lock and the current voltage corresponding to the current working moment respectively;

[0014] Determine whether the current voltage is less than the initial voltage;

[0015] When the current voltage is less than the initial voltage, the current voltage is determined as the battery voltage;

[0016] When the current voltage is not less than the initial voltage, the initial voltage is determined as the battery voltage.

[0017] The present invention takes into account the stability of the voltage of the target smart door lock at the initial power-on moment, and can accurately obtain the battery voltage corresponding to the current working moment by accurately determining the relationship between the current voltage corresponding to the target smart door lock at the current working moment and the initial voltage corresponding to the initial power-on moment, thereby helping to improve the accuracy of subsequent battery power detection.

[0018] In an optional implementation, the power consumption at the current working moment is calculated based on the battery voltage and the preset sampling resistor, including:

[0019] The current current of the preset sampling resistor is calculated based on the battery voltage and the preset sampling resistor, and the current current is the current working current of the smart door lock;

[0020] An integral operation is performed based on the battery voltage, the current current and the current working time to obtain the power consumption at the current working time.

[0021] The present invention integrates the power consumption of the sampling resistor, can take into account the voltage changes of the battery in different states, calculates the dynamic power consumption in real time, and estimates the battery power in combination with the current voltage, which can greatly improve the accuracy of power detection and enhance the user experience of the smart door lock.

[0022] In an optional implementation, after obtaining the battery power of the target smart door lock at the current working moment, the battery power detection method of the smart door lock further includes:

[0023] Detect whether the target smart door lock is in a dormant state between the previous working moment and the current working moment;

[0024] If there is a dormant state, count the dormant time corresponding to the target smart door lock;

[0025] Determine whether the sleep time is less than the sleep threshold;

[0026] When the sleep time is less than the sleep threshold, the historical battery power of the target smart door lock at the previous working moment is obtained;

[0027] Determine the compensation power based on the historical battery power, sleep time, sleep threshold, and the collected power at the current working moment;

[0028] Add the compensated power to the battery power of the target smart door lock at the current working moment to obtain the compensated battery power corresponding to the current working moment.

[0029] The present invention takes into account that when the smart door lock enters a sleep state, the current will decrease rapidly and the battery voltage will slowly recover to a stable state. By detecting the sleep state, when it is detected that sleep exists at historical working moments, the compensation power is calculated according to the historical sleep time, and the calculated current remaining power of the smart door lock is corrected based on the compensation power, which helps to ensure the accuracy of power detection.

[0030] In an optional implementation, the compensation power is determined based on the historical battery power, the sleep time, the sleep threshold, and the collected power at the current working moment, including:

[0031] Subtract the sleep threshold from the sleep time to obtain the sleep difference;

[0032] Multiply the historical battery power and the sleep difference to obtain first data;

[0033] The collected power at the current working moment is multiplied by the sleep time to obtain the second data;

[0034] Add the first data to the second data to obtain third data;

[0035] The third data is divided by the sleep time to obtain the compensated power.

[0036] The present invention calculates the compensation power by jointly calculating the sleep time corresponding to the detected historical working moments and the sleep threshold set in advance, which not only ensures the calculation accuracy of the compensation power, but also helps to improve the detection accuracy of the current battery power, thereby meeting the user's demand for the use of smart door locks.

[0037] In an optional implementation, the battery power detection method of the smart door lock further includes:

[0038] When the sleep time is not less than the sleep threshold, return to the step of determining the battery voltage corresponding to the target smart door lock at the current working moment.

[0039] In an optional implementation, the process of determining the preset battery discharge curve includes:

[0040] Performing an experimental test on a target battery based on a preset electronic device to obtain an initial discharge curve, wherein the target battery is a battery of a target smart door lock or a battery of the same model as the target smart door lock;

[0041] The initial discharge curve is segmented based on a preset number of segments, and a plurality of corresponding curve segments are obtained;

[0042] Each curve segment is fitted using a preset function;

[0043] Construct a preset battery discharge curve based on all fitted curve segments.

[0044] The present invention can greatly improve the curve fitting efficiency by performing segmented fitting on different types of battery discharge curves, thereby helping to improve the accuracy and efficiency of battery power detection.

[0045] In a second aspect, the present invention provides a battery power detection system for a smart door lock, the system comprising:

[0046] A voltage determination module is used to determine the battery voltage corresponding to the target smart door lock at the current working moment;

[0047] The power collection module is used to substitute the battery voltage into the preset battery discharge curve to calculate the collected power at the current working moment. The preset battery discharge curve is obtained by segmented fitting of the battery voltage and power;

[0048] A power consumption module, used to calculate the power consumption at the current working moment based on the battery voltage and a preset sampling resistor, where the preset sampling resistor is connected in series with the battery of the target smart door lock;

[0049] The remaining power module is used to subtract the collected power from the consumed power to obtain the battery power of the target smart door lock at the current working moment.

[0050] The battery power detection system of the smart door lock of the present invention obtains an effective battery discharge curve by performing segmented fitting on the voltage and power and solves the collected power at the current working moment based on the curve; at the same time, considering the voltage change of the battery in different states, the consumed power is calculated by sampling the resistor and the battery voltage, and the current power is calculated based on the collected power and the consumed power. The current remaining power of the smart door lock is accurately calculated in the above manner, which can effectively prevent the detected power value from fluctuating or the power consumption from being fast or slow, thereby improving the battery power detection accuracy and greatly optimizing the user experience of the smart door lock.

[0051] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute a battery power detection method for a smart door lock according to the first aspect or any corresponding embodiment thereof.

[0052] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute a battery power detection method for a smart door lock according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 is a flow chart of a battery power detection method for a smart door lock according to an embodiment of the present invention;

[0055] Figure 2 is a flow chart of another battery power detection method of an intelligent door lock according to an embodiment of the present invention;

[0056] Figure 3 It is a schematic diagram of the internal structure of the smart door lock;

[0057] Figure 4 This is a schematic diagram of the power consumption detection circuit;

[0058] Figure 5 is a structural block diagram of a battery power detection system for an intelligent door lock according to an embodiment of the present invention;

[0059] Figure 6 It is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0061] An embodiment of the present invention provides an embodiment of a battery power detection method for a smart door lock. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0062] In this embodiment, a method for detecting the battery power of a smart door lock is provided. Figure 1 FIG. 1 is a flow chart of a battery power detection method for a smart door lock according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0063] Step S101, determining the battery voltage corresponding to the target smart door lock at the current working moment.

[0064] It should be noted that the current working moment in this embodiment refers to any moment corresponding to the target smart door lock being in working state. The specific triggering method of the working state of the target smart door lock is not limited here and is adaptively adjusted based on actual needs. For example, when a user touches the fingerprint of the target smart door lock for identification and unlocking, the target smart door lock will wake up and then enter the working state from the dormant state. This is only an exemplary explanation.

[0065] Step S102, substituting the battery voltage into a preset battery discharge curve to calculate the collected power at the current working moment, wherein the preset battery discharge curve is obtained by performing segmented fitting of the battery voltage and power.

[0066] In this embodiment, the specific segmentation of voltage and power fitting is not limited here, and is adaptively set based on the computing power and accuracy requirements of the smart door lock in actual applications.

[0067] Step S103, calculating the power consumption at the current working moment based on the battery voltage and a preset sampling resistor, wherein the preset sampling resistor is connected in series with the battery of the target smart door lock.

[0068] It should be noted that the preset sampling resistor is a sampling resistor directly connected in series to the target smart door lock internal circuit board at the battery outlet (i.e., the sampling resistor is the only path for the battery to pass through the circuit board), so the current passing through the sampling resistor in this embodiment is the working current of the entire smart door lock. Specifically, the working current of the entire smart door lock is calculated by the voltage and resistance of the sampling resistor, and the battery voltage and working current at each sampling moment (for example, 1 millisecond) are integrated by the battery voltage, working current and time to obtain the battery power consumption.

[0069] Step S104, subtract the collected power from the consumed power to obtain the battery power of the target smart door lock at the current working moment.

[0070] In the embodiment of the present invention, an effective battery discharge curve is obtained by performing piecewise fitting on the voltage and power, and the collected power at the current working moment is solved based on the battery discharge curve. At the same time, the voltage change of the battery in different states is taken into account, the consumed power is calculated by the sampling resistor and the battery voltage, and the current power is calculated based on the collected power and the consumed power. This can improve the accuracy and efficiency of battery power detection and meet the user's demand for the use of smart door locks.

[0071] In this embodiment, a method for detecting the battery power of a smart door lock is provided. Figure 2 FIG. 1 is a flow chart of another method for detecting battery power of an intelligent door lock according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0072] Step S201, determine the battery voltage corresponding to the target smart door lock at the current working moment.

[0073] Specifically, the above step S201 includes:

[0074] Step S2011, respectively collect the initial voltage corresponding to the target smart door lock at the initial power-on moment and the current voltage corresponding to the current working moment.

[0075] It should be noted that the specific voltage acquisition method in this embodiment is based on the conventional voltage acquisition method in the art.

[0076] In this embodiment, the initial power-on time refers to the time corresponding to the installation of the battery on the target smart door lock, and the voltage data collected at this time is the initial voltage of the target smart door lock. It should be noted that when the smart door lock of this embodiment is powered on for the first time, since the battery state (i.e. the battery state at the previous moment) cannot be determined, the default battery voltage is stable (i.e. the initial voltage is in a stable state), and the battery power can be directly calculated based on the battery discharge curve.

[0077] In this embodiment, since the current power value corresponding to the smart door lock when it is powered on for the first time is relatively low, if the smart door lock is awakened from a sleep state to a working state, the voltage collected at this time is the current voltage, and the power value calculated by the battery discharge curve is the current power. It is necessary to select the smaller value from the two power values ​​as the current power, that is, take the smaller voltage value between the initial voltage and the current voltage as the battery voltage corresponding to the target smart door lock at the current working moment.

[0078] Step S2012, determining whether the current voltage is less than the initial voltage.

[0079] Step S2013: when the current voltage is less than the initial voltage, the current voltage is determined as the battery voltage.

[0080] Step S2014: when the current voltage is not less than the initial voltage, the initial voltage is determined as the battery voltage.

[0081] In the embodiment of the present invention, the stability of the voltage of the target smart door lock at the initial power-on moment is taken into account. By accurately determining the relationship between the current voltage corresponding to the target smart door lock at the current working moment and the initial voltage corresponding to the initial power-on moment, the battery voltage corresponding to the current working moment can be accurately obtained, which helps to improve the accuracy of subsequent battery power detection.

[0082] Step S202, the battery voltage is substituted into a preset battery discharge curve to calculate the collected power at the current working moment, wherein the preset battery discharge curve is obtained by segmentally fitting the battery voltage and power.

[0083] Specifically, the process of determining the preset battery discharge curve in step S201 includes:

[0084] Step A1, experimentally test the target battery based on a preset electronic device to obtain an initial discharge curve, where the target battery is a battery of a target smart door lock or a battery of the same model as the target smart door lock.

[0085] In this embodiment, the specific type of the preset electronic device is not limited here, and is determined based on the adaptability of actual project requirements. For example, the preset electronic device is an electronic load meter, which is only used as an exemplary description.

[0086] Step A2, segmenting the initial discharge curve based on a preset number of segments, and correspondingly obtaining a plurality of curve segments.

[0087] In this embodiment, the specific value of the preset number of segments is not limited here, and is determined based on the adaptability of actual project requirements. For example, the preset number of segments is 5, which is only used as an exemplary description.

[0088] Step A3: Fit each curve segment using a preset function.

[0089] In this embodiment, the specific type of the preset function can be determined according to the actual computing power of the target smart door lock. For example, the preset function is a quadratic function, which is only used as an exemplary illustration. It should be noted that using more segments for curve fitting (i.e., using a higher-order function for data fitting) not only makes it difficult to improve the accuracy of actual door lock use, but also increases the workload for door lock judgment, i.e., it is necessary to store more segments of fitting curve parameters, thereby affecting the fitting effect of the battery discharge curve and reducing the fitting degree of the battery discharge curve.

[0090] In a specific embodiment, considering the computing power used by the smart door lock, it is assumed that the calculation of more than three functions will affect the operation of the door lock. Specifically, the middle section of the discharge curve is relatively flat, and the two ends change more drastically. For the accuracy of fitting, two sections of the curve are used for fitting at the two ends with more drastic changes, and one section of the curve is used for fitting in the middle.

[0091] Step A4: construct a preset battery discharge curve based on all fitted curve segments.

[0092] In the embodiment of the present invention, by performing segmented fitting on the discharge curves of different types of batteries, the curve fitting efficiency can be greatly improved, thereby helping to improve the accuracy and efficiency of battery power detection.

[0093] Step S203, calculating the power consumption at the current working moment based on the battery voltage and a preset sampling resistor, where the preset sampling resistor is connected in series with the battery of the target smart door lock.

[0094] Specifically, the above step S203 calculates the power consumption at the current working moment based on the battery voltage and the preset sampling resistor, including:

[0095] Step B1, calculating the current current of the preset sampling resistor based on the battery voltage and the preset sampling resistor, the current current being the current working current of the smart door lock.

[0096] In this embodiment, the resistance of the preset sampling resistor is very small, so a corresponding voltage processing can be performed on it to increase the accuracy of the collected voltage. For example, the voltage of the sampling resistor is amplified by an amplifier circuit, which is only an exemplary description.

[0097] Step B2, performing an integral operation based on the battery voltage, the current current and the current working time to obtain the power consumption at the current working time.

[0098] In the embodiment of the present invention, by integrating the power consumption of the sampling resistor, the voltage change of the battery in different states can be taken into account. By calculating the dynamic power consumption in real time and estimating the battery power in combination with the current voltage, the accuracy of power detection can be greatly improved, thereby enhancing the user experience of the smart door lock.

[0099] Step S204: Subtract the collected power from the consumed power to obtain the battery power of the target smart door lock at the current working moment. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0100] In actual applications, smart door locks are battery-powered and are in a dormant state most of the time. Since the current will decrease rapidly after the smart door lock enters the dormant state, the battery voltage will slowly recover until it stabilizes. At this time, the current consumed by the door lock is extremely small, and the current power can be judged based on the battery voltage; when the smart door lock is in a working state (such as when the user touches the fingerprint for recognition, the smart door lock will wake up and enter the working state), the current is thousands to tens of thousands times that of the dormant state, and the power cannot be estimated based on the battery voltage. It should be noted that it takes a certain amount of time for the battery voltage of the smart door lock to reach a stable value in the dormant state. If the smart door lock is awakened again within this time range and its current power is calculated, it is necessary to correct the power that did not reach the stable voltage at the previous moment due to the dormant state, that is, to compensate for the battery power at the current working moment. Specifically, after obtaining the battery power of the target smart door lock at the current working moment, the battery power detection method of the smart door lock of this embodiment also includes:

[0101] Step C1, detecting whether the target smart door lock is in a dormant state between the previous working moment and the current working moment.

[0102] In this embodiment, the specific detection method of the sleep state of the smart door lock can be obtained based on conventional detection means in the field.

[0103] Step C2: If there is a sleep state, count the sleep time corresponding to the target smart door lock.

[0104] In this embodiment, the statistics of the sleep time are obtained based on conventional time acquisition means in the art.

[0105] Step C3, determining whether the sleep time is less than the sleep threshold.

[0106] In this embodiment, the specific value of the sleep threshold is adaptively set based on actual needs. For example, the sleep threshold is 5 minutes, which is only used as an example.

[0107] Step C4, when the sleep time is less than the sleep threshold, obtain the historical battery power of the target smart door lock at the previous working moment.

[0108] It should be noted that the specific calculation method of the historical battery power of the target smart door lock at the previous working moment is calculated and solved based on the battery power detection method of the smart door lock in this embodiment. The specific solution process can be found in the previous content and will not be repeated here.

[0109] In this embodiment, when the sleep time is not less than the sleep threshold, the process returns to step S201 of determining the battery voltage corresponding to the target smart door lock at the current working moment.

[0110] Step C5, determining the compensation power based on the historical battery power, the sleep time, the sleep threshold, and the collected power at the current working moment.

[0111] Specifically, the above step C5 includes:

[0112] Step C51, subtracting the sleep threshold from the sleep time to obtain a sleep difference.

[0113] Step C52, multiplying the historical battery power by the sleep difference to obtain first data.

[0114] Step C53, multiplying the collected power at the current working moment by the sleep time to obtain second data.

[0115] Step C54, adding the first data to the second data to obtain third data.

[0116] Step C55, dividing the third data by the sleep time to obtain the compensated power.

[0117] In the embodiment of the present invention, the compensation power is calculated by jointly calculating the sleep time corresponding to the detected historical working moments and the sleep threshold set in advance, which not only ensures the calculation accuracy of the compensation power, but also helps to improve the detection accuracy of the current battery power, thereby meeting the user's demand for the use of smart door locks.

[0118] Step C6, adding the compensated power to the battery power of the target smart door lock at the current working moment to obtain the compensated battery power corresponding to the current working moment.

[0119] In the embodiment of the present invention, it is taken into consideration that when the smart door lock enters the sleep state, the current will decrease rapidly and the battery voltage will slowly return to a stable state. By detecting the sleep state, when it is detected that there is sleep at the historical working moment, the compensation power is calculated according to the historical sleep time, and the current remaining power of the smart door lock calculated based on the compensation power is corrected, which helps to ensure the accuracy of power detection.

[0120] In a specific embodiment, in order to solve the problem that the existing power estimation scheme through battery voltage ignores the large voltage fluctuation of the battery when the current is relatively large, which leads to inaccurate power estimation, this scheme optimizes the traditional power detection method in two ways. First, add a power consumption detection circuit to calculate the dynamic power consumed during the operation of the smart door lock in real time, and second, use a cubic function to fit the discharge curve in sections to accurately correspond to the relationship between voltage and power. Specifically, by integrating the power consumption of the sampling resistor, calculating the dynamic power consumption in real time, and then combining the voltage discharge curve and the battery sampling voltage to jointly estimate the battery power, the battery power usage of the smart door lock can be accurately calculated.

[0121] In one specific embodiment, see Figure 3 , a power consumption detection circuit is added to the working circuit of the smart door lock to calculate the power consumption of the door lock in real time. Specifically, a power consumption detection circuit of the smart door lock is added between the battery and the normal function module of the smart door lock (i.e., the working circuit of the smart door lock) (i.e., between AB). This circuit can accurately detect the power consumption of the smart door lock in the working mode to prevent the voltage from fluctuating greatly in the working mode, and the power consumption of the door lock cannot be accurately judged by the voltage, and it is difficult to accurately detect the current remaining power of the battery.

[0122] In a specific embodiment, Figure 4 This is the schematic diagram of the power consumption detection circuit. Figure 4 It can be seen that a power consumption detection resistor (i.e., a preset sampling resistor) is added between AB, as well as a voltage amplifier circuit and a bias voltage circuit for processing its voltage. Specifically, since the resistance of the sampling resistor is very small, in this embodiment, the voltage of the sampling resistor is amplified by the voltage amplifier circuit ( Figure 4 In addition, the bias voltage circuit raises the input signal to the position of VCC / 2 (the linearity of the voltage amplification effect at this position is the best), thereby making the voltage outputted by the power consumption detection result in a stable state.

[0123] In a specific embodiment, the battery discharge curve is divided into 5 sections, each section is based on y=a n x 3 +b n x 2 +c n x+d n (where y is the battery charge, x is the battery voltage, a n , b n 、c n and d nThe coefficients to be solved of the cubic function are n from 1 to 5. It should be noted that the coefficients to be solved of the 5 curves are different). After the voltage value is collected later, the corresponding fitting function is substituted according to the voltage range to calculate the corresponding battery power.

[0124] In a specific embodiment, for a certain model of smart door lock, the battery discharge curve of the smart door lock is obtained in advance through experimental testing (that is, the discharge curve can be measured by an electronic load meter); and the power consumption detection circuit is integrated into the smart door lock, then the battery power detection process of the smart door lock includes:

[0125] 1) When the smart door lock is powered on for the first time, since the battery status cannot be determined, the battery voltage is assumed to be stable, and the battery power is calculated based on the battery discharge curve, that is, the power is collected.

[0126] 2) During the operation of the smart door lock, the voltage of the power consumption detection resistor is continuously collected, and the power consumption consumed during the working period is accumulated by integration (that is, the voltage value of the power consumption detection resistor is read, and its current value can be calculated according to Ohm's law, and then the battery power consumption can be calculated, that is, the integral of current, battery voltage, and time), and then the power consumption can be obtained.

[0127] 3) When the smart door lock reports the power to the server, the remaining power percentage (i.e. the current calculated power) is calculated based on the power collected when powered on (i.e. the collected power) minus the power consumed during operation (i.e. the consumed power).

[0128] 4) When the smart door lock enters the dormant state for more than 10 minutes (i.e., the dormant threshold), the battery voltage can be considered stable. When the smart door lock enters the working state next time, the voltage is collected and the power is calculated according to the battery discharge curve, and this is used as the basis for subsequent power calculation (i.e., when the smart door lock enters the working state next time).

[0129] 5) When the smart door lock sleep time is less than 10 minutes, the battery voltage has not yet reached a stable value, and the collected voltage will be lower than the actual situation, so it is necessary to compensate based on the result of the last power calculation. Specifically, the compensation power is calculated as follows: (the power calculated at the previous working moment × (10 minutes - sleep time) + (the collected power at the current working moment × sleep time) / 10 minutes.

[0130] In summary, the embodiment of the present invention adds a high-precision power consumption detection circuit and adopts real-time integration to calculate the power consumption in the working state; at the same time, the battery power curve is fitted in sections, and the voltage value is substituted into the two methods to calculate the battery power. It can accurately calculate the current remaining power of the smart door lock at any time in the working state, which not only prevents the reported power value from fluctuating or the power consumption from being fast or slow, but also improves the accuracy and efficiency of power detection, and optimizes the user experience, meeting the user's demand for the use of smart door locks.

[0131] In this embodiment, a battery power detection system for a smart door lock is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As the term "module" is used below, it can implement a combination of software and / or hardware with a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0132] The present invention provides a battery power detection system for an intelligent door lock, such as Figure 5 As shown, the system includes:

[0133] The voltage determination module 501 is used to determine the battery voltage corresponding to the target smart door lock at the current working moment.

[0134] The power collection module 502 is used to substitute the battery voltage into a preset battery discharge curve to calculate the collected power at the current working moment. The preset battery discharge curve is obtained by segmentally fitting the battery voltage and power.

[0135] The power consumption module 503 is used to calculate the power consumption at the current working moment based on the battery voltage and the preset sampling resistor, and the preset sampling resistor is connected in series with the battery of the target smart door lock.

[0136] The remaining power module 504 is used to subtract the collected power from the consumed power to obtain the battery power of the target smart door lock at the current working moment.

[0137] In some optional embodiments, the voltage determination module 501 includes: a first determination submodule, a second determination submodule, a third determination submodule and a fourth determination submodule; wherein the first determination submodule is used to respectively collect the initial voltage corresponding to the target smart door lock at the initial power-on moment, and the current voltage corresponding to the current working moment; the second determination submodule is used to determine whether the current voltage is less than the initial voltage; the third determination submodule is used to determine the current voltage as the battery voltage when the current voltage is less than the initial voltage; the fourth determination submodule is used to determine the initial voltage as the battery voltage when the current voltage is not less than the initial voltage.

[0138] In some optional embodiments, the power acquisition module 502 includes: a first acquisition submodule, a second acquisition submodule, a third acquisition submodule and a fourth acquisition submodule; wherein the first acquisition submodule is used to perform experimental testing on the target battery based on a preset electronic device to obtain an initial discharge curve, and the target battery is a battery of a target smart door lock or a battery of the same model as the target smart door lock; the second acquisition submodule is used to segment the initial discharge curve based on a preset number of segments, and obtain multiple curve segments accordingly; the third acquisition submodule is used to fit each curve segment using a preset function; the fourth acquisition submodule is used to construct a preset battery discharge curve based on all fitted curve segments.

[0139] In some optional embodiments, the power consumption module 503 includes: a first consumption sub-module and a second consumption sub-module; wherein the first consumption sub-module is used to calculate the current current of the preset sampling resistor based on the battery voltage and the preset sampling resistor, and the current current is the current working current of the smart door lock; the second consumption sub-module is used to perform integration operations based on the battery voltage, the current current and the current working time to obtain the power consumption at the current working time.

[0140] In some optional embodiments, the system further includes: a first correction module, a second correction module, a third correction module, a fourth correction module, a fifth correction module, a sixth correction module and a seventh correction module; wherein the first correction module is used to detect whether the target smart door lock is in a dormant state between the previous working moment and the current working moment; the second correction module is used to count the dormant time corresponding to the target smart door lock if a dormant state exists; the third correction module is used to determine whether the dormant time is less than the dormant threshold; the fourth correction module is used to return to the step of determining the battery voltage corresponding to the target smart door lock at the current working moment when the dormant time is not less than the dormant threshold; the fifth correction module is used to obtain the historical battery power of the target smart door lock at the previous working moment when the dormant time is less than the dormant threshold; the sixth correction module is used to determine the compensation power based on the historical battery power, the dormant time, the dormant threshold, and the collected power at the current working moment; the seventh correction module is used to add the compensation power to the battery power of the target smart door lock at the current working moment to obtain the compensated battery power corresponding to the current working moment.

[0141] In some optional embodiments, the sixth correction module includes: a first correction submodule, a second correction submodule, a third correction submodule, a fourth correction submodule and a fifth correction submodule; wherein the first correction submodule is used to subtract the sleep threshold from the sleep time to obtain a sleep difference; the second correction submodule is used to multiply the historical battery power by the sleep difference to obtain first data; the third correction submodule is used to multiply the collected power at the current working moment by the sleep time to obtain second data; the fourth correction submodule is used to add the first data to the second data to obtain third data; the fifth correction submodule is used to divide the third data by the sleep time to obtain compensation power.

[0142] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.

[0143] The battery power detection system of the smart door lock in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0144] The battery power detection system of the smart door lock in the embodiment of the present invention obtains an effective battery discharge curve by segmentally fitting the voltage and power and solves the collected power at the current working moment based on the curve; at the same time, considering the voltage change of the battery in different states, the consumed power is calculated by sampling the resistor and the battery voltage, and the current power is calculated based on the collected power and the consumed power. The current remaining power of the smart door lock is accurately calculated in the above manner, which can effectively prevent the detected power value from fluctuating or the power consumption from being fast or slow, thereby improving the battery power detection accuracy and greatly optimizing the user experience of the smart door lock.

[0145] The embodiment of the present invention also provides a computer device, see Figure 6 , Figure 6 is a schematic diagram of the structure of the above-mentioned computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0146] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0147] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0148] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0149] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0150] The computer device also includes a communication interface 30, which is used for the main control chip to communicate with other devices or a communication network.

[0151] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor main control chip or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0152] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A battery power detection method for a smart door lock, characterized in that: The method comprises: Determine the battery voltage corresponding to the target smart door lock at the current working moment; Substituting the battery voltage into a preset battery discharge curve to calculate the collected power at the current working moment, wherein the preset battery discharge curve is obtained by segmentally fitting the battery voltage and power; Calculate the power consumption at the current working moment based on the battery voltage and a preset sampling resistor, wherein the preset sampling resistor is connected in series with the battery of the target smart door lock; The collected power is subtracted from the consumed power to obtain the battery power of the target smart door lock at the current working moment.

2. The battery power detection method of the smart door lock according to claim 1 is characterized in that: The determining of the battery voltage corresponding to the target smart door lock at the current working moment includes: Collect the initial voltage corresponding to the initial power-on moment of the target smart door lock and the current voltage corresponding to the current working moment respectively; Determining whether the current voltage is less than the initial voltage; When the current voltage is less than the initial voltage, determining the current voltage as the battery voltage; When the current voltage is not less than the initial voltage, the initial voltage is determined as the battery voltage.

3. The battery power detection method of the smart door lock according to claim 1 is characterized in that: The calculating the power consumption at the current working moment based on the battery voltage and the preset sampling resistance includes: Calculating a current current of the preset sampling resistor based on the battery voltage and the preset sampling resistor, wherein the current current is a current working current of the smart door lock; An integral operation is performed based on the battery voltage, the current current and the current working time to obtain the power consumption at the current working time.

4. The battery power detection method for a smart door lock according to any one of claims 1 to 3, characterized in that: After obtaining the battery power of the target smart door lock at the current working moment, the method further includes: Detecting whether the target smart door lock is in a dormant state between the previous working moment and the current working moment; If there is a dormant state, count the dormant time corresponding to the target smart door lock; Determine whether the sleep time is less than a sleep threshold; When the sleep time is less than the sleep threshold, obtaining the historical battery power of the target smart door lock at the previous working moment; Determine the compensation power based on the historical battery power, the sleep time, the sleep threshold, and the collected power at the current working moment; The compensated power is added to the battery power of the target smart door lock at the current working moment to obtain the compensated battery power corresponding to the current working moment.

5. The battery power detection method of the smart door lock according to claim 4 is characterized in that: The determining of the compensation power based on the historical battery power, the sleep time, the sleep threshold, and the collected power at the current working moment includes: Subtracting the sleep threshold from the sleep time to obtain a sleep difference; Multiplying the historical battery power by the sleep difference to obtain first data; Multiplying the collected power at the current working moment by the sleep time to obtain second data; Adding the first data to the second data to obtain third data; The third data is divided by the sleep time to obtain the compensated power.

6. The battery power detection method of the smart door lock according to claim 4 is characterized in that: The method further comprises: When the sleep time is not less than the sleep threshold, return to the step of determining the battery voltage corresponding to the target smart door lock at the current working moment.

7. The battery power detection method of the smart door lock according to claim 1 is characterized in that: The process of determining the preset battery discharge curve includes: Performing an experimental test on a target battery based on a preset electronic device to obtain an initial discharge curve, wherein the target battery is a battery of the target smart door lock or a battery of the same model as the target smart door lock; Segmenting the initial discharge curve based on a preset number of segments to obtain a plurality of curve segments; Each curve segment is fitted using a preset function; Construct a preset battery discharge curve based on all fitted curve segments.

8. A battery power detection system for a smart door lock, characterized in that: The system comprises: A voltage determination module is used to determine the battery voltage corresponding to the target smart door lock at the current working moment; A power collection module, used to substitute the battery voltage into a preset battery discharge curve to calculate the collected power at the current working moment, wherein the preset battery discharge curve is obtained by segmented fitting of the battery voltage and power; A power consumption module, used to calculate the power consumption at the current working moment based on the battery voltage and a preset sampling resistor, wherein the preset sampling resistor is connected in series with the battery of the target smart door lock; The remaining power module is used to subtract the collected power from the consumed power to obtain the battery power of the target smart door lock at the current working moment.

9. A computer device, characterized in that: The device includes: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the battery power detection method for the smart door lock described in any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the battery power detection method for the smart door lock according to any one of claims 1 to 7.