Method, device, equipment and storage medium for estimating the number of days a smart door lock can be used
By training a linear regression model, the user's door-opening characteristic data is used to estimate the remaining usable days of the smart door lock, which solves the problem that the smart door lock cannot accurately know the remaining usable days, improves the accuracy of the estimate, and helps users plan the battery reasonably. use.
Patent Information
- Application Number
- CN202211361209.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-11-02
AI Technical Summary
Existing smart door locks cannot accurately know the number of remaining usable days, making it difficult for users to plan charging or battery replacement in advance.
By obtaining the user's door opening characteristic data, such as the daily average number of password opening times, fingerprint opening times and Bluetooth opening times, a linear regression model is trained to estimate the remaining usable days of the smart door lock.
It improves the accuracy of estimating the number of days of use of smart door locks, helps users plan charging or replacing batteries in a timely manner, and solves the problem of users being unable to accurately know the number of days of use remaining.
Smart Images

Figure CN115713820B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart door locks, and in particular to a method and device for estimating the number of days a smart door lock can be used, equipment, and storage medium. Background Art
[0002] Currently, most smart door locks on the market obtain the remaining power of the smart door lock through battery voltage, but users cannot obtain the remaining usable days of the smart door lock. Even the same smart door lock will have different usage days depending on the user's usage habits. Therefore, how to let users accurately know the remaining usable days of the smart door lock and plan charging or battery replacement in advance has become a problem that needs to be solved urgently.
[0003] With respect to the problem in the above-mentioned related technologies that it is impossible to accurately know the remaining usable days of the smart door lock, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a method and device, equipment, and storage medium for estimating the number of days a smart door lock can be used, so as to overcome the problem in the related art that the remaining number of days a smart door lock can be used cannot be accurately known.
[0005] In order to achieve the above-mentioned purpose, a first aspect of an embodiment of the present invention provides a method for estimating the number of days a smart door lock can be used, comprising:
[0006] Acquire multiple basic training sets, wherein the basic training sets include door opening feature data of the user in a complete use cycle and the number of days of use in the complete use cycle; the door opening feature data includes the daily average number of password door opening times, the daily average number of fingerprint door opening times, the daily average number of face door opening times, and the daily average number of Bluetooth door opening times;
[0007] The preset linear regression model is trained using the multiple basic training sets, the input of the trained linear regression model is the door opening feature data in the current usage cycle of the user, and the output is the total number of days that the smart door lock can be used;
[0008] The total number of days that the target door lock can be used is determined by inputting the door opening feature data of the target door lock into the trained linear regression model, and the remaining number of days that the target door lock can be used is estimated based on the total number of days that the target door lock can be used and the current power of the target door lock.
[0009] The method for estimating the number of days a smart door lock can be used provided by the present invention trains a linear regression model for estimating the total number of days a smart door lock can be used through multiple basic training sets. This can well simulate the different number of days a smart door lock can be used due to different usage habits of different users, thereby making the estimation accuracy of the trained linear regression model higher.
[0010] Optionally, in a possible implementation manner of the first aspect, before using the multiple basic training sets to train a preset linear regression model, the method includes:
[0011] The basic training set is normalized so that the door opening feature data of the user in the complete usage cycle are all within a specific range.
[0012] The method for estimating the number of days a smart door lock can be used provided by the present invention can convert door opening feature data into data within a specific interval by normalizing the basic training set, thereby avoiding the occurrence of excessive differences between data, thereby eliminating the influence of dimensions and orders of magnitude, and changing the weights of variables in the analysis to solve the problem of different metrics.
[0013] Optionally, in a possible implementation manner of the first aspect, the step of training a preset linear regression model using the multiple basic training sets includes:
[0014] The door opening characteristic data in the complete use cycle is used as an independent variable, and the number of days of use in the complete use cycle is used as a dependent variable;
[0015] A linear regression equation is constructed by using multiple groups of the independent variables and the dependent variables, and the linear regression equation is used to represent the linear regression model.
[0016] The method for estimating the usable days of a smart door lock provided by the present invention constructs a linear regression equation by taking the door opening feature data within a complete use cycle as the independent variable and the number of days of use within the complete use cycle as the dependent variable. This method can well reflect that different door opening feature data determine the actual number of days of use of the smart door lock, and indirectly reflect that the different usage habits of different users lead to different number of days of use of the smart door lock, thereby achieving the technical effect of improving the estimation accuracy of the linear regression model.
[0017] Optionally, in a possible implementation of the first aspect, the linear regression equation includes:
[0018] y=ω0+ω1x1+ω2x2+ω3x3+ω4x4
[0019] Among them, x1 represents the daily average number of password door opening times, x2 represents the daily average number of fingerprint door opening times, x3 represents the daily average number of face door opening times, x4 represents the daily average number of Bluetooth door opening times, ω1 represents the first feature weight of the daily average number of password door opening times, ω2 represents the second feature weight of the daily average number of fingerprint door opening times, ω3 represents the third feature weight of the daily average number of face door opening times, ω4 represents the fourth feature weight of the daily average number of Bluetooth door opening times, and y represents the number of days to complete the usage cycle.
[0020] Optionally, in a possible implementation manner of the first aspect, the step of training a preset linear regression model using the multiple basic training sets includes:
[0021] Obtaining a first feature weight, a second feature weight, a third feature weight, and a fourth feature weight of the preset linear regression model;
[0022] Based on the first feature weight, the second feature weight, the third feature weight and the fourth feature weight, the preset linear regression model is iteratively calculated through the basic training set; wherein each iterative calculation obtains a loss value;
[0023] When the loss value reaches a preset threshold, the iterative calculation is stopped to obtain a trained linear regression model.
[0024] The method for estimating the number of days a smart door lock can be used provided by the present invention iteratively calculates a preset linear regression model through multiple feature weights and a basic training set, and stops the iterative calculation when the loss value reaches a preset threshold. It can simulate the gap between the calculation result and the true value, and is used to modify each feature weight of the preset linear regression model to guide the training direction of the model training, thereby improving the estimation accuracy of the linear regression model.
[0025] Optionally, in a possible implementation of the first aspect, a process of calculating the loss value includes:
[0026]
[0027] Among them, m represents the number of samples, loss represents the loss value, ω0 represents the intercept term of the linear regression equation, and y i represents the number of days to complete the usage cycle, i represents the number of the basic training data set, x 1i represents the daily average number of password door openings of the corresponding numbered basic training data set, x 2i represents the daily average number of fingerprint door openings in the corresponding numbered basic training data set, x 3i represents the daily average number of face door openings in the corresponding numbered basic training dataset, x 4i represents the daily average number of Bluetooth door openings of the corresponding numbered basic training data set, ω1 represents the first feature weight of the daily average number of password door openings, ω2 represents the second feature weight of the daily average number of fingerprint door openings, ω3 represents the third feature weight of the daily average number of face door openings, and ω4 represents the fourth feature weight of the daily average number of Bluetooth door openings.
[0028] Specifically, the above-mentioned feature weights include but are not limited to the first feature weight, the second feature weight, the third feature weight and the fourth feature weight. The type of the feature weight is related to the type of the door opening feature data. For example, when the door opening feature data includes the daily average number of password door openings, the daily average number of fingerprint door openings, the daily average number of face door openings and the daily average number of Bluetooth door openings, then the feature weights include the first feature weight, the second feature weight, the third feature weight and the fourth feature weight; when the door opening feature data includes the daily average number of password door openings, the daily average number of fingerprint door openings, the daily average number of face door openings and the daily average number of Bluetooth door openings, then the feature weights include the first feature weight, the second feature weight, the third feature weight and the fourth feature weight; When the number of Bluetooth door openings, the daily average number of iris door openings and the daily average number of finger vein blood door openings are calculated, the feature weights include the first feature weight, the second feature weight, the third feature weight, the fourth feature weight, the fifth feature weight and the sixth feature weight; among them, the first feature weight corresponds to the daily average number of password door openings, the second feature weight corresponds to the daily average number of fingerprint door openings, the third feature weight corresponds to the daily average number of face door openings, the fourth feature weight corresponds to the daily average number of Bluetooth door openings, the fifth feature weight corresponds to the daily average number of iris door openings, and the sixth feature weight corresponds to the daily average number of finger vein door openings.
[0029] Optionally, in a possible implementation of the first aspect, estimating the remaining usable days of the target door lock according to the total number of days the target door lock can be used and the current power of the target door lock includes:
[0030] d=d1*q
[0031] Among them, d represents the remaining usable days of the smart door lock, d1 represents the total number of days, and q represents the percentage of the current power of the target door lock.
[0032] According to a second aspect of an embodiment of the present invention, a device for estimating the number of days a smart door lock can be used is provided, comprising:
[0033] A data acquisition module is used to acquire multiple basic training sets, wherein the basic training sets include door opening feature data of the user in a complete use cycle and the number of days of use in the complete use cycle; the door opening feature data includes the daily average number of password door opening times, the daily average number of fingerprint door opening times, the daily average number of face door opening times, and the daily average number of Bluetooth door opening times;
[0034] A model training module, used to train a preset linear regression model using the multiple basic training sets, wherein the input of the trained linear regression model is the door opening feature data within the user's current usage cycle, and the output is the total number of days that the smart door lock can be used;
[0035] The estimation module is used to determine the total number of days that the target door lock can be used by inputting the door opening feature data of the target door lock into the trained linear regression model, and to estimate the remaining number of days that the target door lock can be used according to the total number of days that the target door lock can be used and the current power of the target door lock.
[0036] According to a third aspect of an embodiment of the present invention, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0037] According to a fourth aspect of an embodiment of the present invention, a readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the steps of the method of the first aspect of the present invention and various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] 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.
[0039] Figure 1 Schematic diagram of the flow of the method for estimating the number of days a smart door lock can be used according to Embodiment 1 of the present invention.
[0040] Figure 2 This is a graph showing the relationship between the average total number of door openings and the number of days of use.
[0041] Figure 3 Schematic diagram of the door opening feature data after normalization.
[0042] Figure 4 This is a principle block diagram of a device for estimating the number of days a smart door lock can be used according to Embodiment 2 of the present invention.
[0043] Figure 5 This is a structural diagram of the computer device in Example 3 of the present invention. DETAILED DESCRIPTION
[0044] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0046] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0047] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0048] Example 1
[0049] This embodiment provides a method for estimating the number of days a smart door lock can be used. Figure 1 As shown, the available days estimation method includes the following steps but is not limited to steps S100 to S300.
[0050] S100: Acquire multiple basic training sets, where the basic training sets include door opening feature data of the user in a complete usage cycle and the number of usage days in the complete usage cycle.
[0051] Specifically, a basic training set may include the door opening feature data taken in a complete use cycle and the number of days of use corresponding to the complete use cycle, such as basic training set 1: [X1=6, X2=0, X3=0, X4=0, Y=280], basic training set 2: [X1=4, X2=4, X3=8, X4=0, Y=174], where X1 represents the average number of password door openings per day, X2 represents the average number of fingerprint door openings per day, X3 represents the average number of face door openings per day, X4 represents the average number of Bluetooth door openings per day, and Y represents the number of days of use in the complete use cycle. The door opening feature data obtained in multiple basic training sets and the number of days of use in the corresponding complete use cycle may be the same or different, which well simulates the different usage habits of different users, resulting in different usage days.
[0052] Specifically, the door opening feature data may include but are not limited to the daily average number of password door openings, the daily average number of fingerprint door openings, the daily average number of face door openings, and the daily average number of Bluetooth door openings. Other door opening feature data may also be added according to the actual functions of the smart door lock, such as the daily average number of iris door openings, the daily average number of induction card door openings, the daily average number of remote control door openings, and the daily average number of finger vein blood door openings.
[0053] Specifically, a complete usage cycle can be used to represent the entire usage cycle of a smart door lock from full power to zero power, and the length of the usage cycle can be determined by different door opening feature data. For example, when the average daily password door opening times in a complete usage cycle are 4, the average daily fingerprint door opening times are 4, the average daily face door opening times are 8, and the average daily Bluetooth door opening times are 0, the usage cycle is 174 days; and when the average daily password door opening times in a complete usage cycle are 3, the average daily fingerprint door opening times are 15, the average daily face door opening times are 1, and the average daily Bluetooth door opening times are 1, the usage cycle is 205 days, as shown in Table 1:
[0054] Table 1
[0055]
[0056]
[0057] More specifically, through different door opening feature data and corresponding usage days, a relationship diagram between the average total door opening times and usage days can be obtained, such as Figure 2 As shown in the figure, the horizontal axis is the number of days of use, and the vertical axis is the average total number of door openings. It can be concluded that the more times the door is opened, the shorter the number of days the smart door lock is used.
[0058] The method for estimating the number of days a smart door lock can be used provided by the present invention trains a linear regression model for estimating the total number of days a smart door lock can be used through multiple basic training sets. This can well simulate the different number of days a smart door lock can be used due to different usage habits of different users, thereby making the estimation accuracy of the trained linear regression model higher.
[0059] S200: Using multiple basic training sets to train a preset linear regression model, the input of the trained linear regression model is the door opening feature data in the user's current usage cycle, and the output is the total number of days that the smart door lock can be used.
[0060] Preferably, before training the preset linear regression model, the method further includes: normalizing the basic training set so that the door opening feature data of the user in the complete use cycle are all within a specific range.
[0061] Specifically, the normalization process adopts the Z-Score method to standardize the data based on the mean and standard deviation of the door opening feature data of the basic training set. The specific formula is as follows:
[0062]
[0063] Where: x i Indicates the door opening feature data, x avg represents the average value of the door opening feature data, s represents the standard deviation of the door opening feature data, and z represents the normalized door opening feature data, such as Figure 3 As shown:
[0064] [-0.98999561 -0.9200832 0.30899583 -0.54299502][1.71022345 -0.9200832 0.30899583 1.5719291][0.91604137 -0.47271698 -0.69308059 -0.54299502][-1.30766844 0.42201547 -0.69308059 0.51446704] and so on.
[0065] The method for estimating the number of days a smart door lock can be used provided by the present invention can convert door opening feature data into data within a specific interval by normalizing the basic training set, thereby avoiding the occurrence of excessive differences between data, thereby eliminating the influence of dimensions and orders of magnitude, and changing the weights of variables in the analysis to solve the problem of different metrics.
[0066] Preferably, step S200 includes the following steps:
[0067] S210: taking the door opening characteristic data in the complete use cycle as an independent variable, and the number of use days in the complete use cycle as a dependent variable;
[0068] S220: A linear regression equation is constructed through multiple sets of independent variables and dependent variables. The linear regression equation is used to represent a linear regression model.
[0069] In steps S210-S220, the linear regression equation includes:
[0070] y=ω0+ω1x1+ω2x2+ω3x3+ω4x4
[0071] Among them, x1 represents the average daily number of password door opening times, x2 represents the average daily number of fingerprint door opening times, x3 represents the average daily number of face door opening times, x4 represents the average daily number of Bluetooth door opening times, ω0 represents the intercept term of the linear regression equation, ω1 represents the first feature weight of the average daily number of password door opening times, ω2 represents the second feature weight of the average daily number of fingerprint door opening times, ω3 represents the third feature weight of the average daily number of face door opening times, ω4 represents the fourth feature weight of the average daily number of Bluetooth door opening times, y represents the number of days to complete the usage cycle, and ω0 represents the intercept term of the linear regression equation.
[0072] Specifically, x in the above linear regression equation i and ω i , it can be set according to the type of door opening feature data. For example, when the door opening feature data only includes the daily average number of password door opening times and the daily average number of fingerprint door opening times, the linear regression equation is: y=ω0+ω1x1+ω2x2; when the door opening feature data includes the daily average number of password door opening times, the daily average number of fingerprint door opening times, the daily average number of face door opening times, the daily average number of Bluetooth door opening times, the daily average number of iris door opening times and the daily average number of finger vein blood door opening times, the linear regression equation is: y=ω0+ω1x1+ω2x2+ω3x3+ω4x4+ω5x5+ω6x6; x5 represents the daily average number of iris door opening times, ω5 represents the fifth feature weight of the daily average number of iris door opening times, x6 represents the daily average number of finger vein door opening times, and ω6 represents the sixth feature weight of the daily average number of finger vein door opening times.
[0073] The method for estimating the usable days of a smart door lock provided by the present invention constructs a linear regression equation by taking the door opening feature data within a complete use cycle as the independent variable and the number of days of use within the complete use cycle as the dependent variable. This method can well reflect that different door opening feature data determine the actual number of days of use of the smart door lock, and indirectly reflect that the different usage habits of different users lead to different number of days of use of the smart door lock, thereby achieving the technical effect of improving the estimation accuracy of the linear regression model.
[0074] Preferably, step S200 further includes the following steps:
[0075] Obtaining a first feature weight, a second feature weight, a third feature weight, and a fourth feature weight of a preset linear regression model; performing iterative calculations on the preset linear regression model through a basic training set based on the first feature weight, the second feature weight, the third feature weight, and the fourth feature weight; wherein each iterative calculation obtains a loss value; when the loss value reaches a preset threshold, stopping the iterative calculation to obtain a trained linear regression model;
[0076] The loss value calculation process includes:
[0077]
[0078] Among them, m represents the number of samples, loss represents the loss value, ω0 represents the intercept term of the linear regression equation, and y i represents the number of days to complete the usage cycle, i represents the number of the basic training data set, x 1i represents the daily average number of password door openings of the corresponding numbered basic training data set, x 2i represents the daily average number of fingerprint door openings in the corresponding numbered basic training data set, x 3i represents the daily average number of face door openings in the corresponding numbered basic training dataset, x 4i represents the daily average number of Bluetooth door openings of the corresponding numbered basic training data set, ω1 represents the first feature weight of the daily average number of password door openings, ω2 represents the second feature weight of the daily average number of fingerprint door openings, ω3 represents the third feature weight of the daily average number of face door openings, and ω4 represents the fourth feature weight of the daily average number of Bluetooth door openings.
[0079] Specifically, the first feature weight, the second feature weight, the third feature weight and the fourth feature weight can be obtained based on the gradient descent method, so that the preset linear regression model can be iteratively calculated through the basic training data set according to the above multiple feature weights.
[0080] Specifically, in the process of iteratively calculating the preset linear regression model according to the basic training data set, each iterative calculation obtains a loss value, and the loss value is compared with the preset threshold. If it reaches or exceeds the preset threshold, the above iterative calculation is stopped, and the current linear regression model is used as the trained linear regression model. Among them, the preset threshold can be set according to the actual situation and is not specifically limited here.
[0081] Preferably, the preset threshold may be the minimum value of the loss value, which may be understood as calculating the minimum value of the loss value using the gradient descent method, and taking ω when the loss value is the minimum value as the optimal solution, that is:
[0082] make
[0083]
[0084] right (α is the learning rate) and iterative calculation is performed to obtain the optimal solution.
[0085] The trained linear regression model is obtained and verified on the test set (the test set can be selected from multiple basic training sets) to obtain a comparison between the predicted and actual days.
[0086] The method for estimating the number of days a smart door lock can be used provided by the present invention iteratively calculates a preset linear regression model through multiple feature weights and a basic training set, and stops the iterative calculation when the loss value reaches a preset threshold. It can simulate the gap between the calculation result and the true value, and is used to modify each feature weight of the preset linear regression model to guide the training direction of the model training, thereby improving the estimation accuracy of the linear regression model.
[0087] S300: Determine the total number of days the target door lock can be used by inputting the door opening feature data of the target door lock into the trained linear regression model, and estimate the remaining number of days the target door lock can be used according to the total number of days the target door lock can be used and the current power of the target door lock.
[0088] It should be understood that the target door lock in the embodiment of the present invention is a smart door lock, for example, a door lock with a password unlocking function, a fingerprint unlocking function, a face unlocking function and a Bluetooth unlocking function.
[0089] Specifically, by inputting the current user usage characteristics (i.e., door opening feature data) into the trained linear regression model, the total number of days that the smart door lock is expected to be usable based on the current usage can be obtained, and then the remaining number of days that the smart door lock can be used is calculated based on the total number of days that can be used and the current power percentage of the smart door lock.
[0090] d=d1*q
[0091] Among them, d represents the remaining usable days of the smart door lock, d1 represents the total number of days, and q represents the percentage of the current power of the target door lock.
[0092] More specifically, for example, a user uses fingerprint unlocking 6 times on average per day, and the rest are 0 times, that is, the door unlocking feature data is (0, 6, 0, 0), and the current remaining power is 80%. First, the door unlocking feature data is normalized to obtain (-1.30730299, 0.41513783, -0.68953841, -0.54386895); then the normalized door unlocking feature data is substituted into the trained linear regression model, and the total number of days that the smart door lock can be used is output to be about 276 days. Finally, the total number of days that can be used (276 days) and the current remaining power (80%) are substituted into d = d1*q, and it can be inferred that the remaining days of use of the current user's smart door lock are 276*0.8 = 220 days.
[0093] Example 2
[0094] This embodiment provides a device for estimating the number of days a smart door lock can be used. Figure 4 As shown, including:
[0095] A data acquisition module is used to acquire multiple basic training sets, which include the door opening feature data of the user in the complete use cycle and the number of days of use in the complete use cycle; the door opening feature data includes the daily average number of password door opening times, the daily average number of fingerprint door opening times, the daily average number of face door opening times, and the daily average number of Bluetooth door opening times;
[0096] The model training module is used to train a preset linear regression model using multiple basic training sets. The input of the trained linear regression model is the door opening feature data in the user's current usage cycle, and the output is the total number of days that the smart door lock can be used.
[0097] The estimation module is used to determine the total number of days that the target door lock can be used by inputting the door opening feature data of the target door lock into the trained linear regression model, and to estimate the remaining days that the target door lock can be used according to the total number of days that the target door lock can be used and the current power of the target door lock.
[0098] Preferably, the smart door lock usable days estimation device also includes:
[0099] The normalization processing module is used to normalize the basic training set so that the door opening feature data of the user in the complete usage cycle are all within a specific range.
[0100] Preferably, the model training module includes:
[0101] The linear regression equation construction unit is used to take the door opening characteristic data within the complete use cycle as the independent variable and the number of use days within the complete use cycle as the dependent variable; the linear regression equation is constructed by multiple groups of independent variables and dependent variables, and the linear regression equation is used to represent the linear regression model.
[0102] Preferably, the linear regression equation comprises:
[0103] y=ω0+ω1x1+ω2x2+ω3x3+ω4x4
[0104] Among them, x1 represents the daily average number of password door opening times, x2 represents the daily average number of fingerprint door opening times, x3 represents the daily average number of face door opening times, x4 represents the daily average number of Bluetooth door opening times, ω1 represents the first feature weight of the daily average number of password door opening times, ω2 represents the second feature weight of the daily average number of fingerprint door opening times, ω3 represents the third feature weight of the daily average number of face door opening times, ω4 represents the fourth feature weight of the daily average number of Bluetooth door opening times, y represents the number of days to complete the usage cycle, and ω0 represents the intercept term of the linear regression equation.
[0105] Preferably, the model training module includes:
[0106] A feature weight acquisition unit, used to acquire a first feature weight, a second feature weight, a third feature weight, and a fourth feature weight of a preset linear regression model;
[0107] The iterative calculation unit is used to iteratively calculate the preset linear regression model through the basic training set based on the first feature weight, the second feature weight, the third feature weight and the fourth feature weight; wherein each iterative calculation obtains a loss value; when the loss value reaches a preset threshold, the iterative calculation is stopped to obtain a trained linear regression model.
[0108] Preferably, the iterative calculation unit is used to calculate the loss value in the following manner, including:
[0109]
[0110] Among them, m represents the number of samples, loss represents the loss value, ω0 represents the intercept term of the linear regression equation, and y i represents the number of days to complete the usage cycle, i represents the number of the basic training data set, x 1i represents the daily average number of password door openings of the corresponding numbered basic training data set, x 2i represents the daily average number of fingerprint door openings in the corresponding numbered basic training data set, x 3i represents the daily average number of face door openings in the corresponding numbered basic training dataset, x 4i represents the daily average number of Bluetooth door openings of the corresponding numbered basic training data set, ω1 represents the first feature weight of the daily average number of password door openings, ω2 represents the second feature weight of the daily average number of fingerprint door openings, ω3 represents the third feature weight of the daily average number of face door openings, and ω4 represents the fourth feature weight of the daily average number of Bluetooth door openings.
[0111] Preferably, the estimation module is also used to estimate the remaining usable days of the smart door lock in the following manner:
[0112] d=d1*q
[0113] Among them, d represents the remaining usable days of the smart door lock, d1 represents the total number of days, and q represents the percentage of the current power of the target door lock.
[0114] Example 3
[0115] The present invention also provides a computer device, such as Figure 5 As shown, it includes a memory and a processor, the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the method for estimating the number of days the smart door lock can be used provided by the various embodiments described above is implemented.
[0116] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for estimating the usable days of a smart door lock provided in the above-mentioned various embodiments is implemented.
[0117] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0118] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 produce 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 A device that provides the functions specified in a block or multiple blocks.
[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0120] 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 The steps for the functions specified in one or more boxes.
[0121] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.
Claims
1. A method for estimating the number of days a smart door lock can be used, characterized in that: include: Acquire a plurality of basic training sets, wherein the basic training sets include door opening feature data of a user in a complete use cycle and the number of days of use in the complete use cycle; The complete usage cycle refers to the entire usage cycle of the smart door lock from full power to zero power, and the door opening feature data includes the daily average number of password door openings, the daily average number of fingerprint door openings, the daily average number of face door openings, and the daily average number of Bluetooth door openings; The preset linear regression model is trained using the multiple basic training sets, the input of the trained linear regression model is the door opening feature data in the current usage cycle of the user, and the output is the total number of days that the smart door lock can be used; The total number of days that the target door lock can be used is determined by inputting the door opening feature data of the current user of the target door lock into the trained linear regression model, and the remaining number of days that the target door lock can be used is estimated based on the total number of days that the target door lock can be used and the current power level of the target door lock.
2. The method for estimating the number of days a smart door lock can be used according to claim 1, characterized in that: Before using the multiple basic training sets to train the preset linear regression model, the method further includes: The basic training set is normalized so that the door opening feature data of the user in the complete usage cycle are all within a specific range.
3. The method for estimating the number of days a smart door lock can be used according to claim 1 or 2, characterized in that: The using the multiple basic training sets to train the preset linear regression model includes: The door opening characteristic data in the complete use cycle is used as an independent variable, and the number of days of use in the complete use cycle is used as a dependent variable; A linear regression equation is constructed by using multiple groups of the independent variables and the dependent variables, and the linear regression equation is used to represent the linear regression model.
4. The method for estimating the number of days a smart door lock can be used according to claim 3, characterized in that: The linear regression equation includes: y=ω0+ω1x1+ω2x2+ω3x3+ω4x4 Among them, x1 represents the daily average number of password door opening times, x2 represents the daily average number of fingerprint door opening times, x3 represents the daily average number of face door opening times, x4 represents the daily average number of Bluetooth door opening times, ω1 represents the first feature weight of the daily average number of password door opening times, ω2 represents the second feature weight of the daily average number of fingerprint door opening times, ω3 represents the third feature weight of the daily average number of face door opening times, ω4 represents the fourth feature weight of the daily average number of Bluetooth door opening times, and y represents the number of days to complete the usage cycle.
5. The method for estimating the number of days a smart door lock can be used according to claim 4, characterized in that: The using the multiple basic training sets to train the preset linear regression model includes: Obtaining a first feature weight, a second feature weight, a third feature weight, and a fourth feature weight of the preset linear regression model; Based on the first feature weight, the second feature weight, the third feature weight and the fourth feature weight, the preset linear regression model is iteratively calculated through the basic training set; wherein each iterative calculation obtains a loss value; When the loss value reaches a preset threshold, the iterative calculation is stopped to obtain a trained linear regression model.
6. The method for estimating the number of days a smart door lock can be used according to claim 5, characterized in that: The loss value calculation process includes: Among them, m represents the number of samples, loss represents the loss value, ω0 represents the intercept term of the linear regression equation, and y i represents the number of days to complete the usage cycle, i represents the number of the basic training data set, x 1i represents the daily average number of password door openings of the corresponding numbered basic training data set, x 2i represents the daily average number of fingerprint door openings in the corresponding numbered basic training data set, x 3i represents the daily average number of face door openings in the corresponding numbered basic training dataset, x 4i represents the daily average number of Bluetooth door openings of the corresponding numbered basic training data set, ω1 represents the first feature weight of the daily average number of password door openings, ω2 represents the second feature weight of the daily average number of fingerprint door openings, ω3 represents the third feature weight of the daily average number of face door openings, and ω4 represents the fourth feature weight of the daily average number of Bluetooth door openings.
7. The method for estimating the number of days a smart door lock can be used according to claim 1, characterized in that: The estimating the remaining usable days of the target door lock according to the total usable days of the target door lock and the current power of the target door lock includes: d=d1*q Among them, d represents the remaining usable days of the smart door lock, d1 represents the total number of days, and q represents the percentage of the current power of the target door lock.
8. A device for estimating the number of days a smart door lock can be used, characterized in that: include: A data acquisition module is used to acquire multiple basic training sets, wherein the basic training sets include door opening feature data of the user in a complete use cycle and the number of days of use in the complete use cycle; the complete use cycle represents the entire use cycle of the smart door lock from full power to zero power, and the door opening feature data includes the daily average number of password door opening times, the daily average number of fingerprint door opening times, the daily average number of face door opening times, and the daily average number of Bluetooth door opening times; A model training module, used to train a preset linear regression model using the multiple basic training sets, wherein the input of the trained linear regression model is the door opening feature data within the user's current usage cycle, and the output is the total number of days that the smart door lock can be used; The estimation module is used to determine the total number of days that the target door lock can be used by inputting the door opening feature data of the current user of the target door lock into the trained linear regression model, and to estimate the remaining number of days that the target door lock can be used according to the total number of days that the target door lock can be used and the current power of the target door lock.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the computer program, the steps of the method for estimating the available days of a smart door lock as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for estimating the number of days a smart door lock can be used as described in any one of claims 1 to 7 are implemented.
