Disclosure of Invention
The invention aims to solve the technical problem of providing a lock control method, a lock and a computer readable storage medium, and aims to solve the defect of excessive power consumption of the lock caused by the fact that the lock detects identification information in a fixed period in the prior art.
The invention adopts the technical scheme that the lock control method comprises the following steps:
under the condition that a user sets that identification information is read through a preset identification module to execute preset operation, setting the detection period of the identification module for detecting the identification information as a set value;
and adjusting the detection period according to the reading times of the identification information read by the identification module in a preset detection period.
Optionally, the adjusting the detection period according to the number of times that the identification module reads the identification information in a preset detection period includes:
acquiring the reading times of the identification module for reading the identification information in the current detection period;
determining a second reading frequency range corresponding to the reading frequency according to a plurality of preset first reading frequency ranges;
and setting the detection period as a first adjustment value corresponding to the second reading frequency range based on a mapping relation between a preset reading frequency range and an adjustment value.
Optionally, the adjusting the detection period according to the number of times that the identification module reads the identification information in a preset detection period includes:
acquiring the reading times of the identification module for reading the identification information in the current detection period;
judging whether the reading times are smaller than a first set threshold value or not;
if the reading times are judged to be smaller than a first set threshold value, setting the detection period as a preset second adjusting value; wherein the second adjustment value is greater than the set value;
otherwise, the detection period is set to the set value.
Optionally, when the number of the detection periods is multiple, the second adjustment value is greater than or equal to the detection period in the previous detection period.
Optionally, the second adjustment value is smaller than or equal to a second set threshold.
Optionally, the method further includes: and closing the identification module under the condition that the user does not set that the identification information is read by the identification module to execute the preset operation.
The invention also provides a lock, which comprises a processor, a memory and an identification module;
the processor is used for executing the lock control program stored in the memory so as to realize the following steps:
under the condition that a user sets that identification information is read through a preset identification module to execute preset operation, setting the detection period of the identification module for detecting the identification information as a set value;
and adjusting the detection period according to the reading times of the identification information read by the identification module in a preset detection period.
Optionally, the adjusting the detection period according to the number of times that the identification module reads the identification information in a preset detection period includes:
acquiring the reading times of the identification module for reading the identification information in the current detection period;
determining a second reading frequency range corresponding to the reading frequency according to a plurality of preset first reading frequency ranges;
and setting the detection period as a first adjustment value corresponding to the second reading frequency range based on a mapping relation between a preset reading frequency range and an adjustment value.
Optionally, the adjusting the detection period according to the number of times that the identification module reads the identification information in a preset detection period includes:
acquiring the reading times of the identification module for reading the identification information in the current detection period;
judging whether the reading times are smaller than a first set threshold value or not;
if the reading times are judged to be smaller than a first set threshold value, setting the detection period as a preset second adjusting value; wherein the second adjustment value is greater than the set value;
otherwise, the detection period is set to the set value.
Optionally, when the number of the detection periods is multiple, the second adjustment value is greater than or equal to the detection period in the previous detection period.
Optionally, the second adjustment value is smaller than or equal to a second set threshold.
Optionally, the processor is further configured to execute the lock control program to implement the following steps: and closing the identification module under the condition that the user does not set that the identification information is read by the identification module to execute the preset operation.
The present invention also provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of the lock control method described above.
By adopting the technical scheme, the invention at least has the following advantages:
the lock control method, the lock and the computer readable storage medium can automatically and dynamically adjust the detection period according to the times of reading the identification information by the identification module in each detection period, effectively control the power consumption of the lock and shorten the battery service cycle of the lock.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The first embodiment of the invention, a lock control method, as shown in fig. 1, includes the following steps:
step S101, under the condition that the user sets that the identification information is read by the preset identification module to execute the preset operation, the detection period of the identification module for detecting the identification information is set as a set value.
Wherein, the identification module includes but is not limited to: a camera, a Radio Frequency Identification (RFID) receiving module, an Integrated Circuit (IC) card reading module, a magnetic stripe card reading module, and the like.
Identification information includes, but is not limited to: bar code information, two-dimensional code information, graphic code information, biological identification feature information of a user, graphic information preset by the user, identification information in an RFID card, identification information in an IC card, identification information in a magnetic stripe card and the like.
The method for reading the identification information through the preset identification module includes but is not limited to:
reading bar code information through a camera, reading two-dimensional code information through the camera, reading graphic code information through the camera, reading biological identification characteristic information of a user through the camera, reading graphic information preset by the user through the camera, reading identification information in an RFID card through an RFID receiving module, reading identification information in the IC card through an IC card reading module, reading identification information in a magnetic strip card through a magnetic strip card reading module, and the like.
In some embodiments of the present invention, the preset operation is not specifically limited, and the preset operation may be an unlocking operation, a locking operation, or a setting interface unlocking operation of a lock.
In some embodiments of the present invention, the set value is not specifically limited, and the set value may be a default value when the lock leaves a factory, or an initial value set by a user, or an optimal value obtained through a limited number of experiments, or an optimal value obtained through a limited number of computer simulations.
For example: step S101, including:
the intelligent door lock sets the detection period of the identification information detected by the identification module to be 0.2s as a set value under the condition that a user sets the identification information read by the preset identification module to execute preset unlocking operation.
And step S102, adjusting the detection period according to the reading times of the identification module for reading the identification information in the preset detection period.
In some embodiments of the present invention, the duration of the detection period is not particularly limited.
Optionally, step S102 includes:
acquiring the reading times of the identification module for reading the identification information in the current detection period;
determining a second reading frequency range corresponding to the reading frequency according to a plurality of preset first reading frequency ranges;
and setting the detection period as a first adjustment value corresponding to the second reading frequency range based on the mapping relation between the preset reading frequency range and the adjustment value.
For example: step S102, comprising:
the intelligent door lock acquisition and identification module reads the identification information for 5 times within 7 days of the current detection period;
according to a plurality of preset first reading times ranges;
wherein the first reading number range includes: [0, 10 ], [11, 20 ], [21, 30 ], [31, 40 ], [41, 50 ] and [41, ∞ times);
determining a second reading time range [0 time and 10 times ] corresponding to the reading time of 5 times;
based on the preset mapping relation between the reading frequency range and the adjustment value;
the preset mapping relationship between the reading frequency range and the adjustment value comprises the following steps:
[0, 10 ] corresponds to an adjustment value of 0.4 s;
[11 times, 20 times ] corresponding to an adjustment value of 0.35 s;
[21 times, 30 times ] corresponding to an adjustment value of 0.3 s;
[31 times, 40 times ] corresponding to an adjustment value of 0.27 s;
[41 times, 50 times ] corresponding to an adjustment value of 0.25 s;
[41 times, ∞ times)) corresponding adjustment value of 0.2 s;
the detection period 0.2 is set to the first adjustment value 0.4s corresponding to the second read number range [0, 10 ].
Optionally, step S102 includes:
acquiring the reading times of the identification module for reading the identification information in the current detection period;
judging whether the reading times are smaller than a first set threshold value or not;
if the reading times are judged to be smaller than the first set threshold value, setting the detection period as a preset second adjustment value; wherein the second adjustment value is greater than the set value;
otherwise, the detection period is set to a set value.
For example: step S102, comprising:
the intelligent door lock acquisition and identification module reads identification information for 3 times within 7 days of the current detection period;
judging whether the reading times are less than a first set threshold value for 5 times or not for 3 times;
in the case where it is determined that the number of readings is less than the first set threshold 5 times 3 times, the detection period is set to a preset second adjustment value of 0.4 s.
For another example: step S102, comprising:
the intelligent door lock acquisition and identification module reads identification information for 6 times within 7 days of the current detection period;
judging whether the reading times are less than 5 times of the first set threshold value for 6 times;
in the case where it is determined that the number of readings 6 times is greater than the first set threshold value 5 times, the detection period is set to a set value of 0.2 s.
For another example: step S102, comprising:
the intelligent door lock acquisition and identification module reads identification information for 0 time within 7 days of the current detection period;
judging whether the reading times of 0 times is less than a first set threshold value of 1 time or not;
in the case where it is determined that the number of readings 0 is smaller than the first set threshold value 1 time, the detection period is set to a preset second adjustment value of 0.4 s.
For another example: step S102, comprising:
the intelligent door lock acquisition and identification module reads identification information for 6 times within 7 days of the current detection period;
judging whether the reading times are less than a first set threshold value for 1 time or not for 6 times;
in the case where it is determined that the number of readings 6 times is greater than the first set threshold value 1 time, the detection period is set to a set value of 0.2 s.
According to the lock control method provided by the first embodiment of the invention, the detection period can be automatically and dynamically adjusted according to the times of reading the identification information by the identification module in each detection period, so that the power consumption of the lock is effectively controlled, and the battery service cycle of the lock is shortened.
A second embodiment of the present invention provides a lock control method, as shown in fig. 2, including the following steps:
in step S201, in the case that the user sets to perform a preset operation by reading the identification information through a preset identification module, a detection period for detecting the identification information by the identification module is set to a set value.
Wherein, the identification module includes but is not limited to: the device comprises a camera, an RFID receiving module, an IC card reading module, a magnetic stripe card reading module and the like.
Identification information includes, but is not limited to: bar code information, two-dimensional code information, graphic code information, biological identification feature information of a user, graphic information preset by the user, identification information in an RFID card, identification information in an IC card, identification information in a magnetic stripe card and the like.
The method for reading the identification information through the preset identification module includes but is not limited to:
reading bar code information through a camera, reading two-dimensional code information through the camera, reading graphic code information through the camera, reading biological identification characteristic information of a user through the camera, reading graphic information preset by the user through the camera, reading identification information in an RFID card through an RFID receiving module, reading identification information in the IC card through an IC card reading module, reading identification information in a magnetic strip card through a magnetic strip card reading module, and the like.
In some embodiments of the present invention, the set value is not specifically limited, and the set value may be a default value when the lock leaves a factory, or an initial value set by a user, or an optimal value obtained through a limited number of experiments, or an optimal value obtained through a limited number of computer simulations.
For example: step S201, including:
the intelligent door lock sets the detection period of the identification information detected by the identification module to be 0.2s as a set value under the condition that a user sets the identification information read by the preset identification module to execute preset unlocking operation.
Step S202, adjusting the detection period according to the reading times of the identification module reading the identification information in the preset detection period.
In some embodiments of the present invention, the duration of the detection period is not particularly limited.
Optionally, step S202 includes:
under the condition that the number of the detection periods is multiple, acquiring the reading times of the identification module for reading the identification information in the current detection period;
judging whether the reading times of reading the identification information in the current detection period is less than a first set threshold value or not;
if the reading times of reading the identification information in the current detection period is judged to be smaller than a first set threshold value, setting the detection period as a preset second adjusting value; wherein, the second adjustment value is greater than or equal to the detection period in the last detection period; the second adjustment value is less than or equal to a second set threshold.
Otherwise, the detection period is set to a set value.
For example: step S202, comprising:
under the condition that the number of the detection periods is multiple, the intelligent door lock acquisition and identification module reads the reading times of the identification information within 7 days of the current detection period for 3 times;
judging whether the reading times of reading the identification information in the current detection period is less than 5 times of a first set threshold value for 3 times;
under the condition that the reading times of reading the identification information within 7 days of the current detection period are judged to be less than 5 times of the first set threshold, setting the detection period as a preset second adjusting value of 0.4 s;
wherein, the second adjustment value 0.4s is greater than or equal to the detection period 0.2s in the last detection period; the second adjustment value 0.4s is less than or equal to the second set threshold value 0.8 s.
For another example: step S202, comprising:
under the condition that the number of the detection periods is multiple, the intelligent door lock acquisition and identification module reads the identification information for 0 time within 7 days of the current detection period;
judging whether the reading times of reading the identification information in the current detection period is less than a first set threshold value for 1 time or not;
under the condition that the reading times of reading the identification information within 7 days of the current detection period are judged to be less than 1 time of the first set threshold, setting the detection period as a preset second adjustment value of 0.4 s;
wherein, the second adjustment value 0.4s is greater than or equal to the detection period 0.2s in the last detection period; the second adjustment value 0.4s is less than or equal to the second set threshold value 0.8 s.
For another example: step S202, comprising:
step S2021, under the condition that the number of the detection periods is multiple, the intelligent door lock acquisition and identification module reads the identification information for 0 time within 7 days of the first detection period;
judging whether the reading times of reading the identification information in the first detection period is less than a first set threshold value for 1 time or not;
under the condition that the reading times of reading the identification information within 7 days in the first detection period are judged to be less than 1 time of the first set threshold, setting the detection period as a preset second adjusting value of 0.4 s;
wherein, the second adjustment value 0.4s is greater than or equal to the detection period 0.2s in the last detection period; the second adjustment value 0.4s is less than or equal to a second set threshold value 0.8 s;
step S2022, the intelligent door lock acquisition and identification module reads the identification information for 0 time within 7 days of the second detection period;
judging whether the reading times of reading the identification information in the second detection period is less than the first set threshold value for 1 time or not;
under the condition that the reading times of reading the identification information within 7 days in the second detection period are judged to be less than 1 time of the first set threshold, setting the detection period as a preset second adjustment value of 0.8 s;
wherein, the second adjustment value 0.8s is greater than or equal to the detection period 0.8s in the last detection period; the second adjustment value 0.8s is less than or equal to a second set threshold value 0.8 s;
step S2023, the intelligent door lock acquisition and identification module reads the identification information for 0 time within 7 days of the Nth detection period; wherein N is greater than or equal to 3;
judging whether the reading times of reading the identification information in the Nth detection period is less than a first set threshold value for 1 time or not;
under the condition that the number of times of reading identification information within 7 days of the Nth detection period is judged to be 0 times smaller than the first set threshold value 1 time, setting the detection period as a preset second adjusting value of 0.8 s;
wherein, the second adjustment value 0.8s is greater than or equal to the detection period 0.8s in the last detection period; the second adjustment value 0.8s is less than or equal to the second set threshold value 0.8 s.
Step S203, in case that the user does not set to execute the preset operation by reading the identification information through the identification module, the identification module is closed.
Through closing the identification module, the consumption of reduction tool to lock that can be very big shortens the battery life cycle of tool to lock.
The lock control method provided by the second embodiment of the invention can automatically and dynamically adjust the detection period according to the times of reading the identification information in each detection period by the identification module, effectively control the power consumption of the lock and shorten the battery service cycle of the lock.
A third embodiment of the present invention is based on the above embodiments, and an application example of the present invention is described with reference to fig. 3 by taking a control method of an intelligent door lock as an example.
Step S301, the intelligent door lock judges whether a user sets that the identification information in the RFID identification card is read through a preset RFID identification module to execute unlocking operation, and if the intelligent door lock judges that the user sets that the identification information in the RFID identification card is read through the preset RFID identification module to execute the unlocking operation, step S302 is executed; otherwise, step S307 is executed.
Step S302, the intelligent door lock sets the detection period of the RFID identification module for detecting the identification information in the RFID identification card to be 0.2S.
Step S303, under the condition that the number of the detection periods is multiple, the intelligent door lock acquisition and identification module reads the reading times of the identification information in 7 days of the first detection period;
judging whether the reading times of reading the identification information in the first detection period is less than a first set threshold value for 1 time or not;
if it is determined that the number of times of reading the identification information within 7 days of the first detection period is less than 1 time of the first set threshold, executing step S304; otherwise, executing step S302;
step S304, setting the detection period to be a preset eleventh adjustment value of 0.4S; wherein, the eleventh adjustment value 0.4s is greater than or equal to the detection period 0.2s in the last detection period; the eleventh adjustment value 0.4s is less than or equal to the third set threshold value 0.8 s.
Step S305, the intelligent door lock acquisition and identification module reads the reading times of the identification information within 7 days of the second detection period;
judging whether the reading times of reading the identification information in the second detection period is less than a first set threshold value for 1 time or not;
if the number of times of reading the identification information within 7 days of the second detection period is determined to be less than 1 time of the first set threshold, executing step S306; otherwise, executing step S302;
step S306, setting the detection period to be a preset twelfth adjustment value of 0.8S; wherein, the twelfth adjustment value 0.8s is greater than or equal to the detection period 0.8s in the last detection period; the twelfth adjustment value of 0.8s is less than or equal to the third set threshold of 0.8 s.
Step S307, the intelligent door lock acquisition and identification module reads the reading times of the identification information in 7 days in the Nth detection period; wherein N is greater than or equal to 3;
judging whether the reading times of reading the identification information in the Nth detection period is less than a first set threshold value for 1 time or not;
if the number of times of reading the identification information in 7 days in the nth detection period is determined to be less than 1 time of the first set threshold, executing step S306; otherwise, executing step S302;
and step S308, the intelligent door lock closes the RFID identification module.
The control method for the intelligent lock according to the third embodiment of the invention can automatically and dynamically adjust the detection period according to the times that the RFID identification module preset in the intelligent lock reads the identification information in the RFID identification card in each detection period, thereby effectively controlling the power consumption of the intelligent lock and shortening the battery service cycle of the intelligent lock.
A fourth embodiment of the present invention is a lock device, as shown in fig. 4, including the following components:
a processor 110, a memory 109, and an identification module 111. In some embodiments of the invention, the processor 110, the memory 109, and the identification module 111 may be connected by a bus or other means.
Processor 110 may be a general-purpose Processor, such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention. Wherein, the memory 109 is used for storing the executable instructions of the processor 110;
a memory 109 for storing the program code and transmitting the program code to the processor 110. Memory 109 may include Volatile Memory (Volatile Memory), such as Random Access Memory (RAM); the Memory 109 may also include a Non-Volatile Memory (Non-Volatile Memory), such as a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, HDD), or a Solid-State Drive (SSD); the memory 109 may also comprise a combination of the above-mentioned kinds of memories.
The identification module 111 may include: the device comprises a camera, an RFID receiving module, an IC card reading module, a magnetic stripe card reading module and the like.
The processor 110 is configured to call the program code management code stored in the memory 109, and perform some or all of the steps in any of the first embodiment to the third embodiment of the present invention.
According to the lockset provided by the fourth embodiment of the invention, the detection period can be automatically and dynamically adjusted according to the times of reading the identification information in each detection period by the identification module, so that the power consumption of the lockset is effectively controlled, and the battery service cycle of the lockset is shortened.
A fifth embodiment of the present invention is a computer-readable storage medium.
The computer storage media may be RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage media known in the art.
The computer readable storage medium stores one or more programs which are executable by one or more processors to implement some or all of the steps in any of the first to third embodiments of the present invention.
The computer-readable storage medium according to the fifth embodiment of the present invention stores one or more programs, where the one or more programs are executable by one or more processors, and can perform automatic dynamic adjustment on a detection period according to the number of times that an identification module reads identification information in each detection period, so as to effectively control power consumption of a lock and shorten a battery life cycle of the lock.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.